NTL library converting from ZZ to unsigned char*

Viewed 49

I'm trying to implement a non-interactive zero knowledge proof the equality of two discrete logs. it's working but in order for me to make it non-interactive i need to hash a really big number so i'm using NTL library and i want to convert from ZZ into a unsigned char* so i could give it to the hash function that i'll use. but when i converted from ZZ to unsigned char* my code give me some weird answer and i don't know why? any help please :(

ZZ n;
n = conv<ZZ>("12121212121212121212121212121212121212121212121");
unsigned char* p = new unsigned char[NumBytes(n)];
memset(p, 0, NumBytes(n));
ByteFromZZ(p, n, NumBytes(n));
for (size_t i = 0; i < NumBytes(n); i++){
    cout << p[i];
}
0 Answers
Related