# -*- tcl -*-
# Commands covered:	haval one-way
#
# This file contains a collection of tests for one or more of the commands
# the TRF extension. Sourcing this file into Tcl runs the
# tests and generates output for errors.  No output means no errors were
# found.
#
# Copyright (c) 1996 Andreas Kupries (andreas_kupries@users.sourceforge.net)
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# $Id: haval.test,v 1.4 1997/07/22 22:00:43 aku Exp $

if {[string compare test [info procs test]] == 1} then {source defs}


foreach {i in digest} {
    1    {}
    4F6938531F0BC8991F62DA7BBD6F7DE3FAD44562B8C6F4EBF146D5B4E46F7C17

    2    a
    47C838FBB4081D9525A0FF9B1E2C05A98F625714E72DB289010374E27DB021D8

    3    HAVAL
    91850C6487C9829E791FC5B58E98E372F3063256BB7D313A93F1F83B426AEDCC

    4    0123456789
    63238D99C02BE18C3C5DB7CCE8432F51329012C228CCC17EF048A5D0FD22D4AE

    5    abcdefghijklmnopqrstuvwxyz
    72FAD4BDE1DA8C8332FB60561A780E7F504F21547B98686824FC33FC796AFA76

    6    ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
    899397D96489281E9E76D5E65ABAB751F312E06C06C07C9C1D42ABD31BB6A404
} {
    if {[info tclversion] < 8.0} {
	test haval-4.$i-7.6 {haval, immediate} {
	    exec_md haval [text2hex $in]
	} $digest
    } else {
	test haval-4.$i-8.x {haval, immediate} {
	    hex -m e [haval $in]
	} $digest
    }
}
