pkcs5_decrypt.h File Reference

PKCS #5 decryption routines. More...

#include "core/crypto.h"
#include "pkix/x509_common.h"
#include "pkix/pkcs5_common.h"

Go to the source code of this file.

Functions

error_t pkcs5Decrypt (const X509AlgoId *encryptionAlgoId, const char_t *password, const uint8_t *ciphertext, size_t ciphertextLen, uint8_t *plaintext, size_t *plaintextLen)
 PKCS #5 decryption operation. More...
 
error_t pkcs5DecryptPbes1 (const X509AlgoId *encryptionAlgoId, const char_t *password, const uint8_t *ciphertext, size_t ciphertextLen, uint8_t *plaintext, size_t *plaintextLen)
 PBES1 decryption operation. More...
 
error_t pkcs5DecryptPbes2 (const X509AlgoId *encryptionAlgoId, const char_t *password, const uint8_t *ciphertext, size_t ciphertextLen, uint8_t *plaintext, size_t *plaintextLen)
 PBES2 decryption operation. More...
 
error_t pkcs5ParsePbes1Params (const uint8_t *data, size_t length, Pkcs5Pbes1Params *pbes1Params)
 Parse PBES1 parameters. More...
 
error_t pkcs5ParsePbes2Params (const uint8_t *data, size_t length, Pkcs5Pbes2Params *pbes2Params)
 Parse PBES2 parameters. More...
 
error_t pkcs5ParseKeyDerivationFunc (const uint8_t *data, size_t length, size_t *totalLength, Pkcs5KeyDerivationFunc *keyDerivationFunc)
 Parse KeyDerivationFunc structure. More...
 
error_t pkcs5ParsePbkdf2Params (const uint8_t *data, size_t length, Pkcs5KeyDerivationFunc *keyDerivationFunc)
 Parse PBKDF2 parameters. More...
 
error_t pkcs5ParseEncryptionScheme (const uint8_t *data, size_t length, size_t *totalLength, Pkcs5EncryptionScheme *encryptionScheme)
 Parse EncryptionScheme structure. More...
 

Detailed Description

PKCS #5 decryption routines.

License

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

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

This file is part of CycloneCRYPTO 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.4.0

Definition in file pkcs5_decrypt.h.

Function Documentation

◆ pkcs5Decrypt()

error_t pkcs5Decrypt ( const X509AlgoId encryptionAlgoId,
const char_t password,
const uint8_t *  ciphertext,
size_t  ciphertextLen,
uint8_t *  plaintext,
size_t *  plaintextLen 
)

PKCS #5 decryption operation.

Parameters
[in]encryptionAlgoIdEncryption algorithm identifier
[in]passwordNULL-terminated string containing the password
[in]ciphertextPointer to the ciphertext data
[in]ciphertextLenLength of the ciphertext data, in bytes
[out]plaintextPointer to the plaintext data
[out]plaintextLenLength of the plaintext data, in bytes
Returns
Error code

Definition at line 61 of file pkcs5_decrypt.c.

◆ pkcs5DecryptPbes1()

error_t pkcs5DecryptPbes1 ( const X509AlgoId encryptionAlgoId,
const char_t password,
const uint8_t *  ciphertext,
size_t  ciphertextLen,
uint8_t *  plaintext,
size_t *  plaintextLen 
)

PBES1 decryption operation.

Parameters
[in]encryptionAlgoIdEncryption algorithm identifier
[in]passwordNULL-terminated string containing the password
[in]ciphertextPointer to the ciphertext data
[in]ciphertextLenLength of the ciphertext data, in bytes
[out]plaintextPointer to the plaintext data
[out]plaintextLenLength of the plaintext data, in bytes
Returns
Error code

Definition at line 108 of file pkcs5_decrypt.c.

◆ pkcs5DecryptPbes2()

error_t pkcs5DecryptPbes2 ( const X509AlgoId encryptionAlgoId,
const char_t password,
const uint8_t *  ciphertext,
size_t  ciphertextLen,
uint8_t *  plaintext,
size_t *  plaintextLen 
)

PBES2 decryption operation.

Parameters
[in]encryptionAlgoIdEncryption algorithm identifier
[in]passwordNULL-terminated string containing the password
[in]ciphertextPointer to the ciphertext data
[in]ciphertextLenLength of the ciphertext data, in bytes
[out]plaintextPointer to the plaintext data
[out]plaintextLenLength of the plaintext data, in bytes
Returns
Error code

Definition at line 247 of file pkcs5_decrypt.c.

◆ pkcs5ParseEncryptionScheme()

error_t pkcs5ParseEncryptionScheme ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
Pkcs5EncryptionScheme encryptionScheme 
)

Parse EncryptionScheme structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]encryptionSchemeInformation resulting from the parsing process
Returns
Error code

Definition at line 684 of file pkcs5_decrypt.c.

◆ pkcs5ParseKeyDerivationFunc()

error_t pkcs5ParseKeyDerivationFunc ( const uint8_t *  data,
size_t  length,
size_t *  totalLength,
Pkcs5KeyDerivationFunc keyDerivationFunc 
)

Parse KeyDerivationFunc structure.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]totalLengthNumber of bytes that have been parsed
[out]keyDerivationFuncInformation resulting from the parsing process
Returns
Error code

Definition at line 507 of file pkcs5_decrypt.c.

◆ pkcs5ParsePbes1Params()

error_t pkcs5ParsePbes1Params ( const uint8_t *  data,
size_t  length,
Pkcs5Pbes1Params pbes1Params 
)

Parse PBES1 parameters.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]pbes1ParamsInformation resulting from the parsing process
Returns
Error code

Definition at line 393 of file pkcs5_decrypt.c.

◆ pkcs5ParsePbes2Params()

error_t pkcs5ParsePbes2Params ( const uint8_t *  data,
size_t  length,
Pkcs5Pbes2Params pbes2Params 
)

Parse PBES2 parameters.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]pbes2ParamsInformation resulting from the parsing process
Returns
Error code

Definition at line 454 of file pkcs5_decrypt.c.

◆ pkcs5ParsePbkdf2Params()

error_t pkcs5ParsePbkdf2Params ( const uint8_t *  data,
size_t  length,
Pkcs5KeyDerivationFunc keyDerivationFunc 
)

Parse PBKDF2 parameters.

Parameters
[in]dataPointer to the ASN.1 structure to parse
[in]lengthLength of the ASN.1 structure
[out]keyDerivationFuncInformation resulting from the parsing process
Returns
Error code

Definition at line 566 of file pkcs5_decrypt.c.