3 * $Id: skipjack.h,v 1.2 2000/08/01 00:28:34 mdw Exp $
5 * The Skipjack block cipher
7 * (c) 2000 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of Catacomb.
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.
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.
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,
30 /*----- Revision history --------------------------------------------------*
32 * $Log: skipjack.h,v $
33 * Revision 1.2 2000/08/01 00:28:34 mdw
34 * Performance improvement: read keys in as 32-bit words and deal them out
37 * Revision 1.1 2000/07/15 15:39:33 mdw
38 * The NSA's Skipjack block cipher.
42 /*----- Notes on the Skipjack block cipher --------------------------------*
44 * Skipjack was designed by the NSA, as a type II algorithm to be used in the
45 * Clipper system. It was initially classified, so that it couldn't be used
46 * without the key escrow feature, though a team of `respectable'
47 * cryptographers, including Dorothy Denning, had a quick look at it and
48 * pronounced it `good', as if this was meant to be convincing. It is
49 * apparently a particular parameterization of a family which includes type I
50 * algorithms. Since declassification, Biham has discovered a miss-in-the-
51 * middle attack which breaks Skipjack with 31 rounds faster than brute
54 * This implementation is provided for interest's sake, and possibly for
55 * interoperability, rather than as a good cipher to use.
58 #ifndef CATACOMB_SKIPJACK_H
59 #define CATACOMB_SKIPJACK_H
65 /*----- Header files ------------------------------------------------------*/
69 #include <mLib/bits.h>
71 /*----- Magical numbers ---------------------------------------------------*/
73 #define SKIPJACK_BLKSZ 8
74 #define SKIPJACK_KEYSZ 10
75 #define SKIPJACK_CLASS (N, B, 64)
77 extern const octet skipjack_keysz
[];
79 /*----- Data structures ---------------------------------------------------*/
81 typedef struct skipjack_ctx
{
82 uint32 ka
, kb
, kc
, kd
, ke
;
85 /*----- Functions provided ------------------------------------------------*/
87 /* --- @skipjack_init@ --- *
89 * Arguments: @skipjack_ctx *k@ = pointer to key block
90 * @const void *buf@ = pointer to key buffer
91 * @size_t sz@ = size of key material
95 * Use: Initializes a Skipjack key buffer. The key buffer must be
96 * exactly 10 bytes long.
99 extern void skipjack_init(skipjack_ctx */
*k*/
,
100 const void */
*buf*/
, size_t /*sz*/);
102 /* --- @skipjack_eblk@, @skipjack_dblk@ --- *
104 * Arguments: @const skipjack_ctx *k@ = pointer to key block
105 * @const uint32 s[2]@ = pointer to source block
106 * @uint32 d[2]@ = pointer to skipjacktination block
110 * Use: Low-level block encryption and decryption.
113 extern void skipjack_eblk(const skipjack_ctx */
*k*/
,
114 const uint32 */
*s*/
, uint32 */
*d*/
);
115 extern void skipjack_dblk(const skipjack_ctx */
*k*/
,
116 const uint32 */
*s*/
, uint32 */
*d*/
);
118 /*----- That's all, folks -------------------------------------------------*/