how should I handle the EVP_[En/De]cryptFinal functions? Should I not be
> implementing them in my engine? Or am I missing something here
>
The do_cipher function is normally the low level block cipher function: it
gets handed a multiple of the block size to encrypt/decrypt. The higher level
Hi there,
I'm building a dynamic engine to support a custom AES hardware module that I've
implemented in FPGA logic**, but after reading all available documentation, and
pouring over the source code, I'm still very confused about the following two
things.
1. How and where I should
The doc says that EVP_EncryptUpdate's outl should contain inl +
cipher_block_size - 1 bytes, but the output buffer is called out, not outl.
Patch is attached to this email and also viewable on github:
https://github.com/openssl/openssl/pull/195
Alok
Many thanks. Patch applied:
https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=5211e094dec9486a540ac480f345df1a8d2b2862
Matt
__
OpenSSL Project http://www.openssl.org
Development Mailing
: Jussi Peltonen
Oggetto: Re: Problem with EVP_EncryptUpdate/EVP_DecryptUpdate
Someone else might have a better answer, but I suspect your problem is that
your calling Final after every Update, and/or the block size is wrong.
I haven't worked with BF, but at least with AES, the modes dictates
.
-Messaggio originale-
Da: owner-openssl-...@openssl.org [mailto:owner-openssl-...@openssl.org] Per
conto di Ladar Levison
Inviato: mercoledì 30 novembre 2011 08:33
A: openssl-dev@openssl.org
Cc: Jussi Peltonen
Oggetto: Re: Problem with EVP_EncryptUpdate/EVP_DecryptUpdate
Someone else
);
EVP_EncryptInit (ctx, EVP_bf_cbc (), key, iv);
left = size;
*outsz = 0;
while (left 0)
{
n = (left IP_SIZE ? IP_SIZE : left);
olen = 0;
if (EVP_EncryptUpdate (ctx, outp, olen, inp, n) != 1
);
EVP_CIPHER_CTX_init (ctx);
EVP_EncryptInit (ctx, EVP_bf_cbc (), key, iv);
left = size;
*outsz = 0;
while (left 0)
{
n = (left IP_SIZE ? IP_SIZE : left);
olen = 0;
if (EVP_EncryptUpdate (ctx, outp,olen, inp, n) != 1
oc( strlen(data) + 2*EVP_CIPHER_CTX_block_size(ectx));
/* Encrypt from data to out */
/* Length of the data is 36 */
EVP_EncryptUpdate( ectx, out, outl, data, strlen(data));
toutl = outl; /* Now outl is 32 */
EVP_EncryptFinal( ectx, out, outl);
to
of the data is 36 */
EVP_EncryptUpdate( ectx, out, outl, data, strlen(data));
After this call 'outl' bytes of encrypted data have been written to
'out' thereform you *must* update the pointer passed to
EVP_EncrytpFinal() so it doesn't overwrite the data:
toutl = outl; /* Now outl
10 matches
Mail list logo