Skip to content

Conversation

@manishbista28
Copy link
Contributor

Fixes #19

@manishbista28 manishbista28 self-assigned this Jan 5, 2026
@manishbista28
Copy link
Contributor Author

removed g2 msm code because it is not used.


pub fn rnd_g1(rng: &mut impl Rng) -> ark_bn254::G1Projective {
ark_bn254::G1Projective::default() * rnd_fr(rng)
ark_bn254::G1Projective::rand(rng) * rnd_fr(rng)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but is overkill for test purposes. A simpler approach is either:

  • Generate a random point using G1Projective::rand and return it directly
  • Multiply the default G1Projective generator by a random scalar produced using rand_fr and return the result

Note that the former is (likely) secure even outside of a test environment. The latter is not.


pub fn rnd_g2(rng: &mut impl Rng) -> ark_bn254::G2Projective {
ark_bn254::G2Projective::default() * rnd_fr(rng)
ark_bn254::G2Projective::rand(rng) * rnd_fr(rng)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the corresponding comment for rnd_g1, which applies here as well.

@AaronFeickert AaronFeickert linked an issue Jan 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(g2): msm test fail after correcting test input [Zenith] H-2 Incorrect random number generation in Testing

3 participants