X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/d03ab969116fe715d569304c1c474749b2f64529..f0c52873e4c1e3a16bb2d5a086df2526f698e4ac:/des.h diff --git a/des.h b/des.h index 857cec3..f3fe91c 100644 --- a/des.h +++ b/des.h @@ -1,13 +1,13 @@ /* -*-c-*- * - * $Id: des.h,v 1.1 1999/09/03 08:41:11 mdw Exp $ + * $Id$ * * The Data Encryption Standard * * (c) 1999 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of Catacomb. * @@ -15,26 +15,18 @@ * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + * * Catacomb is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. - * + * * You should have received a copy of the GNU Library General Public * License along with Catacomb; if not, write to the Free * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: des.h,v $ - * Revision 1.1 1999/09/03 08:41:11 mdw - * Initial import. - * - */ - /*----- Notes on the Data Encryption Standard -----------------------------* * * Almost twenty years after it was first accepted, DES is still the standard @@ -47,8 +39,8 @@ * @des3@ interface which implements proper strong triple-DES. */ -#ifndef DES_H -#define DES_H +#ifndef CATACOMB_DES_H +#define CATACOMB_DES_H #ifdef __cplusplus extern "C" { @@ -66,6 +58,8 @@ #define DES_KEYSZ 7 #define DES_CLASS (N, B, 64) +extern const octet des_keysz[]; + /*----- Data structures ---------------------------------------------------*/ typedef struct des_ctx { @@ -74,6 +68,22 @@ typedef struct des_ctx { /*----- Functions provided ------------------------------------------------*/ +/* --- @des_expand@ --- * + * + * Arguments: @const octet *k@ = pointer to key material + * @size_t n@ = number of octets of key material (7 or 8) + * @uint32 *xx, *yy@ = where to put the results + * + * Returns: --- + * + * Use: Extracts 64 bits of key material from the given buffer, + * possibly expanding it from 56 to 64 bits on the way. + * Parity is set correctly if the key is expanded. + */ + +extern void des_expand(const octet */*k*/, size_t /*n*/, + uint32 */*xx*/, uint32 */*yy*/); + /* --- @des_init@ --- * * * Arguments: @des_ctx *k@ = pointer to key block