fn compute_challenge<D, I, B>(iter: I) -> Scalar
where
    D: Digest,
    I: Iterator<Item = B>,
    B: AsRef<[u8]>,
{
    let mut h = D::new();
    for point_representation in iter {
        h.update(point_representation);
    }
    let digest = h.finalize();

    // TODO: I don't like the 0 padding here (though it's what we've been using before,
    // but we never had a security audit anyway...)
    // instead we could maybe use the `from_bytes` variant and adding some suffix
    // when computing the digest until we produce a valid scalar.
    let mut bytes = [0u8; 64];
    let pad_size = 64usize
        .checked_sub(D::OutputSize::to_usize())
        .unwrap_or_default();

    bytes[pad_size..].copy_from_slice(&digest);

    Scalar::from_bytes_wide(&bytes)
}
// note: this is slightly different from the reference python implementation
// as we omit the unnecessary string conversion. Instead we concatenate byte
// representations together and hash that.
// note2: G1 and G2 elements are using their compressed representations
// and as per the bls12-381 library all elements are using big-endian form
/// Generates a Scalar [or Fp] challenge by hashing a number of elliptic curve points.  
this is slightly different from the reference python implementation
as we omit the unnecessary string conversion. Instead we concatenate byte
representations together and hash that.
note2: G1 and G2 elements are using their compressed representations
and as per the bls12-381 library all elements are using big-endian form
Generates a Scalar [or Fp] challenge by hashing a number of elliptic curve points.
this is slightly different from the reference python implementation as we omit the unnecessary string conversion . Instead we concatenate byte representations together and hash that . note2 : G1 and G2 elements are using their compressed representations and as per the bls12 - 381 library all elements are using big - endian form Generates a Scalar [ or Fp ] challenge by hashing a number of elliptic curve points .
fn compute_challenge<D, I, B>(iter: I) -> Scalar
where
    D: Digest,
    I: Iterator<Item = B>,
    B: AsRef<[u8]>,
{
    let mut h = D::new();
    for point_representation in iter {
        h.update(point_representation);
    }
    let digest = h.finalize();
    // TODO: I don't like the 0 padding here (though it's what we've been using before,
    // but we never had a security audit anyway...)
    // instead we could maybe use the `from_bytes` variant and adding some suffix
    // when computing the digest until we produce a valid scalar.
    let mut bytes = [0u8; 64];
    let pad_size = 64usize
        .checked_sub(D::OutputSize::to_usize())
        .unwrap_or_default();
    bytes[pad_size..].copy_from_slice(&digest);
    Scalar::from_bytes_wide(&bytes)
}
fn compute_challenge < D , I , B > ( iter : I ) -> Scalar where D : Digest , I : Iterator < Item = B > , B : AsRef < [ u8 ] > , { let mut h = D :: new ( ) ; for point_representation in iter { h . update ( point_representation ) ; } let digest = h . finalize ( ) ; // TODO: I don't like the 0 padding here (though it's what we've been using before, // but we never had a security audit anyway...) // instead we could maybe use the `from_bytes` variant and adding some suffix // when computing the digest until we produce a valid scalar. let mut bytes = [ 0u8 ; 64 ] ; let pad_size = 64usize . checked_sub ( D :: OutputSize :: to_usize ( ) ) . unwrap_or_default ( ) ; bytes [ pad_size .. ] . copy_from_slice ( & digest ) ; Scalar :: from_bytes_wide ( & bytes ) }
note: this is slightly different from the reference python implementation
as we omit the unnecessary string conversion.
note : this is slightly different from the reference python implementation as we omit the unnecessary string conversion .
iter
I