dtls13_record_decrypt.c File Reference

DTLS 1.3 record decryption. More...

Go to the source code of this file.

Macros

#define TRACE_LEVEL   TLS_TRACE_LEVEL
 

Functions

error_t dtls13ReadRecord (TlsContext *context)
 Receive a DTLS 1.3 record. More...
 
error_t dtls13ReadPlaintextRecord (TlsContext *context, uint8_t *record)
 Receive a DTLSPlaintext record. More...
 
error_t dtls13ReadCiphertextRecord (TlsContext *context, uint8_t *record)
 Receive a DTLSCiphertext record. More...
 
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. More...
 
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) More...
 
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. More...
 
error_t dtls13DecryptSequenceNumber (TlsEncryptionEngine *decryptionEngine, uint8_t *record)
 Decrypt sequence number. More...
 
void dtls13ReconstructSequenceNumber (TlsEncryptionEngine *decryptionEngine, const uint8_t *record, DtlsSequenceNumber *seqNum)
 Sequence number reconstruction. More...
 

Detailed Description

DTLS 1.3 record decryption.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2026 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneSSL Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.6.2

Definition in file dtls13_record_decrypt.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   TLS_TRACE_LEVEL

Definition at line 32 of file dtls13_record_decrypt.c.

Function Documentation

◆ dtls13DecryptAeadRecord()

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)

Parameters
[in]contextPointer to the TLS context
[in]decryptionEnginePointer to the decryption engine
[in]nonceNonce
[in]nonceLenLength of the nonce, in bytes
[in]aadAdditional authenticated data
[in]aadLenLength of the additional data
[in,out]dataPayload data
[in]dataLenTotal number of data bytes to be decrypted
[out]tagAuthentication tag
Returns
Error code

Definition at line 520 of file dtls13_record_decrypt.c.

◆ dtls13DecryptRecord()

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.

Parameters
[in]contextPointer to the TLS context
[in]decryptionEnginePointer to the decryption engine
[in]nonceNonce
[in]nonceLenLength of the nonce, in bytes
[in]aadAdditional authenticated data
[in]aadLenLength of the additional data
[in,out]dataPayload data
[in]dataLenActual length of the payload data
[out]typeRecord type
Returns
Error code

Definition at line 402 of file dtls13_record_decrypt.c.

◆ dtls13DecryptSequenceNumber()

error_t dtls13DecryptSequenceNumber ( TlsEncryptionEngine decryptionEngine,
uint8_t *  record 
)

Decrypt sequence number.

Parameters
[in]decryptionEnginePointer to the decryption engine
[in,out]recordPointer to the DTLS 1.3 record
Returns
Error code

Definition at line 629 of file dtls13_record_decrypt.c.

◆ dtls13ReadCiphertextRecord()

error_t dtls13ReadCiphertextRecord ( TlsContext context,
uint8_t *  record 
)

Receive a DTLSCiphertext record.

Parameters
[in]contextPointer to the TLS context
[in]recordPointer to the DTLSCiphertext structure
Returns
Error code

Definition at line 190 of file dtls13_record_decrypt.c.

◆ dtls13ReadPlaintextRecord()

error_t dtls13ReadPlaintextRecord ( TlsContext context,
uint8_t *  record 
)

Receive a DTLSPlaintext record.

Parameters
[in]contextPointer to the TLS context
[in]recordPointer to the DTLSPlaintext structure
Returns
Error code

Definition at line 95 of file dtls13_record_decrypt.c.

◆ dtls13ReadRecord()

error_t dtls13ReadRecord ( TlsContext context)

Receive a DTLS 1.3 record.

Parameters
[in]contextPointer to the TLS context
Returns
Error code

Definition at line 52 of file dtls13_record_decrypt.c.

◆ dtls13ReconstructSequenceNumber()

void dtls13ReconstructSequenceNumber ( TlsEncryptionEngine decryptionEngine,
const uint8_t *  record,
DtlsSequenceNumber seqNum 
)

Sequence number reconstruction.

Parameters
[in]decryptionEnginePointer to the decryption engine
[in,out]recordPointer to the DTLS 1.3 record
[out]seqNumReconstructed sequence number

Definition at line 739 of file dtls13_record_decrypt.c.

◆ dtls13VerifyMac()

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.

Parameters
[in]contextPointer to the TLS context
[in]decryptionEnginePointer to the decryption engine
[in]nonceNonce
[in]nonceLenLength of the nonce, in bytes
[in]aadAdditional authenticated data
[in]aadLenLength of the additional data
[in]dataPayload data
[in]dataLenTotal number of data bytes to be authenticated
[out]macMessage authentication code
Returns
Error code

Definition at line 584 of file dtls13_record_decrypt.c.