/* Start of encryption or decryption on data buffers. 
This blocking method transfers input buffer of specified length to the cryptographic coprocessor, and instructs him to begin of ciphering or deciphering. It waits for data to be ready, and then fills the processed data to output buffer. */
uint32_t crypto_process_block(uint32_t *inp, uint32_t *outp, uint32_t length)
/* Start of encryption or decryption on data buffers. 
This blocking method transfers input buffer of specified length to the cryptographic coprocessor, and instructs him to begin of ciphering or deciphering. It waits for data to be ready, and then fills the processed data to output buffer. */
uint32_t crypto_process_block(uint32_t *inp, uint32_t *outp, uint32_t length)
{
	uint32_t rd = 0, wr = 0;
	while (rd != length) {
		if ((wr < length) && (CRYP_SR & CRYP_SR_IFNF)) {
			CRYP_DIN = *inp++;
			wr++;
		}
		if (CRYP_SR & CRYP_SR_OFNE) {
			*outp++ = CRYP_DOUT;
			rd++;
		}
	}
	crypto_wait_busy();
	return wr;
}