From: Taylor R Campbell Date: Wed, 7 Nov 2018 02:52:37 +0000 (+0000) Subject: Simplify construction of chacha core test vector tests. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~116^2~41 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=3b826d76cd7be4de026e8c5232c641f5c4244c13;p=mit-scheme.git Simplify construction of chacha core test vector tests. --- diff --git a/tests/microcode/test-chacha.scm b/tests/microcode/test-chacha.scm index 598563c32..411c41063 100644 --- a/tests/microcode/test-chacha.scm +++ b/tests/microcode/test-chacha.scm @@ -26,18 +26,18 @@ USA. ;;;; Tests of ChaCha -(define (define-chacha-core-test name primitive expected) +(define (define-chacha-core-test name expected) (define-test name (lambda () (let ((output (make-bytevector 64)) (input (make-bytevector 16 0)) (key (make-bytevector 32 0)) - (constant (string->utf8 "expand 32-byte k"))) + (constant (string->utf8 "expand 32-byte k")) + (primitive (make-primitive-procedure name 5))) (primitive output 0 input key constant) (assert-equal output expected))))) (define-chacha-core-test 'chacha8-core - (make-primitive-procedure 'chacha8-core 5) '#u8(#x3e #x00 #xef #x2f #x89 #x5f #x40 #xd6 #x7f #x5b #xb8 #xe8 #x1f #x09 #xa5 #xa1 #x2c #x84 #x0e #xc3 #xce #x9a #x7f #x3b @@ -48,7 +48,6 @@ USA. #x38 #x7b #xfd #xb8 #x0e #x0c #xfe #x42)) (define-chacha-core-test 'chacha12-core - (make-primitive-procedure 'chacha12-core 5) '#u8(#x9b #xf4 #x9a #x6a #x07 #x55 #xf9 #x53 #x81 #x1f #xce #x12 #x5f #x26 #x83 #xd5 #x04 #x29 #xc3 #xbb #x49 #xe0 #x74 #x14 @@ -59,7 +58,6 @@ USA. #x61 #x0b #xe8 #x2f #x41 #x13 #x26 #xbe)) (define-chacha-core-test 'chacha20-core - (make-primitive-procedure 'chacha20-core 5) '#u8(#x76 #xb8 #xe0 #xad #xa0 #xf1 #x3d #x90 #x40 #x5d #x6a #xe5 #x53 #x86 #xbd #x28 #xbd #xd2 #x19 #xb8 #xa0 #x8d #xed #x1a