aboutsummaryrefslogtreecommitdiffstats
path: root/include/mcl
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2018-05-06 13:34:16 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2018-05-06 13:34:16 +0800
commitd88041eb84246d7733877bec5b351a838d4f89ba (patch)
treebf9280586b3c58ba203e7857f6b8d24cec7c03d3 /include/mcl
parent664beecda1351bdeed7d2abf6f529f890248eb0c (diff)
downloadtangerine-mcl-d88041eb84246d7733877bec5b351a838d4f89ba.tar.gz
tangerine-mcl-d88041eb84246d7733877bec5b351a838d4f89ba.tar.zst
tangerine-mcl-d88041eb84246d7733877bec5b351a838d4f89ba.zip
update doc for IoSerialize
Diffstat (limited to 'include/mcl')
-rw-r--r--include/mcl/op.hpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/mcl/op.hpp b/include/mcl/op.hpp
index 874b99f..2cf6838 100644
--- a/include/mcl/op.hpp
+++ b/include/mcl/op.hpp
@@ -76,11 +76,18 @@ namespace mcl {
"2 <x>" ; compressed for even y
"3 <x>" ; compressed for odd y
- IoSerialize(fixed size = Fp::getByteSize())
- use MSB of array of x for 1-bit y for prime p where (p % 8 != 0)
- [0] ; infinity
- <x> ; for even y
- <x>|1 ; for odd y ; |1 means set MSB of x
+ IoSerialize
+ if isMSBserialize(): // p is not full bit
+ size = Fp::getByteSize()
+ use MSB of array of x for 1-bit y for prime p where (p % 8 != 0)
+ [0] ; infinity
+ <x> ; for even y
+ <x>|1 ; for odd y ; |1 means set MSB of x
+ else:
+ size = Fp::getByteSize() + 1
+ [0] ; infinity
+ 2 <x> ; for even y
+ 3 <x> ; for odd y
*/
enum IoMode {
IoAuto = 0, // dec or hex according to ios_base::fmtflags