2016-08-15 18:01:06 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Nordic Semiconductor ASA
|
|
|
|
* Copyright (c) 2016 Vinayak Kariappa Chettimada
|
|
|
|
*
|
2017-01-19 09:01:01 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-08-15 18:01:06 +08:00
|
|
|
*/
|
|
|
|
|
2017-04-21 19:18:52 +08:00
|
|
|
typedef void (*ecb_fp) (u32_t status, u8_t *cipher_be, void *context);
|
2016-08-15 18:01:06 +08:00
|
|
|
|
|
|
|
struct ecb {
|
2017-04-21 19:18:52 +08:00
|
|
|
u8_t in_key_be[16];
|
|
|
|
u8_t in_clear_text_be[16];
|
|
|
|
u8_t out_cipher_text_be[16];
|
2016-08-15 18:01:06 +08:00
|
|
|
/* if not null reverse copy into in_key_be */
|
2017-04-21 19:18:52 +08:00
|
|
|
u8_t *in_key_le;
|
2016-08-15 18:01:06 +08:00
|
|
|
/* if not null reverse copy into in_clear_text_be */
|
2017-04-21 19:18:52 +08:00
|
|
|
u8_t *in_clear_text_le;
|
2016-08-15 18:01:06 +08:00
|
|
|
ecb_fp fp_ecb;
|
2017-04-21 19:18:52 +08:00
|
|
|
void *context;
|
2016-08-15 18:01:06 +08:00
|
|
|
};
|
|
|
|
|
2017-04-21 19:18:52 +08:00
|
|
|
void ecb_encrypt_be(u8_t const *const key_be, u8_t const *const clear_text_be,
|
2017-04-21 01:00:29 +08:00
|
|
|
u8_t * const cipher_text_be);
|
2017-04-21 19:18:52 +08:00
|
|
|
void ecb_encrypt(u8_t const *const key_le, u8_t const *const clear_text_le,
|
|
|
|
u8_t * const cipher_text_le, u8_t * const cipher_text_be);
|
2017-04-21 01:00:29 +08:00
|
|
|
u32_t ecb_encrypt_nonblocking(struct ecb *ecb);
|
2016-12-21 13:21:13 +08:00
|
|
|
void isr_ecb(void *param);
|
2016-08-15 18:01:06 +08:00
|
|
|
|
2017-04-21 01:00:29 +08:00
|
|
|
u32_t ecb_ut(void);
|