forked from wolfSSL/wolfssl
fix mcapi with blinding API addition
This commit is contained in:
@@ -536,7 +536,16 @@ int CRYPT_RSA_EncryptSizeGet(CRYPT_RSA_CTX* rsa)
|
|||||||
return BAD_FUNC_ARG;
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
return RsaEncryptSize((RsaKey*)rsa->holder);
|
return RsaEncryptSize((RsaKey*)rsa->holder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int CRYPT_RSA_SetRng(CRYPT_RSA_CTX* rsa, CRYPT_RNG_CTX* rng)
|
||||||
|
{
|
||||||
|
if (rsa == NULL)
|
||||||
|
return BAD_FUNC_ARG;
|
||||||
|
|
||||||
|
return wc_RsaSetRNG((RsaKey*)rsa->holder, (WC_RNG*)rng);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ECC init */
|
/* ECC init */
|
||||||
|
@@ -220,7 +220,8 @@ int CRYPT_RSA_PrivateDecrypt(CRYPT_RSA_CTX*, unsigned char*,
|
|||||||
unsigned int, const unsigned char*, unsigned int);
|
unsigned int, const unsigned char*, unsigned int);
|
||||||
|
|
||||||
/* helpers */
|
/* helpers */
|
||||||
int CRYPT_RSA_EncryptSizeGet(CRYPT_RSA_CTX*);
|
int CRYPT_RSA_EncryptSizeGet(CRYPT_RSA_CTX*);
|
||||||
|
int CRYPT_RSA_SetRng(CRYPT_RSA_CTX*, CRYPT_RNG_CTX*);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1296,6 +1296,12 @@ static int check_rsa(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = CRYPT_RSA_SetRng(&mcRsa, &mcRng);
|
||||||
|
if (ret != 0) {
|
||||||
|
printf("mcapi rsa set rng failed\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
ret = CRYPT_RSA_PublicEncrypt(&mcRsa, out1, sizeof(out1), ourData,
|
ret = CRYPT_RSA_PublicEncrypt(&mcRsa, out1, sizeof(out1), ourData,
|
||||||
RSA_TEST_SIZE, &mcRng);
|
RSA_TEST_SIZE, &mcRng);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
Reference in New Issue
Block a user