pub fn oracle_p(dst: &[u8], msg: &[u8], spec_p: &BIG) -> BIG {
    // We use `hash_to_field_bls12381` to hash to Z_p, even though it returns an
    // element of Z_MODULUS. However, MODULUS is 381-bit, while p is about 256 bits,
    // so the output is practically uniform modulo `p`.
    let mut x = hash_to_field_bls12381(hmac::MC_SHA2, ecp::HASH_TYPE, dst, msg, 1)[0].redc();
    x.rmod(spec_p);
    x
}
/// Hash a message to a random integer modulo the BLS12-381 order
///
/// # Arguments
/// * `dst` a domain seperator
/// * `msg` the message to hash
/// * `spec_p` the order of BLS12-381
/// # Returns
/// An integer between 0 and spec_p
Hash a message to a random integer modulo the BLS12-381 order
Hash a message to a random integer modulo the BLS12 - 381 order
pub fn oracle_p(dst: &[u8], msg: &[u8], spec_p: &BIG) -> BIG {
    // We use `hash_to_field_bls12381` to hash to Z_p, even though it returns an
    // element of Z_MODULUS. However, MODULUS is 381-bit, while p is about 256 bits,
    // so the output is practically uniform modulo `p`.
    let mut x = hash_to_field_bls12381(hmac::MC_SHA2, ecp::HASH_TYPE, dst, msg, 1)[0].redc();
    x.rmod(spec_p);
    x
}
pub fn oracle_p ( dst : & [ u8 ] , msg : & [ u8 ] , spec_p : & BIG ) -> BIG { // We use `hash_to_field_bls12381` to hash to Z_p, even though it returns an // element of Z_MODULUS. However, MODULUS is 381-bit, while p is about 256 bits, // so the output is practically uniform modulo `p`. let mut x = hash_to_field_bls12381 ( hmac :: MC_SHA2 , ecp :: HASH_TYPE , dst , msg , 1 ) [ 0 ] . redc ( ) ; x . rmod ( spec_p ) ; x }
Hash a message to a random integer modulo the BLS12-381 order
Hash a message to a random integer modulo the BLS12 - 381 order
dst
&[u8]
msg
&[u8]
spec_p
&BIG
An integer between 0 and spec_p
An integer between 0 and spec_p
dst
&[u8]
msg
&[u8]
spec_p
&BIG