Fix Crystal 0.31 warnings.
This commit is contained in:
parent
59d8d543b2
commit
61191d96a6
@ -4,7 +4,7 @@ version: 1.1.0
|
||||
authors:
|
||||
- Andrew Hamon <andrew@hamon.cc>
|
||||
- Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com>
|
||||
crystal: 0.29.0
|
||||
crystal: 0.31.1
|
||||
targets:
|
||||
pwhash_selector:
|
||||
main: examples/pwhash_selector.cr
|
||||
|
@ -72,8 +72,8 @@ module Sodium::Cipher
|
||||
end
|
||||
|
||||
abstract def update(src : Bytes, dst : Bytes)
|
||||
abstract def key_size
|
||||
abstract def nonce_size
|
||||
abstract def key_size : Int32
|
||||
abstract def nonce_size : Int32
|
||||
end
|
||||
|
||||
{% for key, val in {"XSalsa20" => "xsalsa20", "Salsa20" => "salsa20", "XChaCha20" => "xchacha20", "ChaCha20Ietf" => "chacha20_ietf", "ChaCha20" => "chacha20"} %}
|
||||
|
@ -7,7 +7,7 @@ class Sodium::CryptoBox
|
||||
SEAL_SIZE = LibSodium.crypto_box_sealbytes
|
||||
|
||||
# Returns key
|
||||
delegate to_slice, to: @bytes
|
||||
delegate_to_slice to: @bytes
|
||||
|
||||
# :nodoc:
|
||||
# Only used by SecretKey
|
||||
|
@ -42,7 +42,7 @@ class Sodium::CryptoBox
|
||||
getter public_key : PublicKey
|
||||
|
||||
# Returns key
|
||||
delegate to_slice, to: @sbuf
|
||||
delegate_to_slice to: @sbuf
|
||||
|
||||
@seed : SecureBuffer?
|
||||
|
||||
|
@ -23,7 +23,7 @@ module Sodium
|
||||
CONTEXT_SIZE = LibSodium.crypto_kdf_contextbytes
|
||||
|
||||
# Returns key
|
||||
delegate to_slice, to: @sbuf
|
||||
delegate_to_slice to: @sbuf
|
||||
|
||||
# Use an existing KDF key.
|
||||
#
|
||||
|
@ -1,6 +1,12 @@
|
||||
require "random/secure"
|
||||
require "./error"
|
||||
|
||||
macro delegate_to_slice(to object)
|
||||
def to_slice() : Bytes
|
||||
{{object.id}}.to_slice
|
||||
end
|
||||
end
|
||||
|
||||
module Sodium
|
||||
@[Link(ldflags: "`#{__DIR__}/../../build/pkg-libs.sh #{__DIR__}/../..`")]
|
||||
lib LibSodium
|
||||
|
@ -16,7 +16,7 @@ module Sodium
|
||||
property? reusable = false
|
||||
|
||||
# Returns bytes
|
||||
delegate to_slice, to: @bytes
|
||||
delegate_to_slice to: @bytes
|
||||
|
||||
delegate bytesize, to: @bytes
|
||||
|
||||
|
@ -20,7 +20,7 @@ module Sodium
|
||||
MAC_SIZE = LibSodium.crypto_secretbox_macbytes.to_i
|
||||
|
||||
# Returns key
|
||||
delegate to_slice, to: @key
|
||||
delegate_to_slice to: @key
|
||||
|
||||
# Encryption key
|
||||
getter key : SecureBuffer
|
||||
|
@ -6,7 +6,7 @@ module Sodium
|
||||
SIG_SIZE = LibSodium.crypto_sign_bytes.to_i
|
||||
|
||||
# Returns key
|
||||
delegate to_slice, to: @bytes
|
||||
delegate_to_slice to: @bytes
|
||||
|
||||
# :nodoc:
|
||||
# Only used by SecretKey
|
||||
|
@ -21,7 +21,7 @@ module Sodium
|
||||
getter public_key : PublicKey
|
||||
|
||||
# Returns key
|
||||
delegate to_slice, to: @sbuf
|
||||
delegate_to_slice to: @sbuf
|
||||
|
||||
@seed : SecureBuffer?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user