Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:15

0001 /* eddsa.h
0002 
0003    Copyright (C) 2014 Niels Möller
0004 
0005    This file is part of GNU Nettle.
0006 
0007    GNU Nettle is free software: you can redistribute it and/or
0008    modify it under the terms of either:
0009 
0010      * the GNU Lesser General Public License as published by the Free
0011        Software Foundation; either version 3 of the License, or (at your
0012        option) any later version.
0013 
0014    or
0015 
0016      * the GNU General Public License as published by the Free
0017        Software Foundation; either version 2 of the License, or (at your
0018        option) any later version.
0019 
0020    or both in parallel, as here.
0021 
0022    GNU Nettle is distributed in the hope that it will be useful,
0023    but WITHOUT ANY WARRANTY; without even the implied warranty of
0024    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0025    General Public License for more details.
0026 
0027    You should have received copies of the GNU General Public License and
0028    the GNU Lesser General Public License along with this program.  If
0029    not, see http://www.gnu.org/licenses/.
0030 */
0031 
0032 #ifndef NETTLE_EDDSA_H
0033 #define NETTLE_EDDSA_H
0034 
0035 #include "nettle-types.h"
0036 
0037 #include "bignum.h"
0038 
0039 #ifdef __cplusplus
0040 extern "C" {
0041 #endif
0042 
0043 /* Name mangling */
0044 #define ed25519_sha512_set_private_key nettle_ed25519_sha512_set_private_key
0045 #define ed25519_sha512_public_key nettle_ed25519_sha512_public_key
0046 #define ed25519_sha512_sign nettle_ed25519_sha512_sign
0047 #define ed25519_sha512_verify nettle_ed25519_sha512_verify
0048 #define ed448_shake256_public_key nettle_ed448_shake256_public_key
0049 #define ed448_shake256_sign nettle_ed448_shake256_sign
0050 #define ed448_shake256_verify nettle_ed448_shake256_verify
0051 
0052 #define ED25519_KEY_SIZE 32
0053 #define ED25519_SIGNATURE_SIZE 64
0054 
0055 void
0056 ed25519_sha512_public_key (uint8_t *pub, const uint8_t *priv);
0057 
0058 void
0059 ed25519_sha512_sign (const uint8_t *pub,
0060              const uint8_t *priv,            
0061              size_t length, const uint8_t *msg,
0062              uint8_t *signature);
0063 
0064 int
0065 ed25519_sha512_verify (const uint8_t *pub,
0066                size_t length, const uint8_t *msg,
0067                const uint8_t *signature);
0068 
0069 #define ED448_KEY_SIZE 57
0070 #define ED448_SIGNATURE_SIZE 114
0071 
0072 void
0073 ed448_shake256_public_key (uint8_t *pub, const uint8_t *priv);
0074 
0075 void
0076 ed448_shake256_sign (const uint8_t *pub,
0077              const uint8_t *priv,
0078              size_t length, const uint8_t *msg,
0079              uint8_t *signature);
0080 
0081 int
0082 ed448_shake256_verify (const uint8_t *pub,
0083                size_t length, const uint8_t *msg,
0084                const uint8_t *signature);
0085                
0086 #ifdef __cplusplus
0087 }
0088 #endif
0089 
0090 #endif /* NETTLE_EDDSA_H */