Closed paceto256 closed 2 years ago
I am trying to dump the hex prepresentation of the secret key. I am getting different hex using both methods, anyone have an idea which one is correct?
void dumpSec(blsSecretKey *sec) { char buf[1024]; size_t n = blsSecretKeyGetHexStr(buf, sizeof(buf), sec); printf("%s", buf); } void dumpSec2(blsSecretKey *sec) { unsigned char buf[1024]; size_t n = blsSecretKeySerialize(buf, sizeof(buf), sec); for (size_t i = 0; i < n; i++) { printf("%02x", buf[i]); } } void main() { blsSecretKey sec; blsPublicKey pub; dumpSec(&sec); printf("\n"); dumpSec2(&sec); } Response: 3c49efd541331753307e912394e12dd6fd9bb65153c678b4e91aa62d904dafbe beaf4d902da61ae9b478c65351b69bfdd62de19423917e3053173341d5ef493c
Check your endianness. Those are the same values but read left-to-right/right-to-left.
Thank you!
I am trying to dump the hex prepresentation of the secret key. I am getting different hex using both methods, anyone have an idea which one is correct?