sqrt method

  1. @override
FieldSqrtResult<JubJubFq> sqrt()
override

Implementation

@override
FieldSqrtResult<JubJubFq> sqrt() {
  final List<BigInt> tm1d2 = [
    BigInt.parse("0x7fff2dff7fffffff"),
    BigInt.parse("0x04d0ec02a9ded201"),
    BigInt.parse("0x94cebea4199cec04"),
    BigInt.parse("0x0000000039f6d3a9"),
  ];

  return PastaUtils.sqrtTonelliShanks(
    f: this,
    fPowTm1d2: powVartime(tm1d2),
    rootOfUnity: JubJubFq.rootOfUnity(),
    s: JubJubFqConst.S,
    one: JubJubFq.r(),
    conditionalSelect:
        (a, b, choice) => JubJubFq.conditionalSelect(a, b, choice),
  );
}