use crate::constraint_system::StandardComposer;
use crate::constraint_system::Variable;
use dusk_bls12_381::BlsScalar;
#[derive(Debug, Clone, Copy)]
pub(crate) struct WnafRound {
pub acc_x: Variable,
pub acc_y: Variable,
pub accumulated_bit: Variable,
pub xy_alpha: Variable,
pub x_beta: BlsScalar,
pub y_beta: BlsScalar,
pub xy_beta: BlsScalar,
}
impl StandardComposer {
pub(crate) fn fixed_group_add(&mut self, wnaf_round: WnafRound) {
self.w_l.push(wnaf_round.acc_x);
self.w_r.push(wnaf_round.acc_y);
self.w_o.push(wnaf_round.xy_alpha);
self.w_4.push(wnaf_round.accumulated_bit);
self.q_l.push(wnaf_round.x_beta);
self.q_r.push(wnaf_round.y_beta);
self.q_c.push(wnaf_round.xy_beta);
self.q_o.push(BlsScalar::zero());
self.q_fixed_group_add.push(BlsScalar::one());
self.q_variable_group_add.push(BlsScalar::zero());
self.q_m.push(BlsScalar::zero());
self.q_4.push(BlsScalar::zero());
self.q_arith.push(BlsScalar::zero());
self.q_range.push(BlsScalar::zero());
self.q_logic.push(BlsScalar::zero());
self.perm.add_variables_to_map(
wnaf_round.acc_x,
wnaf_round.acc_y,
wnaf_round.xy_alpha,
wnaf_round.accumulated_bit,
self.n,
);
self.n += 1;
}
}