1 /* mvAes.h v2.0 August '99
2 * Reference ANSI C code
5 /* AES Cipher header file for ANSI C Submissions
6 Lawrence E. Bassham III
7 Computer Security Division
8 National Institute of Standards and Technology
12 This sample is to assist implementers developing to the Cryptographic
13 API Profile for AES Candidate Algorithm Submissions. Please consult this
14 document as a cross-reference.
16 ANY CHANGES, WHERE APPROPRIATE, TO INFORMATION PROVIDED IN THIS FILE
17 MUST BE DOCUMENTED. CHANGES ARE ONLY APPROPRIATE WHERE SPECIFIED WITH
18 THE STRING "CHANGE POSSIBLE". FUNCTION CALLS AND THEIR PARAMETERS CANNOT
19 BE CHANGED. STRUCTURES CAN BE ALTERED TO ALLOW IMPLEMENTERS TO INCLUDE
20 IMPLEMENTATION SPECIFIC INFORMATION.
24 Standard include files
30 /* Error Codes - CHANGE POSSIBLE: inclusion of additional error codes */
32 /* Key direction is invalid, e.g., unknown value */
33 #define AES_BAD_KEY_DIR -1
35 /* Key material not of correct length */
36 #define AES_BAD_KEY_MAT -2
38 /* Key passed is not valid */
39 #define AES_BAD_KEY_INSTANCE -3
41 /* Params struct passed to cipherInit invalid */
42 #define AES_BAD_CIPHER_MODE -4
44 /* Cipher in wrong state (e.g., not initialized) */
45 #define AES_BAD_CIPHER_STATE -5
47 #define AES_BAD_CIPHER_INSTANCE -7
50 /* Function protoypes */
51 /* CHANGED: makeKey(): parameter blockLen added
52 this parameter is absolutely necessary if you want to
53 setup the round keys in a variable block length setting
54 cipherInit(): parameter blockLen added (for obvious reasons)
56 int aesMakeKey(MV_U8
*expandedKey
, MV_U8
*keyMaterial
, int keyLen
, int blockLen
);
57 int aesBlockEncrypt128(MV_U8 mode
, MV_U8
*IV
, MV_U8
*expandedKey
, int keyLen
,
58 MV_U32
*plain
, int numBlocks
, MV_U32
*cipher
);
59 int aesBlockDecrypt128(MV_U8 mode
, MV_U8
*IV
, MV_U8
*expandedKey
, int keyLen
,
60 MV_U32
*plain
, int numBlocks
, MV_U32
*cipher
);
This page took 0.051284 seconds and 5 git commands to generate.