You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a procedure that can generate secrets of arbitrary size.
Motivation
Currently, procedures::GenerateKey takes a KeyType and generates a key of appropriate size. However, for some encryption operations, a key of some other length might be required that is not covered by those KeyTypes. For instance, when generating a random encryption key for use with Aes256Gcm, then a key of length crypto::ciphers::aes::Aes256Gcm::KEY_LENGTH is required. This happens to be the same as the size of an X25519 private key, so we can currently hack around it that way. But a proper solution would be to offer a procedure that takes a len: usize or extend the KeyType enum to cover all possible use cases stronghold currently offers.
Requirements
Write a list of what you want this feature to do.
Add a new procedure (or rewrite GenerateKey and add a KeyType::key_length method that returns the key size for the enum variants) that takes a len: usize and location: Location and writes len random bytes to location.
Open questions (optional)
Unclear if rewriting GenerateKey is the way to go, or if another procedure should be added.
Are you planning to do it yourself in a pull request?
Possibly.
The text was updated successfully, but these errors were encountered:
Description
Provide a procedure that can generate secrets of arbitrary size.
Motivation
Currently,
procedures::GenerateKey
takes aKeyType
and generates a key of appropriate size. However, for some encryption operations, a key of some other length might be required that is not covered by thoseKeyType
s. For instance, when generating a random encryption key for use withAes256Gcm
, then a key of lengthcrypto::ciphers::aes::Aes256Gcm::KEY_LENGTH
is required. This happens to be the same as the size of anX25519
private key, so we can currently hack around it that way. But a proper solution would be to offer a procedure that takes alen: usize
or extend theKeyType
enum to cover all possible use cases stronghold currently offers.Requirements
Write a list of what you want this feature to do.
GenerateKey
and add aKeyType::key_length
method that returns the key size for the enum variants) that takes alen: usize
andlocation: Location
and writeslen
random bytes tolocation
.Open questions (optional)
Unclear if rewriting
GenerateKey
is the way to go, or if another procedure should be added.Are you planning to do it yourself in a pull request?
Possibly.
The text was updated successfully, but these errors were encountered: