aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bls.cpp4
-rw-r--r--test/bls_test.cpp9
2 files changed, 5 insertions, 8 deletions
diff --git a/src/bls.cpp b/src/bls.cpp
index c2ae9bf..1d0a791 100644
--- a/src/bls.cpp
+++ b/src/bls.cpp
@@ -185,7 +185,7 @@ struct SecretKey {
const Fr& get() const { return s; }
void set(const uint64_t *p)
{
- s.setArrayMask(p, keySize);
+ s.setArray(p, keySize);
}
void init()
{
@@ -249,7 +249,7 @@ bool Id::isZero() const
void Id::set(const uint64_t *p)
{
- self_->v.setArrayMask(p, keySize);
+ self_->v.setArray(p, keySize);
}
Sign::Sign()
diff --git a/test/bls_test.cpp b/test/bls_test.cpp
index c7bdb68..cfd655c 100644
--- a/test/bls_test.cpp
+++ b/test/bls_test.cpp
@@ -49,13 +49,10 @@ CYBOZU_TEST_AUTO(id)
}
{
/*
- truncate the value in [0, r)
+ exception if the value >= r
*/
- const uint64_t id1[] = { uint64_t(-1), uint64_t(-1), uint64_t(-1), uint64_t(-1) };
- id.set(id1);
- std::ostringstream os;
- os << std::hex << id;
- CYBOZU_TEST_ASSERT(os.str() != "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
+ const uint64_t id1[] = { 0, 0, 0, uint64_t(-1) };
+ CYBOZU_TEST_EXCEPTION(id.set(id1), std::exception);
}
}