Crypto::Secret::Key used Sodium::SecureBuffer when available
parent
8977222b44
commit
39a5f558b2
|
@ -1,12 +1,16 @@
|
|||
require "./bidet"
|
||||
|
||||
module Crypto::Secret
|
||||
# Use this class for holding small amounts of sensitive data such as crypto keys
|
||||
#
|
||||
# Underlying implentation subject to change
|
||||
#
|
||||
# Use this class for holding small amounts of sensitive data such as crypto keys
|
||||
#
|
||||
# Underlying implentation subject to change
|
||||
#
|
||||
# Uses `Sodium::SecureBuffer` If "sodium" is required before "crypto-secret"
|
||||
{% if @type.has_constant?("Sodium") %}
|
||||
class Crypto::Secret::Key < ::Sodum::SecureBuffer
|
||||
end
|
||||
{% else %}
|
||||
# TODO: mlock
|
||||
# TODO: mprotect
|
||||
class Key < Bidet
|
||||
class Crypto::Secret::Key < ::Crypto::Secret::Bidet
|
||||
end
|
||||
end
|
||||
{% end %}
|
||||
|
|
|
@ -106,7 +106,6 @@ module Crypto::Secret
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
# Marks a region allocated using as read & write depending on implementation.
|
||||
abstract def readwrite : self
|
||||
# Marks a region allocated using as read-only depending on implementation.
|
||||
|
|
Loading…
Reference in New Issue