-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
5,020 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
|
||
#ifndef sodium_H | ||
#define sodium_H | ||
|
||
#include "sodium/version.h" | ||
|
||
#include "sodium/core.h" | ||
#include "sodium/crypto_aead_aegis128l.h" | ||
#include "sodium/crypto_aead_aegis256.h" | ||
#include "sodium/crypto_aead_aes256gcm.h" | ||
#include "sodium/crypto_aead_chacha20poly1305.h" | ||
#include "sodium/crypto_aead_xchacha20poly1305.h" | ||
#include "sodium/crypto_auth.h" | ||
#include "sodium/crypto_auth_hmacsha256.h" | ||
#include "sodium/crypto_auth_hmacsha512.h" | ||
#include "sodium/crypto_auth_hmacsha512256.h" | ||
#include "sodium/crypto_box.h" | ||
#include "sodium/crypto_box_curve25519xsalsa20poly1305.h" | ||
#include "sodium/crypto_core_hchacha20.h" | ||
#include "sodium/crypto_core_hsalsa20.h" | ||
#include "sodium/crypto_core_salsa20.h" | ||
#include "sodium/crypto_core_salsa2012.h" | ||
#include "sodium/crypto_core_salsa208.h" | ||
#include "sodium/crypto_generichash.h" | ||
#include "sodium/crypto_generichash_blake2b.h" | ||
#include "sodium/crypto_hash.h" | ||
#include "sodium/crypto_hash_sha256.h" | ||
#include "sodium/crypto_hash_sha512.h" | ||
#include "sodium/crypto_kdf.h" | ||
#include "sodium/crypto_kdf_hkdf_sha256.h" | ||
#include "sodium/crypto_kdf_hkdf_sha512.h" | ||
#include "sodium/crypto_kdf_blake2b.h" | ||
#include "sodium/crypto_kdf_hkdf_sha256.h" | ||
#include "sodium/crypto_kdf_hkdf_sha512.h" | ||
#include "sodium/crypto_kx.h" | ||
#include "sodium/crypto_onetimeauth.h" | ||
#include "sodium/crypto_onetimeauth_poly1305.h" | ||
#include "sodium/crypto_pwhash.h" | ||
#include "sodium/crypto_pwhash_argon2i.h" | ||
#include "sodium/crypto_scalarmult.h" | ||
#include "sodium/crypto_scalarmult_curve25519.h" | ||
#include "sodium/crypto_secretbox.h" | ||
#include "sodium/crypto_secretbox_xsalsa20poly1305.h" | ||
#include "sodium/crypto_secretstream_xchacha20poly1305.h" | ||
#include "sodium/crypto_shorthash.h" | ||
#include "sodium/crypto_shorthash_siphash24.h" | ||
#include "sodium/crypto_sign.h" | ||
#include "sodium/crypto_sign_ed25519.h" | ||
#include "sodium/crypto_stream.h" | ||
#include "sodium/crypto_stream_chacha20.h" | ||
#include "sodium/crypto_stream_salsa20.h" | ||
#include "sodium/crypto_stream_xsalsa20.h" | ||
#include "sodium/crypto_verify_16.h" | ||
#include "sodium/crypto_verify_32.h" | ||
#include "sodium/crypto_verify_64.h" | ||
#include "sodium/randombytes.h" | ||
#include "sodium/randombytes_internal_random.h" | ||
#include "sodium/randombytes_sysrandom.h" | ||
#include "sodium/runtime.h" | ||
#include "sodium/utils.h" | ||
|
||
#ifndef SODIUM_LIBRARY_MINIMAL | ||
#include "sodium/crypto_box_curve25519xchacha20poly1305.h" | ||
#include "sodium/crypto_core_ed25519.h" | ||
#include "sodium/crypto_core_ristretto255.h" | ||
#include "sodium/crypto_pwhash_scryptsalsa208sha256.h" | ||
#include "sodium/crypto_scalarmult_ed25519.h" | ||
#include "sodium/crypto_scalarmult_ristretto255.h" | ||
#include "sodium/crypto_secretbox_xchacha20poly1305.h" | ||
#include "sodium/crypto_stream_salsa2012.h" | ||
#include "sodium/crypto_stream_salsa208.h" | ||
#include "sodium/crypto_stream_xchacha20.h" | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
#ifndef sodium_core_H | ||
#define sodium_core_H | ||
|
||
#include "export.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
SODIUM_EXPORT | ||
int sodium_init(void) | ||
__attribute__ ((warn_unused_result)); | ||
|
||
/* ---- */ | ||
|
||
SODIUM_EXPORT | ||
int sodium_set_misuse_handler(void (*handler)(void)); | ||
|
||
SODIUM_EXPORT | ||
void sodium_misuse(void) | ||
__attribute__ ((noreturn)); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#ifndef crypto_aead_aegis128l_H | ||
#define crypto_aead_aegis128l_H | ||
|
||
#include <stddef.h> | ||
|
||
#include "export.h" | ||
|
||
#ifdef __cplusplus | ||
#ifdef __GNUC__ | ||
#pragma GCC diagnostic ignored "-Wlong-long" | ||
#endif | ||
extern "C" { | ||
#endif | ||
|
||
#define crypto_aead_aegis128l_KEYBYTES 16U | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis128l_keybytes(void); | ||
|
||
#define crypto_aead_aegis128l_NSECBYTES 0U | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis128l_nsecbytes(void); | ||
|
||
#define crypto_aead_aegis128l_NPUBBYTES 16U | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis128l_npubbytes(void); | ||
|
||
#define crypto_aead_aegis128l_ABYTES 32U | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis128l_abytes(void); | ||
|
||
#define crypto_aead_aegis128l_MESSAGEBYTES_MAX \ | ||
SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_aegis128l_ABYTES, (1ULL << 61) - 1) | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis128l_messagebytes_max(void); | ||
|
||
SODIUM_EXPORT | ||
int crypto_aead_aegis128l_encrypt(unsigned char *c, | ||
unsigned long long *clen_p, | ||
const unsigned char *m, | ||
unsigned long long mlen, | ||
const unsigned char *ad, | ||
unsigned long long adlen, | ||
const unsigned char *nsec, | ||
const unsigned char *npub, | ||
const unsigned char *k) __attribute__((nonnull(1, 8, 9))); | ||
|
||
SODIUM_EXPORT | ||
int crypto_aead_aegis128l_decrypt(unsigned char *m, | ||
unsigned long long *mlen_p, | ||
unsigned char *nsec, | ||
const unsigned char *c, | ||
unsigned long long clen, | ||
const unsigned char *ad, | ||
unsigned long long adlen, | ||
const unsigned char *npub, | ||
const unsigned char *k) __attribute__((warn_unused_result)) | ||
__attribute__((nonnull(4, 8, 9))); | ||
|
||
SODIUM_EXPORT | ||
int crypto_aead_aegis128l_encrypt_detached(unsigned char *c, | ||
unsigned char *mac, | ||
unsigned long long *maclen_p, | ||
const unsigned char *m, | ||
unsigned long long mlen, | ||
const unsigned char *ad, | ||
unsigned long long adlen, | ||
const unsigned char *nsec, | ||
const unsigned char *npub, | ||
const unsigned char *k) | ||
__attribute__((nonnull(1, 2, 9, 10))); | ||
|
||
SODIUM_EXPORT | ||
int crypto_aead_aegis128l_decrypt_detached(unsigned char *m, | ||
unsigned char *nsec, | ||
const unsigned char *c, | ||
unsigned long long clen, | ||
const unsigned char *mac, | ||
const unsigned char *ad, | ||
unsigned long long adlen, | ||
const unsigned char *npub, | ||
const unsigned char *k) | ||
__attribute__((warn_unused_result)) __attribute__((nonnull(3, 5, 8, 9))); | ||
|
||
SODIUM_EXPORT | ||
void crypto_aead_aegis128l_keygen(unsigned char k[crypto_aead_aegis128l_KEYBYTES]) | ||
__attribute__((nonnull)); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#ifndef crypto_aead_aegis256_H | ||
#define crypto_aead_aegis256_H | ||
|
||
#include <stddef.h> | ||
|
||
#include "export.h" | ||
|
||
#ifdef __cplusplus | ||
#ifdef __GNUC__ | ||
#pragma GCC diagnostic ignored "-Wlong-long" | ||
#endif | ||
extern "C" { | ||
#endif | ||
|
||
#define crypto_aead_aegis256_KEYBYTES 32U | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis256_keybytes(void); | ||
|
||
#define crypto_aead_aegis256_NSECBYTES 0U | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis256_nsecbytes(void); | ||
|
||
#define crypto_aead_aegis256_NPUBBYTES 32U | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis256_npubbytes(void); | ||
|
||
#define crypto_aead_aegis256_ABYTES 32U | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis256_abytes(void); | ||
|
||
#define crypto_aead_aegis256_MESSAGEBYTES_MAX \ | ||
SODIUM_MIN(SODIUM_SIZE_MAX - crypto_aead_aegis256_ABYTES, (1ULL << 61) - 1) | ||
SODIUM_EXPORT | ||
size_t crypto_aead_aegis256_messagebytes_max(void); | ||
|
||
SODIUM_EXPORT | ||
int crypto_aead_aegis256_encrypt(unsigned char *c, | ||
unsigned long long *clen_p, | ||
const unsigned char *m, | ||
unsigned long long mlen, | ||
const unsigned char *ad, | ||
unsigned long long adlen, | ||
const unsigned char *nsec, | ||
const unsigned char *npub, | ||
const unsigned char *k) __attribute__((nonnull(1, 8, 9))); | ||
|
||
SODIUM_EXPORT | ||
int crypto_aead_aegis256_decrypt(unsigned char *m, | ||
unsigned long long *mlen_p, | ||
unsigned char *nsec, | ||
const unsigned char *c, | ||
unsigned long long clen, | ||
const unsigned char *ad, | ||
unsigned long long adlen, | ||
const unsigned char *npub, | ||
const unsigned char *k) __attribute__((warn_unused_result)) | ||
__attribute__((nonnull(4, 8, 9))); | ||
|
||
SODIUM_EXPORT | ||
int crypto_aead_aegis256_encrypt_detached(unsigned char *c, | ||
unsigned char *mac, | ||
unsigned long long *maclen_p, | ||
const unsigned char *m, | ||
unsigned long long mlen, | ||
const unsigned char *ad, | ||
unsigned long long adlen, | ||
const unsigned char *nsec, | ||
const unsigned char *npub, | ||
const unsigned char *k) | ||
__attribute__((nonnull(1, 2, 9, 10))); | ||
|
||
SODIUM_EXPORT | ||
int crypto_aead_aegis256_decrypt_detached(unsigned char *m, | ||
unsigned char *nsec, | ||
const unsigned char *c, | ||
unsigned long long clen, | ||
const unsigned char *mac, | ||
const unsigned char *ad, | ||
unsigned long long adlen, | ||
const unsigned char *npub, | ||
const unsigned char *k) | ||
__attribute__((warn_unused_result)) __attribute__((nonnull(3, 5, 8, 9))); | ||
|
||
SODIUM_EXPORT | ||
void crypto_aead_aegis256_keygen(unsigned char k[crypto_aead_aegis256_KEYBYTES]) | ||
__attribute__((nonnull)); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
Oops, something went wrong.