1 /* 2 * Copyright (c) 2016-2024 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 15 /* if not null reverse copy into in_key_be */ 16 uint8_t *in_key_le; 17 /* if not null reverse copy into in_clear_text_be */ 18 uint8_t *in_clear_text_le; 19 20 ecb_fp fp_ecb; 21 void *context; 22 }; 23 24 void ecb_encrypt_be(uint8_t const *const key_be, uint8_t const *const clear_text_be, 25 uint8_t * const cipher_text_be); 26 void ecb_encrypt(uint8_t const *const key_le, uint8_t const *const clear_text_le, 27 uint8_t * const cipher_text_le, uint8_t * const cipher_text_be); 28 29 void ecb_encrypt_nonblocking(struct ecb *e); 30 31 int ecb_ut(void); 32