AleoNet / snarkVM

A Virtual Machine for Zero-Knowledge Executions

Home Page:https://snarkvm.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Different tau are used in different SRS files, is it safe?

readygo67 opened this issue · comments

commented

As I know, Aleo holds plumo trustsetup to generate tau, in my mind, which will generate only One tau.
But when I try do unmarshal different SRS files, it seems different tau are used.
I add the following case in AleoHQ/snarkVM/parameters/src/testnet3/powers.rs.
it is supposed to be pass, but unfortunately, it not.

Could aleo guys help this problem?

    #[test] 
    fn test_check_content_are_same(){
        let b15 =   &**POWERS_OF_BETA_G_15;
        let p15 = PowersOfBetaG::<Bls12_377>::load_powers_of_beta_g(b15);

   
        let b16 = Degree16::load_bytes().expect("fail to load degree16");
        let p16 = PowersOfBetaG::<Bls12_377>::load_powers_of_beta_g(&*b16);
      
     
        let b17 = Degree17::load_bytes().expect("fail to load degree17");
        let p17 = PowersOfBetaG::<Bls12_377>::load_powers_of_beta_g(&*b17);
    
        let b18 = Degree18::load_bytes().expect("fail to load degree17");
        let p18 = PowersOfBetaG::<Bls12_377>::load_powers_of_beta_g(&*b18);
   
        let b19 = Degree19::load_bytes().expect("fail to load degree17");
        let p19 = PowersOfBetaG::<Bls12_377>::load_powers_of_beta_g(&*b19);
   
        let b20 = Degree20::load_bytes().expect("fail to load degree17");
        let p20 = PowersOfBetaG::<Bls12_377>::load_powers_of_beta_g(&*b20);
        println!("p15[0]:{}, p16_0:{}, p17_0:{}, p18_0:{}, p19_0:{}, p20_0:{}", p15[0], p16[0], p17[0], p18[0], p19[0], p20[0]);

        for i in 0..p15.len(){
            assert_eq!(p15[i], p16[i]);
            assert_eq!(p15[i], p17[i]);
            assert_eq!(p15[i], p18[i]);
            assert_eq!(p15[i], p19[i]);
            assert_eq!(p15[i], p20[i]);
        }

        for i in 0..p16.len(){
            assert_eq!(p16[i], p17[i]);
            assert_eq!(p16[i], p18[i]);
            assert_eq!(p16[i], p19[i]);
            assert_eq!(p16[i], p20[i]);
        }

        for i in 0..p17.len(){
            assert_eq!(p17[i], p18[i]);
            assert_eq!(p17[i], p19[i]);
            assert_eq!(p17[i], p20[i]);
        }

        for i in 0..p18.len(){
            assert_eq!(p18[i], p19[i]);
            assert_eq!(p18[i], p20[i]);
        }

        for i in 0..p19.len(){
            assert_eq!(p19[i], p20[i]);
        }
    }

Hi there, thank you for taking a look. The next power starts immediately where the previous stops, in order to prevent taking up double the amount of space. To fill the powers, no trimming is needed: https://github.com/AleoHQ/snarkVM/blob/testnet3/parameters/src/testnet3/powers.rs#L424

commented

@vicsn thank for your info.
Please help to check another issue also related to SRS files, https://github.com/AleoHQ/snarkVM/issues/2335.