aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2018-09-22 07:54:03 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2018-09-22 07:54:03 +0800
commit1c36a87da5bbc1cd6dc0e9d9c0e5fbf2e4640dad (patch)
tree5373ee097f7f2ed4ec32a2a663499753cec227ff
parent82f6151244d90a7734c54eea2af51819af9c90c8 (diff)
downloaddexon-bls-1c36a87da5bbc1cd6dc0e9d9c0e5fbf2e4640dad.tar
dexon-bls-1c36a87da5bbc1cd6dc0e9d9c0e5fbf2e4640dad.tar.gz
dexon-bls-1c36a87da5bbc1cd6dc0e9d9c0e5fbf2e4640dad.tar.bz2
dexon-bls-1c36a87da5bbc1cd6dc0e9d9c0e5fbf2e4640dad.tar.lz
dexon-bls-1c36a87da5bbc1cd6dc0e9d9c0e5fbf2e4640dad.tar.xz
dexon-bls-1c36a87da5bbc1cd6dc0e9d9c0e5fbf2e4640dad.tar.zst
dexon-bls-1c36a87da5bbc1cd6dc0e9d9c0e5fbf2e4640dad.zip
mapToG1 for BLS12 is changed
-rw-r--r--test/bls_test.hpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/test/bls_test.hpp b/test/bls_test.hpp
index 3091b69..752f6fd 100644
--- a/test/bls_test.hpp
+++ b/test/bls_test.hpp
@@ -426,7 +426,7 @@ void dataTest()
}
}
-void verifyAggregateTest(int type)
+void verifyAggregateTest()
{
const size_t n = 10;
bls::SecretKey secs[n];
@@ -456,19 +456,10 @@ void verifyAggregateTest(int type)
bls::Signature invalidSig = sigs[0] + sigs[1];
CYBOZU_TEST_ASSERT(!invalidSig.verifyAggregatedHashes(pubs, h.data(), sizeofHash, n));
h[0].data[0]++;
- if (type == MCL_BLS12_381) {
- /*
- CAUTION!!!
- BN::mapToG1 may return same point for different h.
- especially, maptG1(h) may be equal to mapG1(h') such as |h - h'| < small value for BLS12_381.
- */
- CYBOZU_TEST_ASSERT(sig.verifyAggregatedHashes(pubs, h.data(), sizeofHash, n));
- } else {
- CYBOZU_TEST_ASSERT(!sig.verifyAggregatedHashes(pubs, h.data(), sizeofHash, n));
- }
+ CYBOZU_TEST_ASSERT(!sig.verifyAggregatedHashes(pubs, h.data(), sizeofHash, n));
}
-void testAll(int type)
+void testAll()
{
blsTest();
k_of_nTest();
@@ -476,7 +467,7 @@ void testAll(int type)
addTest();
dataTest();
aggregateTest();
- verifyAggregateTest(type);
+ verifyAggregateTest();
}
CYBOZU_TEST_AUTO(all)
{
@@ -497,7 +488,7 @@ CYBOZU_TEST_AUTO(all)
if (type == MCL_BN254) {
testForBN254();
}
- testAll(type);
+ testAll();
hashTest(type);
}
}