1*4724848cSchristos /* 2*4724848cSchristos * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3*4724848cSchristos * 4*4724848cSchristos * Licensed under the OpenSSL license (the "License"). You may not use 5*4724848cSchristos * this file except in compliance with the License. You can obtain a copy 6*4724848cSchristos * in the file LICENSE in the source distribution or at 7*4724848cSchristos * https://www.openssl.org/source/license.html 8*4724848cSchristos */ 9*4724848cSchristos 10*4724848cSchristos #ifndef HEADER_MDC2_H 11*4724848cSchristos # define HEADER_MDC2_H 12*4724848cSchristos 13*4724848cSchristos # include <openssl/opensslconf.h> 14*4724848cSchristos 15*4724848cSchristos #ifndef OPENSSL_NO_MDC2 16*4724848cSchristos # include <stdlib.h> 17*4724848cSchristos # include <openssl/des.h> 18*4724848cSchristos # ifdef __cplusplus 19*4724848cSchristos extern "C" { 20*4724848cSchristos # endif 21*4724848cSchristos 22*4724848cSchristos # define MDC2_BLOCK 8 23*4724848cSchristos # define MDC2_DIGEST_LENGTH 16 24*4724848cSchristos 25*4724848cSchristos typedef struct mdc2_ctx_st { 26*4724848cSchristos unsigned int num; 27*4724848cSchristos unsigned char data[MDC2_BLOCK]; 28*4724848cSchristos DES_cblock h, hh; 29*4724848cSchristos int pad_type; /* either 1 or 2, default 1 */ 30*4724848cSchristos } MDC2_CTX; 31*4724848cSchristos 32*4724848cSchristos int MDC2_Init(MDC2_CTX *c); 33*4724848cSchristos int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 34*4724848cSchristos int MDC2_Final(unsigned char *md, MDC2_CTX *c); 35*4724848cSchristos unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md); 36*4724848cSchristos 37*4724848cSchristos # ifdef __cplusplus 38*4724848cSchristos } 39*4724848cSchristos # endif 40*4724848cSchristos # endif 41*4724848cSchristos 42*4724848cSchristos #endif 43