Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/sodium/crypto_core_ed25519.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #ifndef crypto_core_ed25519_H
0002 #define crypto_core_ed25519_H
0003 
0004 #include <stddef.h>
0005 #include "export.h"
0006 
0007 #ifdef __cplusplus
0008 extern "C" {
0009 #endif
0010 
0011 #define crypto_core_ed25519_BYTES 32
0012 SODIUM_EXPORT
0013 size_t crypto_core_ed25519_bytes(void);
0014 
0015 #define crypto_core_ed25519_UNIFORMBYTES 32
0016 SODIUM_EXPORT
0017 size_t crypto_core_ed25519_uniformbytes(void);
0018 
0019 #define crypto_core_ed25519_HASHBYTES 64
0020 SODIUM_EXPORT
0021 size_t crypto_core_ed25519_hashbytes(void);
0022 
0023 #define crypto_core_ed25519_SCALARBYTES 32
0024 SODIUM_EXPORT
0025 size_t crypto_core_ed25519_scalarbytes(void);
0026 
0027 #define crypto_core_ed25519_NONREDUCEDSCALARBYTES 64
0028 SODIUM_EXPORT
0029 size_t crypto_core_ed25519_nonreducedscalarbytes(void);
0030 
0031 SODIUM_EXPORT
0032 int crypto_core_ed25519_is_valid_point(const unsigned char *p)
0033             __attribute__ ((nonnull));
0034 
0035 SODIUM_EXPORT
0036 int crypto_core_ed25519_add(unsigned char *r,
0037                             const unsigned char *p, const unsigned char *q)
0038             __attribute__ ((nonnull));
0039 
0040 SODIUM_EXPORT
0041 int crypto_core_ed25519_sub(unsigned char *r,
0042                             const unsigned char *p, const unsigned char *q)
0043             __attribute__ ((nonnull));
0044 
0045 SODIUM_EXPORT
0046 int crypto_core_ed25519_from_uniform(unsigned char *p, const unsigned char *r)
0047             __attribute__ ((nonnull));
0048 
0049 SODIUM_EXPORT
0050 int crypto_core_ed25519_from_hash(unsigned char *p, const unsigned char *h)
0051             __attribute__ ((nonnull)) __attribute__ ((deprecated));
0052 
0053 SODIUM_EXPORT
0054 void crypto_core_ed25519_random(unsigned char *p)
0055             __attribute__ ((nonnull));
0056 
0057 SODIUM_EXPORT
0058 void crypto_core_ed25519_scalar_random(unsigned char *r)
0059             __attribute__ ((nonnull));
0060 
0061 SODIUM_EXPORT
0062 int crypto_core_ed25519_scalar_invert(unsigned char *recip, const unsigned char *s)
0063             __attribute__ ((nonnull));
0064 
0065 SODIUM_EXPORT
0066 void crypto_core_ed25519_scalar_negate(unsigned char *neg, const unsigned char *s)
0067             __attribute__ ((nonnull));
0068 
0069 SODIUM_EXPORT
0070 void crypto_core_ed25519_scalar_complement(unsigned char *comp, const unsigned char *s)
0071             __attribute__ ((nonnull));
0072 
0073 SODIUM_EXPORT
0074 void crypto_core_ed25519_scalar_add(unsigned char *z, const unsigned char *x,
0075                                     const unsigned char *y)
0076             __attribute__ ((nonnull));
0077 
0078 SODIUM_EXPORT
0079 void crypto_core_ed25519_scalar_sub(unsigned char *z, const unsigned char *x,
0080                                     const unsigned char *y)
0081             __attribute__ ((nonnull));
0082 
0083 SODIUM_EXPORT
0084 void crypto_core_ed25519_scalar_mul(unsigned char *z, const unsigned char *x,
0085                                     const unsigned char *y)
0086             __attribute__ ((nonnull));
0087 
0088 /*
0089  * The interval `s` is sampled from should be at least 317 bits to ensure almost
0090  * uniformity of `r` over `L`.
0091  */
0092 SODIUM_EXPORT
0093 void crypto_core_ed25519_scalar_reduce(unsigned char *r, const unsigned char *s)
0094             __attribute__ ((nonnull));
0095 
0096 #ifdef __cplusplus
0097 }
0098 #endif
0099 
0100 #endif