File: haval.test

package info (click to toggle)
tcltrf 2.1.4-dfsg3-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,628 kB
  • sloc: ansic: 73,134; sh: 3,155; tcl: 1,343; makefile: 176; exp: 22
file content (47 lines) | stat: -rw-r--r-- 1,440 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- 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
    }
}