X-Git-Url: https://git.distorted.org.uk/~mdw/become/blobdiff_plain/03f996bd8a0d6391518979cdab3dbe38cba0bf83..03820e87affa29da5354d9c54ab660967e8e95fc:/src/icrypt.h diff --git a/src/icrypt.h b/src/icrypt.h index 2117814..dd7fa11 100644 --- a/src/icrypt.h +++ b/src/icrypt.h @@ -1,10 +1,10 @@ /* -*-c-*- * - * $Id: icrypt.h,v 1.2 1997/08/04 10:24:22 mdw Exp $ + * $Id: icrypt.h,v 1.4 1998/01/12 16:46:03 mdw Exp $ * - * Higher level IDEA encryption + * Higher level encryption functions * - * (c) 1997 Mark Wooding + * (c) 1998 Mark Wooding */ /*----- Licensing notice --------------------------------------------------* @@ -29,6 +29,17 @@ /*----- Revision history --------------------------------------------------* * * $Log: icrypt.h,v $ + * Revision 1.4 1998/01/12 16:46:03 mdw + * Fix copyright date. + * + * Revision 1.3 1997/09/26 09:14:58 mdw + * Merged blowfish branch into trunk. + * + * Revision 1.2.2.1 1997/09/26 09:08:08 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.2 1997/08/04 10:24:22 mdw * Sources placed under CVS control. * @@ -48,12 +59,12 @@ #include -#ifndef CONFIG_H -# include "config.h" +#ifndef BLOWFISH_H +# include "blowfish.h" #endif -#ifndef IDEA_H -# include "idea.h" +#ifndef CONFIG_H +# include "config.h" #endif /*----- Type definitions --------------------------------------------------*/ @@ -61,26 +72,16 @@ /* --- @icrypt_job@ --- */ typedef struct icrypt_job { - idea_key k; /* IDEA key for en/decrypting */ + blowfish_key k; /* Key for en/decrypting */ int i; /* Index into the IV buffer */ - char iv[IDEA_BLKSIZE]; /* IV bytes for encrypting */ + unsigned char iv[BLOWFISH_BLKSIZE]; /* IV bytes for encrypting */ } icrypt_job; /*----- Functions provided ------------------------------------------------*/ -/* --- @icrypt_init@ --- * - * - * Arguments: @icrypt_job *j@ = pointer to job context block - * @unsigned char *k@ = pointer to key data - * @const unsigned char *iv@ = pointer to IV - * - * Returns: --- - * - * Use: Primes the context block ready for encryption. - */ - extern void icrypt_init(icrypt_job */*j*/, unsigned char */*k*/, + size_t /*sz*/, const unsigned char */*iv*/); /* --- @icrypt_encrypt@ --- * @@ -120,6 +121,7 @@ extern void icrypt_decrypt(icrypt_job */*j*/, const void */*src*/, * Arguments: @icrypt_job *j@ = pointer to job context block * @unsigned char *k@ = pointer to key data, or zero for * no change + * @size_t sz@ = size of the key in bytes * @const unsigned char *iv@ = pointer to IV, or zero * * Returns: --- @@ -130,6 +132,7 @@ extern void icrypt_decrypt(icrypt_job */*j*/, const void */*src*/, extern void icrypt_reset(icrypt_job */*j*/, unsigned char */*k*/, + size_t /*sz*/, const unsigned char */*iv*/); /* --- @icrypt_saveIV@ --- *