1 // SPDX-License-Identifier: BSD-2-Clause
2 /*
3  * Copyright (c) 2020, Linaro Limited
4  */
5 
6 #include <crypto/crypto_accel.h>
7 #include <kernel/thread.h>
8 
9 /* Prototype for assembly function */
10 void sha256_ce_transform(uint32_t state[8], const void *src,
11 			 unsigned int block_count);
12 
crypto_accel_sha256_compress(uint32_t state[8],const void * src,unsigned int block_count)13 void crypto_accel_sha256_compress(uint32_t state[8], const void *src,
14 				  unsigned int block_count)
15 {
16 	uint32_t vfp_state = 0;
17 
18 	vfp_state = thread_kernel_enable_vfp();
19 	sha256_ce_transform(state, src, block_count);
20 	thread_kernel_disable_vfp(vfp_state);
21 }
22