source: asp3_tinet_ecnl_arm/trunk/wolfssl-3.12.2/wolfssl/wolfcrypt/md5.h@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 3.0 KB
Line 
1/* md5.h
2 *
3 * Copyright (C) 2006-2017 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 2 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#ifndef WOLF_CRYPT_MD5_H
24#define WOLF_CRYPT_MD5_H
25
26#include <wolfssl/wolfcrypt/types.h>
27
28#ifndef NO_MD5
29
30#ifdef HAVE_FIPS
31 #define wc_InitMd5 InitMd5
32 #define wc_Md5Update Md5Update
33 #define wc_Md5Final Md5Final
34 #define wc_Md5Hash Md5Hash
35#endif
36
37#ifdef __cplusplus
38 extern "C" {
39#endif
40
41#ifndef NO_OLD_WC_NAMES
42 #define Md5 wc_Md5
43 #define MD5 WC_MD5
44 #define MD5_BLOCK_SIZE WC_MD5_BLOCK_SIZE
45 #define MD5_DIGEST_SIZE WC_MD5_DIGEST_SIZE
46 #define WC_MD5_PAD_SIZE WC_MD5_PAD_SIZE
47#endif
48
49/* in bytes */
50enum {
51 WC_MD5 = 0, /* hash type unique */
52 WC_MD5_BLOCK_SIZE = 64,
53 WC_MD5_DIGEST_SIZE = 16,
54 WC_MD5_PAD_SIZE = 56
55};
56
57#ifdef WOLFSSL_MICROCHIP_PIC32MZ
58 #include <wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h>
59#endif
60#ifdef WOLFSSL_ASYNC_CRYPT
61 #include <wolfssl/wolfcrypt/async.h>
62#endif
63
64#ifdef WOLFSSL_TI_HASH
65 #include "wolfssl/wolfcrypt/port/ti/ti-hash.h"
66#else
67
68/* MD5 digest */
69typedef struct wc_Md5 {
70 word32 buffLen; /* in bytes */
71 word32 loLen; /* length in bytes */
72 word32 hiLen; /* length in bytes */
73 word32 buffer[WC_MD5_BLOCK_SIZE / sizeof(word32)];
74#ifdef WOLFSSL_PIC32MZ_HASH
75 word32 digest[PIC32_DIGEST_SIZE / sizeof(word32)];
76#else
77 word32 digest[WC_MD5_DIGEST_SIZE / sizeof(word32)];
78#endif
79 void* heap;
80#ifdef WOLFSSL_PIC32MZ_HASH
81 hashUpdCache cache; /* cache for updates */
82#endif
83#if defined(STM32_HASH) && defined(WOLFSSL_STM32_CUBEMX)
84 HASH_HandleTypeDef hashHandle;
85#endif
86#ifdef WOLFSSL_ASYNC_CRYPT
87 WC_ASYNC_DEV asyncDev;
88#endif /* WOLFSSL_ASYNC_CRYPT */
89} wc_Md5;
90
91#endif /* WOLFSSL_TI_HASH */
92
93WOLFSSL_API int wc_InitMd5(wc_Md5*);
94WOLFSSL_API int wc_InitMd5_ex(wc_Md5*, void*, int);
95WOLFSSL_API int wc_Md5Update(wc_Md5*, const byte*, word32);
96WOLFSSL_API int wc_Md5Final(wc_Md5*, byte*);
97WOLFSSL_API void wc_Md5Free(wc_Md5*);
98
99WOLFSSL_API int wc_Md5GetHash(wc_Md5*, byte*);
100WOLFSSL_API int wc_Md5Copy(wc_Md5*, wc_Md5*);
101
102#ifdef WOLFSSL_PIC32MZ_HASH
103WOLFSSL_API void wc_Md5SizeSet(wc_Md5* md5, word32 len);
104#endif
105
106#ifdef __cplusplus
107 } /* extern "C" */
108#endif
109
110#endif /* NO_MD5 */
111#endif /* WOLF_CRYPT_MD5_H */
Note: See TracBrowser for help on using the repository browser.