/*
*   Byte-oriented AES-256 implementation.
*   All lookup tables replaced with 'on the fly' calculations.
*
*   Copyright (c) 2007-2009 Ilya O. Levin, http://www.literatecode.com
*   Other contributors: Hal Finney
*
*   Permission to use, copy, modify, and distribute this software for any
*   purpose with or without fee is hereby granted, provided that the above
*   copyright notice and this permission notice appear in all copies.
*
*   Modified: Georgiy Pruss 2015
*/

typedef unsigned char BYTE;

#ifdef __cplusplus
extern "C" {
#endif

#define KSZ 32 /* key size - 256 bit */
#define BSZ 16 /* block size - 128 bit */
typedef struct { BYTE key[KSZ], enckey[KSZ], deckey[KSZ]; } aes256_context;

void aes256_init( aes256_context* ctx, BYTE* key );
void aes256_done( aes256_context* ctx );
void aes256_encrypt( aes256_context* ctx, BYTE* plaintext );
void aes256_decrypt( aes256_context* ctx, BYTE* cipertext );

#ifdef __cplusplus
}
#endif
