Merged blowfish branch into trunk.
[become] / src / crypt.h
index e84f508..55a4753 100644 (file)
@@ -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
  *
 /*----- 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.
  *
 /* --- 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) */