mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
remove consistency check; let it fail elsewhere.
This commit is contained in:
@ -6217,9 +6217,7 @@ int wc_CheckPrivateKey(const byte* privKey, word32 privKeySz,
|
||||
keyIdx = 0;
|
||||
if ((ret = wc_falcon_import_public(pubKey, pubKeySz,
|
||||
key_pair)) == 0) {
|
||||
/* public and private extracted successfully no check if is
|
||||
* a pair and also do sanity checks on key. wc_ecc_check_key
|
||||
* checks that private * base generator equals pubkey */
|
||||
/* Public and private extracted successfully. Sanity check. */
|
||||
if ((ret = wc_falcon_check_key(key_pair)) == 0)
|
||||
ret = 1;
|
||||
}
|
||||
|
@ -588,24 +588,12 @@ int wc_falcon_export_key(falcon_key* key, byte* priv, word32 *privSz,
|
||||
*/
|
||||
int wc_falcon_check_key(falcon_key* key)
|
||||
{
|
||||
/* Sign and verify a message. */
|
||||
int ret = 0;
|
||||
int res = 0;
|
||||
const byte *msg = (const byte *)"The wolfSSL team is here to make you "
|
||||
"ready for quantum computers!!";
|
||||
word32 msglen = (word32)sizeof(msg);
|
||||
byte sig[FALCON_MAX_SIG_SIZE];
|
||||
word32 siglen = (word32)sizeof(sig);
|
||||
|
||||
ret = wc_falcon_sign_msg(msg, msglen, sig, &siglen, key);
|
||||
|
||||
if (ret == 0) {
|
||||
ret = wc_falcon_verify_msg(sig, siglen, msg, msglen, &res, key);
|
||||
if ((ret != 0) || (res != 1)) {
|
||||
ret = SIG_VERIFY_E;
|
||||
}
|
||||
if (key == NULL) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
return ret;
|
||||
|
||||
/* Assume everything is fine. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Returns the size of a falcon private key.
|
||||
|
Reference in New Issue
Block a user