Add new fixed generators for the output circuit

This commit is contained in:
Sean Bowe 2018-02-20 12:54:14 -07:00
parent ec7323159c
commit 5118fd5008
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
2 changed files with 7 additions and 4 deletions

View File

@ -788,7 +788,7 @@ mod test {
for _ in 0..100 { for _ in 0..100 {
let mut cs = TestConstraintSystem::<Bls12>::new(); let mut cs = TestConstraintSystem::<Bls12>::new();
let p = params.generator(FixedGenerators::NoteCommitmentRandomization); let p = params.generator(FixedGenerators::NoteCommitmentRandomness);
let s = Fs::rand(rng); let s = Fs::rand(rng);
let q = p.mul(s, params); let q = p.mul(s, params);
let (x1, y1) = q.into_xy(); let (x1, y1) = q.into_xy();
@ -805,7 +805,7 @@ mod test {
let q = fixed_base_multiplication( let q = fixed_base_multiplication(
cs.namespace(|| "multiplication"), cs.namespace(|| "multiplication"),
FixedGenerators::NoteCommitmentRandomization, FixedGenerators::NoteCommitmentRandomness,
&s_bits, &s_bits,
params params
).unwrap(); ).unwrap();

View File

@ -67,8 +67,11 @@ impl JubjubEngine for Bls12 {
/// exponent. /// exponent.
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum FixedGenerators { pub enum FixedGenerators {
NoteCommitmentRandomization = 0, NoteCommitmentRandomness = 0,
Max = 1 ProvingPublicKey = 1,
ValueCommitmentValue = 2,
ValueCommitmentRandomness = 3,
Max = 4
} }
pub struct JubjubBls12 { pub struct JubjubBls12 {