Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:16

0001 /* ripemd160.h
0002 
0003    RIPEMD-160 hash function.
0004 
0005    Copyright (C) 2011 Andres Mejia
0006 
0007    This file is part of GNU Nettle.
0008 
0009    GNU Nettle is free software: you can redistribute it and/or
0010    modify it under the terms of either:
0011 
0012      * the GNU Lesser General Public License as published by the Free
0013        Software Foundation; either version 3 of the License, or (at your
0014        option) any later version.
0015 
0016    or
0017 
0018      * the GNU General Public License as published by the Free
0019        Software Foundation; either version 2 of the License, or (at your
0020        option) any later version.
0021 
0022    or both in parallel, as here.
0023 
0024    GNU Nettle is distributed in the hope that it will be useful,
0025    but WITHOUT ANY WARRANTY; without even the implied warranty of
0026    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0027    General Public License for more details.
0028 
0029    You should have received copies of the GNU General Public License and
0030    the GNU Lesser General Public License along with this program.  If
0031    not, see http://www.gnu.org/licenses/.
0032 */
0033 
0034 #ifndef NETTLE_RIPEMD160_H_INCLUDED
0035 #define NETTLE_RIPEMD160_H_INCLUDED
0036 
0037 #ifdef __cplusplus
0038 extern "C" {
0039 #endif
0040 
0041 #include "nettle-types.h"
0042 
0043 /* Name mangling */
0044 #define ripemd160_init nettle_ripemd160_init
0045 #define ripemd160_update nettle_ripemd160_update
0046 #define ripemd160_digest nettle_ripemd160_digest
0047 
0048 /* RIPEMD160 */
0049 
0050 #define RIPEMD160_DIGEST_SIZE 20
0051 #define RIPEMD160_BLOCK_SIZE 64
0052 /* For backwards compatibility */
0053 #define RIPEMD160_DATA_SIZE RIPEMD160_BLOCK_SIZE
0054 
0055 /* Digest is kept internally as 5 32-bit words. */
0056 #define _RIPEMD160_DIGEST_LENGTH 5
0057 
0058 struct ripemd160_ctx
0059 {
0060   uint32_t state[_RIPEMD160_DIGEST_LENGTH];
0061   uint64_t count;         /* 64-bit block count */
0062   unsigned int index;
0063   uint8_t block[RIPEMD160_BLOCK_SIZE];
0064 };
0065 
0066 void
0067 ripemd160_init(struct ripemd160_ctx *ctx);
0068 
0069 void
0070 ripemd160_update(struct ripemd160_ctx *ctx,
0071          size_t length,
0072          const uint8_t *data);
0073 
0074 void
0075 ripemd160_digest(struct ripemd160_ctx *ctx,
0076          size_t length,
0077          uint8_t *digest);
0078 
0079 #ifdef __cplusplus
0080 }
0081 #endif
0082 
0083 #endif /* NETTLE_RIPEMD160_H_INCLUDED */