#include <string.h>
#include <assert.h>
#include "fp2.h"
Go to the source code of this file.
◆ fp2_add()
Definition at line 16 of file fp2.c.
17{
18 fp_add3(&(
x->re), &(y->
re), &(z->
re));
19 fp_add3(&(
x->im), &(y->
im), &(z->
im));
20}
References fp2::im, and fp2::re.
◆ fp2_copy()
◆ fp2_inv()
Definition at line 59 of file fp2.c.
60{
62
67 fp_mul3(&(
x->re), (
const fp *)
x->re, (
const fp *)
t0);
68 fp_mul3(&(
x->im), (
const fp *)
x->im, (
const fp *)
t0);
70}
uint64_t fp[NUMBER_OF_WORDS]
References fp_inv, and fp_sqr.
◆ fp2_mul()
Definition at line 34 of file fp2.c.
35{
37
38 fp_add3(&
t0, &(y->
re), &(y->
im));
39 fp_add3(&
t1, &(z->
re), &(z->
im));
41 fp_mul3(&
t1, &(y->
im), &(z->
im));
42 fp_mul3(&(
x->re), &(y->
re), &(z->
re));
43 fp_sub3(&(
x->im), (
const fp *)
t0, (
const fp *)
t1);
44 fp_sub3(&(
x->im), (
const fp *)(
x->im), (
const fp *)(
x->re));
45 fp_sub3(&(
x->re), (
const fp *)(
x->re), (
const fp *)
t1);
46}
References fp2::im, and fp2::re.
◆ fp2_neg()
Definition at line 28 of file fp2.c.
29{
30 fp_neg2(&(
x->re), &(y->
re));
31 fp_neg2(&(
x->im), &(y->
im));
32}
References fp2::im, and fp2::re.
◆ fp2_sqr()
Definition at line 48 of file fp2.c.
49{
51
52 fp_add3(&
sum, &(y->
re), &(y->
im));
54 fp_mul3(&(
x->im), &(y->
re), &(y->
im));
55 fp_add3(&(
x->im), (
const fp *)(
x->im), (
const fp *)(
x->im));
57}
References fp2::im, and fp2::re.
◆ fp2_sub()
Definition at line 22 of file fp2.c.
23{
24 fp_sub3(&(
x->re), &(y->
re), &(z->
re));
25 fp_sub3(&(
x->im), &(y->
im), &(z->
im));
26}
References fp2::im, and fp2::re.
◆ fp2_test()