Leancrypto 0.12.0
Post-Quantum Cryptographic Library
|
Functions | |
static int | lc_kyber_ies_enc (const struct lc_kyber_pk *pk, struct lc_kyber_ct *ct, const uint8_t *plaintext, uint8_t *ciphertext, size_t datalen, const uint8_t *aad, size_t aadlen, uint8_t *tag, size_t taglen, struct lc_aead_ctx *aead) |
KyberIES encryption oneshot. | |
static int | lc_kyber_ies_enc_init (struct lc_aead_ctx *aead, const struct lc_kyber_pk *pk, struct lc_kyber_ct *ct, const uint8_t *aad, size_t aadlen) |
KyberIES encryption stream operation initialization. | |
static int | lc_kyber_ies_enc_update (struct lc_aead_ctx *aead, const uint8_t *plaintext, uint8_t *ciphertext, size_t datalen) |
KyberIES encryption stream operation add more data. | |
static int | lc_kyber_ies_enc_final (struct lc_aead_ctx *aead, uint8_t *tag, size_t taglen) |
KyberIES encryption stream operation finalization / integrity test. | |
static int | lc_kyber_ies_dec (const struct lc_kyber_sk *sk, const struct lc_kyber_ct *ct, const uint8_t *ciphertext, uint8_t *plaintext, size_t datalen, const uint8_t *aad, size_t aadlen, const uint8_t *tag, size_t taglen, struct lc_aead_ctx *aead) |
KyberIES decryption oneshot. | |
static int | lc_kyber_ies_dec_init (struct lc_aead_ctx *aead, const struct lc_kyber_sk *sk, const struct lc_kyber_ct *ct, const uint8_t *aad, size_t aadlen) |
KyberIES decryption stream operation initialization. | |
static int | lc_kyber_ies_dec_update (struct lc_aead_ctx *aead, const uint8_t *ciphertext, uint8_t *plaintext, size_t datalen) |
KyberIES decryption stream operation add more data. | |
static int | lc_kyber_ies_dec_final (struct lc_aead_ctx *aead, const uint8_t *tag, size_t taglen) |
KyberIES decryption stream operation finalization / integrity test. | |
Kyber Integrated Encryption Schema
This mechanism uses Kyber to encrypt arbitrary data. See KyberIES for the associated documentation.
|
inlinestatic |
KyberIES decryption oneshot.
The implementation supports an in-place data decryption where the plaintext and ciphertext buffer pointers refer to the same memory location.
The function entirely operates on stack memory.
[in] | sk | Kyber secret key of data owner |
[in] | ct | Kyber ciphertext received from the encryption operation |
[in] | ciphertext | Ciphertext data to be encrypted |
[out] | plaintext | Buffer of equal size as ciphertext that will be filled with the decryption result |
[in] | datalen | Length of the ciphertext buffer |
[in] | aad | Additional authenticate data to be processed - this is data which is not encrypted, but considered as part of the authentication. |
[in] | aadlen | Length of the AAD buffer |
[in] | tag | Buffer with the authentication tag |
[in] | taglen | Length of the tag buffer |
[in] | aead | Allocated AEAD algorithm - the caller only needs to provide an allocated but otherwise unused instance of an AEAD algorithm. This allows the caller to define the AEAD algorithm type. The caller must zeroize and release the context after completion. |
Definition at line 1812 of file lc_kyber.h.
|
inlinestatic |
KyberIES decryption stream operation finalization / integrity test.
The implementation supports an in-place data decryption where the plaintext and ciphertext buffer pointers refer to the same memory location.
The function entirely operates on stack memory.
[in] | aead | Allocated AEAD algorithm - the caller only needs to provide an allocated but otherwise unused instance of an AEAD algorithm. This allows the caller to define the AEAD algorithm type. The caller must zeroize and release the context after completion. |
[in] | tag | Buffer with the authentication tag |
[in] | taglen | Length of the tag buffer |
Definition at line 1959 of file lc_kyber.h.
|
inlinestatic |
KyberIES decryption stream operation initialization.
The implementation supports an in-place data decryption where the plaintext and ciphertext buffer pointers refer to the same memory location.
The function entirely operates on stack memory.
The aead context is initialized such that it can be used with lc_kyber_ies_dec_[update|final].
[out] | aead | Allocated AEAD algorithm - the caller only needs to provide an allocated but otherwise unused instance of an AEAD algorithm. This allows the caller to define the AEAD algorithm type. The caller must zeroize and release the context after completion. |
[in] | sk | Kyber secret key of data owner |
[in] | ct | Kyber ciphertext received from the encryption operation |
[in] | aad | Additional authenticate data to be processed - this is data which is not encrypted, but considered as part of the authentication. |
[in] | aadlen | Length of the AAD buffer |
Definition at line 1876 of file lc_kyber.h.
|
inlinestatic |
KyberIES decryption stream operation add more data.
The implementation supports an in-place data decryption where the plaintext and ciphertext buffer pointers refer to the same memory location.
The function entirely operates on stack memory.
[in] | aead | Allocated AEAD algorithm - the caller only needs to provide an allocated but otherwise unused instance of an AEAD algorithm. This allows the caller to define the AEAD algorithm type. The caller must zeroize and release the context after completion. |
[in] | ciphertext | Ciphertext data to be encrypted |
[out] | plaintext | Buffer of equal size as ciphertext that will be filled with the decryption result |
[in] | datalen | Length of the ciphertext buffer |
Definition at line 1933 of file lc_kyber.h.
|
inlinestatic |
KyberIES encryption oneshot.
The implementation supports an in-place data encryption where the plaintext and ciphertext buffer pointers refer to the same memory location.
The function entirely operates on stack memory.
[in] | pk | Kyber public key of data owner |
[out] | ct | Kyber ciphertext to be sent to the decryption operation |
[in] | plaintext | Plaintext data to be encrypted |
[out] | ciphertext | Buffer of equal size as plaintext that will be filled with the encryption result |
[in] | datalen | Length of the plaintext buffer |
[in] | aad | Additional authenticate data to be processed - this is data which is not encrypted, but considered as part of the authentication. |
[in] | aadlen | Length of the AAD buffer |
[out] | tag | Buffer that will be filled with the authentication tag |
[in] | taglen | Length of the tag buffer |
[in] | aead | Allocated AEAD algorithm - the caller only needs to provide an allocated but otherwise unused instance of an AEAD algorithm. This allows the caller to define the AEAD algorithm type. The caller must zeroize and release the context after completion. |
Definition at line 1623 of file lc_kyber.h.
|
inlinestatic |
KyberIES encryption stream operation finalization / integrity test.
The implementation supports an in-place data encryption where the plaintext and ciphertext buffer pointers refer to the same memory location.
The function entirely operates on stack memory.
[in] | aead | Allocated AEAD algorithm - the caller only needs to provide an allocated but otherwise unused instance of an AEAD algorithm. This allows the caller to define the AEAD algorithm type. The caller must zeroize and release the context after completion. |
[out] | tag | Buffer that will be filled with the authentication tag |
[in] | taglen | Length of the tag buffer |
Definition at line 1777 of file lc_kyber.h.
|
inlinestatic |
KyberIES encryption stream operation initialization.
The implementation supports an in-place data encryption where the plaintext and ciphertext buffer pointers refer to the same memory location.
The function entirely operates on stack memory.
The aead context is initialized such that it can be used with lc_kyber_ies_enc_[update|final].
[out] | aead | Allocated AEAD algorithm - the caller only needs to provide an allocated but otherwise unused instance of an AEAD algorithm. This allows the caller to define the AEAD algorithm type. The caller must zeroize and release the context after completion. |
[in] | pk | Kyber public key of data owner |
[out] | ct | Kyber ciphertext to be sent to the decryption operation |
[in] | aad | Additional authenticate data to be processed - this is data which is not encrypted, but considered as part of the authentication. |
[in] | aadlen | Length of the AAD buffer |
Definition at line 1691 of file lc_kyber.h.
|
inlinestatic |
KyberIES encryption stream operation add more data.
The implementation supports an in-place data encryption where the plaintext and ciphertext buffer pointers refer to the same memory location.
The function entirely operates on stack memory.
[in] | aead | Allocated AEAD algorithm - the caller only needs to provide an allocated but otherwise unused instance of an AEAD algorithm. This allows the caller to define the AEAD algorithm type. The caller must zeroize and release the context after completion. |
[in] | plaintext | Plaintext data to be encrypted |
[out] | ciphertext | Buffer of equal size as plaintext that will be filled with the encryption result |
[in] | datalen | Length of the plaintext buffer |
Definition at line 1751 of file lc_kyber.h.