dtls13_record_decrypt.c
Go to the documentation of this file.
369 TRACE_DEBUG("DTLS decrypted record received (%" PRIuSIZE " bytes)...\r\n", headerLen + dataLen);
__weak_func error_t ccmDecrypt(const CipherAlgo *cipher, void *context, const uint8_t *n, size_t nLen, const uint8_t *a, size_t aLen, const uint8_t *c, uint8_t *p, size_t length, const uint8_t *t, size_t tLen)
Authenticated decryption using CCM.
Definition: ccm.c:208
Collection of AEAD algorithms.
error_t dtls13ReadRecord(TlsContext *context)
Receive a DTLS 1.3 record.
Definition: dtls13_record_decrypt.c:52
void dtlsUpdateReplayWindow(TlsEncryptionEngine *decryptionEngine, const DtlsSequenceNumber *seqNum)
Update sliding window.
Definition: dtls_misc.c:581
void chachaCipher(ChachaContext *context, const uint8_t *input, uint8_t *output, size_t length)
Encrypt/decrypt data with the ChaCha algorithm.
Definition: chacha.c:192
error_t dtlsCheckReplayWindow(TlsEncryptionEngine *decryptionEngine, const DtlsSequenceNumber *seqNum)
Perform replay detection.
Definition: dtls_misc.c:506
error_t dtls13ReadCiphertextRecord(TlsContext *context, uint8_t *record)
Receive a DTLSCiphertext record.
Definition: dtls13_record_decrypt.c:190
error_t chachaInit(ChachaContext *context, uint_t nr, const uint8_t *key, size_t keyLen, const uint8_t *nonce, size_t nonceLen)
Initialize ChaCha context using the supplied key and nonce.
Definition: chacha.c:70
DTLS 1.3 (Datagram Transport Layer Security)
void dtls13ReconstructSequenceNumber(TlsEncryptionEngine *decryptionEngine, const uint8_t *record, DtlsSequenceNumber *seqNum)
Sequence number reconstruction.
Definition: dtls13_record_decrypt.c:739
void dtls13FormatNonce(TlsEncryptionEngine *encryptionEngine, const DtlsSequenceNumber *seqNum, uint8_t *nonce, size_t *nonceLen)
Format nonce.
Definition: dtls13_misc.c:381
__weak_func void hmacUpdate(HmacContext *context, const void *data, size_t length)
Update the HMAC context with a portion of the message being hashed.
Definition: hmac.c:201
error_t dtls13VerifyMac(TlsContext *context, TlsEncryptionEngine *decryptionEngine, const uint8_t *nonce, size_t nonceLen, const uint8_t *aad, size_t aadLen, const uint8_t *data, size_t dataLen, uint8_t *mac)
Check message authentication code.
Definition: dtls13_record_decrypt.c:584
__weak_func void hmacFinal(HmacContext *context, uint8_t *digest)
Finish the HMAC calculation.
Definition: hmac.c:218
error_t dtls13DecryptRecord(TlsContext *context, TlsEncryptionEngine *decryptionEngine, const uint8_t *nonce, size_t nonceLen, const uint8_t *aad, size_t aadLen, uint8_t *data, size_t *dataLen, uint8_t *type)
Decrypt an incoming DTLS 1.3 record.
Definition: dtls13_record_decrypt.c:402
error_t dtls13ReadPlaintextRecord(TlsContext *context, uint8_t *record)
Receive a DTLSPlaintext record.
Definition: dtls13_record_decrypt.c:95
TLS (Transport Layer Security)
error_t chacha20Poly1305Decrypt(const uint8_t *k, size_t kLen, const uint8_t *n, size_t nLen, const uint8_t *a, size_t aLen, const uint8_t *c, uint8_t *p, size_t length, const uint8_t *t, size_t tLen)
Authenticated decryption using ChaCha20Poly1305.
Definition: chacha20_poly1305.c:165
__weak_func error_t hmacInit(HmacContext *context, const HashAlgo *hash, const void *key, size_t keyLen)
Initialize HMAC calculation.
Definition: hmac.c:140
__weak_func error_t gcmDecrypt(GcmContext *context, const uint8_t *iv, size_t ivLen, const uint8_t *a, size_t aLen, const uint8_t *c, uint8_t *p, size_t length, const uint8_t *t, size_t tLen)
Authenticated decryption using GCM.
Definition: gcm.c:356
error_t dtls13DecryptAeadRecord(TlsContext *context, TlsEncryptionEngine *decryptionEngine, const uint8_t *nonce, size_t nonceLen, const uint8_t *aad, size_t aadLen, uint8_t *data, size_t dataLen, uint8_t *tag)
Record decryption (AEAD cipher)
Definition: dtls13_record_decrypt.c:520
error_t dtls13DecryptSequenceNumber(TlsEncryptionEngine *decryptionEngine, uint8_t *record)
Decrypt sequence number.
Definition: dtls13_record_decrypt.c:629
Debugging facilities.
DTLS 1.3 record decryption.
