Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / sshd / libtomcrypt / mycrypt.h
1 #ifndef CRYPT_H_
2 #define CRYPT_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
11 /* if there is a custom definition header file use it */
12 #include <mycrypt_custom.h>
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /* version */
19 #define CRYPT   0x0086
20 #define SCRYPT  "0.86"
21
22 /* max size of either a cipher/hash block or symmetric key [largest of the two] */
23 #define MAXBLOCKSIZE           128
24
25 /* ch1-01-1 */
26 /* error codes [will be expanded in future releases] */
27 enum {
28    CRYPT_OK=0,             /* Result OK */
29    CRYPT_ERROR,            /* Generic Error */
30    CRYPT_NOP,              /* Not a failure but no operation was performed */
31
32    CRYPT_INVALID_KEYSIZE,  /* Invalid key size given */
33    CRYPT_INVALID_ROUNDS,   /* Invalid number of rounds */
34    CRYPT_FAIL_TESTVECTOR,  /* Algorithm failed test vectors */
35
36    CRYPT_BUFFER_OVERFLOW,  /* Not enough space for output */
37    CRYPT_INVALID_PACKET,   /* Invalid input packet given */
38
39    CRYPT_INVALID_PRNGSIZE, /* Invalid number of bits for a PRNG */
40    CRYPT_ERROR_READPRNG,   /* Could not read enough from PRNG */
41
42    CRYPT_INVALID_CIPHER,   /* Invalid cipher specified */
43    CRYPT_INVALID_HASH,     /* Invalid hash specified */
44    CRYPT_INVALID_PRNG,     /* Invalid PRNG specified */
45
46    CRYPT_MEM,              /* Out of memory */
47
48    CRYPT_PK_TYPE_MISMATCH, /* Not equivalent types of PK keys */
49    CRYPT_PK_NOT_PRIVATE,   /* Requires a private PK key */
50
51    CRYPT_INVALID_ARG,      /* Generic invalid argument */
52
53    CRYPT_PK_INVALID_TYPE,  /* Invalid type of PK key */
54    CRYPT_PK_INVALID_SYSTEM,/* Invalid PK system specified */
55    CRYPT_PK_DUP,           /* Duplicate key already in key ring */
56    CRYPT_PK_NOT_FOUND,     /* Key not found in keyring */
57    CRYPT_PK_INVALID_SIZE,  /* Invalid size input for PK parameters */
58
59    CRYPT_INVALID_PRIME_SIZE/* Invalid size of prime requested */
60 };
61 /* ch1-01-1 */
62
63 #include <mycrypt_cfg.h>
64 #include <mycrypt_macros.h>
65 #include <mycrypt_cipher.h>
66 #include <mycrypt_hash.h>
67 #include <mycrypt_prng.h>
68 #include <mycrypt_pk.h>
69 #include <mycrypt_gf.h>
70 #include <mycrypt_misc.h>
71 #include <mycrypt_kr.h>
72 #include <mycrypt_argchk.h>
73
74 #ifdef __cplusplus
75    }
76 #endif
77
78 #endif /* CRYPT_H_ */
79