mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
unit_tests: check for ge_frombytes_vartime failure
CID 1446559
This commit is contained in:
parent
67b97a5f16
commit
4251cc0b4d
2 changed files with 4 additions and 4 deletions
|
@ -260,7 +260,7 @@ TEST(multiexp, scalarmult_triple)
|
||||||
rct::key res;
|
rct::key res;
|
||||||
ge_p3 Gp3;
|
ge_p3 Gp3;
|
||||||
|
|
||||||
ge_frombytes_vartime(&Gp3, rct::G.bytes);
|
ASSERT_EQ(ge_frombytes_vartime(&Gp3, rct::G.bytes), 0);
|
||||||
|
|
||||||
static const rct::key scalars[] = {
|
static const rct::key scalars[] = {
|
||||||
rct::Z,
|
rct::Z,
|
||||||
|
|
|
@ -58,14 +58,14 @@ TEST(tx_proof, prove_verify_v2)
|
||||||
// R_B = rB
|
// R_B = rB
|
||||||
crypto::public_key R_B;
|
crypto::public_key R_B;
|
||||||
ge_p3 B_p3;
|
ge_p3 B_p3;
|
||||||
ge_frombytes_vartime(&B_p3,&B);
|
ASSERT_EQ(ge_frombytes_vartime(&B_p3,&B), 0);
|
||||||
ge_p2 R_B_p2;
|
ge_p2 R_B_p2;
|
||||||
ge_scalarmult(&R_B_p2, &unwrap(r), &B_p3);
|
ge_scalarmult(&R_B_p2, &unwrap(r), &B_p3);
|
||||||
ge_tobytes(&R_B, &R_B_p2);
|
ge_tobytes(&R_B, &R_B_p2);
|
||||||
|
|
||||||
// R_G = rG
|
// R_G = rG
|
||||||
crypto::public_key R_G;
|
crypto::public_key R_G;
|
||||||
ge_frombytes_vartime(&B_p3,&B);
|
ASSERT_EQ(ge_frombytes_vartime(&B_p3,&B), 0);
|
||||||
ge_p3 R_G_p3;
|
ge_p3 R_G_p3;
|
||||||
ge_scalarmult_base(&R_G_p3, &unwrap(r));
|
ge_scalarmult_base(&R_G_p3, &unwrap(r));
|
||||||
ge_p3_tobytes(&R_G, &R_G_p3);
|
ge_p3_tobytes(&R_G, &R_G_p3);
|
||||||
|
@ -73,7 +73,7 @@ TEST(tx_proof, prove_verify_v2)
|
||||||
// D = rA
|
// D = rA
|
||||||
crypto::public_key D;
|
crypto::public_key D;
|
||||||
ge_p3 A_p3;
|
ge_p3 A_p3;
|
||||||
ge_frombytes_vartime(&A_p3,&A);
|
ASSERT_EQ(ge_frombytes_vartime(&A_p3,&A), 0);
|
||||||
ge_p2 D_p2;
|
ge_p2 D_p2;
|
||||||
ge_scalarmult(&D_p2, &unwrap(r), &A_p3);
|
ge_scalarmult(&D_p2, &unwrap(r), &A_p3);
|
||||||
ge_tobytes(&D, &D_p2);
|
ge_tobytes(&D, &D_p2);
|
||||||
|
|
Loading…
Reference in a new issue