gnunet-android

GNUnet for Android
Log | Files | Refs | README

md4.h (1943B)


      1 /* md4.h
      2  *
      3  * Copyright (C) 2006-2025 wolfSSL Inc.
      4  *
      5  * This file is part of wolfSSL.
      6  *
      7  * wolfSSL is free software; you can redistribute it and/or modify
      8  * it under the terms of the GNU General Public License as published by
      9  * the Free Software Foundation; either version 3 of the License, or
     10  * (at your option) any later version.
     11  *
     12  * wolfSSL is distributed in the hope that it will be useful,
     13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15  * GNU General Public License for more details.
     16  *
     17  * You should have received a copy of the GNU General Public License
     18  * along with this program; if not, write to the Free Software
     19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
     20  */
     21 
     22 /*!
     23     \file wolfssl/wolfcrypt/md4.h
     24 */
     25 
     26 #ifndef WOLF_CRYPT_MD4_H
     27 #define WOLF_CRYPT_MD4_H
     28 
     29 #include <wolfssl/wolfcrypt/types.h>
     30 
     31 #ifndef NO_MD4
     32 
     33 #ifdef __cplusplus
     34     extern "C" {
     35 #endif
     36 
     37 /* in bytes */
     38 enum {
     39     WC_MD4_BLOCK_SIZE  = 64,
     40     WC_MD4_DIGEST_SIZE = 16,
     41     WC_MD4_PAD_SIZE    = 56
     42 };
     43 
     44 /* MD4 digest */
     45 typedef struct wc_Md4 {
     46     word32  buffLen;   /* in bytes          */
     47     word32  loLen;     /* length in bytes   */
     48     word32  hiLen;     /* length in bytes   */
     49     word32  digest[WC_MD4_DIGEST_SIZE / sizeof(word32)];
     50     word32  buffer[WC_MD4_BLOCK_SIZE  / sizeof(word32)];
     51 } wc_Md4;
     52 
     53 WOLFSSL_API void wc_InitMd4(wc_Md4* md4);
     54 WOLFSSL_API void wc_Md4Update(wc_Md4* md4, const byte* data, word32 len);
     55 WOLFSSL_API void wc_Md4Final(wc_Md4* md4, byte* hash);
     56 
     57 #ifndef OPENSSL_COEXIST
     58 
     59 enum {
     60     MD4             = WC_HASH_TYPE_MD4,
     61     MD4_BLOCK_SIZE  = WC_MD4_BLOCK_SIZE,
     62     MD4_DIGEST_SIZE = WC_MD4_DIGEST_SIZE,
     63     MD4_PAD_SIZE    = WC_MD4_PAD_SIZE
     64 };
     65 
     66 typedef struct wc_Md4 Md4;
     67 
     68 #endif /* !OPENSSL_COEXIST */
     69 
     70 
     71 #ifdef __cplusplus
     72     } /* extern "C" */
     73 #endif
     74 
     75 #endif /* NO_MD4 */
     76 #endif /* WOLF_CRYPT_MD4_H */
     77