tomcrypt.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /* LibTomCrypt, modular cryptographic library -- Tom St Denis
  2. *
  3. * LibTomCrypt is a library that provides various cryptographic
  4. * algorithms in a highly modular and flexible manner.
  5. *
  6. * The library is free for all purposes without any express
  7. * guarantee it works.
  8. */
  9. #ifndef TOMCRYPT_H_
  10. #define TOMCRYPT_H_
  11. #include <assert.h>
  12. #include <stdio.h>
  13. #include <string.h>
  14. #include <stdlib.h>
  15. #include <stddef.h>
  16. #include <time.h>
  17. #include <ctype.h>
  18. #include <limits.h>
  19. /* use configuration data */
  20. #include <tomcrypt_custom.h>
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* version */
  25. #define CRYPT 0x0118
  26. #define SCRYPT "1.18.2-develop"
  27. /* max size of either a cipher/hash block or symmetric key [largest of the two] */
  28. #define MAXBLOCKSIZE 144
  29. #ifndef TAB_SIZE
  30. /* descriptor table size */
  31. #define TAB_SIZE 34
  32. #endif
  33. /* error codes [will be expanded in future releases] */
  34. enum {
  35. CRYPT_OK=0, /* Result OK */
  36. CRYPT_ERROR, /* Generic Error */
  37. CRYPT_NOP, /* Not a failure but no operation was performed */
  38. CRYPT_INVALID_KEYSIZE, /* Invalid key size given */
  39. CRYPT_INVALID_ROUNDS, /* Invalid number of rounds */
  40. CRYPT_FAIL_TESTVECTOR, /* Algorithm failed test vectors */
  41. CRYPT_BUFFER_OVERFLOW, /* Not enough space for output */
  42. CRYPT_INVALID_PACKET, /* Invalid input packet given */
  43. CRYPT_INVALID_PRNGSIZE, /* Invalid number of bits for a PRNG */
  44. CRYPT_ERROR_READPRNG, /* Could not read enough from PRNG */
  45. CRYPT_INVALID_CIPHER, /* Invalid cipher specified */
  46. CRYPT_INVALID_HASH, /* Invalid hash specified */
  47. CRYPT_INVALID_PRNG, /* Invalid PRNG specified */
  48. CRYPT_MEM, /* Out of memory */
  49. CRYPT_PK_TYPE_MISMATCH, /* Not equivalent types of PK keys */
  50. CRYPT_PK_NOT_PRIVATE, /* Requires a private PK key */
  51. CRYPT_INVALID_ARG, /* Generic invalid argument */
  52. CRYPT_FILE_NOTFOUND, /* File Not Found */
  53. CRYPT_PK_INVALID_TYPE, /* Invalid type of PK key */
  54. CRYPT_OVERFLOW, /* An overflow of a value was detected/prevented */
  55. CRYPT_PK_ASN1_ERROR, /* An error occurred while en- or decoding ASN.1 data */
  56. CRYPT_INPUT_TOO_LONG, /* The input was longer than expected. */
  57. CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */
  58. CRYPT_INVALID_PRIME_SIZE,/* Invalid size of prime requested */
  59. CRYPT_PK_INVALID_PADDING, /* Invalid padding on input */
  60. CRYPT_HASH_OVERFLOW /* Hash applied to too many bits */
  61. };
  62. #include <tomcrypt_cfg.h>
  63. #include <tomcrypt_macros.h>
  64. #include <tomcrypt_cipher.h>
  65. #include <tomcrypt_hash.h>
  66. #include <tomcrypt_mac.h>
  67. #include <tomcrypt_prng.h>
  68. #include <tomcrypt_pk.h>
  69. #include <tomcrypt_math.h>
  70. #include <tomcrypt_misc.h>
  71. #include <tomcrypt_argchk.h>
  72. #include <tomcrypt_pkcs.h>
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif /* TOMCRYPT_H_ */
  77. /* ref: HEAD -> develop */
  78. /* git commit: a1f6312416ef6cd183ee62db58b640dc2d7ec1f4 */
  79. /* commit time: 2019-09-04 13:44:47 +0200 */