From 72bae9b544bf8ab8c6740370c1158388221651a4 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Mon, 13 May 2019 15:48:24 +0900 Subject: [PATCH] [she] fix the serialization size for BLS12-381 --- include/mcl/she.hpp | 4 ++-- src/she_c384_256.cpp | 2 ++ test/she_c384_test.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 src/she_c384_256.cpp diff --git a/include/mcl/she.hpp b/include/mcl/she.hpp index 1fafc3e..73dc4f8 100644 --- a/include/mcl/she.hpp +++ b/include/mcl/she.hpp @@ -1045,7 +1045,7 @@ private: G2 R5, R6; ElGamalEnc(R4, R3, rm, Pmul, xPmul, &rp); ElGamalEnc(R6, R5, rm, Qmul, yQmul, &rs); - char buf[sizeof(Fr) * 12]; + char buf[sizeof(Fp) * 12]; cybozu::MemoryOutputStream os(buf, sizeof(buf)); S1.save(os); T1.save(os); @@ -1105,7 +1105,7 @@ private: R5 -= X2; G2::mul(X2, S2, c); R6 -= X2; - char buf[sizeof(Fr) * 12]; + char buf[sizeof(Fp) * 12]; cybozu::MemoryOutputStream os(buf, sizeof(buf)); S1.save(os); T1.save(os); diff --git a/src/she_c384_256.cpp b/src/she_c384_256.cpp new file mode 100644 index 0000000..1da73af --- /dev/null +++ b/src/she_c384_256.cpp @@ -0,0 +1,2 @@ +#include +#include "she_c_impl.hpp" diff --git a/test/she_c384_test.cpp b/test/she_c384_test.cpp index 5c7bd98..4adf495 100644 --- a/test/she_c384_test.cpp +++ b/test/she_c384_test.cpp @@ -1,2 +1,2 @@ -#define MCLBN_FP_UNIT_SIZE 6 +#include #include "she_c_test.hpp"