BeRTOS
Data Structures | Defines | Functions
md2.h File Reference

MD2 Message-Digest algorithm. More...

#include "cfg/cfg_md2.h"
#include <cfg/compiler.h>

Go to the source code of this file.

Data Structures

struct  Md2Context
 Context for MD2 computation. More...

Defines

#define NUM_COMPUTE_ROUNDS   18
 Number of compute rounds.
#define COMPUTE_ARRAY_LEN   CONFIG_MD2_BLOCK_LEN * 3
 Lenght of compute array.

Functions

void md2_init (Md2Context *context)
 Algorithm initialization.
void md2_update (Md2Context *context, const void *block_in, size_t block_len)
 Update block.
uint8_t * md2_end (Md2Context *context)
 Ends an MD2 message digest operation.
bool md2_test (void)
 MD2 test fuction.

Detailed Description

MD2 Message-Digest algorithm.

The algorithm takes as input a message of arbitrary length and produces as output a 128-bit message digest of the input. It is conjectured that it is computationally infeasible to produce two messages having the same message digest, or to produce any message having a given prespecified target message digest.

Author:
Daniele Basile <asterix@develer.com>

Definition in file md2.h.


Function Documentation

uint8_t* md2_end ( Md2Context context)

Ends an MD2 message digest operation.

This fuction take an context and return a pointer to context state.

Parameters:
contextin input.
Returns:
a pointer to context state (message digest).

Definition at line 256 of file md2.c.

void md2_init ( Md2Context context)

Algorithm initialization.

Parameters:
contextempty context.

Definition at line 196 of file md2.c.

bool md2_test ( void  )

MD2 test fuction.

This function test MD2 algorithm with a standard string specified in RFC 1319.

Note:
This test work with official array of 256 byte pemutation contructed from digits of pi, defined in the RFC 1319.

Definition at line 288 of file md2.c.