X-Git-Url: https://git.distorted.org.uk/~mdw/become/blobdiff_plain/38b18db87ee952fef8fc9e856d4ec2dae6fa2847..9e5602f0603b771fdda16731ab5bf6e460fe8795:/src/crypt.h diff --git a/src/crypt.h b/src/crypt.h index e84f508..55a4753 100644 --- a/src/crypt.h +++ b/src/crypt.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: crypt.h,v 1.2 1997/08/04 10:24:21 mdw Exp $ + * $Id: crypt.h,v 1.3 1997/09/26 09:14:58 mdw Exp $ * * Cryptographic transfer of `become' requests * @@ -29,6 +29,14 @@ /*----- Revision history --------------------------------------------------* * * $Log: crypt.h,v $ + * 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:04 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:21 mdw * Sources placed under CVS control. * @@ -61,10 +69,17 @@ /* --- Encryption formats --- */ enum { - cryptType_idea, /* Symmetric IDEA encryption */ + cryptType_blowfish, /* Symmetric Blowfish encryption */ cryptType_rsa /* Public key RSA (later project) */ }; +/* --- Blowfish has a variable key size --- * + * + * Fix a key size here. + */ + +#define BLOWFISH_KEYSIZE (16u) + /* --- Encrypted buffer format --- * * * C structures are no good here. Time for some explicit offsets. @@ -73,7 +88,7 @@ enum { enum { crq_cryptType = 0, /* Encryption type (1 byte) */ crq_iv = crq_cryptType + 1, /* Plaintext IV (8 bytes) */ - crq_session = crq_iv + 8, /* IDEA session key (16 bytes) */ + crq_session = crq_iv + 8, /* Session key (16 bytes) */ crq_cipher = crq_session + 16, /* Where to start encrypting */ crq_time = crq_cipher, /* Time stamp (4 bytes) */ crq_pid = crq_time + 4, /* Process ID (4 bytes) */