Path: blob/master/libs/tomcrypt/src/headers/tomcrypt.h
5971 views
/* LibTomCrypt, modular cryptographic library -- Tom St Denis1*2* LibTomCrypt is a library that provides various cryptographic3* algorithms in a highly modular and flexible manner.4*5* The library is free for all purposes without any express6* guarantee it works.7*/89#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>1920/* use configuration data */21#include <tomcrypt_custom.h>2223#ifdef __cplusplus24extern "C" {25#endif2627/* version */28#define CRYPT 0x011829#define SCRYPT "1.18.2"3031/* max size of either a cipher/hash block or symmetric key [largest of the two] */32#define MAXBLOCKSIZE 1283334#ifndef TAB_SIZE35/* descriptor table size */36#define TAB_SIZE 3237#endif3839/* error codes [will be expanded in future releases] */40enum {41CRYPT_OK=0, /* Result OK */42CRYPT_ERROR, /* Generic Error */43CRYPT_NOP, /* Not a failure but no operation was performed */4445CRYPT_INVALID_KEYSIZE, /* Invalid key size given */46CRYPT_INVALID_ROUNDS, /* Invalid number of rounds */47CRYPT_FAIL_TESTVECTOR, /* Algorithm failed test vectors */4849CRYPT_BUFFER_OVERFLOW, /* Not enough space for output */50CRYPT_INVALID_PACKET, /* Invalid input packet given */5152CRYPT_INVALID_PRNGSIZE, /* Invalid number of bits for a PRNG */53CRYPT_ERROR_READPRNG, /* Could not read enough from PRNG */5455CRYPT_INVALID_CIPHER, /* Invalid cipher specified */56CRYPT_INVALID_HASH, /* Invalid hash specified */57CRYPT_INVALID_PRNG, /* Invalid PRNG specified */5859CRYPT_MEM, /* Out of memory */6061CRYPT_PK_TYPE_MISMATCH, /* Not equivalent types of PK keys */62CRYPT_PK_NOT_PRIVATE, /* Requires a private PK key */6364CRYPT_INVALID_ARG, /* Generic invalid argument */65CRYPT_FILE_NOTFOUND, /* File Not Found */6667CRYPT_PK_INVALID_TYPE, /* Invalid type of PK key */6869CRYPT_OVERFLOW, /* An overflow of a value was detected/prevented */7071CRYPT_UNUSED1, /* UNUSED1 */7273CRYPT_INPUT_TOO_LONG, /* The input was longer than expected. */7475CRYPT_PK_INVALID_SIZE, /* Invalid size input for PK parameters */7677CRYPT_INVALID_PRIME_SIZE,/* Invalid size of prime requested */78CRYPT_PK_INVALID_PADDING, /* Invalid padding on input */7980CRYPT_HASH_OVERFLOW /* Hash applied to too many bits */81};8283#include <tomcrypt_cfg.h>84#include <tomcrypt_macros.h>85#include <tomcrypt_cipher.h>86#include <tomcrypt_hash.h>87#include <tomcrypt_mac.h>88#include <tomcrypt_prng.h>89#include <tomcrypt_pk.h>90#include <tomcrypt_math.h>91#include <tomcrypt_misc.h>92#include <tomcrypt_argchk.h>93#include <tomcrypt_pkcs.h>9495#ifdef __cplusplus96}97#endif9899#endif /* TOMCRYPT_H_ */100101102