1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00
Commit Graph

2059 Commits

Author SHA1 Message Date
Frank Denis
37a1358b81 glibc needs -lrt to get clock_gettime()
Reported by csosstudy
2013-02-28 19:13:07 -08:00
Frank Denis
df814f98b4 Don't forget the prototype for crypto_sign_seed_keypair()
Spotted by @dstufft
2013-02-23 02:51:19 -08:00
Tony Arcieri
08a11d1a05 crypto_scalarmult_raw()
This provides a more direct interface to the crypto_scalarmult function.
By default, this function includes some bit-twiddling, which, to the
best of my understanding, ensures the integer provided as the left
operand of the multiplication operation fits within a specific limit.
(I believe this limit is the order of NaCl's standard group element,
but am not entirely certain). This change allows a user to pass in
an integer which is not subject to this bit-twiddling and can be passed
in wholesale.

The reason NaCl provides this API is to intentionally make it
easy-to-use for the purposes of computing public keys from private keys
or for performing Diffie-Hellman. The API it provides now makes it
quite difficult to do anything wrong yet still get a correct answer.

If we split this function in half, however, we can expose some
power-user functionality. Specifically I need this to implement
semiprivate keys:

https://gist.github.com/tarcieri/4760215

I've been double checking my implementation against a similar version in
SAGE for the past week or so trying to figure out what's wrong, and
today it was pointed out to me that NaCl's scalar multiplication
function automatically performs bit-twiddling for you.

I would love to continue to experiment with semiprivate keys on top of
NaCl. I have no serious intentions of actually using them as part of a
cryptosystem until there's some sort of proof of their security, or at
the very least, some reasonably educated guesses as to its security
properties.

That said, I would love to have this API. If there's worries about
exposing power-user APIs like this, perhaps we can be a bit more
"shouty" in the API name?

crypto_scalarmult_dangerously_direct_access() ? ;)
2013-02-21 20:59:57 -08:00
Frank Denis
0926fc974d Some systems lack flock() 2013-02-18 15:51:21 -08:00
Frank Denis
329ec43e02 Include CurveCP's README 2013-02-18 15:40:41 -08:00
Frank Denis
f5af42f48d CurveCP is optional 2013-02-18 15:28:43 -08:00
Frank Denis
926803f996 Move curvecp, split libcurvecp to its own dir 2013-02-18 15:14:55 -08:00
Frank Denis
60d788a444 Compile curvecp. This will be optional and disabled by default as it is
not exactly portable.
2013-02-18 13:56:29 -08:00
Frank Denis
6774b47cd4 Reintroduce shorthash, this time with the key... 2013-02-13 21:14:29 +08:00
Frank Denis
e5e2150919 Revert "Add crypto_shorthash() for non collision-resistant hash functions"
This reverts commit c8fe5c4afb.

Conflicts:
	.gitignore
	test/Makefile.am
	test/default/shorthash.c
	test/default/shorthash.exp
2013-02-13 20:33:17 +08:00
Frank Denis
c8fe5c4afb Add crypto_shorthash() for non collision-resistant hash functions
Currently using siphash-2-4
2013-02-09 03:51:20 +08:00
Frank Denis
eb96dcb0f7 Skip library version info on Windows 2013-02-04 22:52:51 -08:00
Frank Denis
2abcfa283a BUmp version to 0.3 2013-02-04 22:28:17 -08:00
Frank Denis
6d3afb32de Build the library as a module on Windows 2013-02-04 17:16:46 -08:00
Frank Denis
49461b5e66 Pass -no-undefined to libtool so that a native DLL can be built on Windows 2013-02-04 16:31:02 -08:00
Frank Denis
85ba9d3ff5 Add crypto_box_MACBYTES 2013-02-04 14:51:04 -08:00
Frank Denis
ca02a49b25 Bump minor 2013-01-28 21:46:51 -08:00
Tony Arcieri
c046fe8ccc Rename crypto_sign_publickey to crypto_sign_seed_keypair
The crypto_sign_seed_keypair function is analagous to
crypto_sign_keypair, except it generates a keypair for a seed instead of
a random keypair.

I think this name makes more sense than crypto_sign_publickey.
2013-01-28 21:31:25 -08:00
Tony Arcieri
53d3b5969e Add crypto_sign_publickey() API
This adds a new API crypto_sign_publickey, which works similarly to the
existing crypto_sign_keypair() API, but supports a 32-byte
user-specified seed value (k).

This API is necessary for implementing Ed25519 test vectors, for
example, since we need to pass in a known seed to ensure we're
computing the public key correctly.

The name and implementation are largely borrowed from Brian Warner's
python-ed25519 library. See:

d42d4b7049/src/ed25519.c (L21)

