diff --git a/nacl/ffi/__init__.py b/nacl/ffi/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/nacl/ffi/libsodium.py b/nacl/ffi/libsodium.py new file mode 100644 index 0000000000000000000000000000000000000000..b9b35b482491f739fbfb8c022d09bc1022cc0d7a --- /dev/null +++ b/nacl/ffi/libsodium.py @@ -0,0 +1,21 @@ +""" +CFFI interface to libsodium the library +""" +from cffi import FFI + +ffi = FFI() + +ffi.cdef( + # Low Level Hashing functions + """ + static const int crypto_hash_BYTES; + static const int crypto_hash_sha256_BYTES; + static const int crypto_hash_sha512_BYTES; + + int crypto_hash(unsigned char *out, const unsigned char *in, unsigned long long inlen); + int crypto_hash_sha256(unsigned char *out, const unsigned char *in, unsigned long long inlen); + int crypto_hash_sha512(unsigned char *out, const unsigned char *in, unsigned long long inlen); + """ +) + +lib = ffi.verify("#include <sodium.h>", libraries=["sodium"])