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