Merged blowfish branch into trunk.
[become] / src / crypt.h
index b508b45..55a4753 100644 (file)
@@ -1,13 +1,13 @@
 /* -*-c-*-
  *
- * $Id: crypt.h,v 1.1 1997/07/21 13:47:51 mdw Exp $
+ * $Id: crypt.h,v 1.3 1997/09/26 09:14:58 mdw Exp $
  *
  * Cryptographic transfer of `become' requests
  *
  * (c) 1997 EBI
  */
 
-/*----- Licencing notice --------------------------------------------------*
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of `become'
  *
  * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 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: crypt.h,v $
- * Revision 1.1  1997/07/21 13:47:51  mdw
+ * 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.
+ *
+ * Revision 1.1  1997/07/21  13:47:51  mdw
  * Initial revision
  *
  */
 /* --- 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.
@@ -70,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) */
@@ -93,17 +111,6 @@ enum {
   crp_size = crp_check + 4             /* Size of encrypted reply */
 };
 
-/*----- Macros ------------------------------------------------------------*/
-
-/* --- @burn@ --- *
- *
- * Arguments:  @obj@ = some object
- *
- * Use:                Writes zero bytes over the object.
- */
-
-#define burn(obj) ((void)memset(&obj, 0, sizeof(obj)))
-
 /*----- Functions provided ------------------------------------------------*/
 
 /* --- @crypt_packRequest@ --- *