/* curve25519_test.c * * Copyright (C) 2006-2021 wolfSSL Inc. * * This file is part of wolfSSL. (formerly known as CyaSSL) * * wolfSSL 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 2 of the License, or * (at your option) any later version. * * wolfSSL 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include #include #include /* ./configure --enable-curve25519 --enable-ed25519 && make && sudo make install gcc -o curve25519_test -lwolfssl curve25519_test.c ./configure --enable-curve25519 --enable-ed25519 --enable-debug --disable-shared && make gcc -g -o curve25519_test -I. ./src/.libs/libwolfssl.a curve25519_test.c */ #ifdef HAVE_CURVE25519 static size_t hex2bin(byte* p, const char* hex) { size_t len, i; int x; len = strlen(hex); if ((len & 1) != 0) { return 0; } for (i=0; i