4 * Copyright 2007 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See README.devlib for information.
8 * \brief MD2 Message-Digest algorithm.
10 * The algorithm takes as input a message of arbitrary length and produces
11 * as output a 128-bit message digest of the input.
12 * It is conjectured that it is computationally infeasible to produce
13 * two messages having the same message digest, or to produce any
14 * message having a given prespecified target message digest.
19 * \author Daniele Basile <asterix@develer.com>
24 *#* Revision 1.3 2007/01/31 11:16:48 asterix
25 *#* Defined constants for algorithm compute
27 *#* Revision 1.2 2007/01/30 17:31:44 asterix
28 *#* Add function prototypes.
30 *#* Revision 1.1 2007/01/30 15:53:26 batt
31 *#* Add first md2 skel.
38 #include <cfg/compiler.h>
39 #include <appconfig.h>
41 #define COMPUTE_ARRAY_LEN 48 ///< Lenght of compute array.
42 #define NUM_COMPUTE_ROUNDS 18 ///< Number of compute rounds.
45 * Context for MD2 computation.
47 typedef struct Md2Context
49 uint8_t buffer[CONFIG_MD2_BLOCK_LEN]; ///< Input buffer.
50 uint8_t state[CONFIG_MD2_BLOCK_LEN]; ///< Current state buffer.
51 uint8_t checksum[CONFIG_MD2_BLOCK_LEN]; ///< Checksum.
52 size_t counter; ///< Counter of remaining bytes.
55 void md2_init(Md2Context *context);
56 void md2_update(Md2Context *context, void *block_in, size_t block_len);
57 void md2_end(Md2Context *context, void *msg_digest);
59 #endif /* ALGOS_MD2_H */