1214501Srpaulo/* 2214501Srpaulo * AES encrypt_block 3214501Srpaulo * 4214501Srpaulo * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi> 5214501Srpaulo * 6214501Srpaulo * This program is free software; you can redistribute it and/or modify 7214501Srpaulo * it under the terms of the GNU General Public License version 2 as 8214501Srpaulo * published by the Free Software Foundation. 9214501Srpaulo * 10214501Srpaulo * Alternatively, this software may be distributed under the terms of BSD 11214501Srpaulo * license. 12214501Srpaulo * 13214501Srpaulo * See README and COPYING for more details. 14214501Srpaulo */ 15214501Srpaulo 16214501Srpaulo#include "includes.h" 17214501Srpaulo 18214501Srpaulo#include "common.h" 19214501Srpaulo#include "aes.h" 20214501Srpaulo#include "aes_wrap.h" 21214501Srpaulo 22214501Srpaulo/** 23214501Srpaulo * aes_128_encrypt_block - Perform one AES 128-bit block operation 24214501Srpaulo * @key: Key for AES 25214501Srpaulo * @in: Input data (16 bytes) 26214501Srpaulo * @out: Output of the AES block operation (16 bytes) 27214501Srpaulo * Returns: 0 on success, -1 on failure 28214501Srpaulo */ 29214501Srpauloint aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out) 30214501Srpaulo{ 31214501Srpaulo void *ctx; 32214501Srpaulo ctx = aes_encrypt_init(key, 16); 33214501Srpaulo if (ctx == NULL) 34214501Srpaulo return -1; 35214501Srpaulo aes_encrypt(ctx, in, out); 36214501Srpaulo aes_encrypt_deinit(ctx); 37214501Srpaulo return 0; 38214501Srpaulo} 39