Merge pull request #1416 from dgarske/fix_pluton_ecc_sign

Fix for Pluton ECC sign (2nd try)
This commit is contained in:
toddouska 2018-03-07 08:47:46 -08:00 committed by GitHub
commit 71ba87bb4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -3588,11 +3588,14 @@ int wc_ecc_sign_hash(const byte* in, word32 inlen, byte* out, word32 *outlen,
return BAD_COND_E;
}
#elif defined(PLUTON_CRYPTO_ECC)
/* perform ECC sign */
err = Crypto_EccSign(in, inlen, out, outlen);
if (err != CRYPTO_RES_SUCCESS ||
*outlen != ECC_MAX_CRYPTO_HW_SIZE*2) {
return BAD_COND_E;
{
/* perform ECC sign */
word32 raw_sig_size = *outlen;
err = Crypto_EccSign(in, inlen, out, &raw_sig_size);
if (err != CRYPTO_RES_SUCCESS ||
raw_sig_size != ECC_MAX_CRYPTO_HW_SIZE*2) {
return BAD_COND_E;
}
}
#endif