*
* `n = 2⁰a[0] + 2²⁶a[1] + 2⁷⁷a[2] ... + 2²³⁰a[9]`
*/
+import { FieldElement } from './fe'
// import { load_3, load_4 } from './utils'
/**
* to `v128.load()`.
*/
export type FieldElementPair = StaticArray<i32>
+
export function fep (): FieldElementPair {
return new StaticArray<i32>(20)
}
+export function fep_pack (f: FieldElementPair, f_a: FieldElement, f_b: FieldElement): void {
+ for (let i = 0, j = 0; i < 10; i++, j += 2) {
+ f[j] = f_a[i]
+ f[j + 1] = f_b[i]
+ }
+}
+
+export function fep_unpack (f_a: FieldElementPair, f_b: FieldElement, f: FieldElementPair): void {
+ for (let i = 0, j = 0; i < 10; i++, j += 2) {
+ f_a[i] = f[j]
+ f_b[i] = f[j + 1]
+ }
+}
+
/**
* Set all values of a FieldElementPair to zero.
*