aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-05-29 07:36:39 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-05-29 07:36:39 +0800
commit4400b61efbe0ec8f2e7f4abedcd7c48bf39da7af (patch)
tree92c65968f93e0a0cd75da2ab88cca781649d6d68 /src
parent0e5eed96e05e76f892bec857e63166e3e503c50c (diff)
downloadtangerine-mcl-4400b61efbe0ec8f2e7f4abedcd7c48bf39da7af.tar.gz
tangerine-mcl-4400b61efbe0ec8f2e7f4abedcd7c48bf39da7af.tar.zst
tangerine-mcl-4400b61efbe0ec8f2e7f4abedcd7c48bf39da7af.zip
change spec of copyAndMask
Diffstat (limited to 'src')
-rw-r--r--src/fp.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fp.cpp b/src/fp.cpp
index 7de679c..65fdc85 100644
--- a/src/fp.cpp
+++ b/src/fp.cpp
@@ -607,7 +607,10 @@ void copyAndMask(Unit *y, const void *x, size_t xByteSize, const Op& op, bool do
if (isGreaterOrEqualArray(y, op.p, op.N)) throw cybozu::Exception("fp:copyAndMask:large x");
return;
}
- maskArray(y, op.N, op.bitSize - 1);
+ maskArray(y, op.N, op.bitSize);
+ if (isGreaterOrEqualArray(y, op.p, op.N)) {
+ maskArray(y, op.N, op.bitSize - 1);
+ }
assert(isLessArray(y, op.p, op.N));
}