Commit 90fd36f1 authored by Drew's avatar Drew

Update to libsodium 1.0.7

Close #5
parent e31bf64c
......@@ -3,11 +3,12 @@ All notable changes to this project will be documented in this file.
This project does not follow semver.
# Unreleased
# 1.0.7.0 - 2015-12-14
* Add genericHash for arrays
* Convert to Integer192Bit for nonce arguments. Integer192 has its own constant-time incrementation function.
* Updating to Xcode 7.2
* Update to libsodium 1.0.7. See upstream's [changelog](https://github.com/jedisct1/libsodium/releases/tag/1.0.7).
# 1.0.6.1 - 2015-12-07
......
......@@ -54,7 +54,8 @@ int crypto_box_keypair(unsigned char *pk, unsigned char *sk);
SODIUM_EXPORT
int crypto_box_easy(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *pk, const unsigned char *sk);
const unsigned char *pk, const unsigned char *sk)
__attribute__ ((warn_unused_result));
SODIUM_EXPORT
int crypto_box_open_easy(unsigned char *m, const unsigned char *c,
......@@ -66,7 +67,8 @@ SODIUM_EXPORT
int crypto_box_detached(unsigned char *c, unsigned char *mac,
const unsigned char *m, unsigned long long mlen,
const unsigned char *n, const unsigned char *pk,
const unsigned char *sk);
const unsigned char *sk)
__attribute__ ((warn_unused_result));
SODIUM_EXPORT
int crypto_box_open_detached(unsigned char *m, const unsigned char *c,
......@@ -85,7 +87,8 @@ size_t crypto_box_beforenmbytes(void);
SODIUM_EXPORT
int crypto_box_beforenm(unsigned char *k, const unsigned char *pk,
const unsigned char *sk);
const unsigned char *sk)
__attribute__ ((warn_unused_result));
SODIUM_EXPORT
int crypto_box_easy_afternm(unsigned char *c, const unsigned char *m,
......@@ -139,7 +142,8 @@ size_t crypto_box_boxzerobytes(void);
SODIUM_EXPORT
int crypto_box(unsigned char *c, const unsigned char *m,
unsigned long long mlen, const unsigned char *n,
const unsigned char *pk, const unsigned char *sk);
const unsigned char *pk, const unsigned char *sk)
__attribute__ ((warn_unused_result));
SODIUM_EXPORT
int crypto_box_open(unsigned char *m, const unsigned char *c,
......
......@@ -51,7 +51,8 @@ int crypto_box_curve25519xsalsa20poly1305(unsigned char *c,
unsigned long long mlen,
const unsigned char *n,
const unsigned char *pk,
const unsigned char *sk);
const unsigned char *sk)
__attribute__ ((warn_unused_result));
SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_open(unsigned char *m,
......@@ -74,7 +75,8 @@ int crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk,
SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char *k,
const unsigned char *pk,
const unsigned char *sk);
const unsigned char *sk)
__attribute__ ((warn_unused_result));
SODIUM_EXPORT
int crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char *c,
......
......@@ -14,7 +14,7 @@
extern "C" {
#endif
#ifdef __SUNPRO_C
#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# pragma pack(1)
#else
# pragma pack(push, 1)
......@@ -29,7 +29,7 @@ typedef CRYPTO_ALIGN(64) struct crypto_generichash_blake2b_state {
uint8_t last_node;
} crypto_generichash_blake2b_state;
#ifdef __SUNPRO_C
#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# pragma pack()
#else
# pragma pack(pop)
......
......@@ -16,9 +16,8 @@ extern "C" {
#include <stdint.h>
#include <stdio.h>
typedef struct crypto_onetimeauth_poly1305_state {
unsigned long long aligner;
unsigned char opaque[136];
typedef CRYPTO_ALIGN(16) struct crypto_onetimeauth_poly1305_state {
unsigned char opaque[256];
} crypto_onetimeauth_poly1305_state;
#define crypto_onetimeauth_poly1305_BYTES 16U
......
......@@ -27,7 +27,8 @@ int crypto_scalarmult_base(unsigned char *q, const unsigned char *n);
SODIUM_EXPORT
int crypto_scalarmult(unsigned char *q, const unsigned char *n,
const unsigned char *p);
const unsigned char *p)
__attribute__ ((warn_unused_result));
#ifdef __cplusplus
}
......
......@@ -19,11 +19,16 @@ size_t crypto_scalarmult_curve25519_scalarbytes(void);
SODIUM_EXPORT
int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n,
const unsigned char *p);
const unsigned char *p)
__attribute__ ((warn_unused_result));
SODIUM_EXPORT
int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n);
/* ------------------------------------------------------------------------- */
int _crypto_scalarmult_curve25519_pick_best_implementation(void);
#ifdef __cplusplus
}
#endif
......
......@@ -65,6 +65,11 @@ int crypto_stream_chacha20_ietf_xor_ic(unsigned char *c, const unsigned char *m,
unsigned long long mlen,
const unsigned char *n, uint32_t ic,
const unsigned char *k);
/* ------------------------------------------------------------------------- */
int _crypto_stream_chacha20_pick_best_implementation(void);
#ifdef __cplusplus
}
#endif
......
......@@ -4,33 +4,19 @@
#ifdef __native_client__
#include <stddef.h>
#include <stdint.h>
# include "export.h"
# include "randombytes.h"
#include "export.h"
#ifdef __cplusplus
# ifdef __cplusplus
extern "C" {
#endif
# endif
SODIUM_EXPORT
extern struct randombytes_implementation randombytes_nativeclient_implementation;
SODIUM_EXPORT
const char *randombytes_nativeclient_implementation_name(void);
SODIUM_EXPORT
uint32_t randombytes_nativeclient(void);
SODIUM_EXPORT
uint32_t randombytes_nativeclient_uniform(const uint32_t upper_bound);
SODIUM_EXPORT
void randombytes_nativeclient_buf(void * const buf, const size_t size);
#ifdef __cplusplus
# ifdef __cplusplus
}
#endif
# endif
#endif
......
......@@ -2,17 +2,8 @@
#ifndef randombytes_salsa20_random_H
#define randombytes_salsa20_random_H
/*
* THREAD SAFETY: randombytes_salsa20_random*() functions are
* not thread-safe.
* Always wrap them in a mutex if you need thread safety,
* and call randombytes_stir() after fork()ing.
*/
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#include "randombytes.h"
#ifdef __cplusplus
extern "C" {
......@@ -21,24 +12,6 @@ extern "C" {
SODIUM_EXPORT
extern struct randombytes_implementation randombytes_salsa20_implementation;
SODIUM_EXPORT
const char *randombytes_salsa20_implementation_name(void);
SODIUM_EXPORT
uint32_t randombytes_salsa20_random(void);
SODIUM_EXPORT
void randombytes_salsa20_random_stir(void);
SODIUM_EXPORT
uint32_t randombytes_salsa20_random_uniform(const uint32_t upper_bound);
SODIUM_EXPORT
void randombytes_salsa20_random_buf(void * const buf, const size_t size);
SODIUM_EXPORT
int randombytes_salsa20_random_close(void);
#ifdef __cplusplus
}
#endif
......
......@@ -2,16 +2,8 @@
#ifndef randombytes_sysrandom_H
#define randombytes_sysrandom_H
/*
* THREAD SAFETY: randombytes_sysrandom() functions are thread-safe,
* provided that you called sodium_init() once before using any
* other libsodium function.
*/
#include <stddef.h>
#include <stdint.h>
#include "export.h"
#include "randombytes.h"
#ifdef __cplusplus
extern "C" {
......@@ -20,24 +12,6 @@ extern "C" {
SODIUM_EXPORT
extern struct randombytes_implementation randombytes_sysrandom_implementation;
SODIUM_EXPORT
const char *randombytes_sysrandom_implementation_name(void);
SODIUM_EXPORT
uint32_t randombytes_sysrandom(void);
SODIUM_EXPORT
void randombytes_sysrandom_stir(void);
SODIUM_EXPORT
uint32_t randombytes_sysrandom_uniform(const uint32_t upper_bound);
SODIUM_EXPORT
void randombytes_sysrandom_buf(void * const buf, const size_t size);
SODIUM_EXPORT
int randombytes_sysrandom_close(void);
#ifdef __cplusplus
}
#endif
......
......@@ -23,6 +23,9 @@ int sodium_runtime_has_ssse3(void);
SODIUM_EXPORT
int sodium_runtime_has_sse41(void);
SODIUM_EXPORT
int sodium_runtime_has_avx(void);
SODIUM_EXPORT
int sodium_runtime_has_pclmul(void);
......
......@@ -40,9 +40,15 @@ int sodium_compare(const unsigned char *b1_, const unsigned char *b2_,
size_t len)
__attribute__ ((warn_unused_result));
SODIUM_EXPORT
int sodium_is_zero(const unsigned char *n, const size_t nlen);
SODIUM_EXPORT
void sodium_increment(unsigned char *n, const size_t nlen);
SODIUM_EXPORT
void sodium_add(unsigned char *a, const unsigned char *b, const size_t len);
SODIUM_EXPORT
char *sodium_bin2hex(char * const hex, const size_t hex_maxlen,
const unsigned char * const bin, const size_t bin_len);
......
......@@ -4,9 +4,9 @@
#include "export.h"
#define SODIUM_VERSION_STRING "1.0.6"
#define SODIUM_VERSION_STRING "1.0.7"
#define SODIUM_LIBRARY_VERSION_MAJOR 8
#define SODIUM_LIBRARY_VERSION_MAJOR 9
#define SODIUM_LIBRARY_VERSION_MINOR 0
#ifdef __cplusplus
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment