api.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*********************************************************************************************
  2. * DAGS: Key Encapsulation using Dyadic GS Codes. *
  3. * This code is exclusively intended for submission to the NIST Post=Quantum Cryptography. *
  4. * For any other usage , contact the author(s) to ask permission. *
  5. **********************************************************************************************
  6. */
  7. #ifndef __API_H_INCLUDED__
  8. #define __API_H_INCLUDED__
  9. #if defined(DAGS_1)
  10. #define CRYPTO_ALGNAME "DAGS_1"
  11. #define CRYPTO_SECRETKEYBYTES 3328
  12. #define CRYPTO_PUBLICKEYBYTES 173056
  13. #define CRYPTO_CIPHERTEXTBYTES 2144 // 1616
  14. #endif
  15. #if defined(DAGS_3)
  16. #define CRYPTO_ALGNAME "DAGS_3"
  17. #define CRYPTO_SECRETKEYBYTES 4864
  18. #define CRYPTO_PUBLICKEYBYTES 360448//630784
  19. #define CRYPTO_CIPHERTEXTBYTES 2144 // 1616
  20. #endif
  21. #if defined(DAGS_5) || defined(DAGS_TOY)
  22. #define CRYPTO_ALGNAME "DAGS_5"
  23. #define CRYPTO_SECRETKEYBYTES 6400
  24. #define CRYPTO_PUBLICKEYBYTES 630784
  25. #define CRYPTO_CIPHERTEXTBYTES 2144
  26. #endif
  27. #define CRYPTO_BYTES 64
  28. int crypto_kem_keypair(
  29. unsigned char *pk,
  30. unsigned char *sk);
  31. int crypto_kem_enc(
  32. unsigned char *ct,
  33. unsigned char *ss,
  34. const unsigned char *pk);
  35. int crypto_kem_dec(
  36. unsigned char *ss,
  37. const unsigned char *ct,
  38. const unsigned char *sk);
  39. #endif