KEYGEN: improve error handling, be less fault tolerant
This commit is contained in:
parent
cef08a4ae0
commit
05582c4bed
@ -55,8 +55,8 @@ ntru_create_keypair(
|
|||||||
Fp,
|
Fp,
|
||||||
pub;
|
pub;
|
||||||
|
|
||||||
if (!f || !g || !params)
|
if (!pair || !f || !g || !params)
|
||||||
goto _return;
|
NTRU_ABORT_DEBUG("Unexpected NULL parameters in");
|
||||||
|
|
||||||
fmpz_poly_init(Fq);
|
fmpz_poly_init(Fq);
|
||||||
fmpz_poly_init(Fp);
|
fmpz_poly_init(Fp);
|
||||||
@ -86,7 +86,7 @@ _cleanup:
|
|||||||
fmpz_poly_clear(Fq);
|
fmpz_poly_clear(Fq);
|
||||||
fmpz_poly_clear(Fp);
|
fmpz_poly_clear(Fp);
|
||||||
fmpz_poly_clear(pub);
|
fmpz_poly_clear(pub);
|
||||||
_return:
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user