Function halo2_ecc::ecc::scalar_multiply
source · [−]pub fn scalar_multiply<F: PrimeField, FC, C>(
chip: &FC,
ctx: &mut Context<F>,
P: EcPoint<F, FC::FieldPoint>,
scalar: Vec<AssignedValue<F>>,
max_bits: usize,
window_bits: usize
) -> EcPoint<F, FC::FieldPoint>where
FC: FieldChip<F> + Selectable<F, FC::FieldPoint>,
C: CurveAffineExt<Base = FC::FieldType>,Expand description
Computes [scalar] * P on short Weierstrass curve y^2 = x^3 + b
scalaris represented as a reference array ofAssignedValuesscalar = sum_i scalar_i * 2^{max_bits * i}- an array of length > 1 is needed when
scalarexceeds the modulus of scalar fieldF
Assumptions
window_bits != 0- The order of
Pis at least2^{window_bits}(in particular,Pis not the point at infinity) - The curve has no points of order 2.
scalar_i < 2^{max_bits} for all imax_bits <= modulus::<F>.bits(), and equality only allowed when the order ofPequals the modulus ofF