|
Asylo
|
Defines a nonce-generator interface. More...
#include <nonce_generator.h>
Public Member Functions | |
| NonceGenerator ()=default | |
| virtual | ~NonceGenerator ()=default |
| virtual Status | NextNonce (const std::vector< uint8_t > &key_id, UnsafeBytes< Size > *nonce)=0 |
| Generates the next nonce. More... | |
| virtual bool | uses_key_id () |
Indicates whether nonce generator utilizes the key_id input of the NextNonce() method to maintain key-id-specific nonce state. More... | |
Static Public Member Functions | |
| static constexpr size_t | nonce_size () |
| Gets the size of the nonces generated by this nonce generator. More... | |
Defines a nonce-generator interface.
The template parameter Size determines the size of the nonces produced by this generator.
|
default |
|
virtualdefault |
|
pure virtual |
Generates the next nonce.
Generates the next nonce and writes it to nonce. The nonce generator may optionally use the key_id parameter to select a key_id-specific nonce. There is, however, no guarantee that the nonce-generator implementation will handle the key_id input as a sensitive secret. Consequently, users of the nonce-generator interface must never pass sensitive keys directly as key identifiers. Instead, a key_id must be generated from key using a one-way hash function.
| key_id | Key identifier of the key that will be used with the nonce. | |
| [out] | nonce | The generated nonce. |
|
inlinestatic |
Gets the size of the nonces generated by this nonce generator.
|
inlinevirtual |
Indicates whether nonce generator utilizes the key_id input of the NextNonce() method to maintain key-id-specific nonce state.
key_id input of the NextNonce() method to maintain key-id-specific nonce state.