/// Find a valid generator given the tag and the personalisation.
Find a valid generator given the tag and the personalisation.
Find a valid generator given the tag and the personalisation .
fn find_group_hash(m: &[u8], personalisation: &[u8; 8]) -> jubjub::SubgroupPoint {
    let mut tag = m.to_vec();
    let i = tag.len();
    tag.push(0u8);
    loop {
        let gh = group_hash(&tag, personalisation);
        // We don't want to overflow and start reusing generators
        assert_ne!(tag[i], u8::MAX);
        tag[i] += 1;
        if let Some(gh) = gh {
            break gh;
        }
    }
}
fn find_group_hash ( m : & [ u8 ] , personalisation : & [ u8 ; 8 ] ) -> jubjub :: SubgroupPoint { let mut tag = m . to_vec ( ) ; let i = tag . len ( ) ; tag . push ( 0u8 ) ; loop { let gh = group_hash ( & tag , personalisation ) ; // We don't want to overflow and start reusing generators assert_ne ! ( tag [ i ] u8 MAX ) ; tag [ i ] += 1 ; if let Some ( gh ) = gh { break gh ; } } }
Find a valid generator given the tag and the personalisation.
Find a valid generator given the tag and the personalisation .
m
&[u8]
personalisation
&[u8; 8]