esp_algorithms.h File Reference

ESP algorithm negotiation. More...

#include "esp/esp.h"
#include "ike/ike.h"
#include "ike/ike_algorithms.h"

Go to the source code of this file.

Functions

error_t espSelectEncAlgo (IkeChildSaEntry *childSa, uint16_t encAlgoId, size_t encKeyLen)
 Select the relevant encryption algorithm. More...
 
error_t espSelectAuthAlgo (IkeChildSaEntry *childSa, uint16_t authAlgoId)
 Select the relevant MAC algorithm. More...
 
error_t espAddSupportedTransforms (IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
 Add the supported ESP transforms to the proposal. More...
 
error_t espAddSupportedEncTransforms (IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
 Add the supported encryption transforms to the proposal. More...
 
error_t espAddSupportedAuthTransforms (IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
 Add the supported integrity transforms to the proposal. More...
 
error_t espAddSupportedEsnTransforms (IkeChildSaEntry *childSa, IkeProposal *proposal, uint8_t **lastSubstruc)
 Add the supported ESN transforms to the proposal. More...
 
const IkeEncAlgo * espSelectEncTransform (IkeChildSaEntry *childSa, const IkeProposal *proposal, size_t proposalLen)
 Encryption transform negotiation. More...
 
uint16_t espSelectAuthTransform (IkeChildSaEntry *childSa, const IkeProposal *proposal, size_t proposalLen)
 Integrity transform negotiation. More...
 
uint16_t espSelectEsnTransform (IkeChildSaEntry *childSa, const IkeProposal *proposal, size_t proposalLen)
 ESN transform negotiation. More...
 
error_t espSelectSaProposal (IkeChildSaEntry *childSa, const IkeSaPayload *payload)
 Select a single proposal. More...
 
error_t espCheckSaProposal (IkeChildSaEntry *childSa, const IkeSaPayload *payload)
 Check whether the selected proposal is acceptable. More...
 

Detailed Description

ESP algorithm negotiation.

License

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

Copyright (C) 2022-2026 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.

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

Definition in file esp_algorithms.h.

Function Documentation

◆ espAddSupportedAuthTransforms()

error_t espAddSupportedAuthTransforms ( IkeChildSaEntry *  childSa,
IkeProposal *  proposal,
uint8_t **  lastSubstruc 
)

Add the supported integrity transforms to the proposal.

Parameters
[in]childSaPointer to the Child SA
[in,out]proposalPointer to the Proposal substructure
[in,out]lastSubstrucPointer to the Last Substruc field
Returns
Error code

Definition at line 1079 of file esp_algorithms.c.

◆ espAddSupportedEncTransforms()

error_t espAddSupportedEncTransforms ( IkeChildSaEntry *  childSa,
IkeProposal *  proposal,
uint8_t **  lastSubstruc 
)

Add the supported encryption transforms to the proposal.

Parameters
[in]childSaPointer to the Child SA
[in,out]proposalPointer to the Proposal substructure
[in,out]lastSubstrucPointer to the Last Substruc field
Returns
Error code

Definition at line 1048 of file esp_algorithms.c.

◆ espAddSupportedEsnTransforms()

error_t espAddSupportedEsnTransforms ( IkeChildSaEntry *  childSa,
IkeProposal *  proposal,
uint8_t **  lastSubstruc 
)

Add the supported ESN transforms to the proposal.

Parameters
[in]childSaPointer to the Child SA
[in,out]proposalPointer to the Proposal substructure
[in,out]lastSubstrucPointer to the Last Substruc field
Returns
Error code

Definition at line 1109 of file esp_algorithms.c.

◆ espAddSupportedTransforms()

error_t espAddSupportedTransforms ( IkeChildSaEntry *  childSa,
IkeProposal *  proposal,
uint8_t **  lastSubstruc 
)

Add the supported ESP transforms to the proposal.

Parameters
[in]childSaPointer to the Child SA
[in,out]proposalPointer to the Proposal substructure
[in,out]lastSubstrucPointer to the Last Substruc field
Returns
Error code

Definition at line 993 of file esp_algorithms.c.

◆ espCheckSaProposal()

error_t espCheckSaProposal ( IkeChildSaEntry *  childSa,
const IkeSaPayload *  payload 
)

Check whether the selected proposal is acceptable.

Parameters
[in]childSaPointer to the Child SA
[in]payloadPointer to the Security Association payload
Returns
Error code

Definition at line 1455 of file esp_algorithms.c.

◆ espSelectAuthAlgo()

error_t espSelectAuthAlgo ( IkeChildSaEntry *  childSa,
uint16_t  authAlgoId 
)

Select the relevant MAC algorithm.

Parameters
[in]childSaPointer to the Child SA
[in]authAlgoIdAuthentication algorithm identifier
Returns
Error code

Definition at line 895 of file esp_algorithms.c.

◆ espSelectAuthTransform()

uint16_t espSelectAuthTransform ( IkeChildSaEntry *  childSa,
const IkeProposal *  proposal,
size_t  proposalLen 
)

Integrity transform negotiation.

Parameters
[in]childSaPointer to the Child SA
[in]proposalPointer to the Proposal substructure
[in]proposalLenLength of the Proposal substructure, in bytes
Returns
Selected integrity transform, if any

Definition at line 1255 of file esp_algorithms.c.

◆ espSelectEncAlgo()

error_t espSelectEncAlgo ( IkeChildSaEntry *  childSa,
uint16_t  encAlgoId,
size_t  encKeyLen 
)

Select the relevant encryption algorithm.

Parameters
[in]childSaPointer to the Child SA
[in]encAlgoIdEncryption algorithm identifier
[in]encKeyLenLength of the encryption key, in bytes
Returns
Error code

Definition at line 249 of file esp_algorithms.c.

◆ espSelectEncTransform()

const IkeEncAlgo* espSelectEncTransform ( IkeChildSaEntry *  childSa,
const IkeProposal *  proposal,
size_t  proposalLen 
)

Encryption transform negotiation.

Parameters
[in]childSaPointer to the Child SA
[in]proposalPointer to the Proposal substructure
[in]proposalLenLength of the Proposal substructure, in bytes
Returns
Selected encryption transform, if any

Definition at line 1139 of file esp_algorithms.c.

◆ espSelectEsnTransform()

uint16_t espSelectEsnTransform ( IkeChildSaEntry *  childSa,
const IkeProposal *  proposal,
size_t  proposalLen 
)

ESN transform negotiation.

Parameters
[in]childSaPointer to the Child SA
[in]proposalPointer to the Proposal substructure
[in]proposalLenLength of the Proposal substructure, in bytes
Returns
Selected ESN transform, if any

Definition at line 1272 of file esp_algorithms.c.

◆ espSelectSaProposal()

error_t espSelectSaProposal ( IkeChildSaEntry *  childSa,
const IkeSaPayload *  payload 
)

Select a single proposal.

Parameters
[in]childSaPointer to the Child SA
[in]payloadPointer to the Security Association payload
Returns
Error code

Definition at line 1288 of file esp_algorithms.c.