FeSquare function

void FeSquare(
  1. FieldElement h,
  2. FieldElement f
)

FeSquare calculates h = f*f. Can overlap h with f.

Preconditions: |f| bounded by 1.12^26,1.12^25,1.12^26,1.12^25,etc.

Postconditions: |h| bounded by 1.12^25,1.12^24,1.12^25,1.12^24,etc.

Implementation

void FeSquare(FieldElement h, FieldElement f) {
  var fs = feSquare(f);
  var h0 = fs[0]!;
  var h1 = fs[1]!;
  var h2 = fs[2]!;
  var h3 = fs[3]!;
  var h4 = fs[4]!;
  var h5 = fs[5]!;
  var h6 = fs[6]!;
  var h7 = fs[7]!;
  var h8 = fs[8]!;
  var h9 = fs[9]!;
  FeCombine(h, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9);
}