1214501Srpaulo/*
2214501Srpaulo * AES encrypt_block
3214501Srpaulo *
4214501Srpaulo * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
5214501Srpaulo *
6252726Srpaulo * This software may be distributed under the terms of the BSD license.
7252726Srpaulo * See README for more details.
8214501Srpaulo */
9214501Srpaulo
10214501Srpaulo#include "includes.h"
11214501Srpaulo
12214501Srpaulo#include "common.h"
13214501Srpaulo#include "aes.h"
14214501Srpaulo#include "aes_wrap.h"
15214501Srpaulo
16214501Srpaulo/**
17214501Srpaulo * aes_128_encrypt_block - Perform one AES 128-bit block operation
18214501Srpaulo * @key: Key for AES
19214501Srpaulo * @in: Input data (16 bytes)
20214501Srpaulo * @out: Output of the AES block operation (16 bytes)
21214501Srpaulo * Returns: 0 on success, -1 on failure
22214501Srpaulo */
23214501Srpauloint aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out)
24214501Srpaulo{
25214501Srpaulo	void *ctx;
26214501Srpaulo	ctx = aes_encrypt_init(key, 16);
27214501Srpaulo	if (ctx == NULL)
28214501Srpaulo		return -1;
29214501Srpaulo	aes_encrypt(ctx, in, out);
30214501Srpaulo	aes_encrypt_deinit(ctx);
31214501Srpaulo	return 0;
32214501Srpaulo}
33