Module Name:    src
Committed By:   christos
Date:           Wed Apr 14 21:29:57 UTC 2021

Modified Files:
        src/sys/crypto/adiantum: adiantum.c

Log Message:
use an enum instead of constant variables so that they work in CTASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/crypto/adiantum/adiantum.c

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

Modified files:

Index: src/sys/crypto/adiantum/adiantum.c
diff -u src/sys/crypto/adiantum/adiantum.c:1.5 src/sys/crypto/adiantum/adiantum.c:1.6
--- src/sys/crypto/adiantum/adiantum.c:1.5	Sun Jul 26 00:05:20 2020
+++ src/sys/crypto/adiantum/adiantum.c	Wed Apr 14 17:29:57 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: adiantum.c,v 1.5 2020/07/26 04:05:20 riastradh Exp $	*/
+/*	$NetBSD: adiantum.c,v 1.6 2021/04/14 21:29:57 christos Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: adiantum.c,v 1.5 2020/07/26 04:05:20 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: adiantum.c,v 1.6 2021/04/14 21:29:57 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/endian.h>
@@ -390,10 +390,12 @@ static void
 nh(uint8_t h[static 32], const uint8_t *m, size_t mlen,
     const uint32_t k[static 268 /* u/w + 2s(r - 1) */])
 {
-	const unsigned w = 32;	 /* word size */
-	const unsigned s = 2;	 /* stride */
-	const unsigned r = 4;	 /* rounds */
-	const unsigned u = 8192; /* unit count (bits per msg unit) */
+	enum {
+	    s = 2,	 /* stride */
+	    r = 4,	 /* rounds */
+	    w = 32,	 /* word size */
+	    u = 8192	 /* unit count (bits per msg unit) */
+	};
 	uint64_t h0 = 0, h1 = 0, h2 = 0, h3 = 0;
 	unsigned i;
 

Reply via email to