BeeCrypt 4.2.1
aes.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2002, 2003 Bob Deblier
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 */
19
25
26#ifndef _AES_H
27#define _AES_H
28
29#include "beecrypt/beecrypt.h"
30#include "beecrypt/aesopt.h"
31
35#ifdef __cplusplus
37#else
38struct _aesParam
39#endif
40{
44 uint32_t k[64];
48 uint32_t nr;
52 uint32_t fdback[4];
53};
54
55#ifndef __cplusplus
56typedef struct _aesParam aesParam;
57#endif
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
66extern const BEECRYPTAPI blockCipher aes;
67
79int aesSetup (aesParam* ap, const byte* key, size_t keybits, cipherOperation op);
80
89int aesSetIV (aesParam* ap, const byte* iv);
90
100int aesSetCTR (aesParam* ap, const byte* nivz, size_t counter);
101
111int aesEncrypt (aesParam* ap, uint32_t* dst, const uint32_t* src);
112
122int aesDecrypt (aesParam* ap, uint32_t* dst, const uint32_t* src);
123
125uint32_t* aesFeedback(aesParam* ap);
126
127#ifdef __cplusplus
128}
129#endif
130
131#endif
BEECRYPTAPI int aesSetCTR(aesParam *ap, const byte *nivz, size_t counter)
This function sets the CTR mode counter.
BEECRYPTAPI uint32_t * aesFeedback(aesParam *ap)
const BEECRYPTAPI blockCipher aes
Holds the full API description of the AES algorithm.
BEECRYPTAPI int aesEncrypt(aesParam *ap, uint32_t *dst, const uint32_t *src)
This function performs the raw AES encryption; it encrypts one block of 128 bits.
BEECRYPTAPI int aesSetIV(aesParam *ap, const byte *iv)
This function sets the Initialization Vector.
BEECRYPTAPI int aesDecrypt(aesParam *ap, uint32_t *dst, const uint32_t *src)
This function performs the raw AES decryption; it decrypts one block of 128 bits.
BEECRYPTAPI int aesSetup(aesParam *ap, const byte *key, size_t keybits, cipherOperation op)
This function performs the cipher's key expansion.
AES block cipher, assembler-optimized routines, headers.
#define BEECRYPTAPI
Definition api.h:52
BeeCrypt API, headers.
cipherOperation
Specifies whether to perform encryption or decryption.
Definition beecrypt.h:557
Holds all the parameters necessary for the AES cipher.
Definition aes.h:40
uint32_t fdback[4]
Buffer to be used by block chaining or feedback modes.
Definition aes.h:52
uint32_t k[64]
Holds the key expansion.
Definition aes.h:44
uint32_t nr
Number of rounds to be used in encryption/decryption.
Definition aes.h:48
Holds information and pointers to code specific to each cipher.
Definition beecrypt.h:648