|
|
using | InternalOpaque = OpaqueObject<InternalDefinition> |
| |
|
| | Aead () |
| | Construct a session using the default native backend.
|
| |
| | Aead (Backend backend) |
| | Construct a session using an explicitly selected backend.
|
| |
|
| Aead (const Aead &)=delete |
| |
|
| Aead (Aead &&)=delete |
| |
|
Aead & | operator= (const Aead &)=delete |
| |
|
Aead & | operator= (Aead &&)=delete |
| |
| Result | init (AeadType type, Span< const uint8_t > key) |
| | Initialize an AEAD context with a single key.
|
| |
| Result | seal (Span< const uint8_t > nonce, Span< const uint8_t > aad, Span< const uint8_t > plaintext, Span< uint8_t > ciphertext, Span< uint8_t > tag, size_t &bytesWritten) |
| | Encrypt a single message using AEAD.
|
| |
| Result | open (Span< const uint8_t > nonce, Span< const uint8_t > aad, Span< const uint8_t > ciphertext, Span< const uint8_t > tag, Span< uint8_t > plaintext, size_t &bytesWritten) |
| | Decrypt a single message using AEAD.
|
| |
◆ Aead() [1/2]
| SC::Cryptography::Aead::Aead |
( |
| ) |
|
Construct a session using the default native backend.
◆ Aead() [2/2]
| SC::Cryptography::Aead::Aead |
( |
Backend | backend | ) |
|
|
explicit |
Construct a session using an explicitly selected backend.
◆ init()
| Result SC::Cryptography::Aead::init |
( |
AeadType | type, |
|
|
Span< const uint8_t > | key ) |
Initialize an AEAD context with a single key.
- Note
- Every initialization attempt discards the previous key, including when initialization fails.
◆ open()
| Result SC::Cryptography::Aead::open |
( |
Span< const uint8_t > | nonce, |
|
|
Span< const uint8_t > | aad, |
|
|
Span< const uint8_t > | ciphertext, |
|
|
Span< const uint8_t > | tag, |
|
|
Span< uint8_t > | plaintext, |
|
|
size_t & | bytesWritten ) |
Decrypt a single message using AEAD.
- Parameters
-
| nonce | Nonce/IV for the message. Must be 12 bytes for AES-GCM. |
| aad | Additional authenticated data. Must not overlap plaintext. The Linux AF_ALG backend accepts at most 4096 bytes. |
| ciphertext | Input ciphertext. |
| tag | Input authentication tag. Must be 16 bytes and must not overlap plaintext. |
| plaintext | Output plaintext span. Must be at least ciphertext size. Exact overlap is allowed; partial overlap is rejected. Nonce and AAD must not overlap plaintext. Authentication or backend failure clears the complete output span; validation failure leaves it unchanged. |
| [out] | bytesWritten | Number of plaintext bytes written. Always zero on failure. |
◆ seal()
| Result SC::Cryptography::Aead::seal |
( |
Span< const uint8_t > | nonce, |
|
|
Span< const uint8_t > | aad, |
|
|
Span< const uint8_t > | plaintext, |
|
|
Span< uint8_t > | ciphertext, |
|
|
Span< uint8_t > | tag, |
|
|
size_t & | bytesWritten ) |
Encrypt a single message using AEAD.
- Parameters
-
| nonce | Nonce/IV for the message. Must be 12 bytes for AES-GCM and unique for every message under a key. |
| aad | Additional authenticated data. Must not overlap ciphertext or tag. The Linux AF_ALG backend accepts at most 4096 bytes. |
| plaintext | Input plaintext. |
| ciphertext | Output ciphertext span. Must be at least plaintext size. Exact overlap is allowed; partial overlap is rejected. |
| tag | Output authentication tag. Must be 16 bytes and must not overlap another argument. |
| [out] | bytesWritten | Number of ciphertext bytes written. Always zero on failure. Validation failures leave outputs unchanged; after a backend failure ciphertext and tag must be treated as unusable. |
The documentation for this struct was generated from the following file: