FeIsNonZero function

int FeIsNonZero(
  1. FieldElement f
)

Implementation

int FeIsNonZero(FieldElement f) {
  var s = Uint8List(32);
  FeToBytes(s, f);
  var x = 0;
  for (var i = 0; i < s.length; i++) {
    x |= s[i];
  }
  x |= x >> 4;
  x |= x >> 2;
  x |= x >> 1;
  return x & 1;
}