1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-27 01:48:17 +00:00
trezor-firmware/crypto/ripemd160.h

25 lines
615 B
C
Raw Normal View History

#ifndef __RIPEMD160_H__
#define __RIPEMD160_H__
2013-09-15 23:32:56 +00:00
#include <stdint.h>
#include <stddef.h>
#define RIPEMD160_BLOCK_LENGTH 64
#define RIPEMD160_DIGEST_LENGTH 20
2013-09-15 23:32:56 +00:00
typedef struct {
uint64_t length;
union {
uint32_t w[16];
uint8_t b[64];
} buf;
uint32_t h[5];
uint8_t bufpos;
} ripemd160_state;
void ripemd160_init(ripemd160_state * self);
void ripemd160_process(ripemd160_state * self, const uint8_t *in, size_t length);
void ripemd160_done(ripemd160_state * self, uint8_t out[RIPEMD160_DIGEST_LENGTH]);
void ripemd160(const uint8_t *in, size_t length, uint8_t out[RIPEMD160_DIGEST_LENGTH]);
2013-09-15 23:32:56 +00:00
#endif