File indexing completed on 2025-01-18 10:12:40
0001 #ifndef crypto_sign_H
0002 #define crypto_sign_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <stddef.h>
0012
0013 #include "crypto_sign_ed25519.h"
0014 #include "export.h"
0015
0016 #ifdef __cplusplus
0017 # ifdef __GNUC__
0018 # pragma GCC diagnostic ignored "-Wlong-long"
0019 # endif
0020 extern "C" {
0021 #endif
0022
0023 typedef crypto_sign_ed25519ph_state crypto_sign_state;
0024
0025 SODIUM_EXPORT
0026 size_t crypto_sign_statebytes(void);
0027
0028 #define crypto_sign_BYTES crypto_sign_ed25519_BYTES
0029 SODIUM_EXPORT
0030 size_t crypto_sign_bytes(void);
0031
0032 #define crypto_sign_SEEDBYTES crypto_sign_ed25519_SEEDBYTES
0033 SODIUM_EXPORT
0034 size_t crypto_sign_seedbytes(void);
0035
0036 #define crypto_sign_PUBLICKEYBYTES crypto_sign_ed25519_PUBLICKEYBYTES
0037 SODIUM_EXPORT
0038 size_t crypto_sign_publickeybytes(void);
0039
0040 #define crypto_sign_SECRETKEYBYTES crypto_sign_ed25519_SECRETKEYBYTES
0041 SODIUM_EXPORT
0042 size_t crypto_sign_secretkeybytes(void);
0043
0044 #define crypto_sign_MESSAGEBYTES_MAX crypto_sign_ed25519_MESSAGEBYTES_MAX
0045 SODIUM_EXPORT
0046 size_t crypto_sign_messagebytes_max(void);
0047
0048 #define crypto_sign_PRIMITIVE "ed25519"
0049 SODIUM_EXPORT
0050 const char *crypto_sign_primitive(void);
0051
0052 SODIUM_EXPORT
0053 int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk,
0054 const unsigned char *seed)
0055 __attribute__ ((nonnull));
0056
0057 SODIUM_EXPORT
0058 int crypto_sign_keypair(unsigned char *pk, unsigned char *sk)
0059 __attribute__ ((nonnull));
0060
0061 SODIUM_EXPORT
0062 int crypto_sign(unsigned char *sm, unsigned long long *smlen_p,
0063 const unsigned char *m, unsigned long long mlen,
0064 const unsigned char *sk) __attribute__ ((nonnull(1, 5)));
0065
0066 SODIUM_EXPORT
0067 int crypto_sign_open(unsigned char *m, unsigned long long *mlen_p,
0068 const unsigned char *sm, unsigned long long smlen,
0069 const unsigned char *pk)
0070 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(3, 5)));
0071
0072 SODIUM_EXPORT
0073 int crypto_sign_detached(unsigned char *sig, unsigned long long *siglen_p,
0074 const unsigned char *m, unsigned long long mlen,
0075 const unsigned char *sk) __attribute__ ((nonnull(1, 5)));
0076
0077 SODIUM_EXPORT
0078 int crypto_sign_verify_detached(const unsigned char *sig,
0079 const unsigned char *m,
0080 unsigned long long mlen,
0081 const unsigned char *pk)
0082 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull(1, 4)));
0083
0084 SODIUM_EXPORT
0085 int crypto_sign_init(crypto_sign_state *state);
0086
0087 SODIUM_EXPORT
0088 int crypto_sign_update(crypto_sign_state *state,
0089 const unsigned char *m, unsigned long long mlen)
0090 __attribute__ ((nonnull(1)));
0091
0092 SODIUM_EXPORT
0093 int crypto_sign_final_create(crypto_sign_state *state, unsigned char *sig,
0094 unsigned long long *siglen_p,
0095 const unsigned char *sk)
0096 __attribute__ ((nonnull(1, 2, 4)));
0097
0098 SODIUM_EXPORT
0099 int crypto_sign_final_verify(crypto_sign_state *state, const unsigned char *sig,
0100 const unsigned char *pk)
0101 __attribute__ ((warn_unused_result)) __attribute__ ((nonnull));
0102
0103 #ifdef __cplusplus
0104 }
0105 #endif
0106
0107 #endif