X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/b7a5ecfcbac18c56d0b044975f6ed6835dd86ab4..0bcb8184cfce875a4dde57621139dd44c433f3a5:/x448.c diff --git a/x448.c b/x448.c index d766e5c..c58335a 100644 --- a/x448.c +++ b/x448.c @@ -1,3 +1,40 @@ +/* + * x448.c: Hamburg's X448 key-exchange function + */ +/* + * 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 . + * + * * Remove the test rig code: a replacement is in a separate source file. + * + * * Strip out the key-management definitions. + * + * The file's original comment headers are preserved below. + */ /* -*-c-*- * * The X448 key-agreement algorithm @@ -27,7 +64,7 @@ /*----- Header files ------------------------------------------------------*/ -#include +#include "fake-mLib-bits.h" #include "montladder.h" #include "fgoldi.h" @@ -39,24 +76,6 @@ const octet x448_base[56] = { 5, 0, /* ... */ }; #define A0 39081 -/*----- Key fetching ------------------------------------------------------*/ - -const key_fetchdef x448_pubfetch[] = { - { "pub", offsetof(x448_pub, pub), KENC_BINARY, 0 }, - { 0, 0, 0, 0 } -}; - -static const key_fetchdef priv[] = { - { "priv", offsetof(x448_priv, priv), KENC_BINARY, 0 }, - { 0, 0, 0, 0 } -}; - -const key_fetchdef x448_privfetch[] = { - { "pub", offsetof(x448_priv, pub), KENC_BINARY, 0 }, - { "private", 0, KENC_STRUCT, priv }, - { 0, 0, 0, 0 } -}; - /*----- Main code ---------------------------------------------------------*/ /* --- @x448@ --- *