2e8eb64a |
1 | /* -*-c-*- |
2 | * |
3 | * $Id: rijndael192.h,v 1.1 2001/05/07 17:32:03 mdw Exp $ |
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 | |
30 | /*----- Revision history --------------------------------------------------* |
31 | * |
32 | * $Log: rijndael192.h,v $ |
33 | * Revision 1.1 2001/05/07 17:32:03 mdw |
34 | * New Rijndael block sizes. |
35 | * |
36 | */ |
37 | |
38 | #ifndef CATACOMB_RIJNDAEL192_H |
39 | #define CATACOMB_RIJNDAEL192_H |
40 | |
41 | #ifdef __cplusplus |
42 | extern "C" { |
43 | #endif |
44 | |
45 | /*----- Header files ------------------------------------------------------*/ |
46 | |
47 | #ifndef CATACOMB_RIJNDAEL_H |
48 | # include "rijndael.h" |
49 | #endif |
50 | |
51 | /*----- Magical numbers ---------------------------------------------------*/ |
52 | |
53 | #define RIJNDAEL192_BLKSZ 24 |
54 | #define RIJNDAEL192_KEYSZ 32 |
55 | #define RIJNDAEL192_CLASS (N, L, 192) |
56 | |
57 | #define rijndael192_keysz rijndael_keysz |
58 | |
59 | /*----- Data structures ---------------------------------------------------*/ |
60 | |
61 | typedef struct rijndael_ctx rijndael192_ctx; |
62 | |
63 | /*----- Functions provided ------------------------------------------------*/ |
64 | |
65 | /* --- @rijndael192_init@ --- * |
66 | * |
67 | * Arguments: @rijndael_ctx *k@ = pointer to context to initialize |
68 | * @const void *buf@ = pointer to buffer of key material |
69 | * @size_t sz@ = size of the key material |
70 | * |
71 | * Returns: --- |
72 | * |
73 | * Use: Initializes a Rijndael context with a particular key. This |
74 | * implementation of Rijndael doesn't impose any particular |
75 | * limits on the key size except that it must be multiple of 4 |
76 | * bytes long. 256 bits seems sensible, though. |
77 | */ |
78 | |
79 | extern void rijndael192_init(rijndael_ctx */*k*/, |
80 | const void */*buf*/, size_t /*sz*/); |
81 | |
82 | /* --- @rijndael_eblk@, @rijndael_dblk@ --- * |
83 | * |
84 | * Arguments: @const rijndael_ctx *k@ = pointer to Rijndael context |
85 | * @const uint32 s[4]@ = pointer to source block |
86 | * @uint32 d[4]@ = pointer to destination block |
87 | * |
88 | * Returns: --- |
89 | * |
90 | * Use: Low-level block encryption and decryption. |
91 | */ |
92 | |
93 | extern void rijndael192_eblk(const rijndael_ctx */*k*/, |
94 | const uint32 */*s*/, uint32 */*dst*/); |
95 | extern void rijndael192_dblk(const rijndael_ctx */*k*/, |
96 | const uint32 */*s*/, uint32 */*dst*/); |
97 | |
98 | /*----- That's all, folks -------------------------------------------------*/ |
99 | |
100 | #ifdef __cplusplus |
101 | } |
102 | #endif |
103 | |
104 | #endif |