[cryptodev:master 5/15] drivers/crypto/inside-secure/safexcel_hash.c:1299:25: sparse: cast truncates bits from constant value (6a09e667f3bcc908 becomes f3bcc908)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   38641b83ebc54635151810eeef00b61da3097952
commit: b460edb6230ac2877b0d176b9122736fed6f3c6e [5/15] crypto: inside-secure - sha512 support
reproduce:
        # apt-get install sparse
        git checkout b460edb6230ac2877b0d176b9122736fed6f3c6e
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/slab.h:631:13: sparse: undefined identifier '__builtin_mul_overflow'
   drivers/crypto/inside-secure/safexcel_hash.c:1005:45: sparse: cast to restricted __le32
   drivers/crypto/inside-secure/safexcel_hash.c:1006:45: sparse: cast to restricted __le32
   include/linux/slab.h:631:13: sparse: call with no type!
>> drivers/crypto/inside-secure/safexcel_hash.c:1299:25: sparse: cast truncates bits from constant value (6a09e667f3bcc908 becomes f3bcc908)
>> drivers/crypto/inside-secure/safexcel_hash.c:1301:25: sparse: cast truncates bits from constant value (bb67ae8584caa73b becomes 84caa73b)
>> drivers/crypto/inside-secure/safexcel_hash.c:1303:25: sparse: cast truncates bits from constant value (3c6ef372fe94f82b becomes fe94f82b)
>> drivers/crypto/inside-secure/safexcel_hash.c:1305:25: sparse: cast truncates bits from constant value (a54ff53a5f1d36f1 becomes 5f1d36f1)
>> drivers/crypto/inside-secure/safexcel_hash.c:1307:25: sparse: cast truncates bits from constant value (510e527fade682d1 becomes ade682d1)
>> drivers/crypto/inside-secure/safexcel_hash.c:1309:26: sparse: cast truncates bits from constant value (9b05688c2b3e6c1f becomes 2b3e6c1f)
>> drivers/crypto/inside-secure/safexcel_hash.c:1311:26: sparse: cast truncates bits from constant value (1f83d9abfb41bd6b becomes fb41bd6b)
>> drivers/crypto/inside-secure/safexcel_hash.c:1313:26: sparse: cast truncates bits from constant value (5be0cd19137e2179 becomes 137e2179)

vim +1299 drivers/crypto/inside-secure/safexcel_hash.c

  1291	
  1292	static int safexcel_sha512_init(struct ahash_request *areq)
  1293	{
  1294		struct safexcel_ahash_ctx *ctx = crypto_ahash_ctx(crypto_ahash_reqtfm(areq));
  1295		struct safexcel_ahash_req *req = ahash_request_ctx(areq);
  1296	
  1297		memset(req, 0, sizeof(*req));
  1298	
> 1299		req->state[0] = lower_32_bits(SHA512_H0);
  1300		req->state[1] = upper_32_bits(SHA512_H0);
> 1301		req->state[2] = lower_32_bits(SHA512_H1);
  1302		req->state[3] = upper_32_bits(SHA512_H1);
> 1303		req->state[4] = lower_32_bits(SHA512_H2);
  1304		req->state[5] = upper_32_bits(SHA512_H2);
> 1305		req->state[6] = lower_32_bits(SHA512_H3);
  1306		req->state[7] = upper_32_bits(SHA512_H3);
> 1307		req->state[8] = lower_32_bits(SHA512_H4);
  1308		req->state[9] = upper_32_bits(SHA512_H4);
> 1309		req->state[10] = lower_32_bits(SHA512_H5);
  1310		req->state[11] = upper_32_bits(SHA512_H5);
> 1311		req->state[12] = lower_32_bits(SHA512_H6);
  1312		req->state[13] = upper_32_bits(SHA512_H6);
> 1313		req->state[14] = lower_32_bits(SHA512_H7);
  1314		req->state[15] = upper_32_bits(SHA512_H7);
  1315	
  1316		ctx->alg = CONTEXT_CONTROL_CRYPTO_ALG_SHA512;
  1317		req->digest = CONTEXT_CONTROL_DIGEST_PRECOMPUTED;
  1318		req->state_sz = SHA512_DIGEST_SIZE;
  1319	
  1320		return 0;
  1321	}
  1322	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux