hmac-streebog-meta.c hmac-sm3-meta.c \
knuth-lfib.c hkdf.c \
md2.c md2-meta.c md4.c md4-meta.c \
- md5.c md5-compat.c md5-meta.c \
+ md5.c md5-meta.c \
memeql-sec.c memxor.c memxor3.c \
nettle-lookup-hash.c \
nettle-meta-aeads.c nettle-meta-armors.c \
knuth-lfib.h hkdf.h \
macros.h \
cmac.h siv-cmac.h siv-gcm.h \
- md2.h md4.h \
- md5.h md5-compat.h \
+ md2.h md4.h md5.h \
memops.h memxor.h \
nettle-meta.h nettle-types.h \
ocb.h pbkdf2.h \
+++ /dev/null
-/* md5-compat.c
-
- The md5 hash function, RFC 1321-style interface.
-
- Copyright (C) 2001 Niels Möller
-
- This file is part of GNU Nettle.
-
- GNU Nettle is free software: you can redistribute it and/or
- modify it under the terms of either:
-
- * the GNU Lesser General Public License as published by the Free
- Software Foundation; either version 3 of the License, or (at your
- option) any later version.
-
- or
-
- * the GNU General Public License as published by the Free
- Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- or both in parallel, as here.
-
- GNU Nettle is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received copies of the GNU General Public License and
- the GNU Lesser General Public License along with this program. If
- not, see http://www.gnu.org/licenses/.
-*/
-
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "md5-compat.h"
-
-void
-MD5Init(MD5_CTX *ctx)
-{
- md5_init(ctx);
-}
-
-void
-MD5Update(MD5_CTX *ctx, const unsigned char *data, unsigned int length)
-{
- md5_update(ctx, length, data);
-}
-
-void
-MD5Final(unsigned char *out, MD5_CTX *ctx)
-{
- md5_digest(ctx, MD5_DIGEST_SIZE, out);
-}
+++ /dev/null
-/* md5-compat.h
-
- The md5 hash function, RFC 1321-style interface.
-
- Copyright (C) 2001 Niels Möller
-
- This file is part of GNU Nettle.
-
- GNU Nettle is free software: you can redistribute it and/or
- modify it under the terms of either:
-
- * the GNU Lesser General Public License as published by the Free
- Software Foundation; either version 3 of the License, or (at your
- option) any later version.
-
- or
-
- * the GNU General Public License as published by the Free
- Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- or both in parallel, as here.
-
- GNU Nettle is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received copies of the GNU General Public License and
- the GNU Lesser General Public License along with this program. If
- not, see http://www.gnu.org/licenses/.
-*/
-
-#ifndef NETTLE_MD5_COMPAT_H_INCLUDED
-#define NETTLE_MD5_COMPAT_H_INCLUDED
-
-#include "md5.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Name mangling */
-#define MD5Init nettle_MD5Init
-#define MD5Update nettle_MD5Update
-#define MD5Final nettle_MD5Final
-
-typedef struct md5_ctx MD5_CTX;
-
-void MD5Init(MD5_CTX *ctx);
-void MD5Update(MD5_CTX *ctx, const unsigned char *data, unsigned int length);
-void MD5Final(unsigned char *out, MD5_CTX *ctx);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* NETTLE_MD5_COMPAT_H_INCLUDED */
* Randomness::
* ASCII encoding::
* Miscellaneous functions::
-* Compatibility functions::
Hash functions
* Randomness::
* ASCII encoding::
* Miscellaneous functions::
-* Compatibility functions::
@end menu
@node Hash functions
compatibility with earlier versions of Nettle, @code{memxor} and
@code{memxor3} are also declared in @file{<nettle/memxor.h>}.
-@node Compatibility functions
-@section Compatibility functions
-
-For convenience, Nettle includes alternative interfaces to some
-algorithms, for compatibility with some other popular crypto toolkits.
-These are not fully documented here; refer to the source or to the
-documentation for the original implementation.
-
-MD5 is defined in [RFC 1321], which includes a reference implementation.
-Nettle defines a compatible interface to MD5 in
-@file{<nettle/md5-compat.h>}. This file defines the typedef
-@code{MD5_CTX}, and declares the functions @code{MD5Init}, @code{MD5Update} and
-@code{MD5Final}.
-
@node Nettle soup
@chapter Traditional Nettle Soup
For the serious nettle hacker, here is a recipe for nettle soup. 4 servings.
camellia-test.c chacha-test.c \
cnd-memcpy-test.c \
des-test.c des3-test.c \
- md2-test.c md4-test.c md5-test.c md5-compat-test.c \
+ md2-test.c md4-test.c md5-test.c \
memeql-test.c memxor-test.c gosthash94-test.c \
ripemd160-test.c hkdf-test.c \
salsa20-test.c \
+++ /dev/null
-#include "testutils.h"
-#include "md5-compat.h"
-
-void
-test_main(void)
-{
- MD5_CTX ctx;
- unsigned char digest[MD5_DIGEST_SIZE];
-
- MD5Init(&ctx);
- MD5Final(digest, &ctx);
- ASSERT(MEMEQ(MD5_DIGEST_SIZE, digest,
- H("D41D8CD98F00B204 E9800998ECF8427E")));
-
- MD5Init(&ctx);
- MD5Update(&ctx, US("a"), 1);
- MD5Final(digest, &ctx);
- ASSERT(MEMEQ(MD5_DIGEST_SIZE, digest,
- H("0CC175B9C0F1B6A8 31C399E269772661")));
-
- MD5Init(&ctx);
- MD5Update(&ctx, US("abc"), 3);
- MD5Final(digest, &ctx);
- ASSERT(MEMEQ(MD5_DIGEST_SIZE, digest,
- H("900150983cd24fb0 D6963F7D28E17F72")));
-
- MD5Init(&ctx);
- MD5Update(&ctx, US("message digest"), 14);
- MD5Final(digest, &ctx);
- ASSERT(MEMEQ(MD5_DIGEST_SIZE, digest,
- H("F96B697D7CB7938D 525A2F31AAF161D0")));
-
- MD5Init(&ctx);
- MD5Update(&ctx, US("abcdefghijklmnopqrstuvwxyz"), 26);
- MD5Final(digest, &ctx);
- ASSERT(MEMEQ(MD5_DIGEST_SIZE, digest,
- H("C3FCD3D76192E400 7DFB496CCA67E13B")));
-
- MD5Init(&ctx);
- MD5Update(&ctx, US("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"), 62);
- MD5Final(digest, &ctx);
- ASSERT(MEMEQ(MD5_DIGEST_SIZE, digest,
- H("D174AB98D277D9F5 A5611C2C9F419D9F")));
-
- MD5Init(&ctx);
- MD5Update(&ctx, US("1234567890123456789012345678901234567890"
- "1234567890123456789012345678901234567890"),
- 80);
- MD5Final(digest, &ctx);
- ASSERT(MEMEQ(MD5_DIGEST_SIZE, digest,
- H("57EDF4A22BE3C955 AC49DA2E2107B67A")));
-}