3 * The aes/rijndael block cipher.
6 /* nettle, low-level cryptographics library
8 * Copyright (C) 2001 Niels Möller
10 * The nettle library is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or (at your
13 * option) any later version.
15 * The nettle library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with the nettle library; see the file COPYING.LIB. If not, write to
22 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26 #ifndef NETTLE_AES_H_INCLUDED
27 #define NETTLE_AES_H_INCLUDED
32 #define aes_set_encrypt_key nettle_aes_set_encrypt_key
33 #define aes_set_decrypt_key nettle_aes_set_decrypt_key
34 #define aes_encrypt nettle_aes_encrypt
35 #define aes_decrypt nettle_aes_decrypt
37 #define AES_BLOCK_SIZE 16
39 /* Variable key size between 128 and 256 bits. But the only valid
40 * values are 16 (128 bits), 24 (192 bits) and 32 (256 bits). */
41 #define AES_MIN_KEY_SIZE 16
42 #define AES_MAX_KEY_SIZE 32
44 #define AES_KEY_SIZE 32
48 uint32_t keys
[60]; /* maximum size of key schedule */
49 unsigned nrounds
; /* number of rounds to use for our key size */
53 aes_set_encrypt_key(struct aes_ctx
*ctx
,
54 unsigned length
, const uint8_t *key
);
56 aes_set_decrypt_key(struct aes_ctx
*ctx
,
57 unsigned length
, const uint8_t *key
);
60 aes_encrypt(struct aes_ctx
*ctx
,
61 unsigned length
, uint8_t *dst
,
64 aes_decrypt(struct aes_ctx
*ctx
,
65 unsigned length
, uint8_t *dst
,
68 #endif /* NETTLE_AES_H_INCLUDED */