embedded IPsec source code documentation


md5_test.c File Reference


Detailed Description

This module contains all the test functions used to test MD5.

Author:
Niklaus Schild <n.schild@gmx.ch>
OUTLINE: The purpose of this module is to provide structural tests for the MD5 functions. The tests we did here are not how they should be. Because we took over the code from another project (OpenSSL) which is widely used and tested we assume that they work basically (yes I know assumptions are the worst mistakes of programmers).

IMPLEMENTATION: We call the four basic functions used to implement a HMAC and let them do their job. After the function is called we compare the result with the expected output.

Whenever a test fails we print out the INPUT, OUTPUT and the EXPECTED OUTPUT.

NOTES: This test do NOT fully prove the correctness of this code.

This document is part of embedded IPsec
Copyright (c) 2003 Niklaus Schild and Christian Scheurer, HTI Biel/Bienne
All rights reserved.


Definition in file md5_test.c.

#include <string.h>
#include "ipsec/util.h"
#include "ipsec/md5.h"
#include "ipsec/debug.h"
#include "testing/structural/structural_test.h"

Go to the source code of this file.

Defines

#define DIGEST_SIZE   (16)

Functions

int md5_test_MD5_Init (void)
int md5_test_MD5_Update ()
int md5_test_MD5_Final ()
void md5_test (test_result *global_results)


Define Documentation

#define DIGEST_SIZE   (16)
 


Function Documentation

void md5_test test_result global_results  ) 
 

Main testfunction for the MD5 tests. It does nothing but calling the subtests one after the other.

Definition at line 218 of file md5_test.c.

int md5_test_MD5_Final  ) 
 

Testfunciton for MD5_Final

Returns:
int number of tests failed in this function

Definition at line 159 of file md5_test.c.

int md5_test_MD5_Init void   ) 
 

Testfunciton for MD5_Init

Returns:
int number of tests failed in this function

Definition at line 67 of file md5_test.c.

int md5_test_MD5_Update  ) 
 

Testfunciton for MD5_Update

Returns:
int number of tests failed in this function

Definition at line 97 of file md5_test.c.


Copyright 2003 by Christian Scheurer and Niklaus Schild