From 57122c30f20da9a02b0fc8303bc5327babe83c69 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Sun, 23 Aug 2020 15:51:49 +0200 Subject: Add secp256r1, secp384r1 and secp521r1 to benchmark --- benchmark/benchmark-implementation.lisp | 14 ++++++++------ benchmark/benchmark.lisp | 9 ++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/benchmark/benchmark-implementation.lisp b/benchmark/benchmark-implementation.lisp index a724837..9a622c8 100644 --- a/benchmark/benchmark-implementation.lisp +++ b/benchmark/benchmark-implementation.lisp @@ -112,9 +112,9 @@ (defun benchmark-diffie-hellman () (let ((speeds '())) - (dolist (dh-name '(:curve25519 :curve448 :elgamal)) + (dolist (dh-name '(:curve25519 :curve448 :elgamal :secp256r1 :secp384r1 :secp521r1)) (multiple-value-bind (private-key public-key) - (if (member dh-name '(:curve25519 :curve448)) + (if (member dh-name '(:curve25519 :curve448 :secp256r1 :secp384r1 :secp521r1)) (ironclad:generate-key-pair dh-name) (ironclad:generate-key-pair dh-name :num-bits 2048)) (let ((speed (get-speed-ops (loop repeat *iterations* @@ -135,8 +135,9 @@ (defun benchmark-signatures () (let ((speeds '()) (message (ironclad:random-data 20))) - (dolist (signature-name '(:dsa :ed25519 :ed448 :elgamal :rsa)) - (let* ((private-key (if (member signature-name '(:ed25519 :ed448)) + (dolist (signature-name '(:dsa :ed25519 :ed448 :elgamal :rsa + :secp256r1 :secp384r1 :secp521r1)) + (let* ((private-key (if (member signature-name '(:ed25519 :ed448 :secp256r1 :secp384r1 :secp521r1)) (ironclad:generate-key-pair signature-name) (ironclad:generate-key-pair signature-name :num-bits 2048))) (speed (get-speed-ops (loop repeat *iterations* @@ -147,9 +148,10 @@ (defun benchmark-verifications () (let ((speeds '()) (message (ironclad:random-data 20))) - (dolist (signature-name '(:dsa :ed25519 :ed448 :elgamal :rsa)) + (dolist (signature-name '(:dsa :ed25519 :ed448 :elgamal :rsa + :secp256r1 :secp384r1 :secp521r1)) (multiple-value-bind (private-key public-key) - (if (member signature-name '(:ed25519 :ed448)) + (if (member signature-name '(:ed25519 :ed448 :secp256r1 :secp384r1 :secp521r1)) (ironclad:generate-key-pair signature-name) (ironclad:generate-key-pair signature-name :num-bits 2048)) (let* ((signature (ironclad:sign-message private-key message)) diff --git a/benchmark/benchmark.lisp b/benchmark/benchmark.lisp index 7ffc8b8..a4414d8 100644 --- a/benchmark/benchmark.lisp +++ b/benchmark/benchmark.lisp @@ -158,7 +158,8 @@ (format file " ~10a |" lisp))) (terpri file) (format file "~a~%" line) - (dolist (dh-name '(:curve25519 :curve448 :elgamal)) + (dolist (dh-name '(:curve25519 :curve448 :elgamal + :secp256r1 :secp384r1 :secp521r1)) (format file "| ~14a |" dh-name) (dolist (implementation *lisp-implementations*) (let* ((lisp (car implementation)) @@ -205,7 +206,8 @@ (format file " ~10a |" lisp))) (terpri file) (format file "~a~%" line) - (dolist (signature-name '(:dsa :ed25519 :ed448 :elgamal :rsa)) + (dolist (signature-name '(:dsa :ed25519 :ed448 :elgamal :rsa + :secp256r1 :secp384r1 :secp521r1)) (format file "| ~14a |" signature-name) (dolist (implementation *lisp-implementations*) (let* ((lisp (car implementation)) @@ -229,7 +231,8 @@ (format file " ~10a |" lisp))) (terpri file) (format file "~a~%" line) - (dolist (signature-name '(:dsa :ed25519 :ed448 :elgamal :rsa)) + (dolist (signature-name '(:dsa :ed25519 :ed448 :elgamal :rsa + :secp256r1 :secp384r1 :secp521r1)) (format file "| ~14a |" signature-name) (dolist (implementation *lisp-implementations*) (let* ((lisp (car implementation)) -- cgit v1.2.3-70-g09d2