19 #ifndef __CRYPTO_INTERFACE_RSA_HEADER__ 20 #define __CRYPTO_INTERFACE_RSA_HEADER__ 44 MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_generateKeyAlloc(
45 MOC_RSA(hwAccelDescr hwAccelCtx) randomContext *pRandomContext,
93 MOC_RSA(hwAccelDescr hwAccelCtx)
const RSAKey *pKey,
94 const ubyte *pPlainText,
113 MOC_RSA(hwAccelDescr hwAccelCtx)
const RSAKey *pKey,
114 const ubyte *pCipherText,
116 ubyte4 *pPlainTextLen,
154 intBoolean *pIsValid,
155 vlong **ppVlongQueue);
167 MOC_RSA(hwAccelDescr hwAccelCtx)
169 sbyte4 *pCipherTextLen
186 MOC_RSA(hwAccelDescr hwAccelCtx)
189 const ubyte *pModulus,
209 MOC_RSA(hwAccelDescr hwAccelCtx)
213 const ubyte *pModulus,
237 MOC_RSA(hwAccelDescr hwAccelCtx)
240 const ubyte *modulus,
268 MOC_RSA(hwAccelDescr hwAccelCtx)
272 const ubyte *pModulus,
274 const ubyte *pPrime1,
276 const ubyte *pPrime2,
305 MOC_RSA(hwAccelDescr hwAccelCtx)
307 MRsaKeyTemplate *pTemplate,
323 MRsaKeyTemplate *pTemplate
344 MOC_RSA(hwAccelDescr hwAccelCtx)
374 MOC_RSA(hwAccelDescr hwAccelCtx)
409 MOC_RSA(hwAccelDescr hwAccelCtx)
const RSAKey *pKey,
410 const ubyte *pPlainText,
443 MOC_RSA(hwAccelDescr hwAccelCtx)
const RSAKey *pKey,
444 const ubyte *pCipherText,
446 ubyte4 *pPlainTextLen,
471 MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey **ppKey,
472 const ubyte* pByteString,
495 MOC_RSA(hwAccelDescr hwAccelCtx) randomContext *pRandomContext,
519 MOC_RSA(hwAccelDescr hwAccelCtx)
const RSAKey *pKey,
541 MOC_RSA(hwAccelDescr hwAccelCtx)
564 MOC_RSA(hwAccelDescr hwAccelCtx)
587 MOC_RSA(hwAccelDescr hwAccelCtx)
589 MRsaKeyTemplate *pTemplate,
615 MOC_RSA(hwAccelDescr hwAccelCtx)
622 ubyte **ppRetPaddedMsg,
623 ubyte4 *pRetPaddedMsgLen
636 MOC_RSA(hwAccelDescr hwAccelCtx)
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_verifySignatureAux(MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, const ubyte *pCipherText, ubyte *pPlainText, ubyte4 *pPlainTextLen, vlong **ppVlongQueue)
Uses an RSA key to verify the signature and write to pCipherText.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_cloneKey(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey **ppNewKey, const RSAKey *pSrc, vlong **ppVlongQueue)
Clone (copy) an RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_keyFromByteString(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey **ppKey, const ubyte *pByteString, ubyte4 len, vlong **ppVlongQueue)
Make an RSAKey object from a byte string.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_equalKey(MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey1, const RSAKey *pKey2, byteBoolean *pRes)
Determine whether two RSA keys are equal.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_applyPrivateKeyAux(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, RNGFun rngFun, void *rngFunArg, ubyte *pInput, ubyte4 inputLen, ubyte **ppOutput, vlong **ppVlongQueue)
Apply the private key to the input data.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_setPublicKeyParametersAux(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte4 exponent, const ubyte *pModulus, ubyte4 modulusLen, vlong **ppVlongQueue)
Set the public parameters of an RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_pkcs15Pad(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte4 operation, RNGFun rngFun, void *pRngFunArg, ubyte *pM, ubyte4 mLen, ubyte **ppRetPaddedMsg, ubyte4 *pRetPaddedMsgLen)
Used to generated PKCS 1.5 padded data.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_applyPublicKeyAux(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte *pInput, ubyte4 inputLen, ubyte **ppOutput, vlong **ppVlongQueue)
Apply the public key to the input data.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_encryptAux(MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, const ubyte *pPlainText, ubyte4 plainTextLen, ubyte *pCipherText, RNGFun rngFun, void *pRngFunArg, vlong **ppVlongQueue)
Creates RSA encryption.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_freeKeyAux(RSAKey **ppRsaKey, vlong **ppVlongQueue)
Free an RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_setPublicKeyData(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte *pPubExpo, ubyte4 pubExpoLen, const ubyte *pModulus, ubyte4 modulusLen, vlong **ppVlongQueue)
Set the public parameters of an RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_byteStringFromKey(MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, ubyte *pBuffer, ubyte4 *pRetLen)
Convert RSA key to a string of (PKCS #1) bytes.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_setAllKeyDataAux(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte *pPubExpo, ubyte4 pubExpoLen, const ubyte *pModulus, ubyte4 modulusLen, const ubyte *pPrime1, ubyte4 prime1Len, const ubyte *pPrime2, ubyte4 prime2Len, vlong **ppVlongQueue)
Set all the parameters in a RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_decryptAux(MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, const ubyte *pCipherText, ubyte *pPlainText, ubyte4 *pPlainTextLen, RNGFun rngFun, void *pRngFunArg, vlong **ppVlongQueue)
Decrypts the given cipher text using RSA decryption.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_getKeyParametersAllocAux(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, MRsaKeyTemplate *pTemplate, ubyte keyType)
Allocates and sets the appropriate key parameters of pTemplate with the data in the key...
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_generateKey(MOC_RSA(hwAccelDescr hwAccelCtx) randomContext *pRandomContext, RSAKey *pRsaKey, ubyte4 keySize, vlong **ppVlongQueue)
Generate a key pair for pRsaKey using pRandomContext for entropy.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_freeKeyTemplateAux(RSAKey *pKey, MRsaKeyTemplate *pTemplate)
Free the RSA key template.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_createKey(void **ppNewKey, ubyte4 keyType, void *pKeyAttributes)
Create a new RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_getKeyBitLen(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte4 *pBitLen)
Gets the bitlength of an RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_getCipherTextLengthAux(MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, sbyte4 *pCipherTextLen)
Get length of cipher text associated with RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_signMessageAux(MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, const ubyte *pPlainText, ubyte4 plainTextLen, ubyte *pCipherText, vlong **ppVlongQueue)
Uses an RSA key to sign the plain text and write to pCipherText.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_setAllKeyParameters(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte4 exponent, const ubyte *modulus, ubyte4 modulusLen, const ubyte *prime1, ubyte4 prime1Len, const ubyte *prime2, ubyte4 prime2Len, vlong **ppVlongQueue)
Set all the parameters in a RSA key.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_verifyDigest(MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte *pMsgDigest, ubyte4 digestLen, ubyte *pSignature, ubyte4 sigLen, intBoolean *pIsValid, vlong **ppVlongQueue)
Verify the digest of a message.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_createKeyAux(RSAKey **ppNewKey)
Create a new RSA key.