29#ifdef LIBOPENCM3_HASH_H
31#ifndef LIBOPENCM3_HASH_COMMON_F24_H
32#define LIBOPENCM3_HASH_COMMON_F24_H
41#define HASH_BASE (PERIPH_BASE_AHB2 + 0x60400)
48#define HASH_CR MMIO32(HASH + 0x00)
51#define HASH_DIN MMIO32(HASH + 0x04)
54#define HASH_STR MMIO32(HASH + 0x08)
57#define HASH_HR (&MMIO32(HASH + 0x0C))
60#define HASH_IMR MMIO32(HASH + 0x20)
63#define HASH_SR MMIO32(HASH + 0x28)
66#define HASH_CSR (&MMIO32(HASH + 0xF8))
71#define HASH_CR_INIT (1 << 2)
74#define HASH_CR_DMAE (1 << 3)
82#define HASH_DATA_32BIT (0 << 4)
83#define HASH_DATA_16BIT (1 << 4)
84#define HASH_DATA_8BIT (2 << 4)
85#define HASH_DATA_BITSTRING (3 << 4)
87#define HASH_CR_DATATYPE (3 << 4)
95#define HASH_MODE_HASH (0 << 6)
96#define HASH_MODE_HMAC (1 << 6)
98#define HASH_CR_MODE (1 << 6)
106#define HASH_ALGO_SHA1 (0 << 7)
107#define HASH_ALGO_MD5 (1 << 7)
109#define HASH_CR_ALGO (1 << 7)
112#define HASH_CR_NBW (15 << 8)
115#define HASH_CR_DINNE (1 << 12)
123#define HASH_KEY_SHORT (0 << 16)
124#define HASH_KEY_LONG (1 << 16)
126#define HASH_CR_LKEY (1 << 16)
132#define HASH_STR_NBW (31 << 0)
135#define HASH_STR_DCAL (1 << 8)
140#define HASH_IMR_DINIE (1 << 0)
143#define HASH_IMR_DCIE (1 << 1)
148#define HASH_SR_DINIS (1 << 0)
151#define HASH_SR_DCIS (1 << 1)
154#define HASH_SR_DMAS (1 << 2)
157#define HASH_SR_BUSY (1 << 3)
178#warning "hash_common_f24.h should not be included explicitly, only via hash.h"
void hash_set_mode(uint8_t mode)
HASH Set Mode.
void hash_set_algorithm(uint8_t algorithm)
HASH Set Algorithm.
void hash_add_data(uint32_t data)
HASH Add data.
void hash_set_last_word_valid_bits(uint8_t validbits)
HASH Set Last Word Valid Bits.
void hash_init(void)
HASH Init.
void hash_get_result(uint32_t *data)
HASH Get Hash Result.
void hash_set_key_length(uint8_t keylength)
HASH Set Key Length.
void hash_set_data_type(uint8_t datatype)
HASH Set Data Type.
void hash_digest(void)
HASH Digest.