2004-12-30 23:55:53 +00:00
|
|
|
#ifndef TOMCRYPT_H_
|
|
|
|
#define TOMCRYPT_H_
|
2003-03-03 00:59:24 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
2004-12-30 23:55:53 +00:00
|
|
|
/* use configuration data */
|
|
|
|
#include <tomcrypt_custom.h>
|
2003-03-03 01:02:42 +00:00
|
|
|
|
2003-03-03 00:59:24 +00:00
|
|
|
#ifdef __cplusplus
|
2004-06-23 19:55:24 +00:00
|
|
|
extern "C" {
|
2003-03-03 00:59:24 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* version */
|
2005-06-27 11:47:35 +00:00
|
|
|
#define CRYPT 0x0105
|
|
|
|
#define SCRYPT "1.05"
|
2003-03-03 00:59:24 +00:00
|
|
|
|
|
|
|
/* max size of either a cipher/hash block or symmetric key [largest of the two] */
|
2004-12-30 23:55:53 +00:00
|
|
|
#define MAXBLOCKSIZE 128
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2004-05-12 20:42:16 +00:00
|
|
|
/* descriptor table size */
|
2004-06-20 02:41:49 +00:00
|
|
|
#define TAB_SIZE 32
|
2004-05-12 20:42:16 +00:00
|
|
|
|
2003-03-03 00:59:24 +00:00
|
|
|
/* error codes [will be expanded in future releases] */
|
|
|
|
enum {
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_OK=0, /* Result OK */
|
|
|
|
CRYPT_ERROR, /* Generic Error */
|
2003-03-29 18:19:07 +00:00
|
|
|
CRYPT_NOP, /* Not a failure but no operation was performed */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_INVALID_KEYSIZE, /* Invalid key size given */
|
|
|
|
CRYPT_INVALID_ROUNDS, /* Invalid number of rounds */
|
|
|
|
CRYPT_FAIL_TESTVECTOR, /* Algorithm failed test vectors */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_BUFFER_OVERFLOW, /* Not enough space for output */
|
|
|
|
CRYPT_INVALID_PACKET, /* Invalid input packet given */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_INVALID_PRNGSIZE, /* Invalid number of bits for a PRNG */
|
|
|
|
CRYPT_ERROR_READPRNG, /* Could not read enough from PRNG */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_INVALID_CIPHER, /* Invalid cipher specified */
|
|
|
|
CRYPT_INVALID_HASH, /* Invalid hash specified */
|
|
|
|
CRYPT_INVALID_PRNG, /* Invalid PRNG specified */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_MEM, /* Out of memory */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_PK_TYPE_MISMATCH, /* Not equivalent types of PK keys */
|
|
|
|
CRYPT_PK_NOT_PRIVATE, /* Requires a private PK key */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_INVALID_ARG, /* Generic invalid argument */
|
2003-09-26 01:16:18 +00:00
|
|
|
CRYPT_FILE_NOTFOUND, /* File Not Found */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_PK_INVALID_TYPE, /* Invalid type of PK key */
|
|
|
|
CRYPT_PK_INVALID_SYSTEM,/* Invalid PK system specified */
|
|
|
|
CRYPT_PK_DUP, /* Duplicate key already in key ring */
|
|
|
|
CRYPT_PK_NOT_FOUND, /* Key not found in keyring */
|
|
|
|
CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2003-03-03 01:02:10 +00:00
|
|
|
CRYPT_INVALID_PRIME_SIZE/* Invalid size of prime requested */
|
2003-03-03 00:59:24 +00:00
|
|
|
};
|
|
|
|
|
2004-12-30 23:55:53 +00:00
|
|
|
#include <tomcrypt_cfg.h>
|
|
|
|
#include <tomcrypt_macros.h>
|
|
|
|
#include <tomcrypt_cipher.h>
|
|
|
|
#include <tomcrypt_hash.h>
|
2005-04-17 11:37:13 +00:00
|
|
|
#include <tomcrypt_mac.h>
|
2004-12-30 23:55:53 +00:00
|
|
|
#include <tomcrypt_prng.h>
|
|
|
|
#include <tomcrypt_pk.h>
|
|
|
|
#include <tomcrypt_misc.h>
|
|
|
|
#include <tomcrypt_argchk.h>
|
|
|
|
#include <tomcrypt_pkcs.h>
|
2003-03-03 00:59:24 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-12-30 23:55:53 +00:00
|
|
|
#endif /* TOMCRYPT_H_ */
|
2003-03-03 00:59:24 +00:00
|
|
|
|
2005-06-09 00:08:13 +00:00
|
|
|
|
|
|
|
/* $Source$ */
|
|
|
|
/* $Revision$ */
|
|
|
|
/* $Date$ */
|