Module Name:    src
Committed By:   riastradh
Date:           Tue Mar 11 12:34:09 UTC 2025

Modified Files:
        src/lib/libc/gen: arc4random.c

Log Message:
arc4random(4): Fix crypto_onetimestream_selftest on big-endian.

Had computed the nonce increment the wrong way around when simulating
a big-endian machine to generate this.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/lib/libc/gen/arc4random.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/gen/arc4random.c
diff -u src/lib/libc/gen/arc4random.c:1.47 src/lib/libc/gen/arc4random.c:1.48
--- src/lib/libc/gen/arc4random.c:1.47	Mon Mar 10 21:21:32 2025
+++ src/lib/libc/gen/arc4random.c	Tue Mar 11 12:34:09 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.47 2025/03/10 21:21:32 riastradh Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.48 2025/03/11 12:34:09 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: arc4random.c,v 1.47 2025/03/10 21:21:32 riastradh Exp $");
+__RCSID("$NetBSD: arc4random.c,v 1.48 2025/03/11 12:34:09 riastradh Exp $");
 
 #include "namespace.h"
 #include "reentrant.h"
@@ -455,15 +455,15 @@ crypto_onetimestream_selftest(void)
 #elif _BYTE_ORDER == _BIG_ENDIAN
 #  if crypto_core_ROUNDS == 20
 		0x20,0xf0,0x66,		/* initial block */
-		0xc9,0x06,0x63,0xc5,0x45,0x38,0xd1,0xb1,
-		0xe6,0x3e,0xbf,0x68,0x19,0xd6,0xf1,0xbe,
-		0x09,0xb9,0x49,0xc4,0xf5,0x55,0x95,0xc1,
-		0x54,0x56,0xeb,0xe4,0x8c,0xa5,0xbb,0x55,
-		0x17,0x89,0x8e,0x90,0x51,0x53,0xea,0x17,
-		0x29,0xf5,0x7e,0xe4,0x78,0x08,0x53,0xc8,
-		0x54,0xa8,0xba,0x76,0xce,0x0e,0x8d,0x2f,
-		0xe1,0x07,0xc8,0x46,0x73,0x3e,0x61,0x0c,
-		0x02,			/* final block */
+		0x1a,0x82,0xda,0xb6,0xba,0x90,0x42,0x19,
+		0x39,0xc2,0x4e,0x4d,0xaf,0xbc,0x67,0xcf,
+		0xe3,0xe4,0xe2,0x80,0x38,0x80,0x8e,0x53,
+		0x19,0x25,0x37,0x67,0x66,0x57,0x7c,0x78,
+		0xac,0xb3,0x8b,0x97,0x54,0x20,0xc4,0x46,
+		0xff,0x90,0x76,0x56,0xcc,0xde,0xe5,0xb9,
+		0xdf,0x82,0x8c,0x05,0x9d,0xf0,0x69,0x99,
+		0x42,0x53,0x74,0x5e,0x80,0x81,0xdb,0x9b,
+		0xb1,			/* final block */
 #  else
 #    error crypto_core_ROUNDS other than 20 left as exercise for reader.
 #  endif

Reply via email to