PKCS #5 decryption routines. More...
#include "core/crypto.h"
#include "pkix/pkcs5_common.h"
#include "pkix/pkcs5_decrypt.h"
#include "encoding/asn1.h"
#include "encoding/oid.h"
#include "cipher/cipher_algorithms.h"
#include "cipher_modes/cbc.h"
#include "mac/hmac.h"
#include "kdf/pbkdf.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL CRYPTO_TRACE_LEVEL |
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.
- Version
- 2.4.4
Definition in file pkcs5_decrypt.c.
Macro Definition Documentation
◆ TRACE_LEVEL
#define TRACE_LEVEL CRYPTO_TRACE_LEVEL |
Definition at line 32 of file pkcs5_decrypt.c.
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] encryptionAlgoId Encryption algorithm identifier [in] password NULL-terminated string containing the password [in] ciphertext Pointer to the ciphertext data [in] ciphertextLen Length of the ciphertext data, in bytes [out] plaintext Pointer to the plaintext data [out] plaintextLen Length 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] encryptionAlgoId Encryption algorithm identifier [in] password NULL-terminated string containing the password [in] ciphertext Pointer to the ciphertext data [in] ciphertextLen Length of the ciphertext data, in bytes [out] plaintext Pointer to the plaintext data [out] plaintextLen Length 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] encryptionAlgoId Encryption algorithm identifier [in] password NULL-terminated string containing the password [in] ciphertext Pointer to the ciphertext data [in] ciphertextLen Length of the ciphertext data, in bytes [out] plaintext Pointer to the plaintext data [out] plaintextLen Length 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] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] encryptionScheme Information 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] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] totalLength Number of bytes that have been parsed [out] keyDerivationFunc Information 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] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] pbes1Params Information 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] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] pbes2Params Information 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] data Pointer to the ASN.1 structure to parse [in] length Length of the ASN.1 structure [out] keyDerivationFunc Information resulting from the parsing process
- Returns
- Error code
Definition at line 566 of file pkcs5_decrypt.c.