-/*
- * fgoldi.c: arithmetic modulo 2^448 - 2^224 - 1
- */
-/*
- * This file is Free Software. It has been modified to as part of its
- * incorporation into secnet.
- *
- * Copyright 2017 Mark Wooding
- *
- * You may redistribute this file and/or modify it under the terms of
- * the permissive licence shown below.
- *
- * You may redistribute secnet as a whole and/or modify it under the
- * terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 3, or (at your option) any
- * later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see
- * https://www.gnu.org/licenses/gpl.html.
- */
-/*
- * Imported from Catacomb, and modified for Secnet (2017-04-30):
- *
- * * Use `fake-mLib-bits.h' in place of the real <mLib/bits.h>.
- *
- * * Remove the 16/32-bit implementation, since C99 always has 64-bit
- * arithmetic.
- *
- * * Remove the test rig code: a replacement is in a separate source file.
- *
- * The file's original comment headers are preserved below.
- */
/* -*-c-*-
*
* Arithmetic in the Goldilocks field GF(2^448 - 2^224 - 1)
/*----- Licensing notice --------------------------------------------------*
*
- * This file is part of Catacomb.
+ * This file is part of secnet.
+ * See README for full list of copyright holders.
+ *
+ * secnet is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version d of the License, or
+ * (at your option) any later version.
+ *
+ * secnet is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 3 along with secnet; if not, see
+ * https://www.gnu.org/licenses/gpl.html.
+ *
+ * This file was originally part of Catacomb, but has been automatically
+ * modified for incorporation into secnet: see `import-catacomb-crypto'
+ * for details.
*
* Catacomb is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
void fgoldi_load(fgoldi *z, const octet xv[56])
{
+
unsigned i;
uint32 xw[14];
piece b, c;
void fgoldi_store(octet zv[56], const fgoldi *x)
{
+
piece y[NPIECE], yy[NPIECE], c, d;
uint32 u, v;
mask32 m;
void fgoldi_sqr(fgoldi *z, const fgoldi *x)
{
+
dblpiece zz[NPIECE], u[NPIECE];
piece ab[NPIECE];
const piece *a = x->P + NPIECE/2, *b = x->P;
/* Finally, carrying. */
for (i = 0; i < 2; i++) CARRY_REDUCE(zz, zz);
for (i = 0; i < NPIECE; i++) z->P[i] = zz[i];
-
}
/*----- More advanced operations ------------------------------------------*/