ESP packet encryption. More...
Go to the source code of this file.
Functions | |
error_t | espEncryptPacket (IpsecContext *context, IpsecSadEntry *sa, const EspHeader *espHeader, uint8_t *payload, size_t *payloadLen, uint8_t nextHeader) |
Encrypt an outgoing ESP packet. More... | |
error_t | espComputeChecksum (IpsecContext *context, IpsecSadEntry *sa, const EspHeader *espHeader, const uint8_t *payload, size_t length, uint8_t *icv) |
Compute ICV checksum. More... | |
size_t | espAddTrailer (IpsecSadEntry *sa, uint8_t *data, size_t length, uint8_t nextHeader) |
Append ESP trailer. More... | |
void | espGenerateIv (uint8_t *iv) |
IV generation. More... | |
Detailed Description
ESP packet encryption.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2022-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneIPSEC 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.4.4
Definition in file esp_packet_encrypt.h.
Function Documentation
◆ espAddTrailer()
size_t espAddTrailer | ( | IpsecSadEntry * | sa, |
uint8_t * | data, | ||
size_t | length, | ||
uint8_t | nextHeader | ||
) |
Append ESP trailer.
- Parameters
-
[in] sa Pointer to the SAD entry [in] data Pointer to the payload data [in] length Length of the payload data, in bytes [in] nextHeader Value of the next header field
- Returns
- Length of the resulting payload data
Definition at line 459 of file esp_packet_encrypt.c.
◆ espComputeChecksum()
error_t espComputeChecksum | ( | IpsecContext * | context, |
IpsecSadEntry * | sa, | ||
const EspHeader * | espHeader, | ||
const uint8_t * | payload, | ||
size_t | length, | ||
uint8_t * | icv | ||
) |
Compute ICV checksum.
- Parameters
-
[in] context Pointer to the IPsec context [in] sa Pointer to the SAD entry [in] espHeader Pointer to the ESP header [in] payload Pointer to the payload data [in] length Length of the packet, in bytes [out] icv Integrity Checksum Value (ICV)
- Returns
- Error code
Definition at line 356 of file esp_packet_encrypt.c.
◆ espEncryptPacket()
error_t espEncryptPacket | ( | IpsecContext * | context, |
IpsecSadEntry * | sa, | ||
const EspHeader * | espHeader, | ||
uint8_t * | payload, | ||
size_t * | payloadLen, | ||
uint8_t | nextHeader | ||
) |
Encrypt an outgoing ESP packet.
- Parameters
-
[in] context Pointer to the IPsec context [in] sa Pointer to the SAD entry [in] espHeader Pointer to the ESP header [in,out] payload Payload data to be encrypted [in,out] payloadLen Actual length of the payload data [in] nextHeader Value of the next header field
- Returns
- Error code
Definition at line 58 of file esp_packet_encrypt.c.
◆ espGenerateIv()
void espGenerateIv | ( | uint8_t * | iv | ) |
IV generation.
- Parameters
-
[in,out] iv Pointer to the 8-octet initialization vector
Definition at line 527 of file esp_packet_encrypt.c.