On Tue, Nov 06, 2012, Andy Polyakov wrote:

> >Can the same pointer safely be used for the input and output buffers in
> >encrypt and decrypt operations ?
> >i.e. is something like AES_encrypt(out,out,key) guaranteed not to rewrite
> >the input before it's been processed ?
> >
> >The following IMPLIES this is safe but lingering doubts remain.
> >
> >...
> >
> >Note: I'm interested in the general case. AES was just used as an example
> >of the type of operation and it's the example I found which implied this
> >works.
> >
> >Alternatively do any test cases exist that'd fail if someone provided asm
> >which broke this behaviour ?.
> >
> >Checking the source code only goes so far, it'd be really hard to verify
> >all the asm modules.
> 
> The least I can say is that I always consider inp==out as valid case.
> 

So do I. There are some places in the SSL/TLS code that require encryption
in place i.e. inp==out.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to