X-Git-Url: https://git.distorted.org.uk/~mdw/become/blobdiff_plain/fe59d3d70fc7337b7a50c4fcff72d20967672157..f60a34341fee6aafd5b878dce23b80af7c60064d:/src/blowfish.h diff --git a/src/blowfish.h b/src/blowfish.h deleted file mode 100644 index d008988..0000000 --- a/src/blowfish.h +++ /dev/null @@ -1,137 +0,0 @@ -/* -*-c-*- - * - * $Id: blowfish.h,v 1.5 1998/01/12 16:45:45 mdw Exp $ - * - * Blowfish encryption routines - * - * (c) 1998 Mark Wooding - */ - -/*----- Licensing notice --------------------------------------------------* - * - * This file is part of `become' - * - * `Become' is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * `Become' 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with `become'; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/*----- Revision history --------------------------------------------------* - * - * $Log: blowfish.h,v $ - * Revision 1.5 1998/01/12 16:45:45 mdw - * Fix copyright date. - * - * Revision 1.4 1997/09/26 09:14:57 mdw - * Merged blowfish branch into trunk. - * - * Revision 1.3.2.1 1997/09/26 09:07:59 mdw - * Use the Blowfish encryption algorithm instead of IDEA. This is partly - * because I prefer Blowfish (without any particularly strong evidence) but - * mainly because IDEA is patented and Blowfish isn't. - * - * Revision 1.3 1997/08/07 09:43:20 mdw - * Fix address of the FSF. - * - * Revision 1.2 1997/08/04 10:24:20 mdw - * Sources placed under CVS control. - * - * Revision 1.1 1997/07/21 13:47:53 mdw - * Initial revision - * - */ - -#ifndef BLOWFISH_H -#define BLOWFISH_H - -#ifdef __cplusplus - extern "C" { -#endif - -/*----- Required headers --------------------------------------------------*/ - -#ifndef CONFIG_H -# include "config.h" -#endif - -/*----- Type definitions --------------------------------------------------*/ - -/* --- A blowfish expanded key --- */ - -typedef struct blowfish_key { - uint_32 p[18]; - uint_32 s0[256]; - uint_32 s1[256]; - uint_32 s2[256]; - uint_32 s3[256]; -} blowfish_key; - -/* --- Size of a blowfish block --- */ - -#define BLOWFISH_BLKSIZE (8u) - -/*----- Functions provided ------------------------------------------------*/ - -/* --- @blowfish_encrypt@ --- * - * - * Arguments: @const blowfish_key *k@ = pointer to key block - * @const voic *from@ = block to encrypt from - * @void *to@ = block to encrypt to - * - * Returns: --- - * - * Use: Encrypts a block using the Blowfish algorithm. - */ - -extern void blowfish_encrypt(const blowfish_key */*k*/, - const void */*from*/, void */*to*/); - - -/* --- @blowfish_decrypt@ --- * - * - * Arguments: @const blowfish_key *k@ = pointer to key block - * @const void *from@ = block to decrypt from - * @void *to@ = block to decrypt to - * - * Returns: --- - * - * Use: Decrypts a block using the Blowfish algorithm. - */ - -extern void blowfish_decrypt(const blowfish_key */*k*/, - const void */*from*/, void */*to*/); - -/* --- @blowfish_setKey@ --- * - * - * Arguments: @blowfish_key *kb@ = pointer to key block to fill - * @void *k@ = pointer to key data - * @size_t sz@ = length of data in bytes - * - * Returns: --- - * - * Use: Expands a key which isn't represented as a number of whole - * words. This is a nonstandard extension, although it can be - * used to support 40-bit keys, which some governments might - * find more palatable than 160-bit (or 448-bit!) keys. - */ - -extern void blowfish_setKey(blowfish_key */*kb*/, - const void */*k*/, size_t /*sz*/); - -/*----- That's all, folks -------------------------------------------------*/ - -#ifdef __cplusplus - } -#endif - -#endif