97#ifdef LIBOPENCM3_CRYPTO_H
100#ifndef LIBOPENCM3_CRYPTO_COMMON_F24_H
101#define LIBOPENCM3_CRYPTO_COMMON_F24_H
114#define CRYP CRYP_BASE
117#define CRYP_CR MMIO32(CRYP_BASE + 0x00)
120#define CRYP_SR MMIO32(CRYP_BASE + 0x04)
123#define CRYP_DIN MMIO32(CRYP_BASE + 0x08)
126#define CRYP_DOUT MMIO32(CRYP_BASE + 0x0C)
129#define CRYP_DMACR MMIO32(CRYP_BASE + 0x10)
132#define CRYP_IMSCR MMIO32(CRYP_BASE + 0x14)
135#define CRYP_RISR MMIO32(CRYP_BASE + 0x18)
138#define CRYP_MISR MMIO32(CRYP_BASE + 0x1C)
141#define CRYP_KR(i) MMIO64(CRYP_BASE + 0x20 + (i) * 8)
144#define CRYP_IVR(i) MMIO32(CRYP_BASE + 0x40 + (i) * 8)
149#define CRYP_CR_ALGODIR (1 << 2)
152#define CRYP_CR_ALGOMODE_SHIFT 3
153#define CRYP_CR_ALGOMODE (7 << CRYP_CR_ALGOMODE_SHIFT)
154#define CRYP_CR_ALGOMODE_TDES_ECB (0 << CRYP_CR_ALGOMODE_SHIFT)
155#define CRYP_CR_ALGOMODE_TDES_CBC (1 << CRYP_CR_ALGOMODE_SHIFT)
156#define CRYP_CR_ALGOMODE_DES_ECB (2 << CRYP_CR_ALGOMODE_SHIFT)
157#define CRYP_CR_ALGOMODE_DES_CBC (3 << CRYP_CR_ALGOMODE_SHIFT)
158#define CRYP_CR_ALGOMODE_AES_ECB (4 << CRYP_CR_ALGOMODE_SHIFT)
159#define CRYP_CR_ALGOMODE_AES_CBC (5 << CRYP_CR_ALGOMODE_SHIFT)
160#define CRYP_CR_ALGOMODE_AES_CTR (6 << CRYP_CR_ALGOMODE_SHIFT)
161#define CRYP_CR_ALGOMODE_AES_PREP (7 << CRYP_CR_ALGOMODE_SHIFT)
164#define CRYP_CR_DATATYPE_SHIFT 6
165#define CRYP_CR_DATATYPE (3 << CRYP_CR_DATATYPE_SHIFT)
166#define CRYP_CR_DATATYPE_32 (0 << CRYP_CR_DATATYPE_SHIFT)
167#define CRYP_CR_DATATYPE_16 (1 << CRYP_CR_DATATYPE_SHIFT)
168#define CRYP_CR_DATATYPE_8 (2 << CRYP_CR_DATATYPE_SHIFT)
169#define CRYP_CR_DATATYPE_BIT (3 << CRYP_CR_DATATYPE_SHIFT)
172#define CRYP_CR_KEYSIZE_SHIFT 8
173#define CRYP_CR_KEYSIZE (3 << CRYP_CR_KEYSIZE_SHIFT)
174#define CRYP_CR_KEYSIZE_128 (0 << CRYP_CR_KEYSIZE_SHIFT)
175#define CRYP_CR_KEYSIZE_192 (1 << CRYP_CR_KEYSIZE_SHIFT)
176#define CRYP_CR_KEYSIZE_256 (2 << CRYP_CR_KEYSIZE_SHIFT)
179#define CRYP_CR_FFLUSH (1 << 14)
182#define CRYP_CR_CRYPEN (1 << 15)
187#define CRYP_SR_IFEM (1 << 0)
190#define CRYP_SR_IFNF (1 << 1)
193#define CRYP_SR_OFNE (1 << 2)
196#define CRYP_SR_OFFU (1 << 3)
199#define CRYP_SR_BUSY (1 << 4)
204#define CRYP_DMACR_DIEN (1 << 0)
207#define CRYP_DMACR_DOEN (1 << 1)
212#define CRYP_IMSCR_INIM (1 << 0)
215#define CRYP_IMSCR_OUTIM (1 << 1)
220#define CRYP_RISR_INRIS (1 << 0)
223#define CRYP_RISR_OUTRIS (1 << 0)
228#define CRYP_MISR_INMIS (1 << 0)
231#define CRYP_MISR_OUTMIS (1 << 0)
287#warning "crypto_common_f24.h should not be included explicitly, "
void crypto_set_algorithm(enum crypto_mode mode)
Set the algorithm for Encryption/decryption.
void crypto_set_iv(uint64_t iv[])
Set Initialization Vector.
void crypto_start(void)
Enable the cryptographic controller and start processing.
uint32_t crypto_process_block(uint32_t *inp, uint32_t *outp, uint32_t length)
Start of encryption or decryption on data buffers.
void crypto_set_key(enum crypto_keysize keysize, uint64_t key[])
Set key value to the controller.
void crypto_stop(void)
Disable the cryptographic controller and stop processing.
void crypto_set_datatype(enum crypto_datatype datatype)
Set the order of the data to be crypted.
void crypto_wait_busy(void)
Wait, if the Controller is busy.
#define CRYP_CR_ALGOMODE_AES_CTR
#define CRYP_CR_ALGOMODE_DES_ECB
#define CRYP_CR_ALGOMODE_DES_CBC
#define CRYP_CR_ALGOMODE_AES_CBC
#define CRYP_CR_ALGOMODE_AES_ECB
#define CRYP_CR_ALGOMODE_TDES_CBC
#define CRYP_CR_ALGOMODE_TDES_ECB