(chacha20-core bytes (fix:* i 64) nonce key chacha-const)
(let loop ((j 0) (t 1))
(if (fix:< j 8)
- (let ((t (fix:+ t (bytevector-u8-ref nonce i))))
- (bytevector-u8-set! nonce i (fix:and t #xff))
+ (let ((t (fix:+ t (bytevector-u8-ref nonce j))))
+ (bytevector-u8-set! nonce j (fix:and t #xff))
(loop (fix:+ j 1) (fix:lsh t -8))))))
(let* ((rem (fix:- n (fix:* n/64 64))))
(if (fix:positive? rem)
(define-test 'random-bytevector-large
(lambda ()
- (assert-error
- (lambda ()
- (assert-= (bytevector-length (random-bytevector 1088)) 1088)))))
+ (assert-= (bytevector-length (random-bytevector 1088)) 1088)))
\f
(define (define-random-test name procedure)
(define-test name