mirror of https://github.com/wolfSSL/wolfssl.git
fix mcapi with blinding API addition
parent
cd5486a4e6
commit
51042e166f
|
@ -536,7 +536,16 @@ int CRYPT_RSA_EncryptSizeGet(CRYPT_RSA_CTX* rsa)
|
|||
return BAD_FUNC_ARG;
|
||||
|
||||
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 */
|
||||
|
|
|
@ -220,7 +220,8 @@ int CRYPT_RSA_PrivateDecrypt(CRYPT_RSA_CTX*, unsigned char*,
|
|||
unsigned int, const unsigned char*, unsigned int);
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
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,
|
||||
RSA_TEST_SIZE, &mcRng);
|
||||
if (ret < 0) {
|
||||
|
|
Loading…
Reference in New Issue