<commit_before>/*
 * Copyright (c) 2016 Nordic Semiconductor ASA
 * Copyright (c) 2016 <NAME>
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <string.h>

#include <misc/dlist.h>
#include <misc/mempool_base.h>

#include "util/mem.h"
#include "hal/ecb.h"

#define LOG_MODULE_NAME bt_ctlr_nrf5_ecb
#include "common/log.h"
#include "hal/debug.h"

#include "nrf_ecb.h"

struct ecb_param {
	u8_t key[16];
	u8_t clear_text[16];
	u8_t cipher_text[16];
} __packed;

static void do_ecb(struct ecb_param *ecb)
{
	do {
		nrf_ecb_task_trigger(NRF_ECB, NRF_ECB_TASK_STOPECB);
		NRF_ECB->ECBDATAPTR = (u32_t)ecb;
		NRF_ECB->EVENTS_ENDECB = 0;
		NRF_ECB->EVENTS_ERRORECB = 0;
		nrf_ecb_task_trigger(NRF_ECB, NRF_ECB_TASK_STARTECB);
		while ((NRF_ECB->EVENTS_ENDECB == 0) &&
		       (NRF_ECB->EVENTS_ERRORECB == 0) &&
		       (NRF_ECB->ECBDATAPTR != 0)) {
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
			__WFE();
#else
			/*__WFE();*/
#endif
		}<commit_msg>Bluetooth: nordic ECB hal: Bugfix for simulation<commit_after>/*
 * Copyright (c) 2016 Nordic Semiconductor ASA
 * Copyright (c) 2016 <NAME>
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#include <string.h>

#include <misc/dlist.h>
#include <misc/mempool_base.h>

#include "util/mem.h"
#include "hal/ecb.h"

#define LOG_MODULE_NAME bt_ctlr_nrf5_ecb
#include "common/log.h"
#include "hal/debug.h"

#include "nrf_ecb.h"

struct ecb_param {
	u8_t key[16];
	u8_t clear_text[16];
	u8_t cipher_text[16];
} __packed;

static void do_ecb(struct ecb_param *ecb)
{
	do {
		nrf_ecb_task_trigger(NRF_ECB, NRF_ECB_TASK_STOPECB);
		NRF_ECB->ECBDATAPTR = (u32_t)ecb;
		NRF_ECB->EVENTS_ENDECB = 0;
		NRF_ECB->EVENTS_ERRORECB = 0;
		nrf_ecb_task_trigger(NRF_ECB, NRF_ECB_TASK_STARTECB);
		while ((NRF_ECB->EVENTS_ENDECB == 0) &&
		       (NRF_ECB->EVENTS_ERRORECB == 0) &&
		       (NRF_ECB->ECBDATAPTR != 0)) {
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
			k_busy_wait(10);
#else
			/*__WFE();*/
#endif
		}
{'fraction_non_alphanumeric': 0.146618482188952, 'fraction_numerical': 0.028910686628807435, 'mean_word_length': 4.585014409221902, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2223706', 'n_tokens_mistral': 997, 'n_tokens_neox': 917, 'n_words': 146}