> From: owner-openssl-us...@openssl.org On Behalf Of jeetendra gangele
> Sent: Monday, 07 January, 2013 10:26

> void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
>         size_t length, const AES_KEY *key,
>         unsigned char *ivec, int *num)
> 
> What will be the value for num (last parameter) for 
> encryption and decryption
> 
> 0 = decryptio
> 1=encryption
> Anybody has any idea?
> 
>From crypto/modes/ofb128.c:

/* The input and output encrypted as though 128bit ofb mode is being
 * used.  The extra state information to record how much of the
 * 128bit block we have used is contained in *num;

It appears you should initialize it to 0 and let openssl 
maintain it thereafter.

A parameter to select encrypt vs decrypt is usually (always?) 
named 'enc', and is not needed for OFB because it (like CTR) 
is the same in both directions. (There's an official word for 
this I can't remember at the moment -- self-inverse maybe?)


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to