ringct: switch to Borromean signatures

This commit is contained in:
Shen Noether 2016-11-17 23:17:21 +00:00 committed by moneromooo-monero
parent 45bb393577
commit 76958fc75a
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
8 changed files with 111 additions and 154 deletions

View file

@ -40,29 +40,12 @@
using namespace crypto;
using namespace rct;
TEST(ringct, SNL)
{
key x, P1;
skpkGen(x, P1);
key P2 = pkGen();
key P3 = pkGen();
key L1, s1, s2;
GenSchnorrNonLinkable(L1, s1, s2, x, P1, P2, 0);
// a valid one
// an invalid one
ASSERT_TRUE(VerSchnorrNonLinkable(P1, P2, L1, s1, s2));
ASSERT_FALSE(VerSchnorrNonLinkable(P1, P3, L1, s1, s2));
}
TEST(ringct, ASNL)
TEST(ringct, Borromean)
{
int j = 0;
//Tests for ASNL
//#ASNL true one, false one, C != sum Ci, and one out of the range..
//Tests for Borromean signatures
//#boro true one, false one, C != sum Ci, and one out of the range..
int N = 64;
key64 xv;
key64 P1v;
@ -86,22 +69,22 @@ TEST(ringct, ASNL)
}
//#true one
asnlSig L1s2s = GenASNL(xv, P1v, P2v, indi);
ASSERT_TRUE(VerASNL(P1v, P2v, L1s2s));
boro bb = genBorromean(xv, P1v, P2v, indi);
ASSERT_TRUE(verifyBorromean(bb, P1v, P2v));
//#false one
indi[3] = (indi[3] + 1) % 2;
L1s2s = GenASNL(xv, P1v, P2v, indi);
ASSERT_FALSE(VerASNL(P1v, P2v, L1s2s));
bb = genBorromean(xv, P1v, P2v, indi);
ASSERT_FALSE(verifyBorromean(bb, P1v, P2v));
//#true one again
indi[3] = (indi[3] + 1) % 2;
L1s2s = GenASNL(xv, P1v, P2v, indi);
ASSERT_TRUE(VerASNL(P1v, P2v, L1s2s));
bb = genBorromean(xv, P1v, P2v, indi);
ASSERT_TRUE(verifyBorromean(bb, P1v, P2v));
//#false one
L1s2s = GenASNL(xv, P2v, P1v, indi);
ASSERT_FALSE(VerASNL(P1v, P2v, L1s2s));
bb = genBorromean(xv, P2v, P1v, indi);
ASSERT_FALSE(verifyBorromean(bb, P1v, P2v));
}
TEST(ringct, MG_sigs)