shithub: mc

ref: da45fcd5ccafb05f813c989a379dd6920e517c53
dir: /lib/cryptohash/test/sha1.myr/

View raw version
use std
use cryptohash

use "test/util.use"

const main = {
	hasheq(cryptohash.sha1("")[:], \
		"da39a3ee5e6b4b0d3255bfef60951890d8af0709")
	hasheq(cryptohash.sha1("h")[:], \
		"27d5482eebd075de44389774e2fc8c695cf48a75")
	/* 64 byte block */
	hasheq(cryptohash.sha1("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")[:], \
		"0098ba824b5c16427bd7a1125a2a442aec25644d")
	/* tail spanning */
	hasheq(cryptohash.sha1("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb")[:], \
		"4eb17e52bb55910b037869438f69d9c87643d75a")
}