00001 #ifndef AES_CTR_H 00002 #define AES_CTR_H 00003 00004 00005 typedef struct _aes_ctr_ctx 00006 { 00007 AES_KEY key; 00008 unsigned char counter[AES_BLOCK_SIZE]; 00009 unsigned char ecount_buf[AES_BLOCK_SIZE]; 00010 unsigned int num; 00011 } aes_ctr_ctx; 00012 00013 void AES_ctr128_inc(unsigned char *counter); 00014 00015 void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out, 00016 const unsigned long length, const AES_KEY *key, 00017 unsigned char counter[AES_BLOCK_SIZE], 00018 unsigned char ecount_buf[AES_BLOCK_SIZE], 00019 unsigned int *num) ; 00020 00021 00022 #endif