sha/asm/sha1-armv4-large.pl: add NEON and ARMv8 code paths.
[oweals/openssl.git] / crypto / mdc2 / mdc2_one.c
index 0cfc9c6698ce206b17d618e1dd07596c556ada64..72647f67ede4ee05b5b11d261b22587f7ad296e7 100644 (file)
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "mdc2.h"
+#include <openssl/mdc2.h>
 
-unsigned char *MDC2(unsigned char *d, unsigned long n, unsigned char *md)
+unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md)
        {
        MDC2_CTX c;
        static unsigned char m[MDC2_DIGEST_LENGTH];
 
        if (md == NULL) md=m;
-       MDC2_Init(&c);
+       if (!MDC2_Init(&c))
+               return NULL;
        MDC2_Update(&c,d,n);
         MDC2_Final(md,&c);
-       memset(&c,0,sizeof(c)); /* security consideration */
+       OPENSSL_cleanse(&c,sizeof(c)); /* security consideration */
        return(md);
        }