00001 /*00002 * AES encrypt_block00003 *00004 * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>00005 *00006 * This program is free software; you can redistribute it and/or modify00007 * it under the terms of the GNU General Public License version 2 as00008 * published by the Free Software Foundation.00009 *00010 * Alternatively, this software may be distributed under the terms of BSD00011 * license.00012 *00013 * See README and COPYING for more details.00014 */00015
00016 #include "includes.h"00017
00018 #include "common.h"00019 #include "aes.h"00020 #include "aes_wrap.h"00021
00029intaes_128_encrypt_block(constu8 *key, constu8 *in, u8 *out)
00030 {
00031 void *ctx;
00032 ctx = aes_encrypt_init(key, 16);
00033 if (ctx == NULL)
00034 return -1;
00035 aes_encrypt(ctx, in, out);
00036 aes_encrypt_deinit(ctx);
00037 return 0;
00038 }