#include <encryptor.h>
Inherits ccf::kv::AbstractTxEncryptor.
|
| | TxEncryptor (const std::shared_ptr< T > &secrets) |
| |
| size_t | get_header_length () override |
| |
| uint64_t | get_term (const uint8_t *data, size_t size) override |
| |
| bool | encrypt (const std::vector< uint8_t > &plain, const std::vector< uint8_t > &additional_data, std::vector< uint8_t > &serialised_header, std::vector< uint8_t > &cipher, const TxID &tx_id, EntryType entry_type=EntryType::WriteSet, bool historical_hint=false) override |
| |
| bool | decrypt (const std::vector< uint8_t > &cipher, const std::vector< uint8_t > &additional_data, const std::vector< uint8_t > &serialised_header, std::vector< uint8_t > &plain, Version version, Term &term, bool historical_hint=false) override |
| |
| ccf::crypto::HashBytes | get_commit_nonce (const TxID &tx_id, bool historical_hint=false) override |
| |
| void | rollback (Version version) override |
| |
| virtual | ~AbstractTxEncryptor ()=default |
| |
◆ TxEncryptor()
template<typename T , typename S >
◆ decrypt()
template<typename T , typename S >
| bool ccf::kv::TxEncryptor< T, S >::decrypt |
( |
const std::vector< uint8_t > & |
cipher, |
|
|
const std::vector< uint8_t > & |
additional_data, |
|
|
const std::vector< uint8_t > & |
serialised_header, |
|
|
std::vector< uint8_t > & |
plain, |
|
|
Version |
version, |
|
|
Term & |
term, |
|
|
bool |
historical_hint = false |
|
) |
| |
|
inlineoverridevirtual |
Decrypt cipher and return plaintext.
- Parameters
-
| [in] | cipher | Cipher to decrypt |
| [in] | additional_data | Additional data to verify tag |
| [in] | serialised_header | Serialised header (iv + tag) |
| [out] | plain | Decrypted plaintext |
| [in] | version | Version used to retrieve the corresponding encryption key |
| [out] | term | Term contained in header |
| [in] | historical_hint | If true, considers all ledger secrets for decryption. Otherwise, try to use the latest used secret (defaults to false) |
- Returns
- Boolean status indicating success of decryption.
Implements ccf::kv::AbstractTxEncryptor.
◆ encrypt()
template<typename T , typename S >
| bool ccf::kv::TxEncryptor< T, S >::encrypt |
( |
const std::vector< uint8_t > & |
plain, |
|
|
const std::vector< uint8_t > & |
additional_data, |
|
|
std::vector< uint8_t > & |
serialised_header, |
|
|
std::vector< uint8_t > & |
cipher, |
|
|
const TxID & |
tx_id, |
|
|
EntryType |
entry_type = EntryType::WriteSet, |
|
|
bool |
historical_hint = false |
|
) |
| |
|
inlineoverridevirtual |
Encrypt data and return serialised GCM header and cipher.
- Parameters
-
| [in] | plain | Plaintext to encrypt |
| [in] | additional_data | Additional data to tag |
| [out] | serialised_header | Serialised header (iv + tag) |
| [out] | cipher | Encrypted ciphertext encryption key |
| [in] | tx_id | Transaction ID (version + term) corresponding with the plaintext |
| [in] | entry_type | Indicates the type of the entry to avoid IV re-use |
| [in] | historical_hint | If true, considers all ledger secrets for encryption. Otherwise, try to use the latest used secret (defaults to false) |
- Returns
- Boolean status indicating success of encryption.
Implements ccf::kv::AbstractTxEncryptor.
◆ get_commit_nonce()
template<typename T , typename S >
◆ get_header_length()
template<typename T , typename S >
◆ get_term()
template<typename T , typename S >
◆ rollback()
template<typename T , typename S >
The documentation for this class was generated from the following file: