|
@ -600,7 +600,7 @@ int32_t iguana_rwvout(int32_t rwflag,struct OS_memspace *mem,uint8_t *serialized |
|
|
return(len); |
|
|
return(len); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgjoinsplit *msg) |
|
|
int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgjoinsplit *msg, uint32_t proof_size) |
|
|
{ |
|
|
{ |
|
|
int32_t len = 0; |
|
|
int32_t len = 0; |
|
|
len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->vpub_old),&msg->vpub_old); |
|
|
len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->vpub_old),&msg->vpub_old); |
|
@ -620,9 +620,9 @@ int32_t iguana_rwjoinsplit(int32_t rwflag,uint8_t *serialized,struct iguana_msgj |
|
|
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->vmacs[0]),msg->vmacs[0].bytes); |
|
|
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->vmacs[0]),msg->vmacs[0].bytes); |
|
|
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->vmacs[1]),msg->vmacs[1].bytes); |
|
|
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(msg->vmacs[1]),msg->vmacs[1].bytes); |
|
|
if ( rwflag == 1 ) |
|
|
if ( rwflag == 1 ) |
|
|
memcpy(&serialized[len],msg->zkproof,sizeof(msg->zkproof)); |
|
|
memcpy(&serialized[len],msg->zkproof,proof_size); |
|
|
else memcpy(msg->zkproof,&serialized[len],sizeof(msg->zkproof)); |
|
|
else memcpy(msg->zkproof,&serialized[len],proof_size); |
|
|
len += sizeof(msg->zkproof); |
|
|
len += proof_size; |
|
|
return(len); |
|
|
return(len); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -697,8 +697,14 @@ int32_t iguana_rwtx(struct supernet_info *myinfo,uint8_t zcash,int32_t rwflag,st |
|
|
len += iguana_rwvarint32(rwflag,&serialized[len],&numjoinsplits); |
|
|
len += iguana_rwvarint32(rwflag,&serialized[len],&numjoinsplits); |
|
|
if ( numjoinsplits > 0 ) |
|
|
if ( numjoinsplits > 0 ) |
|
|
{ |
|
|
{ |
|
|
|
|
|
// for version 4 the ZK proof size is 192, otherwise 296
|
|
|
|
|
|
uint32_t zksnark_proof_size = ZKSNARK_PROOF_SIZE; |
|
|
|
|
|
if (msg->version >= 4) { |
|
|
|
|
|
zksnark_proof_size = GROTH_PROOF_SIZE; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for (i=0; i<numjoinsplits; i++) |
|
|
for (i=0; i<numjoinsplits; i++) |
|
|
len += iguana_rwjoinsplit(rwflag,&serialized[len],&joinsplit); |
|
|
len += iguana_rwjoinsplit(rwflag,&serialized[len],&joinsplit,zksnark_proof_size); |
|
|
if ( rwflag != 0 ) |
|
|
if ( rwflag != 0 ) |
|
|
{ |
|
|
{ |
|
|
memset(joinsplitpubkey,0,sizeof(joinsplitpubkey)); // for now
|
|
|
memset(joinsplitpubkey,0,sizeof(joinsplitpubkey)); // for now
|
|
|