dtls13_record_encrypt.h File Reference

DTLS 1.3 record encryption. More...

#include "tls/tls.h"

Go to the source code of this file.

Functions

error_t dtls13EncryptRecord (TlsContext *context, TlsEncryptionEngine *encryptionEngine, uint8_t type, const uint8_t *data, size_t dataLen, uint8_t *record, size_t *recordLen)
 Encrypt an outgoing DTLS 1.3 record. More...
 
error_t dtls13EncryptAeadRecord (TlsContext *context, TlsEncryptionEngine *encryptionEngine, const uint8_t *nonce, size_t nonceLen, const uint8_t *aad, size_t aadLen, uint8_t *data, size_t dataLen, uint8_t *tag)
 Record encryption (AEAD cipher) More...
 
error_t dtls13ComputeMac (TlsContext *context, TlsEncryptionEngine *encryptionEngine, const uint8_t *nonce, size_t nonceLen, const uint8_t *aad, size_t aadLen, const uint8_t *data, size_t dataLen, uint8_t *mac)
 Compute message authentication code. More...
 
error_t dtls13EncryptSequenceNumber (TlsEncryptionEngine *encryptionEngine, uint8_t *record)
 Encrypt sequence number. More...
 
error_t dtls13DecryptSequenceNumber (TlsEncryptionEngine *decryptionEngine, uint8_t *record)
 Decrypt sequence number. More...
 

Detailed Description

DTLS 1.3 record encryption.

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_encrypt.h.

Function Documentation

◆ dtls13ComputeMac()

error_t dtls13ComputeMac ( TlsContext context,
TlsEncryptionEngine encryptionEngine,
const uint8_t *  nonce,
size_t  nonceLen,
const uint8_t *  aad,
size_t  aadLen,
const uint8_t *  data,
size_t  dataLen,
uint8_t *  mac 
)

Compute message authentication code.

Parameters
[in]contextPointer to the TLS context
[in]encryptionEnginePointer to the encryption 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 264 of file dtls13_record_encrypt.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.

◆ dtls13EncryptAeadRecord()

error_t dtls13EncryptAeadRecord ( TlsContext context,
TlsEncryptionEngine encryptionEngine,
const uint8_t *  nonce,
size_t  nonceLen,
const uint8_t *  aad,
size_t  aadLen,
uint8_t *  data,
size_t  dataLen,
uint8_t *  tag 
)

Record encryption (AEAD cipher)

Parameters
[in]contextPointer to the TLS context
[in]encryptionEnginePointer to the encryption 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 encrypted
[out]tagAuthentication tag
Returns
Error code

Definition at line 200 of file dtls13_record_encrypt.c.

◆ dtls13EncryptRecord()

error_t dtls13EncryptRecord ( TlsContext context,
TlsEncryptionEngine encryptionEngine,
uint8_t  type,
const uint8_t *  data,
size_t  dataLen,
uint8_t *  record,
size_t *  recordLen 
)

Encrypt an outgoing DTLS 1.3 record.

Parameters
[in]contextPointer to the TLS context
[in]encryptionEnginePointer to the encryption engine
[in]typeRecord type
[in]dataPointer to the payload data
[in]dataLenLength of the payload data
[out]recordBuffer where to store the encrypted DTLS record
[out]recordLenLength of the encrypted DTLS record, in bytes
Returns
Error code

Definition at line 58 of file dtls13_record_encrypt.c.

◆ dtls13EncryptSequenceNumber()

error_t dtls13EncryptSequenceNumber ( TlsEncryptionEngine encryptionEngine,
uint8_t *  record 
)

Encrypt sequence number.

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

Definition at line 299 of file dtls13_record_encrypt.c.