Added SILC Thread Queue API
[silc.git] / lib / silccrypt / des_internal.h
1 /*
2
3   des_internal.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2007 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 #ifndef DES_INTERNAL_H
21 #define DES_INTERNAL_H
22
23 #include "ciphers_def.h"
24
25 typedef struct {
26   SilcUInt32 ek[32];
27   SilcUInt32 dk[32];
28   SilcUInt32 padlen;
29 } des_key;
30
31 typedef struct {
32   SilcUInt32 ek[3][32];
33   SilcUInt32 dk[3][32];
34   SilcUInt32 padlen;
35 } des3_key;
36
37 int des_setup(const unsigned char *key, int keylen, int num_rounds,
38               des_key *skey);
39 int des_encrypt(des_key *skey, const SilcUInt32 pt[2],
40                 SilcUInt32 ct[2]);
41 int des_decrypt(des_key *skey, const SilcUInt32 ct[2],
42                 SilcUInt32 pt[2]);
43
44 int des3_setup(const unsigned char *key, int keylen, int num_rounds,
45                des3_key *skey);
46 int des3_encrypt(des3_key *skey, const SilcUInt32 pt[2],
47                  SilcUInt32 ct[2]);
48 int des3_decrypt(des3_key *skey, const SilcUInt32 ct[2],
49                  SilcUInt32 pt[2]);
50
51 #endif /* DES_INTERNAL_H */