shithub: mc

ref: 2be6300162a3b32e4d82f71ed6772aa5feced897
dir: /bench/sha1-compute.myr/

View raw version
use crypto
use std

const N = 20
const main = {
	var i, b
	var buf : byte[1024*1024]
	var st

	b = 0
	for i = 0; i < buf.len; i++
		buf[i] = b++
	;;
	for i = 0; i < N; i++
		crypto.sha1init(&st)
		crypto.sha1add(&st, buf[:])
		crypto.sha1fin(&st)
	;;
}