ripemd.h
Go to the documentation of this file.
1 /* ripemd.h
2  *
3  * Copyright (C) 2006-2020 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 
26 #ifndef WOLF_CRYPT_RIPEMD_H
27 #define WOLF_CRYPT_RIPEMD_H
28 
30 
31 #ifdef WOLFSSL_RIPEMD
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
37 
38 /* in bytes */
39 enum {
40  RIPEMD = 3, /* hash type unique */
41  RIPEMD_BLOCK_SIZE = 64,
42  RIPEMD_DIGEST_SIZE = 20,
43  RIPEMD_PAD_SIZE = 56
44 };
45 
46 
47 /* RipeMd 160 digest */
48 typedef struct RipeMd {
49  word32 buffLen; /* in bytes */
50  word32 loLen; /* length in bytes */
51  word32 hiLen; /* length in bytes */
52  word32 digest[RIPEMD_DIGEST_SIZE / sizeof(word32)];
53  word32 buffer[RIPEMD_BLOCK_SIZE / sizeof(word32)];
54 } RipeMd;
55 
56 
57 WOLFSSL_API int wc_InitRipeMd(RipeMd*);
58 WOLFSSL_API int wc_RipeMdUpdate(RipeMd*, const byte*, word32);
59 WOLFSSL_API int wc_RipeMdFinal(RipeMd*, byte*);
60 
61 
62 #ifdef __cplusplus
63  } /* extern "C" */
64 #endif
65 
66 #endif /* WOLFSSL_RIPEMD */
67 #endif /* WOLF_CRYPT_RIPEMD_H */
WOLFSSL_API int wc_RipeMdFinal(RipeMd *, byte *)
This function copies the computed digest into hash. If there is a partial unhashed block...
Definition: ripemd.c:315
Definition: ripemd.h:48
WOLFSSL_API int wc_RipeMdUpdate(RipeMd *, const byte *, word32)
This function generates the RipeMd digest of the data input and stores the result in the ripemd->dige...
Definition: ripemd.c:282
WOLFSSL_API int wc_InitRipeMd(RipeMd *)
This function initializes a ripemd structure by initializing ripemd’s digest, buffer, loLen and hiLen.
Definition: ripemd.c:42