18 #ifndef __PPKCS5_HEADER__ 19 #define __PPKCS5_HEADER__ 21 #if defined(__ENABLE_MOCANA_CRYPTO_INTERFACE__) 22 #include "../crypto_interface/crypto_interface_pkcs5_priv.h" 35 sha256Encryption = 11,
36 sha384Encryption = 12,
37 sha512Encryption = 13,
45 twoKeyTdesEncryption = 2,
57 #ifdef __ENABLE_MOCANA_PKCS5__ 59 #define MOC_MIN_800_132_SALT_LEN 16 60 #define MOC_MIN_800_132_KEY_LEN 14 61 #define MOC_MIN_800_132_ITERATION_COUNT 1000 66 MOC_EXTERN
const ubyte pkcs5_root_OID[];
67 MOC_EXTERN
const ubyte pkcs5_PBKDF2_OID[];
68 MOC_EXTERN
const ubyte pkcs5_PBES2_OID[];
133 MOC_EXTERN MSTATUS
PKCS5_CreateKey_PBKDF1(MOC_HASH(hwAccelDescr hwAccelCtx)
const ubyte *pSalt, ubyte4 saltLen,
134 ubyte4 iterationCount,
enum hashFunc hashingFunction,
135 const ubyte *pPassword, ubyte4 passwordLen,
136 ubyte4 dkLen, ubyte *pRetDerivedKey);
204 MOC_EXTERN MSTATUS
PKCS5_CreateKey_PBKDF2(MOC_HASH(hwAccelDescr hwAccelCtx)
const ubyte *pSalt, ubyte4 saltLen,
205 ubyte4 iterationCount, ubyte rsaAlgoId,
206 const ubyte *pPassword, ubyte4 passwordLen,
207 ubyte4 dkLen, ubyte *pRetDerivedKey);
238 MOC_EXTERN MSTATUS
PKCS5_decrypt( MOC_SYM(hwAccelDescr hwAccelCtx)
239 ubyte subType, CStream cs,
240 ASN1_ITEMPTR pPBEParam, ASN1_ITEMPTR pEncrypted,
241 const ubyte* password, sbyte4 passwordLen,
242 ubyte** privateKeyInfo,
243 sbyte4* privateKeyInfoLen);
273 const ubyte *pAsn1PBE, ubyte4 pbeLen,
274 ubyte *pData, ubyte4 dataLen,
275 const ubyte *pPassword, sbyte4 passwordLen,
276 ubyte *pPrivateKeyInfo, ubyte4 privKeyInfoBufferLen,
277 ubyte4 *pPrivKeyInfoLen);
328 const ubyte* password, ubyte4 passwordLen,
329 const ubyte* salt, ubyte4 saltLen,
331 ubyte* plainText, ubyte4 ptLen);
404 ubyte4 keyLength, sbyte4 effectiveKeyBits,
405 const ubyte* password, ubyte4 passwordLen,
406 const ubyte* salt, ubyte4 saltLen,
407 ubyte4 iterCount,
const ubyte* iv,
408 ubyte* plainText, ubyte4 ptLen);
470 MOC_SYM(hwAccelDescr hwAccelCtx)
471 ubyte encryptionAlgo, ubyte digestAlg,
472 ubyte4 keyLength, sbyte4 effectiveKeyBits,
473 const ubyte *pPassword, ubyte4 passwordLen,
474 const ubyte *pSalt, ubyte4 saltLen,
475 ubyte4 iterCount,
const ubyte *pIv,
476 ubyte *pPlainText, ubyte4 ptLen,
477 ubyte *pCipherText, ubyte4 ctBufferLen,
MOC_EXTERN MSTATUS PKCS5_decryptV2(MOC_SYM(hwAccelDescr hwAccelCtx) const ubyte *pAsn1PBE, ubyte4 pbeLen, ubyte *pData, ubyte4 dataLen, const ubyte *pPassword, sbyte4 passwordLen, ubyte *pPrivateKeyInfo, ubyte4 privKeyInfoBufferLen, ubyte4 *pPrivKeyInfoLen)
Decrypt data that is PKCS5 V2 encrypted and in a raw buffer form.
MOC_EXTERN MSTATUS PKCS5_encryptV1(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte pkcs5SubType, const ubyte *password, ubyte4 passwordLen, const ubyte *salt, ubyte4 saltLen, ubyte4 iterCount, ubyte *plainText, ubyte4 ptLen)
Encrypt a plaintext buffer with PBES1 encryption as defined in RFC 2898.
MOC_EXTERN MSTATUS PKCS5_encryptV2(MOC_SYM(hwAccelDescr hwAccelCtx) const BulkEncryptionAlgo *pAlgo, ubyte rsaAlgoId, ubyte4 keyLength, sbyte4 effectiveKeyBits, const ubyte *password, ubyte4 passwordLen, const ubyte *salt, ubyte4 saltLen, ubyte4 iterCount, const ubyte *iv, ubyte *plainText, ubyte4 ptLen)
Encrypt a plaintext buffer with PBES2 encryption as defined in RFC 2898.
MOC_EXTERN MSTATUS PKCS5_decrypt(MOC_SYM(hwAccelDescr hwAccelCtx) ubyte subType, CStream cs, ASN1_ITEMPTR pPBEParam, ASN1_ITEMPTR pEncrypted, const ubyte *password, sbyte4 passwordLen, ubyte **privateKeyInfo, sbyte4 *privateKeyInfoLen)
Decrypt data that is PKCS5 encrypted.
MOC_EXTERN MSTATUS PKCS5_CreateKey_PBKDF1(MOC_HASH(hwAccelDescr hwAccelCtx) const ubyte *pSalt, ubyte4 saltLen, ubyte4 iterationCount, enum hashFunc hashingFunction, const ubyte *pPassword, ubyte4 passwordLen, ubyte4 dkLen, ubyte *pRetDerivedKey)
Generate a key based on the RFC 2898 PBKDF1 key generation method.
MOC_EXTERN MSTATUS PKCS5_CreateKey_PBKDF2(MOC_HASH(hwAccelDescr hwAccelCtx) const ubyte *pSalt, ubyte4 saltLen, ubyte4 iterationCount, ubyte rsaAlgoId, const ubyte *pPassword, ubyte4 passwordLen, ubyte4 dkLen, ubyte *pRetDerivedKey)
Generate a key based on the RFC 2898 PBKDF2 key generation method.
MOC_EXTERN MSTATUS PKCS5_encryptV2_Alt(ubyte encryptionAlgo, ubyte digestAlg, ubyte4 keyLength, sbyte4 effectiveKeyBits, const ubyte *pPassword, ubyte4 passwordLen, const ubyte *pSalt, ubyte4 saltLen, ubyte4 iterCount, const ubyte *pIv, ubyte *pPlainText, ubyte4 ptLen, ubyte *pCipherText, ubyte4 ctBufferLen, ubyte4 *pCtLen)
Encrypt a plaintext buffer with PBES2 encryption as defined in RFC 2898.
Structure to hold function pointers to symmetric key cipher methods.
Definition: crypto.h:48