X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/fcdff1398b72c97915b11975046865fbdf2f8713..c69ec1ac6875ae97d8cb70b4a6ed1fddfb9fd72d:/lib/arcfour.c diff --git a/lib/arcfour.c b/lib/arcfour.c index 42aaf2b..3450562 100644 --- a/lib/arcfour.c +++ b/lib/arcfour.c @@ -18,17 +18,28 @@ * 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) {