key-data.[ch] (key_copydata): New function copies filtered key data.
[u/mdw/catacomb] / rc4.h
diff --git a/rc4.h b/rc4.h
index b1acc23..7df1348 100644 (file)
--- a/rc4.h
+++ b/rc4.h
@@ -1,13 +1,13 @@
 /* -*-c-*-
  *
- * $Id: rc4.h,v 1.2 1999/12/10 23:27:46 mdw Exp $
+ * $Id: rc4.h,v 1.4 2004/04/08 01:36:15 mdw Exp $
  *
  * The alleged RC4 stream cipher
  *
  * (c) 1999 Straylight/Edgeware
  */
 
-/*----- Licensing notice --------------------------------------------------* 
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of Catacomb.
  *
  * it under the terms of the GNU Library General Public License as
  * published by the Free Software Foundation; either version 2 of the
  * License, or (at your option) any later version.
- * 
+ *
  * Catacomb 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 Library General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Library General Public
  * License along with Catacomb; if not, write to the Free
  * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
  * MA 02111-1307, USA.
  */
 
-/*----- Revision history --------------------------------------------------* 
- *
- * $Log: rc4.h,v $
- * Revision 1.2  1999/12/10 23:27:46  mdw
- * Generic cipher and RNG interfaces.
- *
- * Revision 1.1  1999/09/03 08:41:12  mdw
- * Initial import.
- *
- */
-
 /*----- Notes on RC4 ------------------------------------------------------*
  *
  * RC4 is a stream cipher desgigned by Ron Rivest.  For a while RC4 was a
@@ -128,6 +117,21 @@ typedef struct rc4_ctx {
 
 /*----- Functions provided ------------------------------------------------*/
 
+/* --- @rc4_addkey@ --- *
+ *
+ * Arguments:  @rc4_ctx *ctx@ = pointer to context to key
+ *             @const void *k@ = pointer to key data to use
+ *             @size_t sz@ = size of the key data
+ *
+ * Returns:    ---
+ *
+ * Use:                Mixes key data with an RC4 context.  The RC4 context is not
+ *             reset before mixing.  This may be used to mix new key
+ *             material with an existing RC4 context.
+ */
+
+extern void rc4_addkey(rc4_ctx */*ctx*/, const void */*k*/, size_t /*sz*/);
+
 /* --- @rc4_init@ --- *
  *
  * Arguments:  @rc4_ctx *ctx@ = pointer to context to initialize
@@ -164,6 +168,9 @@ extern void rc4_encrypt(rc4_ctx */*ctx*/,
 
 /*----- Generic cipher interface ------------------------------------------*/
 
+#define RC4_KEYSZ 16
+extern const octet rc4_keysz[];
+
 extern const gccipher rc4;
 
 /*----- Generic random number generator interface -------------------------*/