# -*- tcl -*-
# Commands covered:	otp_sha1 one-way hash function
#
# This file contains a collection of tests for one or more of the commands
# the BLOB-X 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: otp_sha1_bb.test,v 1.1 1999/09/19 10:33:30 aku Exp $


foreach {i in digest} {
    0 abc
    DAC3778F0643563F

    1 abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq
    140470DB8BFB6AE5
} {
    if {[info tclversion] < 8.0} {
	test otp_sha1-4.$i-7.6 {otp_sha1, immediate} {hasSSL} {
	    exec_md otp_sha1 [text2hex $in]
	} [string toupper $digest]
    } else {
	test otp_sha1-4.$i-8.x {otp_sha1, immediate} {hasSSL} {
	    hex -m e [otp_sha1 $in]
	} [string toupper $digest]
    }
}


::tcltest::cleanupTests
