tomcrypt.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef TOMCRYPT_H_
  2. #define TOMCRYPT_H_
  3. #include <assert.h>
  4. #include <stdio.h>
  5. #include <string.h>
  6. #include <stdlib.h>
  7. #include <time.h>
  8. #include <ctype.h>
  9. #include <limits.h>
  10. /* use configuration data */
  11. #include <tomcrypt_custom.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /* version */
  16. #define CRYPT 0x0104
  17. #define SCRYPT "1.04"
  18. /* max size of either a cipher/hash block or symmetric key [largest of the two] */
  19. #define MAXBLOCKSIZE 128
  20. /* descriptor table size */
  21. #define TAB_SIZE 32
  22. /* error codes [will be expanded in future releases] */
  23. enum {
  24. CRYPT_OK=0, /* Result OK */
  25. CRYPT_ERROR, /* Generic Error */
  26. CRYPT_NOP, /* Not a failure but no operation was performed */
  27. CRYPT_INVALID_KEYSIZE, /* Invalid key size given */
  28. CRYPT_INVALID_ROUNDS, /* Invalid number of rounds */
  29. CRYPT_FAIL_TESTVECTOR, /* Algorithm failed test vectors */
  30. CRYPT_BUFFER_OVERFLOW, /* Not enough space for output */
  31. CRYPT_INVALID_PACKET, /* Invalid input packet given */
  32. CRYPT_INVALID_PRNGSIZE, /* Invalid number of bits for a PRNG */
  33. CRYPT_ERROR_READPRNG, /* Could not read enough from PRNG */
  34. CRYPT_INVALID_CIPHER, /* Invalid cipher specified */
  35. CRYPT_INVALID_HASH, /* Invalid hash specified */
  36. CRYPT_INVALID_PRNG, /* Invalid PRNG specified */
  37. CRYPT_MEM, /* Out of memory */
  38. CRYPT_PK_TYPE_MISMATCH, /* Not equivalent types of PK keys */
  39. CRYPT_PK_NOT_PRIVATE, /* Requires a private PK key */
  40. CRYPT_INVALID_ARG, /* Generic invalid argument */
  41. CRYPT_FILE_NOTFOUND, /* File Not Found */
  42. CRYPT_PK_INVALID_TYPE, /* Invalid type of PK key */
  43. CRYPT_PK_INVALID_SYSTEM,/* Invalid PK system specified */
  44. CRYPT_PK_DUP, /* Duplicate key already in key ring */
  45. CRYPT_PK_NOT_FOUND, /* Key not found in keyring */
  46. CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */
  47. CRYPT_INVALID_PRIME_SIZE/* Invalid size of prime requested */
  48. };
  49. #include <tomcrypt_cfg.h>
  50. #include <tomcrypt_macros.h>
  51. #include <tomcrypt_cipher.h>
  52. #include <tomcrypt_hash.h>
  53. #include <tomcrypt_mac.h>
  54. #include <tomcrypt_prng.h>
  55. #include <tomcrypt_pk.h>
  56. #include <tomcrypt_misc.h>
  57. #include <tomcrypt_argchk.h>
  58. #include <tomcrypt_pkcs.h>
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif /* TOMCRYPT_H_ */
  63. /* $Source$ */
  64. /* $Revision$ */
  65. /* $Date$ */