what is gcry_md_reset()'s relationship with HMAC?

View: New views
2 Messages — Rating Filter:   Alert me  

what is gcry_md_reset()'s relationship with HMAC?

by Daniel Kahn Gillmor-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hey folks--

from reading the gcrypt source, it looks to me like gcry_md_reset() does
actually re-initializes the digest with the first part of the macpads
structure, but it doesn't wipe the pads out.

But the documentation for gcry_md_reset() doesn't mention setkey() at
all -- it implies that it's the same as a close() followed by an open(),
which would actually result in the wiping of the macpads themselves.
(i.e. another gcry_md_setkey() would need to be invoked).

Any explanation of this?  Can the documentation be updated to be clearer?

(i'm afraid i don't understand the md_write() of the inner padding for
HMAC-enabled MDs at all, but that's probably because i don't correctly
understand the HMAC context itself yet -- pointers welcome!)

Regards,

        --dkg



_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@...
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

signature.asc (909 bytes) Download Attachment

Re: what is gcry_md_reset()'s relationship with HMAC?

by Daniel Kahn Gillmor-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 11/05/2009 11:31 PM, Daniel Kahn Gillmor wrote:
> from reading the gcrypt source, it looks to me like gcry_md_reset() does
> actually re-initializes the digest with the first part of the macpads
> structure, but it doesn't wipe the pads out.
>
> But the documentation for gcry_md_reset() doesn't mention setkey() at
> all -- it implies that it's the same as a close() followed by an open(),
> which would actually result in the wiping of the macpads themselves.
> (i.e. another gcry_md_setkey() would need to be invoked).

after some tests, it seems clear that gcry_md_reset() does not reset the
HMAC keys.  I think this is the Right Thing to do, but the documentation
does not appear to describe this properly -- it seems to be different
from a close() followed by an open().

maybe the docs should be updated?

        --dkg



_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@...
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel

signature.asc (909 bytes) Download Attachment