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
70 stars 18 forks source link

bignum: num2hex: Delete the first space when it is a positive number #62

Closed justalittlenoob closed 1 year ago

justalittlenoob commented 1 year ago

This PR is used to fix the bug in bignum:num2hex.
evidence

const char* c1 = "0xd";
BigNumber bn1(c1);

string s;
bn1.num2hex(s);

const char* c2 = s.c_str(); // c2 is " 0x3f2d"
BigNumber bn2(c2);

bn1 != bn2; // bn1 is not equal to bn2, which is not reasonable.