aboutsummaryrefslogtreecommitdiff
path: root/benchmark.sh
blob: f6c83c974af7b48e795acf9b28d953ea51b719ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh

P11SPEED=p11speed
MODULE=/usr/local/homebrew/lib/libcryptech-pkcs11.dylib

# use pkcs11spy for testing
export PKCS11SPY=$MODULE
#export PKCS11SPY_OUTPUT=pkcs11spy.log
MODULE=/Library/OpenSC/lib/pkcs11/pkcs11-spy.so

SLOT=0
USER_PIN=1234

THREADS=2

run_p11speed() {
	$P11SPEED \
		--sign \
		--module $MODULE \
		--slot $SLOT \
		--threads $THREADS \
		--pin $USER_PIN \
		$@
}

run_p11speed --mechanism RSA_PKCS --keysize 1024 --iterations 40
run_p11speed --mechanism RSA_PKCS --keysize 2048 --iterations 20
run_p11speed --mechanism RSA_PKCS --keysize 4096 --iterations 10

run_p11speed --mechanism DSA --keysize 1024 --iterations 40
run_p11speed --mechanism DSA --keysize 2048 --iterations 20
run_p11speed --mechanism DSA --keysize 4096 --iterations 10

run_p11speed --mechanism ECDSA --keysize 256 --iterations 20
run_p11speed --mechanism ECDSA --keysize 384 --iterations 10