Ignore:
Timestamp:
Jul 18, 2015, 5:06:52 PM (6 years ago)
Author:
katerina
Message:

Enhancements and fixes for tickets #374, #375, #376, #377, #378, and #379.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/rijndael-alg-fst.h

    r230 r481  
    1 /*
    2  * rijndael-alg-fst.h   v2.3   April '2000
     1/*      $NetBSD: rijndael-alg-fst.h,v 1.4 2005/12/11 12:20:52 christos Exp $    */
     2/*      $KAME: rijndael-alg-fst.h,v 1.5 2003/07/15 10:47:16 itojun Exp $        */
     3/**
     4 * rijndael-alg-fst.h
    35 *
    4  * Optimised ANSI C code
     6 * @version 3.0 (December 2000)
    57 *
     8 * Optimised ANSI C code for the Rijndael cipher (now AES)
     9 *
     10 * @author Vincent Rijmen <vincent.rijmen@esat.kuleuven.ac.be>
     11 * @author Antoon Bosselaers <antoon.bosselaers@esat.kuleuven.ac.be>
     12 * @author Paulo Barreto <paulo.barreto@terra.com.br>
     13 *
     14 * This code is hereby placed in the public domain.
     15 *
     16 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
     17 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE
     20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
     23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
     25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    627 */
    7 
    8 /*@-fixedformalarray@*/
    9 
    1028#ifndef __RIJNDAEL_ALG_FST_H
    1129#define __RIJNDAEL_ALG_FST_H
    1230
    13 #define MAXKC                   (256/32)
    14 #define MAXROUNDS               14
    15 
    16 /* USUAL_TYPES */
    17 #ifndef USUAL_TYPES
    18 #define USUAL_TYPES
    19 typedef unsigned char   byte;
    20 typedef unsigned char   word8; 
    21 typedef unsigned short  word16;
    22 typedef unsigned int    word32;
    23 #endif
     31#define RIJNDAEL_MAXKC  (256/32)
     32#define RIJNDAEL_MAXKB  (256/8)
     33#define RIJNDAEL_MAXNR  14
    2434
    2535#ifdef SH_ENCRYPT
    2636
    27 int rijndaelKeySched(word8 k[MAXKC][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
    28 
    29 int rijndaelKeyEncToDec(word8 W[MAXROUNDS+1][4][4], int ROUNDS);
    30 
    31 int rijndaelEncrypt(word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
    32 
    33 
    34 int rijndaelDecrypt(word8 a[16], word8 b[16], word8 rk[MAXROUNDS+1][4][4], int ROUNDS);
    35 
    36 #ifdef INTERMEDIATE_VALUE_KAT
    37 int rijndaelEncryptRound(word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS, int rounds);
    38 int rijndaelDecryptRound(word8 a[4][4], word8 rk[MAXROUNDS+1][4][4], int ROUNDS, int rounds);
    39 #endif
     37int rijndaelKeySetupEnc(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
     38int rijndaelKeySetupDec(u32 rk[/*4*(Nr + 1)*/], const u8 cipherKey[], int keyBits);
     39void rijndaelEncrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 pt[16], u8 ct[16]);
     40void rijndaelDecrypt(const u32 rk[/*4*(Nr + 1)*/], int Nr, const u8 ct[16], u8 pt[16]);
    4041
    4142/* SH_ENCRYPT */
    4243#endif
    43 
    44 /* __RIJNDAEL_ALG_FST_H */
    45 #endif
    46 
     44#endif /* __RIJNDAEL_ALG_FST_H */
Note: See TracChangeset for help on using the changeset viewer.