Sodium::Cipher::Aead::XChaCha20Poly1305IetfL: Add #nonce_size
This commit is contained in:
parent
910666bcdf
commit
b90d9bf117
@ -78,8 +78,9 @@ module Sodium::Cipher::Aead
|
|||||||
|
|
||||||
abstract def encrypt_detached(src : Bytes, dst : Bytes? = nil, *, nonce : Sodium::Nonce? = nil, mac : Bytes? = nil, additional : String | Bytes | Nil = nil) : {Bytes, Bytes, Sodium::Nonce}
|
abstract def encrypt_detached(src : Bytes, dst : Bytes? = nil, *, nonce : Sodium::Nonce? = nil, mac : Bytes? = nil, additional : String | Bytes | Nil = nil) : {Bytes, Bytes, Sodium::Nonce}
|
||||||
abstract def decrypt_detached(src : Bytes, dst : Bytes? = nil, *, nonce : Sodium::Nonce, mac : Bytes, additional : String | Bytes | Nil = nil) : Bytes
|
abstract def decrypt_detached(src : Bytes, dst : Bytes? = nil, *, nonce : Sodium::Nonce, mac : Bytes, additional : String | Bytes | Nil = nil) : Bytes
|
||||||
protected abstract def key_size : Int32
|
abstract def key_size : Int32
|
||||||
protected abstract def mac_size : Int32
|
abstract def mac_size : Int32
|
||||||
|
abstract def nonce_size : Int32
|
||||||
|
|
||||||
def dup
|
def dup
|
||||||
self.class.new @key.dup
|
self.class.new @key.dup
|
||||||
@ -143,13 +144,17 @@ module Sodium::Cipher::Aead
|
|||||||
dst
|
dst
|
||||||
end
|
end
|
||||||
|
|
||||||
protected def key_size : Int32
|
def key_size : Int32
|
||||||
KEY_SIZE
|
KEY_SIZE
|
||||||
end
|
end
|
||||||
|
|
||||||
protected def mac_size : Int32
|
def mac_size : Int32
|
||||||
MAC_SIZE
|
MAC_SIZE
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def nonce_size : Int32
|
||||||
|
NONCE_SIZE
|
||||||
|
end
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user