24 #ifndef __PKCS1_HEADER__ 25 #define __PKCS1_HEADER__ 27 #ifdef __ENABLE_MOCANA_CRYPTO_INTERFACE_PKCS1__ 28 #include "../crypto_interface/crypto_interface_pkcs1_priv.h" 40 #ifndef MOC_PKCS1_ALG_MGF1 41 #define MOC_PKCS1_ALG_MGF1 1 47 #ifndef OPENSSL_ENGINE 49 #define PKCS1_MGF1 PKCS1_MGF1_FUNC 57 typedef MSTATUS (*
mgfFunc)(MOC_RSA(hwAccelDescr hwAccelCtx)
const ubyte *mgfSeed, ubyte4 mgfSeedLen, ubyte4 maskLen,
BulkHashAlgo *H, ubyte **ppRetMask);
62 MOC_EXTERN MSTATUS PKCS1_rsaesOaepEncrypt(MOC_RSA(hwAccelDescr hwAccelCtx) randomContext *pRandomContext,
const RSAKey *pRSAKey, ubyte H_rsaAlgoId,
mgfFunc MGF,
const ubyte *M, ubyte4 mLen,
const ubyte *L, ubyte4 lLen, ubyte **ppRetEncrypt, ubyte4 *pRetEncryptLen);
63 #if (!defined(__DISABLE_MOCANA_RSA_DECRYPTION__)) 64 MOC_EXTERN MSTATUS PKCS1_rsaesOaepDecrypt(MOC_RSA(hwAccelDescr hwAccelCtx)
const RSAKey *pRSAKey, ubyte H_rsaAlgoId,
mgfFunc MGF,
const ubyte *C, ubyte4 cLen,
const ubyte *L, ubyte4 lLen, ubyte **ppRetDecrypt, ubyte4 *pRetDecryptLength);
67 #if (!defined(__DISABLE_MOCANA_RSA_DECRYPTION__)) 68 MOC_EXTERN MSTATUS PKCS1_rsassaPssSign(MOC_RSA(hwAccelDescr hwAccelCtx) randomContext *pRandomContext,
const RSAKey *pRSAKey, ubyte H_rsaAlgoId,
mgfFunc MGF,
const ubyte *pMessage, ubyte4 mesgLen, ubyte4 saltLen, ubyte **ppRetSignature, ubyte4 *pRetSignatureLen);
69 MOC_EXTERN MSTATUS PKCS1_rsassaFreePssSign(MOC_RSA(hwAccelDescr hwAccelCtx) ubyte **ppSignature);
71 MOC_EXTERN MSTATUS PKCS1_rsassaPssVerify(MOC_RSA(hwAccelDescr hwAccelCtx)
const RSAKey *pRSAKey, ubyte H_rsaAlgoId,
mgfFunc MGF,
const ubyte *
const pMessage, ubyte4 mesgLen,
const ubyte *pSignature, ubyte4 signatureLen, sbyte4 saltLen, intBoolean *pRetIsSignatureValid);
74 MOC_EXTERN MSTATUS PKCS1_MGF1_FUNC(MOC_RSA(hwAccelDescr hwAccelCtx)
const ubyte *mgfSeed, ubyte4 mgfSeedLen, ubyte4 maskLen,
BulkHashAlgo *H, ubyte **ppRetMask);
102 MOC_RSA(hwAccelDescr hwAccelCtx)
103 randomContext *pRandomContext,
104 const RSAKey *pRSAKey,
108 const ubyte *pMessage,
112 ubyte **ppCipherText,
113 ubyte4 *pCipherTextLen
139 MOC_RSA(hwAccelDescr hwAccelCtx)
140 const RSAKey *pRSAKey,
144 const ubyte *pCipherText,
149 ubyte4 *pPlainTextLen
177 MOC_RSA(hwAccelDescr hwAccelCtx)
178 randomContext *pRandomContext,
179 const RSAKey *pRSAKey,
183 const ubyte *pMessage,
187 ubyte4 *pSignatureLen,
215 MOC_RSA(hwAccelDescr hwAccelCtx)
216 randomContext *pRandomContext,
217 const RSAKey *pRSAKey,
221 const ubyte *pMessage,
225 ubyte4 *pSignatureLen
252 MOC_RSA(hwAccelDescr hwAccelCtx)
253 const RSAKey *pRSAKey,
257 const ubyte *pMessage,
259 const ubyte *pSignature,
289 MOC_RSA(hwAccelDescr hwAccelCtx)
290 const RSAKey *pRSAKey,
294 const ubyte *pMessage,
296 const ubyte *pSignature,
MOC_EXTERN MSTATUS PKCS1_rsaPssSign(randomContext *pRandomContext, const RSAKey *pRSAKey, ubyte hashAlgo, ubyte mgfAlgo, ubyte mgfHashAlgo, const ubyte *pMessage, ubyte4 mLen, ubyte4 saltLen, ubyte **ppSignature, ubyte4 *pSignatureLen)
Use the provided RSA Key to sign some data using the PSS scheme.
MOC_EXTERN MSTATUS PKCS1_rsaOaepDecrypt(const RSAKey *pRSAKey, ubyte hashAlgo, ubyte mgfAlgo, ubyte mgfHashAlgo, const ubyte *pCipherText, ubyte4 cLen, const ubyte *pLabel, ubyte4 lLen, ubyte **ppPlainText, ubyte4 *pPlainTextLen)
Perform RSA-OAEP decryption.
MOC_EXTERN MSTATUS PKCS1_rsaPssSignExt(randomContext *pRandomContext, const RSAKey *pRSAKey, ubyte hashAlgo, ubyte mgfAlgo, ubyte mgfHashAlgo, const ubyte *pMessage, ubyte4 mLen, ubyte4 saltLen, ubyte **ppSignature, ubyte4 *pSignatureLen, void *pExtCtx)
Use the provided RSA Key to sign some data using the PSS scheme.
Structure to hold function pointers to hashing or extenable output methods.
Definition: crypto.h:133
MOC_EXTERN MSTATUS PKCS1_rsaOaepEncrypt(randomContext *pRandomContext, const RSAKey *pRSAKey, ubyte hashAlgo, ubyte mgfAlgo, ubyte mgfHashAlgo, const ubyte *pMessage, ubyte4 mLen, const ubyte *pLabel, ubyte4 lLen, ubyte **ppCipherText, ubyte4 *pCipherTextLen)
Perform RSA-OAEP encryption.
MOC_EXTERN MSTATUS PKCS1_rsaPssVerifyExt(const RSAKey *pRSAKey, ubyte hashAlgo, ubyte mgfAlgo, ubyte mgfHashAlgo, const ubyte *pMessage, ubyte4 mLen, const ubyte *pSignature, ubyte4 signatureLen, sbyte4 saltLen, ubyte4 *pVerify, void *pExtCtx)
Use the provided RSA Key to verify a PSS signature.
MOC_EXTERN MSTATUS PKCS1_rsaPssVerify(const RSAKey *pRSAKey, ubyte hashAlgo, ubyte mgfAlgo, ubyte mgfHashAlgo, const ubyte *pMessage, ubyte4 mLen, const ubyte *pSignature, ubyte4 signatureLen, sbyte4 saltLen, ubyte4 *pVerify)
Use the provided RSA Key to verify a PSS signature.
MSTATUS(* mgfFunc)(MOC_RSA(hwAccelDescr hwAccelCtx) const ubyte *mgfSeed, ubyte4 mgfSeedLen, ubyte4 maskLen, BulkHashAlgo *H, ubyte **ppRetMask)
Definition: pkcs1.h:57