Documentation fixes.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
therealyingtong 2021-05-18 16:07:40 +08:00
parent edea9bde73
commit caa3791562
1 changed files with 14 additions and 8 deletions

View File

@ -23,20 +23,23 @@ pub trait EccInstructions<C: CurveAffine>: Chip<C::Base> {
/// to be in the base field of the curve. (See non-normative notes in /// to be in the base field of the curve. (See non-normative notes in
/// https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents.) /// https://zips.z.cash/protocol/nu5.pdf#orchardkeycomponents.)
type ScalarVar: Clone + Debug; type ScalarVar: Clone + Debug;
/// Variable representing a full-width element of the elliptic curve's scalar field, to be used for fixed-base scalar mul. /// Variable representing a full-width element of the elliptic curve's
/// scalar field, to be used for fixed-base scalar mul.
type ScalarFixed: Clone + Debug; type ScalarFixed: Clone + Debug;
/// Variable representing a signed short element of the elliptic curve's scalar field, to be used for fixed-base scalar mul. /// Variable representing a signed short element of the elliptic curve's
/// scalar field, to be used for fixed-base scalar mul.
/// ///
/// A `ScalarFixedShort` must be in the range [-(2^64 - 1), 2^64 - 1]. /// A `ScalarFixedShort` must be in the range [-(2^64 - 1), 2^64 - 1].
type ScalarFixedShort: Clone + Debug; type ScalarFixedShort: Clone + Debug;
/// Variable representing an elliptic curve point. /// Variable representing an elliptic curve point.
type Point: Clone + Debug; type Point: Clone + Debug;
/// Variable representing the x-coordinate of an elliptic curve point. /// Variable representing the affine short Weierstrass x-coordinate of an
/// elliptic curve point.
type X: Clone + Debug; type X: Clone + Debug;
/// Variable representing the set of fixed bases in the circuit. /// Variable representing the set of fixed bases in the circuit.
type FixedPoints: Clone + Debug; type FixedPoints: Clone + Debug;
/// Variable representing the set of fixed bases to be used in scalar multiplication /// Variable representing the set of fixed bases to be used in scalar
/// with a short signed exponent. /// multiplication with a short signed exponent.
type FixedPointsShort: Clone + Debug; type FixedPointsShort: Clone + Debug;
/// Variable representing a fixed elliptic curve point (constant in the circuit). /// Variable representing a fixed elliptic curve point (constant in the circuit).
type FixedPoint: Clone + Debug; type FixedPoint: Clone + Debug;
@ -44,21 +47,24 @@ pub trait EccInstructions<C: CurveAffine>: Chip<C::Base> {
/// to be used in scalar multiplication with a short signed exponent. /// to be used in scalar multiplication with a short signed exponent.
type FixedPointShort: Clone + Debug; type FixedPointShort: Clone + Debug;
/// Witnesses the given base field element as a private input to the circuit for variable-base scalar mul. /// Witnesses the given base field element as a private input to the circuit
/// for variable-base scalar mul.
fn witness_scalar_var( fn witness_scalar_var(
&self, &self,
layouter: &mut impl Layouter<C::Base>, layouter: &mut impl Layouter<C::Base>,
value: Option<C::Base>, value: Option<C::Base>,
) -> Result<Self::ScalarVar, Error>; ) -> Result<Self::ScalarVar, Error>;
/// Witnesses the given full-width scalar as a private input to the circuit for fixed-base scalar mul. /// Witnesses the given full-width scalar as a private input to the circuit
/// for fixed-base scalar mul.
fn witness_scalar_fixed( fn witness_scalar_fixed(
&self, &self,
layouter: &mut impl Layouter<C::Base>, layouter: &mut impl Layouter<C::Base>,
value: Option<C::Scalar>, value: Option<C::Scalar>,
) -> Result<Self::ScalarFixed, Error>; ) -> Result<Self::ScalarFixed, Error>;
/// Witnesses the given signed short scalar as a private input to the circuit for fixed-base scalar mul. /// Witnesses the given signed short scalar as a private input to the circuit
/// for fixed-base scalar mul.
fn witness_scalar_fixed_short( fn witness_scalar_fixed_short(
&self, &self,
layouter: &mut impl Layouter<C::Base>, layouter: &mut impl Layouter<C::Base>,