# -*- tcl -*-
# Commands covered:	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 (a.kupries@westend.com)
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# $Id: sha1_bb.test,v 1.1 1999/09/19 10:33:31 aku Exp $


foreach {i in digest} {
    0 abc
    A9993E364706816ABA3E25717850C26C9CD0D89D

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


::tcltest::cleanupTests
