Hello!

I have a question about EVP_sha1 engine and 
the allocation size for md_data in the 
corresponding EVP_MD_CTX structure.

EVP_sha1 is defined in crypto/evp/m_sha1.c by 
the structure

static const EVP_MD sha1_md=
        {
        NID_sha1,
        NID_sha1WithRSAEncryption,
        SHA_DIGEST_LENGTH,
        0,
        init,
        update,
        final,
        NULL,
        NULL,
        EVP_PKEY_RSA_method,
        SHA_CBLOCK,
        sizeof(EVP_MD *)+sizeof(SHA_CTX),
        };

The last element of the structure is the allocation size needed
for md_data in a EVP_MD_CTX structure.

My question is: why do we need to allocate with
size  "sizeof(EVP_MD *)+sizeof(SHA_CTX)" ? 
(why not only with size "sizeof(SHA_CTX)" ? )

The real question is: if we realy need to allocate for  EVP_MD *,
where is it used?

Thanks!




______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to