Hey guys,
i'm working on a pool module in python, if anyone can tell me how this:
mpz_t bns[7];
//Take care of zeros and load gmp
for(int i=0; i < 7; i++){
if(hash[i]==0)
hash[i] = 1;
mpz_init(bns[i]);
mpz_set_uint512(bns[i],hash[i]);
}
mpz_t product;
mpz_init(product);
mpz_set_ui(product,1);
for(int i=0; i < 7; i++){
mpz_mul(product,product,bns[i]);
}
int bytes = mpz_sizeinbase(product, 256);
char *data = (char*)malloc(bytes);
mpz_export(data, NULL, -1, 1, 0, 0, product);
//Free the memory
for(int i=0; i < 7; i++){
mpz_clear(bns[i]);
}
mpz_clear(product);
Can be translated to normal "C" instead of "c++" i can set it up i a few mins
I have already made a python module. I will upload it soon.
edit: here it is
https://bitbucket.org/dstorm/cryptonite-python-module