diff options
| author | Pieter Wuille <[email protected]> | 2016-05-11 19:36:38 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-05-11 19:37:02 +0200 |
| commit | cd2be4419e9d8c6445fecc877b50198dc918a81f (patch) | |
| tree | 4e490121ea95decee565f00e97110cfc560cabd7 /src/crypto/ctaes/ctaes.h | |
| parent | Merge #7972: [qa] pull-tester: Run rpc test in parallel (diff) | |
| parent | Squashed 'src/crypto/ctaes/' content from commit cd3c3ac (diff) | |
| download | discoin-cd2be4419e9d8c6445fecc877b50198dc918a81f.tar.xz discoin-cd2be4419e9d8c6445fecc877b50198dc918a81f.zip | |
Merge commit 'a545127fbccef4ee674d18d43732ce00ba97f782' as 'src/crypto/ctaes'
Diffstat (limited to 'src/crypto/ctaes/ctaes.h')
| -rw-r--r-- | src/crypto/ctaes/ctaes.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/crypto/ctaes/ctaes.h b/src/crypto/ctaes/ctaes.h new file mode 100644 index 000000000..2f0af0421 --- /dev/null +++ b/src/crypto/ctaes/ctaes.h @@ -0,0 +1,41 @@ + /********************************************************************* + * Copyright (c) 2016 Pieter Wuille * + * Distributed under the MIT software license, see the accompanying * + * file COPYING or http://www.opensource.org/licenses/mit-license.php.* + **********************************************************************/ + +#ifndef _CTAES_H_ +#define _CTAES_H_ 1 + +#include <stdint.h> +#include <stdlib.h> + +typedef struct { + uint16_t slice[8]; +} AES_state; + +typedef struct { + AES_state rk[11]; +} AES128_ctx; + +typedef struct { + AES_state rk[13]; +} AES192_ctx; + +typedef struct { + AES_state rk[15]; +} AES256_ctx; + +void AES128_init(AES128_ctx* ctx, const unsigned char* key16); +void AES128_encrypt(const AES128_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16); +void AES128_decrypt(const AES128_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16); + +void AES192_init(AES192_ctx* ctx, const unsigned char* key24); +void AES192_encrypt(const AES192_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16); +void AES192_decrypt(const AES192_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16); + +void AES256_init(AES256_ctx* ctx, const unsigned char* key32); +void AES256_encrypt(const AES256_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16); +void AES256_decrypt(const AES256_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16); + +#endif |