mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Move macro definitions close to their related function definition
This commit is contained in:
@@ -10,6 +10,11 @@ crypto_generichash_blake2b_bytes_max(void) {
|
||||
return crypto_generichash_blake2b_BYTES_MAX;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_generichash_blake2b_bytes(void) {
|
||||
return crypto_generichash_blake2b_BYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_generichash_blake2b_keybytes_min(void) {
|
||||
return crypto_generichash_blake2b_KEYBYTES_MIN;
|
||||
@@ -21,8 +26,8 @@ crypto_generichash_blake2b_keybytes_max(void) {
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_generichash_blake2b_blockbytes(void) {
|
||||
return crypto_generichash_blake2b_BLOCKBYTES;
|
||||
crypto_generichash_blake2b_keybytes(void) {
|
||||
return crypto_generichash_blake2b_KEYBYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
|
||||
#include "crypto_generichash.h"
|
||||
|
||||
size_t
|
||||
crypto_generichash_bytes(void)
|
||||
{
|
||||
return crypto_generichash_BYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_generichash_bytes_min(void)
|
||||
{
|
||||
@@ -20,9 +14,9 @@ crypto_generichash_bytes_max(void)
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_generichash_keybytes(void)
|
||||
crypto_generichash_bytes(void)
|
||||
{
|
||||
return crypto_generichash_KEYBYTES;
|
||||
return crypto_generichash_BYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
@@ -38,9 +32,9 @@ crypto_generichash_keybytes_max(void)
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_generichash_blockbytes(void)
|
||||
crypto_generichash_keybytes(void)
|
||||
{
|
||||
return crypto_generichash_BLOCKBYTES;
|
||||
return crypto_generichash_KEYBYTES;
|
||||
}
|
||||
|
||||
const char *crypto_generichash_primitive(void)
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
|
||||
#include "crypto_hash.h"
|
||||
|
||||
size_t
|
||||
crypto_hash_bytes(void)
|
||||
{
|
||||
return crypto_hash_BYTES;
|
||||
}
|
||||
|
||||
int
|
||||
crypto_hash(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen)
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
#include "crypto_hash_sha256.h"
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_auth_hmacsha256_BYTES 32U
|
||||
#define crypto_auth_hmacsha256_KEYBYTES 32U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -20,9 +17,11 @@ typedef struct crypto_auth_hmacsha256_state {
|
||||
crypto_hash_sha256_state octx;
|
||||
} crypto_auth_hmacsha256_state;
|
||||
|
||||
#define crypto_auth_hmacsha256_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha256_bytes(void);
|
||||
|
||||
#define crypto_auth_hmacsha256_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha256_keybytes(void);
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
#include "crypto_hash_sha512.h"
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_auth_hmacsha512_BYTES 64U
|
||||
#define crypto_auth_hmacsha512_KEYBYTES 32U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -20,9 +17,11 @@ typedef struct crypto_auth_hmacsha512_state {
|
||||
crypto_hash_sha512_state octx;
|
||||
} crypto_auth_hmacsha512_state;
|
||||
|
||||
#define crypto_auth_hmacsha512_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512_bytes(void);
|
||||
|
||||
#define crypto_auth_hmacsha512_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512_keybytes(void);
|
||||
|
||||
@@ -54,7 +53,7 @@ int crypto_auth_hmacsha512_update(crypto_auth_hmacsha512_state *state,
|
||||
SODIUM_EXPORT
|
||||
int crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state,
|
||||
unsigned char *out);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
#include "crypto_auth_hmacsha512.h"
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_auth_hmacsha512256_BYTES 32U
|
||||
#define crypto_auth_hmacsha512256_KEYBYTES 32U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -17,9 +14,11 @@ extern "C" {
|
||||
|
||||
typedef struct crypto_auth_hmacsha512_state crypto_auth_hmacsha512256_state;
|
||||
|
||||
#define crypto_auth_hmacsha512256_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512256_bytes(void);
|
||||
|
||||
#define crypto_auth_hmacsha512256_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_auth_hmacsha512256_keybytes(void);
|
||||
|
||||
|
||||
@@ -4,14 +4,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 32U
|
||||
#define crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES 32U
|
||||
#define crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES 32U
|
||||
#define crypto_box_curve25519xsalsa20poly1305_NONCEBYTES 24U
|
||||
#define crypto_box_curve25519xsalsa20poly1305_ZEROBYTES 32U
|
||||
#define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 16U
|
||||
#define crypto_box_curve25519xsalsa20poly1305_MACBYTES (crypto_box_curve25519xsalsa20poly1305_ZEROBYTES - crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES)
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -19,24 +11,33 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_publickeybytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_secretkeybytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_beforenmbytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_NONCEBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_noncebytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_ZEROBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_zerobytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void);
|
||||
|
||||
#define crypto_box_curve25519xsalsa20poly1305_MACBYTES \
|
||||
(crypto_box_curve25519xsalsa20poly1305_ZEROBYTES - \
|
||||
crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_box_curve25519xsalsa20poly1305_macbytes(void);
|
||||
|
||||
|
||||
@@ -4,24 +4,23 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_core_hsalsa20_OUTPUTBYTES 32U
|
||||
#define crypto_core_hsalsa20_INPUTBYTES 16U
|
||||
#define crypto_core_hsalsa20_KEYBYTES 32U
|
||||
#define crypto_core_hsalsa20_CONSTBYTES 16U
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_hsalsa20_OUTPUTBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hsalsa20_outputbytes(void);
|
||||
|
||||
#define crypto_core_hsalsa20_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hsalsa20_inputbytes(void);
|
||||
|
||||
#define crypto_core_hsalsa20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hsalsa20_keybytes(void);
|
||||
|
||||
#define crypto_core_hsalsa20_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_hsalsa20_constbytes(void);
|
||||
|
||||
|
||||
@@ -4,24 +4,23 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_core_salsa20_OUTPUTBYTES 64U
|
||||
#define crypto_core_salsa20_INPUTBYTES 16U
|
||||
#define crypto_core_salsa20_KEYBYTES 32U
|
||||
#define crypto_core_salsa20_CONSTBYTES 16U
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_salsa20_OUTPUTBYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa20_outputbytes(void);
|
||||
|
||||
#define crypto_core_salsa20_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa20_inputbytes(void);
|
||||
|
||||
#define crypto_core_salsa20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa20_keybytes(void);
|
||||
|
||||
#define crypto_core_salsa20_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa20_constbytes(void);
|
||||
|
||||
|
||||
@@ -4,24 +4,23 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_core_salsa2012_OUTPUTBYTES 64U
|
||||
#define crypto_core_salsa2012_INPUTBYTES 16U
|
||||
#define crypto_core_salsa2012_KEYBYTES 32U
|
||||
#define crypto_core_salsa2012_CONSTBYTES 16U
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_salsa2012_OUTPUTBYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa2012_outputbytes(void);
|
||||
|
||||
#define crypto_core_salsa2012_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa2012_inputbytes(void);
|
||||
|
||||
#define crypto_core_salsa2012_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa2012_keybytes(void);
|
||||
|
||||
#define crypto_core_salsa2012_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa2012_constbytes(void);
|
||||
|
||||
|
||||
@@ -4,24 +4,23 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_core_salsa208_OUTPUTBYTES 64U
|
||||
#define crypto_core_salsa208_INPUTBYTES 16U
|
||||
#define crypto_core_salsa208_KEYBYTES 32U
|
||||
#define crypto_core_salsa208_CONSTBYTES 16U
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_core_salsa208_OUTPUTBYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa208_outputbytes(void);
|
||||
|
||||
#define crypto_core_salsa208_INPUTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa208_inputbytes(void);
|
||||
|
||||
#define crypto_core_salsa208_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa208_keybytes(void);
|
||||
|
||||
#define crypto_core_salsa208_CONSTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_core_salsa208_constbytes(void);
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_generichash_BYTES crypto_generichash_blake2b_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_bytes(void);
|
||||
|
||||
#define crypto_generichash_BYTES_MIN crypto_generichash_blake2b_BYTES_MIN
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_bytes_min(void);
|
||||
@@ -25,9 +21,9 @@ size_t crypto_generichash_bytes_min(void);
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_bytes_max(void);
|
||||
|
||||
#define crypto_generichash_KEYBYTES crypto_generichash_blake2b_KEYBYTES
|
||||
#define crypto_generichash_BYTES crypto_generichash_blake2b_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_keybytes(void);
|
||||
size_t crypto_generichash_bytes(void);
|
||||
|
||||
#define crypto_generichash_KEYBYTES_MIN crypto_generichash_blake2b_KEYBYTES_MIN
|
||||
SODIUM_EXPORT
|
||||
@@ -37,9 +33,9 @@ size_t crypto_generichash_keybytes_min(void);
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_keybytes_max(void);
|
||||
|
||||
#define crypto_generichash_BLOCKBYTES crypto_generichash_blake2b_BLOCKBYTES
|
||||
#define crypto_generichash_KEYBYTES crypto_generichash_blake2b_KEYBYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blockbytes(void);
|
||||
size_t crypto_generichash_keybytes(void);
|
||||
|
||||
#define crypto_generichash_PRIMITIVE "blake2b"
|
||||
SODIUM_EXPORT
|
||||
|
||||
@@ -7,16 +7,6 @@
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_generichash_blake2b_BYTES 32U
|
||||
#define crypto_generichash_blake2b_BYTES_MIN 16U
|
||||
#define crypto_generichash_blake2b_BYTES_MAX 64U
|
||||
#define crypto_generichash_blake2b_KEYBYTES 32U
|
||||
#define crypto_generichash_blake2b_KEYBYTES_MIN 16U
|
||||
#define crypto_generichash_blake2b_KEYBYTES_MAX 64U
|
||||
#define crypto_generichash_blake2b_BLOCKBYTES 128U
|
||||
#define crypto_generichash_blake2b_SALTBYTES 16U
|
||||
#define crypto_generichash_blake2b_PERSONALBYTES 16U
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
# define CRYPTO_ALIGN(x) __declspec(align(x))
|
||||
#else
|
||||
@@ -35,30 +25,41 @@ CRYPTO_ALIGN(64) typedef struct crypto_generichash_blake2b_state {
|
||||
uint64_t h[8];
|
||||
uint64_t t[2];
|
||||
uint64_t f[2];
|
||||
uint8_t buf[2 * crypto_generichash_blake2b_BLOCKBYTES];
|
||||
uint8_t buf[2 * 128];
|
||||
size_t buflen;
|
||||
uint8_t last_node;
|
||||
} crypto_generichash_blake2b_state;
|
||||
#pragma pack(pop)
|
||||
|
||||
#define crypto_generichash_blake2b_BYTES_MIN 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_bytes_min(void);
|
||||
|
||||
#define crypto_generichash_blake2b_BYTES_MAX 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_bytes_max(void);
|
||||
|
||||
#define crypto_generichash_blake2b_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_bytes(void);
|
||||
|
||||
#define crypto_generichash_blake2b_KEYBYTES_MIN 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_keybytes_min(void);
|
||||
|
||||
#define crypto_generichash_blake2b_KEYBYTES_MAX 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_keybytes_max(void);
|
||||
|
||||
#define crypto_generichash_blake2b_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_blockbytes(void);
|
||||
size_t crypto_generichash_blake2b_keybytes(void);
|
||||
|
||||
#define crypto_generichash_blake2b_SALTBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_saltbytes(void);
|
||||
|
||||
#define crypto_generichash_blake2b_PERSONALBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_generichash_blake2b_personalbytes(void);
|
||||
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
#include "crypto_hash_sha512.h"
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_hash_BYTES crypto_hash_sha512_BYTES
|
||||
#define crypto_hash_BLOCKBYTES crypto_hash_sha512_BLOCKBYTES
|
||||
#define crypto_hash_PRIMITIVE "sha512"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -15,10 +11,15 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_hash_BYTES crypto_hash_sha512_BYTES
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_bytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_hash(unsigned char *out, const unsigned char *in,
|
||||
unsigned long long inlen);
|
||||
|
||||
#define crypto_hash_PRIMITIVE "sha512"
|
||||
SODIUM_EXPORT
|
||||
const char *crypto_hash_primitive(void);
|
||||
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_hash_sha256_BYTES 32U
|
||||
#define crypto_hash_sha256_BLOCKBYTES 64U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -23,6 +20,7 @@ typedef struct crypto_hash_sha256_state {
|
||||
unsigned char buf[64];
|
||||
} crypto_hash_sha256_state;
|
||||
|
||||
#define crypto_hash_sha256_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha256_bytes(void);
|
||||
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_hash_sha512_BYTES 64U
|
||||
#define crypto_hash_sha512_BLOCKBYTES 128U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -23,6 +20,7 @@ typedef struct crypto_hash_sha512_state {
|
||||
unsigned char buf[128];
|
||||
} crypto_hash_sha512_state;
|
||||
|
||||
#define crypto_hash_sha512_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_hash_sha512_bytes(void);
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_onetimeauth_poly1305_BYTES 16U
|
||||
#define crypto_onetimeauth_poly1305_KEYBYTES 32U
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -30,9 +28,11 @@ typedef struct crypto_onetimeauth_poly1305_implementation {
|
||||
const unsigned char *k);
|
||||
} crypto_onetimeauth_poly1305_implementation;
|
||||
|
||||
#define crypto_onetimeauth_poly1305_BYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_onetimeauth_poly1305_bytes(void);
|
||||
|
||||
#define crypto_onetimeauth_poly1305_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_onetimeauth_poly1305_keybytes(void);
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_pwhash_scryptxsalsa208sha256_SALTBYTES 32
|
||||
#define crypto_pwhash_scryptxsalsa208sha256_STRBYTES 102
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -15,9 +12,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_pwhash_scryptxsalsa208sha256_SALTBYTES 32
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptxsalsa208sha256_saltbytes(void);
|
||||
|
||||
#define crypto_pwhash_scryptxsalsa208sha256_STRBYTES 102
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_pwhash_scryptxsalsa208sha256_strbytes(void);
|
||||
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_KEYBYTES 32U
|
||||
#define crypto_secretbox_xsalsa20poly1305_NONCEBYTES 24U
|
||||
#define crypto_secretbox_xsalsa20poly1305_ZEROBYTES 32U
|
||||
#define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 16U
|
||||
#define crypto_secretbox_xsalsa20poly1305_MACBYTES (crypto_secretbox_xsalsa20poly1305_ZEROBYTES - crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES)
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -17,18 +11,25 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_keybytes(void);
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_NONCEBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_noncebytes(void);
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_ZEROBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_zerobytes(void);
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes(void);
|
||||
|
||||
#define crypto_secretbox_xsalsa20poly1305_MACBYTES \
|
||||
(crypto_secretbox_xsalsa20poly1305_ZEROBYTES - \
|
||||
crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_secretbox_xsalsa20poly1305_macbytes(void);
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_shorthash_siphash24_BYTES 8U
|
||||
#define crypto_shorthash_siphash24_KEYBYTES 16U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -14,9 +11,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_shorthash_siphash24_BYTES 8U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_shorthash_siphash24_bytes(void);
|
||||
|
||||
#define crypto_shorthash_siphash24_KEYBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_shorthash_siphash24_keybytes(void);
|
||||
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_sign_ed25519_SECRETKEYBYTES (32U + 32U)
|
||||
#define crypto_sign_ed25519_PUBLICKEYBYTES 32U
|
||||
#define crypto_sign_ed25519_SEEDBYTES 32U
|
||||
#define crypto_sign_ed25519_BYTES 64U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -16,15 +11,19 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_sign_ed25519_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519_bytes(void);
|
||||
|
||||
#define crypto_sign_ed25519_SEEDBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519_seedbytes(void);
|
||||
|
||||
#define crypto_sign_ed25519_PUBLICKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519_publickeybytes(void);
|
||||
|
||||
#define crypto_sign_ed25519_SECRETKEYBYTES (32U + 32U)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_ed25519_secretkeybytes(void);
|
||||
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES (32U + 32U)
|
||||
#define crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES 32U
|
||||
#define crypto_sign_edwards25519sha512batch_BYTES 64U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -15,12 +11,15 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_sign_edwards25519sha512batch_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_edwards25519sha512batch_bytes(void);
|
||||
|
||||
#define crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_edwards25519sha512batch_publickeybytes(void);
|
||||
|
||||
#define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES (32U + 32U)
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_sign_edwards25519sha512batch_secretkeybytes(void);
|
||||
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_stream_aes128ctr_KEYBYTES 16U
|
||||
#define crypto_stream_aes128ctr_NONCEBYTES 16U
|
||||
#define crypto_stream_aes128ctr_BEFORENMBYTES 1408U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -23,12 +19,15 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_stream_aes128ctr_KEYBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes128ctr_keybytes(void);
|
||||
|
||||
#define crypto_stream_aes128ctr_NONCEBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes128ctr_noncebytes(void);
|
||||
|
||||
#define crypto_stream_aes128ctr_BEFORENMBYTES 1408U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes128ctr_beforenmbytes(void);
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_stream_aes256estream_KEYBYTES 32U
|
||||
#define crypto_stream_aes256estream_NONCEBYTES 16U
|
||||
#define crypto_stream_aes256estream_BEFORENMBYTES 276U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -24,12 +20,15 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_stream_aes256estream_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes256estream_keybytes(void);
|
||||
|
||||
#define crypto_stream_aes256estream_NONCEBYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes256estream_noncebytes(void);
|
||||
|
||||
#define crypto_stream_aes256estream_BEFORENMBYTES 276U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_aes256estream_beforenmbytes(void);
|
||||
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_stream_xsalsa20_KEYBYTES 32U
|
||||
#define crypto_stream_xsalsa20_NONCEBYTES 24U
|
||||
|
||||
#ifdef __cplusplus
|
||||
# if __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wlong-long"
|
||||
@@ -22,9 +19,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_stream_xsalsa20_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_xsalsa20_keybytes(void);
|
||||
|
||||
#define crypto_stream_xsalsa20_NONCEBYTES 24U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_stream_xsalsa20_noncebytes(void);
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_verify_16_BYTES 16U
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_verify_16_BYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_verify_16_bytes(void);
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_verify_32_BYTES 32U
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_verify_32_BYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_verify_32_bytes(void);
|
||||
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
#include <stddef.h>
|
||||
#include "export.h"
|
||||
|
||||
#define crypto_verify_64_BYTES 64U
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define crypto_verify_64_BYTES 64U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_verify_64_bytes(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user