pkcs5_decrypt.c
const HashAlgo * pkcs5GetPbes1HashAlgo(const uint8_t *oid, size_t length)
Get the hash algorithm to be used for PBES1 operation.
Definition: pkcs5_common.c:69
error_t pkcs5ParsePbes1Params(const uint8_t *data, size_t length, Pkcs5Pbes1Params *pbes1Params)
Parse PBES1 parameters.
Definition: pkcs5_decrypt.c:393
OID (Object Identifier)
Collection of AEAD algorithms.
error_t pkcs5ParseEncryptionScheme(const uint8_t *data, size_t length, size_t *totalLength, Pkcs5EncryptionScheme *encryptionScheme)
Parse EncryptionScheme structure.
Definition: pkcs5_decrypt.c:684
error_t pkcs5ParsePbkdf2Params(const uint8_t *data, size_t length, Pkcs5KeyDerivationFunc *keyDerivationFunc)
Parse PBKDF2 parameters.
Definition: pkcs5_decrypt.c:566
const CipherAlgo * pkcs5GetPbes2CipherAlgo(const uint8_t *oid, size_t length)
Get the cipher algorithm to be used for PBES2 operation.
Definition: pkcs5_common.c:285
uint_t pkcs5GetPbes2KeyLength(const uint8_t *oid, size_t length)
Get the encryption key length to be used for PBES2 operation.
Definition: pkcs5_common.c:384
int_t oidComp(const uint8_t *oid1, size_t oidLen1, const uint8_t *oid2, size_t oidLen2)
Compare object identifiers.
Definition: oid.c:103
PKCS #5 common definitions.
error_t asn1ReadOid(const uint8_t *data, size_t length, Asn1Tag *tag)
Read an object identifier from the input stream.
Definition: asn1.c:218
error_t asn1ReadOctetString(const uint8_t *data, size_t length, Asn1Tag *tag)
Read an octet string from the input stream.
Definition: asn1.c:190
Pkcs5EncryptionScheme encryptionScheme
Definition: pkcs5_common.h:216
const HashAlgo * pkcs5GetPbes2HashAlgo(const uint8_t *oid, size_t length)
Get the hash algorithm to be used for PBES2 operation.
Definition: pkcs5_common.c:135
error_t pkcs5ParsePbes2Params(const uint8_t *data, size_t length, Pkcs5Pbes2Params *pbes2Params)
Parse PBES2 parameters.
Definition: pkcs5_decrypt.c:454
error_t asn1ReadInt32(const uint8_t *data, size_t length, Asn1Tag *tag, int32_t *value)
Read a 32-bit integer from the input stream.
Definition: asn1.c:285
error_t pkcs5ParseKeyDerivationFunc(const uint8_t *data, size_t length, size_t *totalLength, Pkcs5KeyDerivationFunc *keyDerivationFunc)
Parse KeyDerivationFunc structure.
Definition: pkcs5_decrypt.c:507
General definitions for cryptographic algorithms.
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.
Definition: pkcs5_decrypt.c:108
Cipher Block Chaining (CBC) mode.
error_t pbkdf2(const HashAlgo *hash, const uint8_t *p, size_t pLen, const uint8_t *s, size_t sLen, uint_t c, uint8_t *dk, size_t dkLen)
PBKDF2 key derivation function.
Definition: pbkdf.c:140
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.
Definition: pkcs5_decrypt.c:61
PBKDF (Password-Based Key Derivation Function)
const CipherAlgo * pkcs5GetPbes1CipherAlgo(const uint8_t *oid, size_t length)
Get the cipher algorithm to be used for PBES1 operation.
Definition: pkcs5_common.c:222
__weak_func error_t cbcDecrypt(const CipherAlgo *cipher, void *context, uint8_t *iv, const uint8_t *c, uint8_t *p, size_t length)
CBC decryption.
Definition: cbc.c:108
error_t pbkdf1(const HashAlgo *hash, const uint8_t *p, size_t pLen, const uint8_t *s, size_t sLen, uint_t c, uint8_t *dk, size_t dkLen)
PBKDF1 key derivation function.
Definition: pbkdf.c:64
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.
Definition: pkcs5_decrypt.c:247
PKCS #5 decryption routines.
error_t asn1ReadSequence(const uint8_t *data, size_t length, Asn1Tag *tag)
Read an ASN.1 sequence from the input stream.
Definition: asn1.c:163
HMAC (Keyed-Hashing for Message Authentication)
Debugging facilities.
ASN.1 (Abstract Syntax Notation One)
Pkcs5KeyDerivationFunc keyDerivationFunc
Definition: pkcs5_common.h:215