chiark / gitweb /
Quieten compiler
[disorder] / lib / arcfour.c
index 42aaf2b9a3f6bebc52be0c82d3bc50a5db382afb..34505628372061f28c4eaeb109abcc07d9941de2 100644 (file)
  * 02110-1301, USA.
  *
  */
-
-/* Code from Libgcrypt adapted for gnulib by Simon Josefsson. */
-
-/*
+/** @file lib/arcfour.c
+ * @brief Arcfour (RC4-compatible) stream cipher implementation
+ *
+ * Code from Libgcrypt adapted for gnulib by Simon Josefsson.
+ *
  * For a description of the algorithm, see:
+ * 
  *   Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
  *   ISBN 0-471-11709-9. Pages 397 ff.
  */
 
 #include "arcfour.h"
 
+/** @brief Encrypt using Arcfour stream cipher
+ * @param context Context structure
+ * @param inbuf Input buffer
+ * @param outbuf Output buffer
+ * @param length Number of bytes in @p inbuf
+ *
+ * Copies from @p inbuf to @p outbuf, encrypting (or decrypting) using
+ * the stream controlled by @p context.
+ */
 void
 arcfour_stream (arcfour_context * context, const char *inbuf, char *outbuf,
                size_t length)
@@ -54,6 +65,13 @@ arcfour_stream (arcfour_context * context, const char *inbuf, char *outbuf,
   context->idx_j = j;
 }
 
+/** @brief Initialize an @ref arcfour_context
+ * @param context Context structure
+ * @param key Key data
+ * @param keylen Length of key
+ *
+ * Initializes @p context using @p key.
+ */
 void
 arcfour_setkey (arcfour_context * context, const char *key, size_t keylen)
 {