OSDN Git Service

crypto: streebog - use correct endianness type
authorEric Biggers <ebiggers@google.com>
Thu, 10 Jan 2019 20:17:54 +0000 (12:17 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Jan 2019 10:43:43 +0000 (18:43 +0800)
streebog_uint512::qword needs to be __le64, not u64.  This fixes a large
number of sparse warnings:

    crypto/streebog_generic.c:25:9: warning: incorrect type in initializer (different base types)
    crypto/streebog_generic.c:25:9:    expected unsigned long long
    crypto/streebog_generic.c:25:9:    got restricted __le64 [usertype]
    [omitted many similar warnings]

No actual change in behavior.

Cc: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/streebog_generic.c
include/crypto/streebog.h

index 03272a2..5a2eafe 100644 (file)
@@ -960,7 +960,7 @@ static int streebog_init(struct shash_desc *desc)
        memset(ctx, 0, sizeof(struct streebog_state));
        for (i = 0; i < 8; i++) {
                if (digest_size == STREEBOG256_DIGEST_SIZE)
-                       ctx->h.qword[i] = 0x0101010101010101ULL;
+                       ctx->h.qword[i] = cpu_to_le64(0x0101010101010101ULL);
        }
        return 0;
 }
index 4af119f..856e32a 100644 (file)
@@ -19,7 +19,7 @@
 #define STREEBOG_BLOCK_SIZE    64
 
 struct streebog_uint512 {
-       u64 qword[8];
+       __le64 qword[8];
 };
 
 struct streebog_state {