3 * The Skipjack block cipher
5 * (c) 2000 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of Catacomb.
12 * Catacomb is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Library General Public License as
14 * published by the Free Software Foundation; either version 2 of the
15 * License, or (at your option) any later version.
17 * Catacomb is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with Catacomb; if not, write to the Free
24 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
28 /*----- Notes on the Skipjack block cipher --------------------------------*
30 * Skipjack was designed by the NSA, as a type II algorithm to be used in the
31 * Clipper system. It was initially classified, so that it couldn't be used
32 * without the key escrow feature, though a team of `respectable'
33 * cryptographers, including Dorothy Denning, had a quick look at it and
34 * pronounced it `good', as if this was meant to be convincing. It is
35 * apparently a particular parameterization of a family which includes type I
36 * algorithms. Since declassification, Biham has discovered a miss-in-the-
37 * middle attack which breaks Skipjack with 31 rounds faster than brute
40 * This implementation is provided for interest's sake, and possibly for
41 * interoperability, rather than as a good cipher to use.
44 #ifndef CATACOMB_SKIPJACK_H
45 #define CATACOMB_SKIPJACK_H
51 /*----- Header files ------------------------------------------------------*/
55 #include <mLib/bits.h>
57 /*----- Magical numbers ---------------------------------------------------*/
59 #define SKIPJACK_BLKSZ 8
60 #define SKIPJACK_KEYSZ 10
61 #define SKIPJACK_CLASS (N, B, 64)
63 extern const octet skipjack_keysz[];
65 /*----- Data structures ---------------------------------------------------*/
67 typedef struct skipjack_ctx {
68 uint32 ka, kb, kc, kd, ke;
71 /*----- Functions provided ------------------------------------------------*/
73 /* --- @skipjack_init@ --- *
75 * Arguments: @skipjack_ctx *k@ = pointer to key block
76 * @const void *buf@ = pointer to key buffer
77 * @size_t sz@ = size of key material
81 * Use: Initializes a Skipjack key buffer. The key buffer must be
82 * exactly 10 bytes long.
85 extern void skipjack_init(skipjack_ctx */*k*/,
86 const void */*buf*/, size_t /*sz*/);
88 /* --- @skipjack_eblk@, @skipjack_dblk@ --- *
90 * Arguments: @const skipjack_ctx *k@ = pointer to key block
91 * @const uint32 s[2]@ = pointer to source block
92 * @uint32 d[2]@ = pointer to skipjacktination block
96 * Use: Low-level block encryption and decryption.
99 extern void skipjack_eblk(const skipjack_ctx */*k*/,
100 const uint32 */*s*/, uint32 */*d*/);
101 extern void skipjack_dblk(const skipjack_ctx */*k*/,
102 const uint32 */*s*/, uint32 */*d*/);
104 /*----- That's all, folks -------------------------------------------------*/