Ben Laurie wrote:
> 
> [EMAIL PROTECTED] wrote:
> >                 /* read in at offset 8, read the EVP_Cipher
> >                  * documentation about why */
> >   -             i=BIO_read(b->next_bio,&(ctx->buf[8]),ENC_BLOCK_SIZE);
> >   +             i=BIO_read(b->next_bio,&(ctx->buf[BUF_OFFSET]),ENC_BLOCK_SIZE);
> 
> BTW, AFAICS, this is not documented at all - anyone know what its about?
> 

I think this is so it can encrypt the buffer in place rather than have
separate plain text and encrypted buffers. The way EVP works you can't
have the same input and output buffers but because it handles a block at
a time its legal to write the encrypted date one block behind the plain
text. And presumably vice versa for decryption.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to