diff options
author | Paul Traina <pst@FreeBSD.org> | 1997-02-07 03:44:44 +0000 |
---|---|---|
committer | Paul Traina <pst@FreeBSD.org> | 1997-02-07 03:44:44 +0000 |
commit | 049c277a7b457bbea474173cbe9e5fe508c6e36e (patch) | |
tree | 4a01c0d95dd1199dee05d0da073b3565c93433ba /contrib/opie | |
parent | c7006192c952e14dc8f80c3c2ab97271bd1bb1aa (diff) | |
download | src-test2-049c277a7b457bbea474173cbe9e5fe508c6e36e.tar.gz src-test2-049c277a7b457bbea474173cbe9e5fe508c6e36e.zip |
Notes
Diffstat (limited to 'contrib/opie')
-rw-r--r-- | contrib/opie/libopie/hash.c | 24 | ||||
-rw-r--r-- | contrib/opie/libopie/hashlen.c | 24 |
2 files changed, 30 insertions, 18 deletions
diff --git a/contrib/opie/libopie/hash.c b/contrib/opie/libopie/hash.c index 4029fa9313e9..0f1e4979a832 100644 --- a/contrib/opie/libopie/hash.c +++ b/contrib/opie/libopie/hash.c @@ -14,7 +14,9 @@ you didn't get a copy, you may request one from <license@inner.net>. #include "opie_cfg.h" #include "opie.h" -static struct opiemdx_ctx mdx; +#include <md4.h> +#include <md5.h> + static UINT4 mdx_tmp[4]; #if 0 static SHA_INFO sha; @@ -34,19 +36,23 @@ VOIDRET opiehash FUNCTION((x, algorithm), VOIDPTR x AND unsigned algorithm) results[1] = sha.digest[1] ^ sha.digest[3] ^ sha.digest[5]; break; #endif /* 0 */ - case 4: - opiemd4init(&mdx); - opiemd4update(&mdx, (unsigned char *)x, 8); - opiemd4final((unsigned char *)mdx_tmp, &mdx); + case 4: { + MD4_CTX mdx; + MD4Init(&mdx); + MD4Update(&mdx, (unsigned char *)x, 8); + MD4Final((unsigned char *)mdx_tmp, &mdx); results[0] = mdx_tmp[0] ^ mdx_tmp[2]; results[1] = mdx_tmp[1] ^ mdx_tmp[3]; break; - case 5: - opiemd5init(&mdx); - opiemd5update(&mdx, (unsigned char *)x, 8); - opiemd5final((unsigned char *)mdx_tmp, &mdx); + } + case 5: { + MD5_CTX mdx; + MD5Init(&mdx); + MD5Update(&mdx, (unsigned char *)x, 8); + MD5Final((unsigned char *)mdx_tmp, &mdx); results[0] = mdx_tmp[0] ^ mdx_tmp[2]; results[1] = mdx_tmp[1] ^ mdx_tmp[3]; break; + } } } diff --git a/contrib/opie/libopie/hashlen.c b/contrib/opie/libopie/hashlen.c index 110eef4038b3..7205004a1101 100644 --- a/contrib/opie/libopie/hashlen.c +++ b/contrib/opie/libopie/hashlen.c @@ -14,10 +14,12 @@ you didn't get a copy, you may request one from <license@inner.net>. #include "opie_cfg.h" #include "opie.h" +#include <md4.h> +#include <md5.h> + VOIDRET opiehashlen FUNCTION((algorithm, in, out, n), int algorithm AND VOIDPTR in AND VOIDPTR out AND int n) { UINT4 *results = (UINT4 *)out; - struct opiemdx_ctx mdx; UINT4 mdx_tmp[4]; #if 0 SHA_INFO sha; @@ -33,19 +35,23 @@ VOIDRET opiehashlen FUNCTION((algorithm, in, out, n), int algorithm AND VOIDPTR results[1] = sha.digest[1] ^ sha.digest[3] ^ sha.digest[5]; break; #endif /* 0 */ - case 4: - opiemd4init(&mdx); - opiemd4update(&mdx, (unsigned char *)in, n); - opiemd4final((unsigned char *)mdx_tmp, &mdx); + case 4: { + MD4_CTX mdx; + MD4Init(&mdx); + MD4Update(&mdx, (unsigned char *)in, n); + MD4Final((unsigned char *)mdx_tmp, &mdx); results[0] = mdx_tmp[0] ^ mdx_tmp[2]; results[1] = mdx_tmp[1] ^ mdx_tmp[3]; break; - case 5: - opiemd5init(&mdx); - opiemd5update(&mdx, (unsigned char *)in, n); - opiemd5final((unsigned char *)mdx_tmp, &mdx); + } + case 5: { + MD5_CTX mdx; + MD5Init(&mdx); + MD5Update(&mdx, (unsigned char *)in, n); + MD5Final((unsigned char *)mdx_tmp, &mdx); results[0] = mdx_tmp[0] ^ mdx_tmp[2]; results[1] = mdx_tmp[1] ^ mdx_tmp[3]; break; + } } } |