DTLS 1.3 record encryption. More...
#include "tls/tls.h"#include "dtls13/dtls13_record_encrypt.h"#include "dtls13/dtls13_misc.h"#include "cipher/cipher_algorithms.h"#include "debug.h"Go to the source code of this file.
Macros | |
| #define | TRACE_LEVEL TLS_TRACE_LEVEL |
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... | |
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.
- Version
- 2.6.2
Definition in file dtls13_record_encrypt.c.
Macro Definition Documentation
◆ TRACE_LEVEL
| #define TRACE_LEVEL TLS_TRACE_LEVEL |
Definition at line 32 of file dtls13_record_encrypt.c.
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] context Pointer to the TLS context [in] encryptionEngine Pointer to the encryption engine [in] nonce Nonce [in] nonceLen Length of the nonce, in bytes [in] aad Additional authenticated data [in] aadLen Length of the additional data [in] data Payload data [in] dataLen Total number of data bytes to be authenticated [out] mac Message authentication code
- Returns
- Error code
Definition at line 264 of file dtls13_record_encrypt.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] context Pointer to the TLS context [in] encryptionEngine Pointer to the encryption engine [in] nonce Nonce [in] nonceLen Length of the nonce, in bytes [in] aad Additional authenticated data [in] aadLen Length of the additional data [in,out] data Payload data [in] dataLen Total number of data bytes to be encrypted [out] tag Authentication 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] context Pointer to the TLS context [in] encryptionEngine Pointer to the encryption engine [in] type Record type [in] data Pointer to the payload data [in] dataLen Length of the payload data [out] record Buffer where to store the encrypted DTLS record [out] recordLen Length 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] encryptionEngine Pointer to the encryption engine [in,out] record Pointer to the DTLS 1.3 record
- Returns
- Error code
Definition at line 299 of file dtls13_record_encrypt.c.
