Merge remote-tracking branch 'stouset/add-lookup-methods-for-all-constants'

* stouset/add-lookup-methods-for-all-constants:
  Add remaining functions for looking up constants
  Fix definition of crypto_box_curve25519xsalsa20poly1305_macbytes
  Add functions exposing constants for all operation/primitive pairs
This commit is contained in:
Frank Denis
2013-05-22 11:42:58 -07:00
51 changed files with 770 additions and 1 deletions
+24 -1
View File
@@ -1,46 +1,58 @@
lib_LTLIBRARIES = \
libsodium.la
libsodium_la_SOURCES = \
crypto_auth/crypto_auth.c \
crypto_auth/hmacsha256/auth_hmacsha256_api.c \
crypto_auth/hmacsha256/ref/api.h \
crypto_auth/hmacsha256/ref/hmac_hmacsha256.c \
crypto_auth/hmacsha256/ref/verify_hmacsha256.c \
crypto_auth/hmacsha512256/auth_hmacsha512256_api.c \
crypto_auth/hmacsha512256/ref/api.h \
crypto_auth/hmacsha512256/ref/hmac_hmacsha512256.c \
crypto_auth/hmacsha512256/ref/verify_hmacsha512256.c \
crypto_box/crypto_box.c \
crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305_api.c \
crypto_box/curve25519xsalsa20poly1305/ref/api.h \
crypto_box/curve25519xsalsa20poly1305/ref/after_curve25519xsalsa20poly1305.c \
crypto_box/curve25519xsalsa20poly1305/ref/before_curve25519xsalsa20poly1305.c \
crypto_box/curve25519xsalsa20poly1305/ref/box_curve25519xsalsa20poly1305.c \
crypto_box/curve25519xsalsa20poly1305/ref/keypair_curve25519xsalsa20poly1305.c \
crypto_core/hsalsa20/ref2/core_hsalsa20.c \
crypto_core/hsalsa20/core_hsalsa20_api.c \
crypto_core/hsalsa20/ref2/api.h \
crypto_core/salsa20/ref/core_salsa20.c \
crypto_core/salsa20/core_salsa20_api.c \
crypto_core/salsa20/ref/api.h \
crypto_core/salsa2012/ref/core_salsa2012.c \
crypto_core/salsa2012/core_salsa2012_api.c \
crypto_core/salsa2012/ref/api.h \
crypto_core/salsa208/ref/core_salsa208.c \
crypto_core/salsa208/core_salsa208_api.c \
crypto_core/salsa208/ref/api.h \
crypto_generichash/crypto_generichash.c \
crypto_generichash/blake2/generichash_blake2_api.c \
crypto_generichash/blake2/ref/api.h \
crypto_generichash/blake2/ref/blake2-impl.h \
crypto_generichash/blake2/ref/blake2.h \
crypto_generichash/blake2/ref/blake2b-ref.c \
crypto_generichash/blake2/ref/generichash_blake2b.c \
crypto_hash/crypto_hash.c \
crypto_hash/sha256/hash_sha256_api.c \
crypto_hash/sha256/ref/api.h \
crypto_hash/sha256/ref/hash_sha256.c \
crypto_hash/sha512/hash_sha512_api.c \
crypto_hash/sha512/ref/api.h \
crypto_hash/sha512/ref/hash_sha512.c \
crypto_hashblocks/sha256/ref/blocks_sha256.c \
crypto_hashblocks/sha256/hashblocks_sha256_api.c \
crypto_hashblocks/sha256/ref/api.h \
crypto_hashblocks/sha512/ref/blocks_sha512.c \
crypto_hashblocks/sha512/hashblocks_sha512_api.c \
crypto_hashblocks/sha512/ref/api.h \
crypto_onetimeauth/crypto_onetimeauth.c \
crypto_onetimeauth/poly1305/onetimeauth_poly1305.c \
crypto_onetimeauth/poly1305/onetimeauth_poly1305_api.c \
crypto_onetimeauth/poly1305/onetimeauth_poly1305_try.c \
crypto_onetimeauth/poly1305/53/api.h \
crypto_onetimeauth/poly1305/53/auth_poly1305_53.c \
@@ -50,14 +62,17 @@ libsodium_la_SOURCES = \
crypto_onetimeauth/poly1305/ref/verify_poly1305_ref.c \
crypto_scalarmult/crypto_scalarmult.c \
crypto_secretbox/crypto_secretbox.c \
crypto_secretbox/xsalsa20poly1305/secretbox_xsalsa20poly1305_api.c \
crypto_secretbox/xsalsa20poly1305/ref/api.h \
crypto_secretbox/xsalsa20poly1305/ref/box_xsalsa20poly1305.c \
crypto_shorthash/crypto_shorthash.c \
crypto_shorthash/siphash24/shorthash_siphash24_api.c \
crypto_shorthash/siphash24/ref/api.h \
crypto_shorthash/siphash24/ref/shorthash_siphash24.c \
crypto_sign/crypto_sign.c \
crypto_sign/ed25519/ref10/base.h \
crypto_sign/ed25519/ref10/base2.h \
crypto_sign/ed25519/sign_ed25519_api.c \
crypto_sign/ed25519/ref10/api.h \
crypto_sign/ed25519/ref10/d.h \
crypto_sign/ed25519/ref10/d2.h \
@@ -111,6 +126,7 @@ libsodium_la_SOURCES = \
crypto_sign/ed25519/ref10/sc_reduce.c \
crypto_sign/ed25519/ref10/sign.c \
crypto_sign/ed25519/ref10/sqrtm1.h \
crypto_sign/edwards25519sha512batch/sign_edwards25519sha512batch_api.c \
crypto_sign/edwards25519sha512batch/ref/api.h \
crypto_sign/edwards25519sha512batch/ref/fe25519.h \
crypto_sign/edwards25519sha512batch/ref/fe25519_edwards25519sha512batch.c \
@@ -121,6 +137,7 @@ libsodium_la_SOURCES = \
crypto_sign/edwards25519sha512batch/ref/sign_edwards25519sha512batch.c \
crypto_stream/crypto_stream.c \
crypto_stream/aes128ctr/portable/afternm_aes128ctr.c \
crypto_stream/aes128ctr/stream_aes128ctr_api.c \
crypto_stream/aes128ctr/portable/api.h \
crypto_stream/aes128ctr/portable/beforenm_aes128ctr.c \
crypto_stream/aes128ctr/portable/common.h \
@@ -135,19 +152,25 @@ libsodium_la_SOURCES = \
crypto_stream/aes256estream/hongjun/aes-table.h \
crypto_stream/aes256estream/hongjun/aes256-ctr.c \
crypto_stream/aes256estream/hongjun/aes256.h \
crypto_stream/aes256estream/stream_aes256estream_api.c \
crypto_stream/aes256estream/hongjun/api.h \
crypto_stream/aes256estream/hongjun/ecrypt-sync.h \
crypto_stream/salsa2012/stream_salsa2012_api.c \
crypto_stream/salsa2012/ref/api.h \
crypto_stream/salsa2012/ref/stream_salsa2012.c \
crypto_stream/salsa2012/ref/xor_salsa2012.c \
crypto_stream/salsa208/stream_salsa208_api.c \
crypto_stream/salsa208/ref/api.h \
crypto_stream/salsa208/ref/stream_salsa208.c \
crypto_stream/salsa208/ref/xor_salsa208.c \
crypto_stream/xsalsa20/stream_xsalsa20_api.c \
crypto_stream/xsalsa20/ref/api.h \
crypto_stream/xsalsa20/ref/stream_xsalsa20.c \
crypto_stream/xsalsa20/ref/xor_xsalsa20.c \
crypto_verify/16/verify_16_api.c \
crypto_verify/16/ref/api.h \
crypto_verify/16/ref/verify_16.c \
crypto_verify/32/verify_32_api.c \
crypto_verify/32/ref/api.h \
crypto_verify/32/ref/verify_32.c \
randombytes/randombytes.c \
@@ -0,0 +1,16 @@
#include "crypto_auth_hmacsha256.h"
size_t
crypto_auth_hmacsha256_bytes(void) {
return crypto_auth_hmacsha256_BYTES;
}
size_t
crypto_auth_hmacsha256_keybytes(void) {
return crypto_auth_hmacsha256_KEYBYTES;
}
const char *
crypto_auth_hmacsha256_primitive(void) {
return "hmacsha256";
}
@@ -0,0 +1,16 @@
#include "crypto_auth_hmacsha512256.h"
size_t
crypto_auth_hmacsha512256_bytes(void) {
return crypto_auth_hmacsha512256_BYTES;
}
size_t
crypto_auth_hmacsha512256_keybytes(void) {
return crypto_auth_hmacsha512256_KEYBYTES;
}
const char *
crypto_auth_hmacsha512256_primitive(void) {
return "hmacsha512256";
}
@@ -0,0 +1,41 @@
#include "crypto_box_curve25519xsalsa20poly1305.h"
size_t
crypto_box_curve25519xsalsa20poly1305_publickeybytes(void) {
return crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES;
}
size_t
crypto_box_curve25519xsalsa20poly1305_secretkeybytes(void) {
return crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES;
}
size_t
crypto_box_curve25519xsalsa20poly1305_beforenmbytes(void) {
return crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES;
}
size_t
crypto_box_curve25519xsalsa20poly1305_noncebytes(void) {
return crypto_box_curve25519xsalsa20poly1305_NONCEBYTES;
}
size_t
crypto_box_curve25519xsalsa20poly1305_zerobytes(void) {
return crypto_box_curve25519xsalsa20poly1305_ZEROBYTES;
}
size_t
crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void) {
return crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES;
}
size_t
crypto_box_curve25519xsalsa20poly1305_macbytes(void) {
return crypto_box_curve25519xsalsa20poly1305_MACBYTES;
}
const char *
crypto_box_curve25519xsalsa20poly1305_primitive(void) {
return "curve25519xsalsa20poly1305";
}
@@ -0,0 +1,26 @@
#include "crypto_core_hsalsa20.h"
size_t
crypto_core_hsalsa20_outputbytes(void) {
return crypto_core_hsalsa20_OUTPUTBYTES;
}
size_t
crypto_core_hsalsa20_inputbytes(void) {
return crypto_core_hsalsa20_INPUTBYTES;
}
size_t
crypto_core_hsalsa20_keybytes(void) {
return crypto_core_hsalsa20_KEYBYTES;
}
size_t
crypto_core_hsalsa20_constbytes(void) {
return crypto_core_hsalsa20_CONSTBYTES;
}
const char *
crypto_core_hsalsa20_primitive(void) {
return "hsalsa20";
}
@@ -0,0 +1,26 @@
#include "crypto_core_salsa20.h"
size_t
crypto_core_salsa20_outputbytes(void) {
return crypto_core_salsa20_OUTPUTBYTES;
}
size_t
crypto_core_salsa20_inputbytes(void) {
return crypto_core_salsa20_INPUTBYTES;
}
size_t
crypto_core_salsa20_keybytes(void) {
return crypto_core_salsa20_KEYBYTES;
}
size_t
crypto_core_salsa20_constbytes(void) {
return crypto_core_salsa20_CONSTBYTES;
}
const char *
crypto_core_salsa20_primitive(void) {
return "salsa20";
}
@@ -0,0 +1,26 @@
#include "crypto_core_salsa2012.h"
size_t
crypto_core_salsa2012_outputbytes(void) {
return crypto_core_salsa2012_OUTPUTBYTES;
}
size_t
crypto_core_salsa2012_inputbytes(void) {
return crypto_core_salsa2012_INPUTBYTES;
}
size_t
crypto_core_salsa2012_keybytes(void) {
return crypto_core_salsa2012_KEYBYTES;
}
size_t
crypto_core_salsa2012_constbytes(void) {
return crypto_core_salsa2012_CONSTBYTES;
}
const char *
crypto_core_salsa2012_primitive(void) {
return "salsa2012";
}
@@ -0,0 +1,26 @@
#include "crypto_core_salsa208.h"
size_t
crypto_core_salsa208_outputbytes(void) {
return crypto_core_salsa208_OUTPUTBYTES;
}
size_t
crypto_core_salsa208_inputbytes(void) {
return crypto_core_salsa208_INPUTBYTES;
}
size_t
crypto_core_salsa208_keybytes(void) {
return crypto_core_salsa208_KEYBYTES;
}
size_t
crypto_core_salsa208_constbytes(void) {
return crypto_core_salsa208_CONSTBYTES;
}
const char *
crypto_core_salsa208_primitive(void) {
return "salsa208";
}
@@ -0,0 +1,31 @@
#include "crypto_generichash_blake2b.h"
size_t
crypto_generichash_blake2b_bytes_min(void) {
return crypto_generichash_blake2b_BYTES_MIN;
}
size_t
crypto_generichash_blake2b_bytes_max(void) {
return crypto_generichash_blake2b_BYTES_MAX;
}
size_t
crypto_generichash_blake2b_keybytes_min(void) {
return crypto_generichash_blake2b_KEYBYTES_MIN;
}
size_t
crypto_generichash_blake2b_keybytes_max(void) {
return crypto_generichash_blake2b_KEYBYTES_MAX;
}
size_t
crypto_generichash_blake2b_blockbytes(void) {
return crypto_generichash_blake2b_BLOCKBYTES;
}
const char *
crypto_generichash_blake2b_blockbytes_primitive(void) {
return "blake2b";
}
@@ -0,0 +1,11 @@
#include "crypto_hash_sha256.h"
size_t
crypto_hash_sha256_bytes(void) {
return crypto_hash_sha256_BYTES;
}
const char *
crypto_hash_sha256_primitive(void) {
return "sha256";
}
@@ -0,0 +1,11 @@
#include "crypto_hash_sha512.h"
size_t
crypto_hash_sha512_bytes(void) {
return crypto_hash_sha512_BYTES;
}
const char *
crypto_hash_sha512_primitive(void) {
return "sha512";
}
@@ -0,0 +1,16 @@
#include "crypto_hashblocks_sha256.h"
size_t
crypto_hashblocks_sha256_statebytes(void) {
return crypto_hashblocks_sha256_STATEBYTES;
}
size_t
crypto_hashblocks_sha256_blockbytes(void) {
return crypto_hashblocks_sha256_BLOCKBYTES;
}
const char *
crypto_hashblocks_sha256_primitive(void) {
return "sha256";
}
@@ -0,0 +1,16 @@
#include "crypto_hashblocks_sha512.h"
size_t
crypto_hashblocks_sha512_statebytes(void) {
return crypto_hashblocks_sha512_STATEBYTES;
}
size_t
crypto_hashblocks_sha512_blockbytes(void) {
return crypto_hashblocks_sha512_BLOCKBYTES;
}
const char *
crypto_hashblocks_sha512_primitive(void) {
return "sha512";
}
@@ -0,0 +1,16 @@
#include "crypto_onetimeauth_poly1305.h"
size_t
crypto_onetimeauth_poly1305_bytes(void) {
return crypto_onetimeauth_poly1305_BYTES;
}
size_t
crypto_onetimeauth_poly1305_keybytes(void) {
return crypto_onetimeauth_poly1305_KEYBYTES;
}
const char *
crypto_onetimeauth_poly1305_primitive(void) {
return "poly1305";
}
@@ -0,0 +1 @@
#include "crypto_scalarmult_curve25519.h"
@@ -0,0 +1,26 @@
#include "crypto_secretbox_xsalsa20poly1305.h"
size_t
crypto_secretbox_xsalsa20poly1305_keybytes(void) {
return crypto_secretbox_xsalsa20poly1305_KEYBYTES;
}
size_t
crypto_secretbox_xsalsa20poly1305_noncebytes(void) {
return crypto_secretbox_xsalsa20poly1305_NONCEBYTES;
}
size_t
crypto_secretbox_xsalsa20poly1305_zerobytes(void) {
return crypto_secretbox_xsalsa20poly1305_ZEROBYTES;
}
size_t
crypto_secretbox_xsalsa20poly1305_boxzerobytes(void) {
return crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES;
}
const char *
crypto_secretbox_xsalsa20poly1305_primitive(void) {
return "xsalsa20poly1305";
}
@@ -0,0 +1,11 @@
#include "crypto_shorthash_siphash24.h"
size_t
crypto_shorthash_siphash24_bytes(void) {
return crypto_shorthash_siphash24_BYTES;
}
const char *
crypto_shorthash_siphash24_primitive(void) {
return "siphash24";
}
@@ -0,0 +1,21 @@
#include "crypto_sign_ed25519.h"
size_t
crypto_sign_ed25519_bytes(void) {
return crypto_sign_ed25519_BYTES;
}
size_t
crypto_sign_ed25519_publickeybytes(void) {
return crypto_sign_ed25519_PUBLICKEYBYTES;
}
size_t
crypto_sign_ed25519_secretkeybytes(void) {
return crypto_sign_ed25519_SECRETKEYBYTES;
}
const char *
crypto_sign_ed25519_primitive(void) {
return "ed25519";
}
@@ -0,0 +1,21 @@
#include "crypto_sign_edwards25519sha512batch.h"
size_t
crypto_sign_edwards25519sha512batch_bytes(void) {
return crypto_sign_edwards25519sha512batch_BYTES;
}
size_t
crypto_sign_edwards25519sha512batch_publickeybytes(void) {
return crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES;
}
size_t
crypto_sign_edwards25519sha512batch_secretkeybytes(void) {
return crypto_sign_edwards25519sha512batch_SECRETKEYBYTES;
}
const char *
crypto_sign_edwards25519sha512batch_primitive(void) {
return "edwards25519sha512batch";
}
@@ -0,0 +1,21 @@
#include "crypto_stream_aes128ctr.h"
size_t
crypto_stream_aes128ctr_keybytes(void) {
return crypto_stream_aes128ctr_KEYBYTES;
}
size_t
crypto_stream_aes128ctr_noncebytes(void) {
return crypto_stream_aes128ctr_NONCEBYTES;
}
size_t
crypto_stream_aes128ctr_beforenmbytes(void) {
return crypto_stream_aes128ctr_BEFORENMBYTES;
}
const char *
crypto_stream_aes128ctr_primitive(void) {
return "aes128ctr";
}
@@ -0,0 +1,21 @@
#include "crypto_stream_aes256estream.h"
size_t
crypto_stream_aes256estream_keybytes(void) {
return crypto_stream_aes256estream_KEYBYTES;
}
size_t
crypto_stream_aes256estream_noncebytes(void) {
return crypto_stream_aes256estream_NONCEBYTES;
}
size_t
crypto_stream_aes256estream_beforenmbytes(void) {
return crypto_stream_aes256estream_BEFORENMBYTES;
}
const char *
crypto_stream_aes256estream_primitive(void) {
return "aes256estream";
}
@@ -0,0 +1 @@
#include "crypto_stream_salsa20.h"
@@ -0,0 +1,16 @@
#include "crypto_stream_salsa2012.h"
size_t
crypto_stream_salsa2012_keybytes(void) {
return crypto_stream_salsa2012_KEYBYTES;
}
size_t
crypto_stream_salsa2012_noncebytes(void) {
return crypto_stream_salsa2012_NONCEBYTES;
}
const char *
crypto_stream_salsa2012_primitive(void) {
return "salsa2012";
}
@@ -0,0 +1,16 @@
#include "crypto_stream_salsa208.h"
size_t
crypto_stream_salsa208_keybytes(void) {
return crypto_stream_salsa208_KEYBYTES;
}
size_t
crypto_stream_salsa208_noncebytes(void) {
return crypto_stream_salsa208_NONCEBYTES;
}
const char *
crypto_stream_salsa208_primitive(void) {
return "salsa208";
}
@@ -0,0 +1,16 @@
#include "crypto_stream_xsalsa20.h"
size_t
crypto_stream_xsalsa20_keybytes(void) {
return crypto_stream_xsalsa20_KEYBYTES;
}
size_t
crypto_stream_xsalsa20_noncebytes(void) {
return crypto_stream_xsalsa20_NONCEBYTES;
}
const char *
crypto_stream_xsalsa20_primitive(void) {
return "xsalsa20";
}
@@ -0,0 +1,6 @@
#include "crypto_verify_16.h"
size_t
crypto_verify_16_bytes(void) {
return crypto_verify_16_BYTES;
}
@@ -0,0 +1,6 @@
#include "crypto_verify_32.h"
size_t
crypto_verify_32_bytes(void) {
return crypto_verify_32_BYTES;
}
@@ -1,6 +1,7 @@
#ifndef crypto_auth_hmacsha256_H
#define crypto_auth_hmacsha256_H
#include <stddef.h>
#include "export.h"
#define crypto_auth_hmacsha256_BYTES 32U
@@ -10,6 +11,15 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_auth_hmacsha256_bytes(void);
SODIUM_EXPORT
size_t crypto_auth_hmacsha256_keybytes(void);
SODIUM_EXPORT
const char * crypto_auth_hmacsha256_primitive(void);
SODIUM_EXPORT
int crypto_auth_hmacsha256(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_auth_hmacsha512256_H
#define crypto_auth_hmacsha512256_H
#include <stddef.h>
#include "export.h"
#define crypto_auth_hmacsha512256_BYTES 32U
@@ -10,6 +11,15 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_auth_hmacsha512256_bytes(void);
SODIUM_EXPORT
size_t crypto_auth_hmacsha512256_keybytes(void);
SODIUM_EXPORT
const char * crypto_auth_hmacsha512256_primitive(void);
SODIUM_EXPORT
int crypto_auth_hmacsha512256(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_box_curve25519xsalsa20poly1305_H
#define crypto_box_curve25519xsalsa20poly1305_H
#include <stddef.h>
#include "export.h"
#define crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES 32U
@@ -15,6 +16,30 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_publickeybytes(void);
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_secretkeybytes(void);
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_beforenmbytes(void);
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_noncebytes(void);
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_zerobytes(void);
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_boxzerobytes(void);
SODIUM_EXPORT
size_t crypto_box_curve25519xsalsa20poly1305_macbytes(void);
SODIUM_EXPORT
const char * crypto_box_curve25519xsalsa20poly1305_primitive(void);
SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_core_hsalsa20_H
#define crypto_core_hsalsa20_H
#include <stddef.h>
#include "export.h"
#define crypto_core_hsalsa20_OUTPUTBYTES 32U
@@ -12,6 +13,21 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_core_hsalsa20_outputbytes(void);
SODIUM_EXPORT
size_t crypto_core_hsalsa20_inputbytes(void);
SODIUM_EXPORT
size_t crypto_core_hsalsa20_keybytes(void);
SODIUM_EXPORT
size_t crypto_core_hsalsa20_constbytes(void);
SODIUM_EXPORT
const char * crypto_core_hsalsa20_primitive(void);
SODIUM_EXPORT
int crypto_core_hsalsa20(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_core_salsa20_H
#define crypto_core_salsa20_H
#include <stddef.h>
#include "export.h"
#define crypto_core_salsa20_OUTPUTBYTES 64U
@@ -12,6 +13,21 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_core_salsa20_outputbytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa20_inputbytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa20_keybytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa20_constbytes(void);
SODIUM_EXPORT
const char * crypto_core_salsa20_primitive(void);
SODIUM_EXPORT
int crypto_core_salsa20(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_core_salsa2012_H
#define crypto_core_salsa2012_H
#include <stddef.h>
#include "export.h"
#define crypto_core_salsa2012_OUTPUTBYTES 64U
@@ -12,6 +13,21 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_core_salsa2012_outputbytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa2012_inputbytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa2012_keybytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa2012_constbytes(void);
SODIUM_EXPORT
const char * crypto_core_salsa2012_primitive(void);
SODIUM_EXPORT
int crypto_core_salsa2012(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_core_salsa208_H
#define crypto_core_salsa208_H
#include <stddef.h>
#include "export.h"
#define crypto_core_salsa208_OUTPUTBYTES 64U
@@ -12,6 +13,21 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_core_salsa208_outputbytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa208_inputbytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa208_keybytes(void);
SODIUM_EXPORT
size_t crypto_core_salsa208_constbytes(void);
SODIUM_EXPORT
const char * crypto_core_salsa208_primitive(void);
SODIUM_EXPORT
int crypto_core_salsa208(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *);
@@ -3,6 +3,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include "export.h"
@@ -35,6 +36,24 @@ CRYPTO_ALIGN(64) typedef struct crypto_generichash_blake2b_state {
} crypto_generichash_blake2b_state;
#pragma pack(pop)
SODIUM_EXPORT
size_t crypto_generichash_blake2b_bytes_min(void);
SODIUM_EXPORT
size_t crypto_generichash_blake2b_bytes_max(void);
SODIUM_EXPORT
size_t crypto_generichash_blake2b_keybytes_min(void);
SODIUM_EXPORT
size_t crypto_generichash_blake2b_keybytes_max(void);
SODIUM_EXPORT
size_t crypto_generichash_blake2b_blockbytes(void);
SODIUM_EXPORT
const char * crypto_generichash_blake2b_blockbytes_primitive(void);
SODIUM_EXPORT
int crypto_generichash_blake2b(unsigned char *out, size_t outlen,
const unsigned char *in,
@@ -1,6 +1,7 @@
#ifndef crypto_hash_sha256_H
#define crypto_hash_sha256_H
#include <stddef.h>
#include "export.h"
#define crypto_hash_sha256_BYTES 32U
@@ -10,6 +11,12 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_hash_sha256_bytes(void);
SODIUM_EXPORT
const char * crypto_hash_sha256_primitive(void);
SODIUM_EXPORT
int crypto_hash_sha256(unsigned char *,const unsigned char *,unsigned long long);
@@ -1,6 +1,7 @@
#ifndef crypto_hash_sha512_H
#define crypto_hash_sha512_H
#include <stddef.h>
#include "export.h"
#define crypto_hash_sha512_BYTES 64U
@@ -10,6 +11,12 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_hash_sha512_bytes(void);
SODIUM_EXPORT
const char * crypto_hash_sha512_primitive(void);
SODIUM_EXPORT
int crypto_hash_sha512(unsigned char *,const unsigned char *,unsigned long long);
@@ -1,6 +1,7 @@
#ifndef crypto_hashblocks_sha256_H
#define crypto_hashblocks_sha256_H
#include <stddef.h>
#include "export.h"
#define crypto_hashblocks_sha256_STATEBYTES 32U
@@ -10,6 +11,15 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_hashblocks_sha256_statebytes(void);
SODIUM_EXPORT
size_t crypto_hashblocks_sha256_blockbytes(void);
SODIUM_EXPORT
const char * crypto_hashblocks_sha256_primitive(void);
SODIUM_EXPORT
int crypto_hashblocks_sha256(unsigned char *,const unsigned char *,unsigned long long);
@@ -1,6 +1,7 @@
#ifndef crypto_hashblocks_sha512_H
#define crypto_hashblocks_sha512_H
#include <stddef.h>
#include "export.h"
#define crypto_hashblocks_sha512_STATEBYTES 64U
@@ -10,6 +11,15 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_hashblocks_sha512_statebytes(void);
SODIUM_EXPORT
size_t crypto_hashblocks_sha512_blockbytes(void);
SODIUM_EXPORT
const char * crypto_hashblocks_sha512_primitive(void);
SODIUM_EXPORT
int crypto_hashblocks_sha512(unsigned char *,const unsigned char *,unsigned long long);
@@ -1,6 +1,7 @@
#ifndef crypto_onetimeauth_poly1305_H
#define crypto_onetimeauth_poly1305_H
#include <stddef.h>
#include "export.h"
#define crypto_onetimeauth_poly1305_BYTES 16U
@@ -26,6 +27,15 @@ typedef struct crypto_onetimeauth_poly1305_implementation {
const unsigned char *k);
} crypto_onetimeauth_poly1305_implementation;
SODIUM_EXPORT
size_t crypto_onetimeauth_poly1305_bytes(void);
SODIUM_EXPORT
size_t crypto_onetimeauth_poly1305_keybytes(void);
SODIUM_EXPORT
const char * crypto_onetimeauth_poly1305_primitive(void);
SODIUM_EXPORT
const char *crypto_onetimeauth_poly1305_ref_implementation_name(void);
@@ -1,6 +1,7 @@
#ifndef crypto_secretbox_xsalsa20poly1305_H
#define crypto_secretbox_xsalsa20poly1305_H
#include <stddef.h>
#include "export.h"
#define crypto_secretbox_xsalsa20poly1305_KEYBYTES 32U
@@ -12,6 +13,21 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_secretbox_xsalsa20poly1305_keybytes(void);
SODIUM_EXPORT
size_t crypto_secretbox_xsalsa20poly1305_noncebytes(void);
SODIUM_EXPORT
size_t crypto_secretbox_xsalsa20poly1305_zerobytes(void);
SODIUM_EXPORT
size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes(void);
SODIUM_EXPORT
const char * crypto_secretbox_xsalsa20poly1305_primitive(void);
SODIUM_EXPORT
int crypto_secretbox_xsalsa20poly1305(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_shorthash_siphash24_H
#define crypto_shorthash_siphash24_H
#include <stddef.h>
#include "export.h"
#define crypto_shorthash_siphash24_BYTES 8U
@@ -10,6 +11,12 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_shorthash_siphash24_bytes(void);
SODIUM_EXPORT
const char * crypto_shorthash_siphash24_primitive(void);
SODIUM_EXPORT
int crypto_shorthash_siphash24(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_sign_ed25519_H
#define crypto_sign_ed25519_H
#include <stddef.h>
#include "export.h"
#define crypto_sign_ed25519_SECRETKEYBYTES 64U
@@ -11,6 +12,18 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_sign_ed25519_bytes(void);
SODIUM_EXPORT
size_t crypto_sign_ed25519_publickeybytes(void);
SODIUM_EXPORT
size_t crypto_sign_ed25519_secretkeybytes(void);
SODIUM_EXPORT
const char * crypto_sign_ed25519_primitive(void);
SODIUM_EXPORT
int crypto_sign_ed25519(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_sign_edwards25519sha512batch_H
#define crypto_sign_edwards25519sha512batch_H
#include <stddef.h>
#include "export.h"
#define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES 64U
@@ -11,6 +12,18 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_sign_edwards25519sha512batch_bytes(void);
SODIUM_EXPORT
size_t crypto_sign_edwards25519sha512batch_publickeybytes(void);
SODIUM_EXPORT
size_t crypto_sign_edwards25519sha512batch_secretkeybytes(void);
SODIUM_EXPORT
const char * crypto_sign_edwards25519sha512batch_primitive(void);
SODIUM_EXPORT
int crypto_sign_edwards25519sha512batch(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *);
@@ -9,6 +9,7 @@
* the crypto_box functions.
*/
#include <stddef.h>
#include "export.h"
#define crypto_stream_aes128ctr_KEYBYTES 16U
@@ -19,6 +20,18 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_stream_aes128ctr_keybytes(void);
SODIUM_EXPORT
size_t crypto_stream_aes128ctr_noncebytes(void);
SODIUM_EXPORT
size_t crypto_stream_aes128ctr_beforenmbytes(void);
SODIUM_EXPORT
const char * crypto_stream_aes128ctr_primitive(void);
SODIUM_EXPORT
int crypto_stream_aes128ctr(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
@@ -10,6 +10,7 @@
* the crypto_box functions.
*/
#include <stddef.h>
#include "export.h"
#define crypto_stream_aes256estream_KEYBYTES 32U
@@ -20,6 +21,18 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_stream_aes256estream_keybytes(void);
SODIUM_EXPORT
size_t crypto_stream_aes256estream_noncebytes(void);
SODIUM_EXPORT
size_t crypto_stream_aes256estream_beforenmbytes(void);
SODIUM_EXPORT
const char * crypto_stream_aes256estream_primitive(void);
SODIUM_EXPORT
int crypto_stream_aes256estream(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
@@ -9,6 +9,7 @@
* the crypto_box functions.
*/
#include <stddef.h>
#include "export.h"
#define crypto_stream_salsa2012_KEYBYTES 32U
@@ -18,6 +19,15 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_stream_salsa2012_keybytes(void);
SODIUM_EXPORT
size_t crypto_stream_salsa2012_noncebytes(void);
SODIUM_EXPORT
const char * crypto_stream_salsa2012_primitive(void);
SODIUM_EXPORT
int crypto_stream_salsa2012(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
@@ -9,6 +9,7 @@
* the crypto_box functions.
*/
#include <stddef.h>
#include "export.h"
#define crypto_stream_salsa208_KEYBYTES 32U
@@ -18,6 +19,15 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_stream_salsa208_keybytes(void);
SODIUM_EXPORT
size_t crypto_stream_salsa208_noncebytes(void);
SODIUM_EXPORT
const char * crypto_stream_salsa208_primitive(void);
SODIUM_EXPORT
int crypto_stream_salsa208(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
@@ -9,6 +9,7 @@
* the crypto_box functions.
*/
#include <stddef.h>
#include "export.h"
#define crypto_stream_xsalsa20_KEYBYTES 32U
@@ -18,6 +19,15 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_keybytes(void);
SODIUM_EXPORT
size_t crypto_stream_xsalsa20_noncebytes(void);
SODIUM_EXPORT
const char * crypto_stream_xsalsa20_primitive(void);
SODIUM_EXPORT
int crypto_stream_xsalsa20(unsigned char *,unsigned long long,const unsigned char *,const unsigned char *);
@@ -1,6 +1,7 @@
#ifndef crypto_verify_16_H
#define crypto_verify_16_H
#include <stddef.h>
#include "export.h"
#define crypto_verify_16_BYTES 16U
@@ -9,6 +10,9 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_verify_16_bytes(void);
SODIUM_EXPORT
int crypto_verify_16(const unsigned char *x, const unsigned char *y);
@@ -1,6 +1,7 @@
#ifndef crypto_verify_32_H
#define crypto_verify_32_H
#include <stddef.h>
#include "export.h"
#define crypto_verify_32_BYTES 32U
@@ -9,6 +10,9 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_verify_32_bytes(void);
SODIUM_EXPORT
int crypto_verify_32(const unsigned char *x, const unsigned char *y);