finally in sync with archive
[bcm963xx.git] / userapps / opensource / sshd / libtomcrypt / hash.c
diff --git a/userapps/opensource/sshd/libtomcrypt/hash.c b/userapps/opensource/sshd/libtomcrypt/hash.c
deleted file mode 100755 (executable)
index 1d3eb57..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#include "mycrypt.h"
-
-int hash_memory(int hash, const unsigned char *data, unsigned long len, unsigned char *dst, unsigned long *outlen)
-{
-    hash_state md;
-    int err;
-
-    _ARGCHK(data != NULL);
-    _ARGCHK(dst != NULL);
-    _ARGCHK(outlen != NULL);
-
-    if ((err = hash_is_valid(hash)) != CRYPT_OK) {
-        return err;
-    }
-
-    if (*outlen < hash_descriptor[hash].hashsize) {
-       return CRYPT_BUFFER_OVERFLOW;
-    }
-    *outlen = hash_descriptor[hash].hashsize;
-
-    hash_descriptor[hash].init(&md);
-    hash_descriptor[hash].process(&md, data, len);
-    hash_descriptor[hash].done(&md, dst);
-    return CRYPT_OK;
-}
-
-int hash_filehandle(int hash, FILE *in, unsigned char *dst, unsigned long *outlen)
-{
-#ifdef NO_FILE
-    return CRYPT_ERROR;
-#else
-    hash_state md;
-    unsigned char buf[512];
-    size_t x;
-    int err;
-
-    _ARGCHK(dst != NULL);
-    _ARGCHK(outlen != NULL);
-    _ARGCHK(in != NULL);
-
-    if ((err = hash_is_valid(hash)) != CRYPT_OK) {
-        return err;
-    }
-
-    if (*outlen < hash_descriptor[hash].hashsize) {
-       return CRYPT_BUFFER_OVERFLOW;
-    }
-    *outlen = hash_descriptor[hash].hashsize;
-
-    hash_descriptor[hash].init(&md);
-    do {
-        x = fread(buf, 1, sizeof(buf), in);
-        hash_descriptor[hash].process(&md, buf, x);
-    } while (x == sizeof(buf));
-    hash_descriptor[hash].done(&md, dst);
-
-#ifdef CLEAN_STACK
-    zeromem(buf, sizeof(buf));
-#endif
-    return CRYPT_OK;
-#endif
-}
-
-int hash_file(int hash, const char *fname, unsigned char *dst, unsigned long *outlen)
-{
-#ifdef NO_FILE
-    return CRYPT_ERROR;
-#else
-    FILE *in;
-    int err;
-    _ARGCHK(fname != NULL);
-    _ARGCHK(dst != NULL);
-    _ARGCHK(outlen != NULL);
-
-    if ((err = hash_is_valid(hash)) != CRYPT_OK) {
-        return err;
-    }
-
-    in = fopen(fname, "rb");
-    if (in == NULL) { 
-       return CRYPT_INVALID_ARG;
-    }
-
-    if ((err = hash_filehandle(hash, in, dst, outlen)) != CRYPT_OK) {
-       (void)fclose(in);
-       return err;
-    }
-    (void)fclose(in);
-
-    return CRYPT_OK;
-#endif
-}
-