Chromium Code Reviews| Index: base/md5.cc |
| diff --git a/base/md5.cc b/base/md5.cc |
| index 754994c0e562b45b2bc4b90cc2a7c612d14ec5a7..c3299c2ae109f773eab344cfa0ebcd26ae11fdc5 100644 |
| --- a/base/md5.cc |
| +++ b/base/md5.cc |
| @@ -260,6 +260,15 @@ void MD5Final(MD5Digest* digest, MD5Context* context) { |
| memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ |
| } |
| +/* |
| + * Clone the context and use the clone to generate the digest. |
|
awong
2014/03/31 20:22:19
This should be an impl comment, not a function com
Scott Hess - ex-Googler
2014/03/31 20:48:26
I'll try, but the commenting style is breaking my
awong
2014/03/31 21:04:32
I think it's critical to understand the MD5Final m
Scott Hess - ex-Googler
2014/03/31 21:29:59
Done.
|
| + */ |
| +void MD5IntermediateFinal(MD5Digest* digest, const MD5Context* context) { |
| + MD5Context context_copy; |
| + memcpy(&context_copy, context, sizeof(context_copy)); |
| + MD5Final(digest, &context_copy); |
| +} |
| + |
| std::string MD5DigestToBase16(const MD5Digest& digest) { |
| static char const zEncode[] = "0123456789abcdef"; |