summaryrefslogtreecommitdiff
path: root/bench/sha1-compute.myr
blob: 22e9a9b05b55b8708b75dcdfc89f3f1c39e86bae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use cryptohash
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++
		cryptohash.sha1init(&st)
		cryptohash.sha1add(&st, buf[:])
		cryptohash.sha1fin(&st)
	;;
}