diff options
author | Shen Noether <Shen.Noether@gmx.com> | 2016-11-17 23:17:21 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-12-04 21:54:11 +0000 |
commit | 76958fc75abc18c928474eea91ac05fd5e0fcb41 (patch) | |
tree | 8644fe15b761d9121c23e67d0cd553505f8a0c04 /tests/unit_tests/ringct.cpp | |
parent | Merge pull request #1403 (diff) | |
download | monero-76958fc75abc18c928474eea91ac05fd5e0fcb41.tar.xz |
ringct: switch to Borromean signatures
Diffstat (limited to 'tests/unit_tests/ringct.cpp')
-rw-r--r-- | tests/unit_tests/ringct.cpp | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/tests/unit_tests/ringct.cpp b/tests/unit_tests/ringct.cpp index 1abf2511d..5ab77d4aa 100644 --- a/tests/unit_tests/ringct.cpp +++ b/tests/unit_tests/ringct.cpp @@ -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) |