1 /* 2 * Copyright (c) 2016 Nordic Semiconductor ASA 3 * Copyright (c) 2016 Vinayak Kariappa Chettimada 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 typedef void (*ecb_fp) (uint32_t status, uint8_t *cipher_be, void *context); 9 10 struct ecb { 11 uint8_t in_key_be[16]; 12 uint8_t in_clear_text_be[16]; 13 uint8_t out_cipher_text_be[16]; 14 /* if not null reverse copy into in_key_be */ 15 uint8_t *in_key_le; 16 /* if not null reverse copy into in_clear_text_be */ 17 uint8_t *in_clear_text_le; 18 ecb_fp fp_ecb; 19 void *context; 20 }; 21 22 void ecb_encrypt_be(uint8_t const *const key_be, uint8_t const *const clear_text_be, 23 uint8_t * const cipher_text_be); 24 void ecb_encrypt(uint8_t const *const key_le, uint8_t const *const clear_text_le, 25 uint8_t * const cipher_text_le, uint8_t * const cipher_text_be); 26 uint32_t ecb_encrypt_nonblocking(struct ecb *ecb); 27 void isr_ecb(void *param); 28 29 uint32_t ecb_ut(void); 30