Closed MisterEJ closed 6 months ago
If you use BLS12_381, then serialize() deals with buffer as big-endian. So you can use serialize() as getBigEndian().
#include <mcl/bls12_381.hpp>
int main()
{
using namespace mcl::bn;
initPairing(mcl::BLS12_381);
Fp x;
x = 0x1234;
printf("x=%s\n", x.serializeToHexStr().c_str());
Fp::setETHserialization(true);
printf("x=%s\n", x.serializeToHexStr().c_str());
}
x=341200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
x=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001234
Is this feature good enough for you?
Hi
I noticed that getBigEndian is missing from bn.h and bn.hpp while there are getLittleEndian representations.
Is there a specific reason for it not being implemented?
In addition, is there a correct way to apply a patch?