/* CCM mode 
 */
static void x86_aes_encrypt(const void *_ctx,
			    size_t length, uint8_t * dst,
			    const uint8_t * src)
{
	AES_KEY *ctx = (void*)_ctx;
	aesni_ecb_encrypt(src, dst, length, ctx, 1);
}
Esempio n. 2
0
static void x86_aes_encrypt(void *_ctx,
				unsigned length, uint8_t * dst,
				const uint8_t * src)
{
	AES_KEY *ctx = _ctx;

	aesni_ecb_encrypt(src, dst, 16, ctx, 1);
}
Esempio n. 3
0
static int aesni_ecb_cipher(EVP_CIPHER_CTX *ctx,unsigned char *out,
	const unsigned char *in, size_t len)
{
	size_t	bl = ctx->cipher->block_size;

	if (len<bl)	return 1;

	aesni_ecb_encrypt(in,out,len,ctx->cipher_data,ctx->encrypt);

	return 1;
}
static int aesni_cipher_ecb(EVP_CIPHER_CTX *ctx, unsigned char *out,
		 const unsigned char *in, size_t inl)
{	AES_KEY *key = AESNI_ALIGN(ctx->cipher_data);
	aesni_ecb_encrypt(in, out, inl, key, ctx->encrypt);
	return 1;
}