That said, perhaps a different name would be more descriptive, since it
still returns a keypair, not just the public key? Or perhaps that's
needless bikeshedding since this name is already in use.
2013-01-26 13:12:10 -08:00
Frank Denis
0ca9901e14 <poll.h> is not needed any more 2013-01-21 20:45:39 -08:00
Frank Denis
0d48d2a10b Of course (...) in CryptGenRandom() the size comes before the buffer. 2013-01-21 19:45:58 -08:00
Frank Denis
4668611533 <sys/timeb.h> is required for Windows 2013-01-21 19:30:39 -08:00
Frank Denis
7ba8af5936 Check for SecureZeroMemory at compile time. 2013-01-21 19:18:15 -08:00
Frank Denis
0aaa42ed69 libsodium-randombytes is gone, remove it from all Makefiles 2013-01-21 18:43:11 -08:00
Frank Denis
dff36063a6 randombytes/randombytes_sysrandom.h moved to includes/sodium 2013-01-21 18:11:19 -08:00
Douglas Campos
fdbaa9a9ea add AUTHORS file from designers/implementors files 2013-01-21 23:25:51 -02:00
Frank Denis
40d6182ecd Indentation wankery 2013-01-21 14:44:22 -08:00
Frank Denis
68822dab0a COMPILER_ASSERT is not needed for randombytes_sysrandom 2013-01-21 14:39:22 -08:00
Frank Denis
3505db86a5 Add randombytes_sysrandom and use that as the default randombytes impl. 2013-01-21 14:36:26 -08:00
Frank Denis
3bb7e4b1b7 Rename salsa20_random.c to randombytes_salsa20_random.c for consistency 2013-01-21 13:58:18 -08:00
Frank Denis
8a54e2efa8 Implement randombytes_set_implementation() 2013-01-21 13:52:37 -08:00
Frank Denis
5788f3d6a8 Add randombytes wrappers.
These are real wrappers, not globals or macros, in order to make it easier
to use them in different programming languages.
2013-01-21 13:50:00 -08:00
Frank Denis
3444a46f35 Prepare for pluggable randombytes*() implementations. 2013-01-21 13:28:27 -08:00
Frank Denis
4c6e162c52 Remove libsodium-randombytes. 2013-01-21 12:46:40 -08:00
Frank Denis
137ae007ae Export randombytes helpers 2013-01-21 12:35:58 -08:00
Frank Denis
dde2e8086c Use salsa20_random() for randombytes, install libsodium-randombytes DLL. 2013-01-21 12:23:57 -08:00
Frank Denis
87af79c629 Don't include randombyte - move it to a different library. 2013-01-21 11:32:34 -08:00
Frank Denis
b4e28221e8 Add library version 2013-01-20 17:51:57 -08:00
Frank Denis
61775cc84d Add missing dependencies 2013-01-20 17:23:37 -08:00
Frank Denis
d4a5db2459 Remove benchmark progs for now, they will be reintroduced later. 2013-01-20 17:05:24 -08:00
Frank Denis
9bb13efa5a Don't forget to install version.h 2013-01-20 16:21:37 -08:00
Frank Denis
83961aae3b How about just #include <sodium.h> to include everything you need? 2013-01-20 16:18:36 -08:00
Frank Denis
4825914aa8 Give C++ some love 2013-01-20 16:13:09 -08:00
Frank Denis
cfd84663b9 A library should expose its version 2013-01-20 16:04:43 -08:00
Frank Denis
40567fe583 Use $(top_srcdir) to reference the path to headers 2013-01-20 13:29:54 -08:00
Frank Denis
221da81226 Switch crypto_sign* to ed25519
Ok qmx@
2013-01-20 12:09:00 -08:00
Frank Denis
ed943d58f3 Link ed25519 2013-01-20 11:58:20 -08:00
Frank Denis
972984880e Fix double definition of ge25519_base in ed25519 2013-01-20 11:57:39 -08:00
Douglas Campos
ee16bc6e6c rename libnacl-ref -> libsodium 2013-01-20 17:23:32 -02:00
Frank Denis
8b3ac469f1 Install headers with high-level macros 2013-01-20 00:32:51 -08:00
Frank Denis
f266b4cbd4 Keep library version, it's not a plugin 2013-01-20 00:25:18 -08:00
Frank Denis
11bc2610ae edwards25519sha512batch requires api.h
(but it will be replaced by ed25519 anyways)
2013-01-20 00:09:22 -08:00
Frank Denis
5a9209a4a8 Remove old dependencies 2013-01-20 00:01:29 -08:00
Frank Denis
33f97cbb3b Replace the build system 2013-01-19 23:51:05 -08:00
Frank Denis
b801c07db2 One more Makefile.in 2013-01-19 18:10:29 -08:00
Frank Denis
9cd4c769a7 Add libnacl/Makefile.in 2013-01-19 18:08:06 -08:00
Frank Denis
9177909d03 Remove C++ wrappers 2013-01-19 16:45:10 -08:00
Frank Denis
b7075c1d9f Drop PROTOTYPES.cpp, we don't build C++ wrappers. 2013-01-19 16:36:18 -08:00
Frank Denis
95b9c37cc5 Import libnacl from dnscrypt-proxy 2013-01-19 16:02:02 -08:00