3 * $Id: rijndael256.h,v 1.2 2004/04/08 01:36:15 mdw Exp $
5 * The Rijndael block cipher, 256-bit version
7 * (c) 2001 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of Catacomb.
14 * Catacomb is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU Library General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
19 * Catacomb is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with Catacomb; if not, write to the Free
26 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
30 #ifndef CATACOMB_RIJNDAEL256_H
31 #define CATACOMB_RIJNDAEL256_H
37 /*----- Header files ------------------------------------------------------*/
39 #ifndef CATACOMB_RIJNDAEL_H
40 # include "rijndael.h"
43 /*----- Magical numbers ---------------------------------------------------*/
45 #define RIJNDAEL256_BLKSZ 32
46 #define RIJNDAEL256_KEYSZ 32
47 #define RIJNDAEL256_CLASS (N, B, 256)
49 #define rijndael256_keysz rijndael_keysz
51 /*----- Data structures ---------------------------------------------------*/
53 typedef struct rijndael_ctx rijndael256_ctx;
55 /*----- Functions provided ------------------------------------------------*/
57 /* --- @rijndael256_init@ --- *
59 * Arguments: @rijndael_ctx *k@ = pointer to context to initialize
60 * @const void *buf@ = pointer to buffer of key material
61 * @size_t sz@ = size of the key material
65 * Use: Initializes a Rijndael context with a particular key. This
66 * implementation of Rijndael doesn't impose any particular
67 * limits on the key size except that it must be multiple of 4
68 * bytes long. 256 bits seems sensible, though.
71 extern void rijndael256_init(rijndael_ctx */*k*/,
72 const void */*buf*/, size_t /*sz*/);
74 /* --- @rijndael_eblk@, @rijndael_dblk@ --- *
76 * Arguments: @const rijndael_ctx *k@ = pointer to Rijndael context
77 * @const uint32 s[4]@ = pointer to source block
78 * @uint32 d[4]@ = pointer to destination block
82 * Use: Low-level block encryption and decryption.
85 extern void rijndael256_eblk(const rijndael_ctx */*k*/,
86 const uint32 */*s*/, uint32 */*dst*/);
87 extern void rijndael256_dblk(const rijndael_ctx */*k*/,
88 const uint32 */*s*/, uint32 */*dst*/);
90 /*----- That's all, folks -------------------------------------------------*/