enhance comment describing how a pow is hashed (#3623)

Integrate feedback from Tromp

Some more feedback from Tromp

readability improvement
This commit is contained in:
Blade Doyle 2021-03-31 11:43:04 -07:00 committed by GitHub
parent 09c90fc257
commit cccaf98493
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -318,8 +318,11 @@ impl ProofOfWork {
///
/// The hash of the `Proof` is the hash of its packed nonces when serializing
/// them at their exact bit size. The resulting bit sequence is padded to be
/// byte-aligned.
///
/// byte-aligned. We form a PROOFSIZE*edge_bits integer by packing the PROOFSIZE edge
/// indices together, with edge index i occupying bits i * edge_bits through
/// (i+1) * edge_bits - 1, padding it with up to 7 0-bits to a multiple of 8 bits,
/// writing as a little endian byte array, and hashing with blake2b using 256 bit digest.
#[derive(Clone, PartialOrd, PartialEq, Serialize)]
pub struct Proof {
/// Power of 2 used for the size of the cuckoo graph