Reserve high nonce bit for future use

This commit is contained in:
Jeremy Lakeman 2012-11-28 11:18:17 +10:30
parent 383a63107f
commit f86176f3bd

View File

@ -752,6 +752,8 @@ int overlay_mdp_dispatch(overlay_mdp_frame *mdp,int userGeneratedFrameP,
op_free(frame);
RETURN(WHY("urandombytes() failed to generate nonce"));
}
// reserve the high bit of the nonce as a flag for transmitting a shorter nonce.
nonce[0]&=0x7f;
fe|= ob_append_bytes(frame->payload,nonce,nb);
/* generate plain message with zero bytes and get ready to cipher it */
unsigned char plain[zb+10+mdp->out.payload_length];