Remove #to_slice for keys
This commit is contained in:
parent
475ce2e5c8
commit
5e03d23ed9
@ -43,7 +43,7 @@ class Sodium::CryptoBox
|
|||||||
getter public_key : PublicKey
|
getter public_key : PublicKey
|
||||||
|
|
||||||
# Returns key
|
# Returns key
|
||||||
delegate_to_slice to: @key
|
# delegate_to_slice to: @key
|
||||||
|
|
||||||
@seed : Crypto::Secret?
|
@seed : Crypto::Secret?
|
||||||
|
|
||||||
@ -163,9 +163,12 @@ class Sodium::CryptoBox
|
|||||||
# For authenticated messages use `secret_key.box(recipient_public_key).decrypt`.
|
# For authenticated messages use `secret_key.box(recipient_public_key).decrypt`.
|
||||||
#
|
#
|
||||||
# Optionally supply a destination buffer.
|
# Optionally supply a destination buffer.
|
||||||
def decrypt_string(src, dst : Bytes? = nil) : String
|
def decrypt_string(src) : String
|
||||||
msg = decrypt src.to_slice, dst
|
dsize = src.bytesize - SEAL_SIZE
|
||||||
String.new msg
|
String.new(dsize) do |dst|
|
||||||
|
decrypt src.to_slice, dst.to_slice(dsize)
|
||||||
|
{dsize, dsize}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
|
@ -4,7 +4,5 @@ require "./wipe"
|
|||||||
module Sodium
|
module Sodium
|
||||||
abstract class Key
|
abstract class Key
|
||||||
include Sodium::Wipe
|
include Sodium::Wipe
|
||||||
|
|
||||||
abstract def to_slice : Bytes
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user