* Can overlap h with f.
*
* Preconditions:
- * |f| bounded by 1.65*2^26,1.65*2^25,1.65*2^26,1.65*2^25,etc.
+ * |f| bounded by 1.65*2²⁶,1.65*2²⁵,1.65*2²⁶,1.65*2²⁵,etc.
*
* Postconditions:
- * |h| bounded by 1.01*2^25,1.01*2^24,1.01*2^25,1.01*2^24,etc.
+ * |h| bounded by 1.01*2²⁵,1.01*2²⁴,1.01*2²⁵,1.01*2²⁴,etc.
*
* @param h FieldElement power destination
* @param f FieldElement base source
const f6_2: i64 = f6 * 2
const f7_2: i64 = f7 * 2
- const f5_38: i64 = f5 * 38 /* 1.959375*2^30 */
- const f6_19: i64 = f6 * 19 /* 1.959375*2^30 */
- const f7_38: i64 = f7 * 38/* 1.959375*2^30 */
- const f8_19: i64 = f8 * 19/* 1.959375*2^30 */
- const f9_38: i64 = f9 * 38/* 1.959375*2^30 */
+ const f5_38: i64 = f5 * 38 /* 1.959375 * 2³⁰ */
+ const f6_19: i64 = f6 * 19 /* 1.959375 * 2³⁰ */
+ const f7_38: i64 = f7 * 38/* 1.959375 * 2³⁰ */
+ const f8_19: i64 = f8 * 19/* 1.959375 * 2³⁰ */
+ const f9_38: i64 = f9 * 38/* 1.959375 * 2³⁰ */
const f0f0: i64 = f0 * f0
const f0f1_2: i64 = f0_2 * f1
}
/**
+ * Checks input `s` is less than the field prime `p = 2²⁵⁵ - 19`
+ * @param {StaticArray<u8>} s 32-byte encoded group element
* @returns 0 if `s < p`, else -1
*/
export function ge_is_canonical (s: StaticArray<u8>): i32 {