Why RistrettoPrivate::from_random(&mut rng) is not equal the example?

I changed the tests but got the account private key is not equal with data from repo, is there something wrong?

fn test_subadress_private_keys_agree_with_subaddress_public_keys() {
    let mut rng: StdRng = SeedableRng::from_seed([0u8; 32]);
    let view_private = RistrettoPrivate::from_random(&mut rng);
    let spend_private = RistrettoPrivate::from_random(&mut rng);

    println!("seed   {:?}", [0u8; 32]);
    println!("view_private   {:?}", view_private.to_bytes());
    println!("view_private   {:?}", view_private);
    println!("view_private   {:?}", spend_private.to_bytes());
    println!("spend_private  {:?}", spend_private);

=====output=====
seed [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
view_private [254, 223, 204, 77, 124, 49, 129, 181, 52, 114, 46, 105, 219, 193, 255, 183, 238, 180, 142, 76, 64, 161, 221, 222, 41, 229, 57, 97, 92, 128, 139, 4]
view_private RistrettoPrivate for pubkey: RistrettoPublic(e29f549f8d607e862859a946968ce3b14f917abf5afbb30006099c43e793386e)
view_private [238, 128, 247, 83, 86, 112, 89, 3, 127, 217, 230, 97, 137, 119, 199, 182, 124, 38, 133, 31, 178, 151, 115, 251, 26, 214, 190, 79, 93, 183, 107, 2]
spend_private RistrettoPrivate for pubkey: RistrettoPublic(bed88887abe0a84f64691fe0bdfa3daf1a6cd697a13f07ae07588910ce39c927)

How to implement RistrettoPrivate::from_random with Golang?

I solved this problem

1 Like