Mercurial > hg > octave-kai > gnulib-hg
annotate lib/des.h @ 10690:01f3623813da
Split winsock.c into many smaller files.
* lib/close.c: Add _gl_close_fd_maybe_socket from winsock.c.
* lib/accept.c: New file, based on winsock.c.
* lib/bind.c: New file, based on winsock.c.
* lib/connect.c: New file, based on winsock.c.
* lib/getpeername.c: New file, based on winsock.c.
* lib/getsockname.c: New file, based on winsock.c.
* lib/getsockopt.c: New file, based on winsock.c.
* lib/ioctl.c: New file, based on winsock.c.
* lib/listen.c: New file, based on winsock.c.
* lib/recv.c: New file, based on winsock.c.
* lib/recvfrom.c: New file, based on winsock.c.
* lib/send.c: New file, based on winsock.c.
* lib/sendto.c: New file, based on winsock.c.
* lib/setsockopt.c: New file, based on winsock.c.
* lib/shutdown.c: New file, based on winsock.c.
* lib/socket.c: New file, based on winsock.c.
* lib/w32sock.h: New file, based on winsock.c.
* lib/winsock.c: Remove file.
* modules/accept: Likewise.
* modules/bind: Likewise.
* modules/connect: Likewise.
* modules/getpeername: Likewise.
* modules/getsockname: Likewise.
* modules/getsockopt: Likewise.
* modules/ioctl: Likewise.
* modules/listen: Likewise.
* modules/recv: Likewise.
* modules/recvfrom: Likewise.
* modules/send: Likewise.
* modules/sendto: Likewise.
* modules/setsockopt: Likewise.
* modules/shutdown: Likewise.
* modules/socket: Use socket.c instead of winsock.c.
* modules/sys_socket: Remove (unneeded?) dependency on winsock.c.
* doc/posix-functions/accept.texi: Doc fix.
* doc/posix-functions/bind.texi: Doc fix.
* doc/posix-functions/close.texi: Doc fix.
* doc/posix-functions/connect.texi: Doc fix.
* doc/posix-functions/getpeername.texi: Doc fix.
* doc/posix-functions/getsockname.texi: Doc fix.
* doc/posix-functions/getsockopt.texi: Doc fix.
* doc/posix-functions/ioctl.texi: Doc fix.
* doc/posix-functions/listen.texi: Doc fix.
* doc/posix-functions/recv.texi: Doc fix.
* doc/posix-functions/recvfrom.texi: Doc fix.
* doc/posix-functions/send.texi: Doc fix.
* doc/posix-functions/sendto.texi: Doc fix.
* doc/posix-functions/setsockopt.texi: Doc fix.
* doc/posix-functions/shutdown.texi: Doc fix.
* doc/posix-functions/socket.texi: Doc fix.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Tue, 21 Oct 2008 12:17:19 +0200 |
parents | 51634bc628de |
children | e8d2c6fc33ad |
rev | line source |
---|---|
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
1 /* des.h --- DES cipher implementation. |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
2 * Copyright (C) 2005, 2007 Free Software Foundation, Inc. |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
3 * |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
4 * This file is free software; you can redistribute it and/or modify |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
5 * it under the terms of the GNU General Public License as published |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
6 * by the Free Software Foundation; either version 2, or (at your |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
7 * option) any later version. |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
8 * |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
9 * This file is distributed in the hope that it will be useful, but |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
10 * WITHOUT ANY WARRANTY; without even the implied warranty of |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
12 * General Public License for more details. |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
13 * |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
14 * You should have received a copy of the GNU General Public License |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
15 * along with this file; if not, write to the Free Software |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
17 * 02110-1301, USA. |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
18 * |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
19 */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
20 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
21 /* Adapted for gnulib by Simon Josefsson, based on Libgcrypt. */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
22 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
23 #ifndef DES_H |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
24 # define DES_H |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
25 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
26 #include <stddef.h> |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
27 #include <stdint.h> |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
28 #include <stdbool.h> |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
29 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
30 /* |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
31 * Encryption/Decryption context of DES |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
32 */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
33 typedef struct |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
34 { |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
35 uint32_t encrypt_subkeys[32]; |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
36 uint32_t decrypt_subkeys[32]; |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
37 } gl_des_ctx; |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
38 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
39 /* |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
40 * Encryption/Decryption context of Triple-DES |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
41 */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
42 typedef struct |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
43 { |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
44 uint32_t encrypt_subkeys[96]; |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
45 uint32_t decrypt_subkeys[96]; |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
46 } gl_3des_ctx; |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
47 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
48 /* Check whether the 8 byte key is weak. Does not check the parity |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
49 * bits of the key but simple ignore them. */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
50 extern bool |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
51 gl_des_is_weak_key (const char * key); |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
52 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
53 /* |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
54 * DES |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
55 * --- |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
56 */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
57 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
58 /* Fill a DES context CTX with subkeys calculated from 64bit KEY. |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
59 * Does not check parity bits, but simply ignore them. Does not check |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
60 * for weak keys. */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
61 extern void |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
62 gl_des_setkey (gl_des_ctx *ctx, const char * key); |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
63 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
64 /* Fill a DES context CTX with subkeys calculated from 64bit KEY, with |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
65 * weak key checking. Does not check parity bits, but simply ignore |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
66 * them. */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
67 extern bool |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
68 gl_des_makekey (gl_des_ctx *ctx, const char * key, size_t keylen); |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
69 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
70 /* Electronic Codebook Mode DES encryption/decryption of data |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
71 * according to 'mode'. */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
72 extern void |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
73 gl_des_ecb_crypt (gl_des_ctx *ctx, const char * from, char * to, int mode); |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
74 |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
75 #define gl_des_ecb_encrypt(ctx, from, to) gl_des_ecb_crypt(ctx, from, to, 0) |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
76 #define gl_des_ecb_decrypt(ctx, from, to) gl_des_ecb_crypt(ctx, from, to, 1) |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
77 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
78 /* Triple-DES |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
79 * ---------- |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
80 */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
81 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
82 /* Fill a Triple-DES context CTX with subkeys calculated from two |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
83 * 64bit keys in KEY1 and KEY2. Does not check the parity bits of the |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
84 * keys, but simply ignore them. Does not check for weak keys. */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
85 extern void |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
86 gl_3des_set2keys (gl_3des_ctx *ctx, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
87 const char * key1, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
88 const char * key2); |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
89 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
90 /* |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
91 * Fill a Triple-DES context CTX with subkeys calculated from three |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
92 * 64bit keys in KEY1, KEY2 and KEY3. Does not check the parity bits |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
93 * of the keys, but simply ignore them. Does not check for weak |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
94 * keys. */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
95 extern void |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
96 gl_3des_set3keys (gl_3des_ctx *ctx, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
97 const char * key1, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
98 const char * key2, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
99 const char * key3); |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
100 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
101 /* Fill a Triple-DES context CTX with subkeys calculated from three |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
102 * concatenated 64bit keys in KEY, with weak key checking. Does not |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
103 * check the parity bits of the keys, but simply ignore them. */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
104 extern bool |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
105 gl_3des_makekey (gl_3des_ctx *ctx, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
106 const char * key, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
107 size_t keylen); |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
108 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
109 /* Electronic Codebook Mode Triple-DES encryption/decryption of data |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
110 * according to 'mode'. Sometimes this mode is named 'EDE' mode |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
111 * (Encryption-Decryption-Encryption). */ |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
112 extern void |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
113 gl_3des_ecb_crypt (gl_3des_ctx *ctx, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
114 const char * from, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
115 char * to, |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
116 int mode); |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
117 |
8433
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
118 #define gl_3des_ecb_encrypt(ctx, from, to) gl_3des_ecb_crypt(ctx,from,to,0) |
51634bc628de
* lib/quotearg.c: Include <wctype.h> early, before the definition of
Paul Eggert <eggert@cs.ucla.edu>
parents:
6404
diff
changeset
|
119 #define gl_3des_ecb_decrypt(ctx, from, to) gl_3des_ecb_crypt(ctx,from,to,1) |
6404
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
120 |
d38a727f8479
Add des, des-tests, gc-des, gc-des-tests modules.
Simon Josefsson <simon@josefsson.org>
parents:
diff
changeset
|
121 #endif /* DES_H */ |