> From: owner-openssl-us...@openssl.org On Behalf Of Michael S. Zick
> Sent: Sunday, 30 October, 2011 06:36

> On Sun October 30 2011, Ananthasayanan Kandiah wrote:
> > #include <stdio.h>
> > #include <string.h>
> > #include <openssl/aes.h>
> > #include <openssl/bio.h>
> > 
> > #define  KEY_SIZE 16

> Ask the compiler to help you:
> 
> mszick@wolf466:~/crypto$ gcc -Wall -E aes_test.c | grep "_SIZE"
> 
> aes_test.c:6:9: error: macro names must be identifiers
>     unsigned char key_data[KEY_SIZE] = {
>     AES_set_encrypt_key(key_data, KEY_SIZE * 8, &key);
> 
I don't know what happened to the message you got, 
but I got "#define  KEY_SIZE 16" which is a valid identifier, 
compiled without error, and gave the symptom reported -- 
because CRYPTO_cfb128_1_encrypt treats the length as bits 
not bytes (apparently only used for AES and Camellia).
97 bits is 12 bytes plus 1 bit, and that 'extra' bit 
is 0 and thus 'disappears'.

Note these CFB-1 and CFB-8 modes don't update 'num', 
so OP's line 68 is unnecessary (but harmless).
CFB-block (16bytes=128bits) does.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to