diff options
-rw-r--r-- | src/bls.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/bls.cpp b/src/bls.cpp index 091ce6f..c85ce61 100644 --- a/src/bls.cpp +++ b/src/bls.cpp @@ -52,25 +52,15 @@ static const G2& getQ() return Q; } -static void hash(Fp& t, const std::string& m) +static void HashAndMapToG1(G1& P, const std::string& m) { + static mcl::bn::MapTo<Fp> mapTo; std::string digest = cybozu::crypto::Hash::digest(cybozu::crypto::Hash::N_SHA256, m); + Fp t; t.setArrayMask(digest.c_str(), digest.size()); -} - -static void mapToG1(G1& P, const Fp& t) -{ - static mcl::bn::MapTo<Fp> mapTo; mapTo.calcG1(P, t); } -static void HashAndMapToG1(G1& P, const std::string& m) -{ - Fp t; - hash(t, m); - mapToG1(P, t); -} - struct Polynomial { FrVec c; // f[x] = sum_{i=0}^{k-1} c[i] x^i void init(const Fr& s, int k) |