intel / pailliercryptolib

Intel Paillier Cryptosystem Library is an open-source library which provides accelerated performance of a partial homomorphic encryption (HE), named Paillier cryptosystem, by utilizing Intel® IPP-Crypto on AVX512IFMA instructions. Intel Paillier Cryptosystem Library is certified for ISO compliance.
Apache License 2.0
73 stars 18 forks source link

The module operation always gives 0 #85

Closed maths644311798 closed 2 months ago

maths644311798 commented 2 months ago

I randomly generate big number N_ and see its value, like

N_ = 0x8bcaa4a9fd30809e36349546530be05f03f51af94c81ade6d0751cd24c0df7d27865d78f714528a26a170a88fc8aec9dccb5771eced3c251f6b72eff44cb9d76a8920478d65f6ae11a2415a9b275bce1ab08cb43ebab0e6a929a6579f3bc497a1fd2a352e8fdb8f07e03894129b7f6a6206d6cb9559967c1a6a5e398fb975051e19926dddfde1022e7f3cfbffe486ec58acd32b47b52a217a6f41d5bb137b307a5b505e0b17656f72fa41086e53187751d30352f89b7d50d8a92d8f15275a7c304e3d0f17762bbeaddc24b1b46e5789be0c4b8b734afa5181f81f2b4c82c00536ae5b78f0c723db0a0690c06e2ed8636726dfafe5236238d46aa898f6561b3e5

But I have code

BigNumber temp(4);
  temp %= N_;
std::cout << temp;

It always outputs 0. I have testet for many times, so it should be a general problem.

Tested on Ubuntu 22.04 Gcc version: 14.2 Library version: https://github.com/intel/pailliercryptolib/archive/fdc21350302117103452968ababc2f9676f0d383.tar.gz

maths644311798 commented 2 months ago

This is my coding mistake causing N_ = 0.