2e8eb64a |
1 | /* -*-c-*- |
2 | * |
b817bfc6 |
3 | * $Id: rijndael192.h,v 1.2 2004/04/08 01:36:15 mdw Exp $ |
2e8eb64a |
4 | * |
5 | * The Rijndael block cipher, 192-bit version |
6 | * |
7 | * (c) 2001 Straylight/Edgeware |
8 | */ |
9 | |
10 | /*----- Licensing notice --------------------------------------------------* |
11 | * |
12 | * This file is part of Catacomb. |
13 | * |
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. |
18 | * |
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. |
23 | * |
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, |
27 | * MA 02111-1307, USA. |
28 | */ |
29 | |
2e8eb64a |
30 | #ifndef CATACOMB_RIJNDAEL192_H |
31 | #define CATACOMB_RIJNDAEL192_H |
32 | |
33 | #ifdef __cplusplus |
34 | extern "C" { |
35 | #endif |
36 | |
37 | /*----- Header files ------------------------------------------------------*/ |
38 | |
39 | #ifndef CATACOMB_RIJNDAEL_H |
40 | # include "rijndael.h" |
41 | #endif |
42 | |
43 | /*----- Magical numbers ---------------------------------------------------*/ |
44 | |
45 | #define RIJNDAEL192_BLKSZ 24 |
46 | #define RIJNDAEL192_KEYSZ 32 |
47 | #define RIJNDAEL192_CLASS (N, L, 192) |
48 | |
49 | #define rijndael192_keysz rijndael_keysz |
50 | |
51 | /*----- Data structures ---------------------------------------------------*/ |
52 | |
53 | typedef struct rijndael_ctx rijndael192_ctx; |
54 | |
55 | /*----- Functions provided ------------------------------------------------*/ |
56 | |
57 | /* --- @rijndael192_init@ --- * |
58 | * |
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 |
62 | * |
63 | * Returns: --- |
64 | * |
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. |
69 | */ |
70 | |
71 | extern void rijndael192_init(rijndael_ctx */*k*/, |
72 | const void */*buf*/, size_t /*sz*/); |
73 | |
74 | /* --- @rijndael_eblk@, @rijndael_dblk@ --- * |
75 | * |
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 |
79 | * |
80 | * Returns: --- |
81 | * |
82 | * Use: Low-level block encryption and decryption. |
83 | */ |
84 | |
85 | extern void rijndael192_eblk(const rijndael_ctx */*k*/, |
86 | const uint32 */*s*/, uint32 */*dst*/); |
87 | extern void rijndael192_dblk(const rijndael_ctx */*k*/, |
88 | const uint32 */*s*/, uint32 */*dst*/); |
89 | |
90 | /*----- That's all, folks -------------------------------------------------*/ |
91 | |
92 | #ifdef __cplusplus |
93 | } |
94 | #endif |
95 | |
96 | #endif |