1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 04:25:10 -07:00
A modern, portable, easy to use crypto library.
Go to file
Ilya Maykov 6bece9c8c4 Relax most __attribute__ ((nonnull)) to allow 0-length inputs to be NULL.
Justifications:
- crypto_(auth|hash|generichash|onetimeauth|shorthash)*:
  it's legal to hash or HMAC a 0-length message
- crypto_box*: it's legal to encrypt a 0-length message
- crypto_sign*: it's legal to sign a 0-length message
- utils:
  comparing two 0-length byte arrays is legal
  memzero on a 0-length byte array is a no-op
  converting an empty hex string to binary results in an empty binary string
  converting an empty binary string to hex results in an empty hex string
  converting an empty b64 string to binary results in an empty binary string
  converting an empty binary string to b64 results in an empty b64 string
  sodium_add / sodium_sub on zero-length arrays is a no-op

For the functions declared in utils.h, I moved the logic into private functions that
have the __attribute__ ((nonnull)) check, but they are only called when the
corresponding length argument is non-0. I didn't do this for the hash/box/sign
functions since it would have been a lot more work and quite a large refactor.

Only memset() may have issues with a zero length.

Fix tests, use guard page instead of NULL because of Wasm
2019-04-26 15:36:58 +02:00
build-aux Regen autoconf scripts 2018-03-14 12:03:49 -07:00
builds Regen builds/Makefile.in to include MSVC 2019 files 2019-04-23 10:18:18 +02:00
contrib Add -pthread to pkgconfig's Libs.private if enabled 2019-01-15 00:29:20 +01:00
dist-build Add -pthread to pkgconfig's Libs.private if enabled 2019-01-15 00:29:20 +01:00
m4 1.0.16 2017-12-13 16:21:20 +01:00
msvc-scripts Add -pthread to pkgconfig's Libs.private if enabled 2019-01-15 00:29:20 +01:00
packaging Update the dotnet-core release script 2019-04-22 14:37:59 +02:00
regen-msvc Indent regen-msvc.py 2019-04-22 19:53:26 +02:00
src Relax most __attribute__ ((nonnull)) to allow 0-length inputs to be NULL. 2019-04-26 15:36:58 +02:00
test Relax most __attribute__ ((nonnull)) to allow 0-length inputs to be NULL. 2019-04-26 15:36:58 +02:00
.gitignore Sort .gitignore 2019-04-22 19:53:26 +02:00
.travis.yml Travis: parallelize builds, not checks 2019-04-02 09:36:59 +02:00
aclocal.m4 Regen autoconf scripts 2018-03-14 12:03:49 -07:00
appveyor.yml Revert "Use os: Visual Studio 2017 in appveyor.yml" 2017-03-13 08:56:46 +01:00
AUTHORS crypto_core/curve25519 was renamed crypto_core/ed25519 2017-11-15 17:04:07 +01:00
autogen.sh Replace which with command for portability (#542) 2017-05-19 14:51:56 +02:00
ChangeLog Nits 2019-01-06 18:43:57 +01:00
configure Regen 2019-03-30 11:25:40 +01:00
configure.ac Regen 2019-03-30 11:25:40 +01:00
lgtm.yml + lgtm.yml 2018-03-27 14:43:23 +02:00
libsodium-uninstalled.pc.in Add -pthread to pkgconfig's Libs.private if enabled 2019-01-15 00:29:20 +01:00
libsodium.pc.in Add -pthread to pkgconfig's Libs.private if enabled 2019-01-15 00:29:20 +01:00
libsodium.sln Retarget the top solution to Visual Studio 2015 2015-11-01 08:29:49 -08:00
libsodium.vcxproj Downgrade the TL solution for AppVeyor again 2019-04-03 16:05:09 +02:00
libsodium.vcxproj.filters Revert "Add crypto_kx_ed25519" and "Add low-level kx_curve25519 functions" 2018-12-25 19:22:33 +01:00
LICENSE 2019 2019-01-02 16:17:10 +01:00
logo.png Recompress logo 2019-04-22 19:53:26 +02:00
Makefile.am Add all the Visual Studio files in the tarball 2017-07-24 14:27:33 +02:00
Makefile.in Add -pthread to pkgconfig's Libs.private if enabled 2019-01-15 00:29:20 +01:00
README.markdown Revert "Coverity Scan is having hosting issues" 2019-01-30 18:46:49 +01:00
THANKS + Alexander Ilin for Factor bindings 2018-12-25 10:25:23 +01:00

Build Status Windows build status Coverity Scan Build Status

libsodium

Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more.

It is a portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API, and an extended API to improve usability even further.

Its goal is to provide all of the core operations needed to build higher-level cryptographic tools.

Sodium supports a variety of compilers and operating systems, including Windows (with MingW or Visual Studio, x86 and x64), iOS, Android, as well as Javascript and Webassembly.

Documentation

The documentation is available on Gitbook and built from the libsodium-doc repository:

Integrity Checking

The integrity checking instructions (including the signing key for libsodium) are available in the installation section of the documentation.

Community

A mailing-list is available to discuss libsodium.

In order to join, just send a random mail to sodium-subscribe {at} pureftpd {dot} org.

License

ISC license.