diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2018-03-13 18:02:36 +0200 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2018-03-13 18:02:36 +0200 |
| commit | 5305970d43139ff99a8da4d57d50a5637b5b03b4 (patch) | |
| tree | cea23fb419bd9d2a82c385593e2ca990bb01da29 | |
| parent | 7eec4bad08139426de4bfd5bcb54907fd01dd8e5 (diff) | |
| download | tomcrypt-nim-5305970d43139ff99a8da4d57d50a5637b5b03b4.tar.gz tomcrypt-nim-5305970d43139ff99a8da4d57d50a5637b5b03b4.zip | |
Add definitions from tomcrypt.h to tomcrypt.nim
| -rw-r--r-- | src/tomcrypt/tomcrypt.nim | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/tomcrypt/tomcrypt.nim b/src/tomcrypt/tomcrypt.nim index f7d953e..3bc1691 100644 --- a/src/tomcrypt/tomcrypt.nim +++ b/src/tomcrypt/tomcrypt.nim @@ -1 +1,36 @@ import private/config + +const + CRYPT* = 0x0118 + SCRYPT* = "1.18.1" + MAXBLOCKSIZE* = 128 + TAB_SIZE* = 32 + +type + TomCryptErrorCode* = enum + CRYPT_OK=0, # Result OK + CRYPT_ERROR, # Generic Error + CRYPT_NOP, # Not a failure but no operation was performed + CRYPT_INVALID_KEYSIZE, # Invalid key size given + CRYPT_INVALID_ROUNDS, # Invalid number of rounds + CRYPT_FAIL_TESTVECTOR, # Algorithm failed test vectors + CRYPT_BUFFER_OVERFLOW, # Not enough space for output + CRYPT_INVALID_PACKET, # Invalid input packet given + CRYPT_INVALID_PRNGSIZE, # Invalid number of bits for a PRNG + CRYPT_ERROR_READPRNG, # Could not read enough from PRNG + CRYPT_INVALID_CIPHER, # Invalid cipher specified + CRYPT_INVALID_HASH, # Invalid hash specified + CRYPT_INVALID_PRNG, # Invalid PRNG specified + CRYPT_MEM, # Out of memory + CRYPT_PK_TYPE_MISMATCH, # Not equivalent types of PK keys + CRYPT_PK_NOT_PRIVATE, # Requires a private PK key + CRYPT_INVALID_ARG, # Generic invalid argument + CRYPT_FILE_NOTFOUND, # File Not Found + CRYPT_PK_INVALID_TYPE, # Invalid type of PK key + CRYPT_OVERFLOW, # An overflow of a value was detected/prevented + CRYPT_UNUSED1, # UNUSED1 + CRYPT_INPUT_TOO_LONG, # The input was longer than expected. + CRYPT_PK_INVALID_SIZE, # Invalid size input for PK parameters + CRYPT_INVALID_PRIME_SIZE, # Invalid size of prime requested + CRYPT_PK_INVALID_PADDING, # Invalid padding on input + CRYPT_HASH_OVERFLOW # Hash applied to too many bits |
