crypto_api.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* $OpenBSD: crypto_api.h,v 1.5 2019/01/21 10:20:12 djm Exp $ */
  2. /*
  3. * Assembled from generated headers and source files by Markus Friedl.
  4. * Placed in the public domain.
  5. */
  6. #ifndef crypto_api_h
  7. #define crypto_api_h
  8. #include "includes.h"
  9. #ifdef HAVE_STDINT_H
  10. # include <stdint.h>
  11. #endif
  12. #include <stdlib.h>
  13. typedef int8_t crypto_int8;
  14. typedef uint8_t crypto_uint8;
  15. typedef int16_t crypto_int16;
  16. typedef uint16_t crypto_uint16;
  17. typedef int32_t crypto_int32;
  18. typedef uint32_t crypto_uint32;
  19. typedef int64_t crypto_int64;
  20. typedef uint64_t crypto_uint64;
  21. #define randombytes(buf, buf_len) arc4random_buf((buf), (buf_len))
  22. #define small_random32() arc4random()
  23. #define crypto_hash_sha512_BYTES 64U
  24. int crypto_hash_sha512(unsigned char *, const unsigned char *,
  25. unsigned long long);
  26. int crypto_verify_32(const unsigned char *, const unsigned char *);
  27. #define crypto_sign_ed25519_SECRETKEYBYTES 64U
  28. #define crypto_sign_ed25519_PUBLICKEYBYTES 32U
  29. #define crypto_sign_ed25519_BYTES 64U
  30. int crypto_sign_ed25519(unsigned char *, unsigned long long *,
  31. const unsigned char *, unsigned long long, const unsigned char *);
  32. int crypto_sign_ed25519_open(unsigned char *, unsigned long long *,
  33. const unsigned char *, unsigned long long, const unsigned char *);
  34. int crypto_sign_ed25519_keypair(unsigned char *, unsigned char *);
  35. #define crypto_kem_sntrup761_PUBLICKEYBYTES 1158
  36. #define crypto_kem_sntrup761_SECRETKEYBYTES 1763
  37. #define crypto_kem_sntrup761_CIPHERTEXTBYTES 1039
  38. #define crypto_kem_sntrup761_BYTES 32
  39. int crypto_kem_sntrup761_enc(unsigned char *cstr, unsigned char *k,
  40. const unsigned char *pk);
  41. int crypto_kem_sntrup761_dec(unsigned char *k,
  42. const unsigned char *cstr, const unsigned char *sk);
  43. int crypto_kem_sntrup761_keypair(unsigned char *pk, unsigned char *sk);
  44. #endif /* crypto_api_h */