<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-rng/include/crypto, branch master</title>
<subtitle>Development tree for the kernel CSPRNG</subtitle>
<id>https://git.zx2c4.com/linux-rng/atom/include/crypto?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-rng/atom/include/crypto?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/'/>
<updated>2026-10-22T19:36:46Z</updated>
<entry>
<title>Merge tag 'v7.4-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6</title>
<updated>2026-10-22T19:36:46Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-10-22T19:36:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=bf2325084583daaea91084b25069f121d5d8832b'/>
<id>urn:sha1:bf2325084583daaea91084b25069f121d5d8832b</id>
<content type='text'>
Pull crypto updates from Herbert Xu:
 "API:
   - Fix algif_skcipher source SG overrun
   - Allow hmac(sha512) for non-root users

  Algorithms:
   - Add wrapper for zeroing AES key context
   - Avoid redundant stream initialisations in zstd

  Drivers:
   - Remove hisilicon/sec.
   - Handle digest-only authenc requests in atmel
   - Handle zero-length skcipher requests in mxs-dcp
   - Lower the default priority of caam/qi2

  Others:
   - Optimise key comparison in rhashtable lookup that uses constant
     parameters"

* tag 'v7.4-p1' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (146 commits)
  crypto: atmel-tdes - consolidate error paths in atmel_tdes_dma_init()
  crypto: atmel-tdes - reuse fast in atmel_tdes_crypt_start()
  crypto: atmel-tdes - use separate DMA scatterlists
  MAINTAINERS: delete entry for John Allen
  hwrng: amd - use PMBASE_OFFSET consistently
  hwrng: cctrng - simplify cctrng_probe()
  hwrng: intel - simplify intel_rng_mod_init()
  crypto: qat - fix use of destroyed vf2pf_lock on VF restart
  crypto: qat - initialise state_lock on every path in adf_devmgr_add_dev()
  hwrng: imx-rngc - Use optional clock
  crypto: talitos - init tasklets before requesting IRQs
  crypto: algif_skcipher - rewind rounded output bytes
  crypto: algif_hash - Allow hmac(sha512) for unpriviledged users
  crypto: sa2ul - Remove unused fields
  hwrng: stm32 - use devm_platform_ioremap_resource() in stm32_rng_probe()
  hwrng: stm32 - drop redundant initializations
  hwrng: amd - simplify control flow in amd_rng_mod_init()
  hwrng: stm32 - reuse clock rate in stm32_rng_clock_freq_restrain()
  hwrng: stm32 - use swap() in stm32_rng_probe()
  hwrng: cctrng - drop redundant initializations
  ...
</content>
</entry>
<entry>
<title>lib/crypto: chacha: Use size_t length</title>
<updated>2026-10-16T06:16:46Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@kernel.org</email>
</author>
<published>2026-10-14T15:26:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=e42003dba6dd11380b8c2a39f3bc1bf11a6d0b0f'/>
<id>urn:sha1:e42003dba6dd11380b8c2a39f3bc1bf11a6d0b0f</id>
<content type='text'>
Upgrade the ChaCha functions from 32-bit lengths to size_t.

'size_t' is the best practice for buffer lengths, and it's what the rest
of the crypto library uses.

Moreover, all the 64-bit ChaCha assembly functions actually already
treated the length as 64-bit, despite it being declared as 32-bit in C
on arm64, ppc64, and x86_64.  For arm64 and x86_64, this caused
unspecified behavior due to the high 32 bits of the corresponding
register having an unspecified value in those architectures' ABIs.
However, in practice these bits are always zero and no issue occurred.

(ppc64 was fine too, since there the ABI zero-extends 32-bit arguments.)

These issues date to the original introduction of the ChaCha code.
However, as noted above, they don't have any real-world impact
currently; so this is an API robustness improvement only.

Reported-by: Vladimir Kukharenko &lt;vladimir@genproof.com&gt;
Closes: https://lore.kernel.org/r/20261012-libcrypto-4gib-lengths-v1-0-ea566c129a2e@genproof.com
Tested-by: Vladimir Kukharenko &lt;vladimir@genproof.com&gt;
Link: https://patch.msgid.link/20261014152604.323310-3-ebiggers@kernel.org
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/crypto: poly1305: Use size_t length</title>
<updated>2026-10-16T06:09:15Z</updated>
<author>
<name>Eric Biggers</name>
<email>ebiggers@kernel.org</email>
</author>
<published>2026-10-14T15:26:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=0b58c136c2f9067b1a5253bffa322f6bf3e2cc74'/>
<id>urn:sha1:0b58c136c2f9067b1a5253bffa322f6bf3e2cc74</id>
<content type='text'>
Upgrade the Poly1305 functions from 32-bit lengths to size_t.

'size_t' is the best practice for buffer lengths, and it's what the rest
of the crypto library uses.

Moreover, all the 64-bit Poly1305 assembly functions actually already
treated the length as 64-bit, despite it being declared as 32-bit in C
on arm64, mips64, ppc64, and riscv64:

- On arm64, this caused unspecified behavior due to the high 32 bits
  having an unspecified value in that architecture's ABI.  However, in
  practice these bits are always zero and no issue occurred.  (ppc64 was
  fine too, since there the ABI zero-extends 32-bit arguments.)

- On mips64 and riscv64, this caused incorrect behavior on lengths above
  S32_MAX, due to the sign extension done by those architectures' ABIs.
  Note that no current callers pass lengths over S32_MAX.

Also, the expression 'desc-&gt;buflen + nbytes &gt;= POLY1305_BLOCK_SIZE' in
poly1305_update() could overflow if nbytes was in [UINT_MAX - 14,
UINT_MAX].  Note that again, no current callers pass lengths this large.

These issues date to the original introduction of the Poly1305 code.
However, as noted above, they don't have any real-world impact
currently; so this is an API robustness improvement only.

Reported-by: Vladimir Kukharenko &lt;vladimir@genproof.com&gt;
Closes: https://lore.kernel.org/r/20261012-libcrypto-4gib-lengths-v1-0-ea566c129a2e@genproof.com
Tested-by: Vladimir Kukharenko &lt;vladimir@genproof.com&gt;
Link: https://patch.msgid.link/20261014152604.323310-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/crypto: sha2: Provide functions for zeroizing SHA2 hmac_sha* structures</title>
<updated>2026-09-30T16:42:09Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-09-28T08:30:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=fb4ccd3d321f890c87e74c5937a74ece822f47e6'/>
<id>urn:sha1:fb4ccd3d321f890c87e74c5937a74ece822f47e6</id>
<content type='text'>
In certain cases crypto code functions need to zeroize their local SHA2
hmac_sha*_key or hmac_sha*_ctx structures after use to avoid leaking
sensitive material on the stack.
Provide hmac_sha*_zeroize_key() and hmac_sha*_zeroize_ctx() helper
functions that can be used with __cleanup() to automatically zeroize
the structure when it goes out of scope.

Reviewed-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Link: https://patch.msgid.link/20260928083055.104266-3-thuth@redhat.com
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/crypto: sha1: Provide functions for zeroizing hmac_sha1 structures</title>
<updated>2026-09-30T16:33:54Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-09-16T09:50:10Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=e09cbc96ff8c94d477a07b2e35b4b4886dc9cf30'/>
<id>urn:sha1:e09cbc96ff8c94d477a07b2e35b4b4886dc9cf30</id>
<content type='text'>
In certain cases crypto code needs to zeroize their local hmac_sha1_key
or hmac_sha1_ctx structures after use to avoid leaking sensitive material.
Provide hmac_sha1_zeroize_key() and hmac_sha1_zeroize_ctx() helper
functions that e.g. can be used with __cleanup() to automatically zeroize
the structures when they go out of scope.

While we're at it, replace the related memzero_explicit() call in
lib/crypto/sha1.c with a call to the new helper function.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Link: https://patch.msgid.link/20260916095022.604354-9-thuth@redhat.com
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/crypto: blake2: Provide functions for zeroizing blake2*_ctx structures</title>
<updated>2026-09-30T16:33:54Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-09-16T09:50:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=97560fd98d4d36b2fd656a6270e15cb2218fcbe2'/>
<id>urn:sha1:97560fd98d4d36b2fd656a6270e15cb2218fcbe2</id>
<content type='text'>
In certain cases crypto code needs to zeroize their local blake2b_ctx
or blake2s_ctx structures after use to avoid leaking sensitive material.
Provide blake2b_zeroize_ctx() and blake2s_zeroize_ctx() helper functions
that e.g. can be used with __cleanup() to automatically zeroize the
structures when they go out of scope.

While we're at it, replace the related memzero_explicit() calls in
lib/crypto/blake2*.c with calls to the new helper functions.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Link: https://patch.msgid.link/20260916095022.604354-8-thuth@redhat.com
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/crypto: sm3: Provide a function for zeroizing the sm3_ctx structure</title>
<updated>2026-09-30T16:33:54Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-09-16T09:50:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=e2b5aa03d6f42d2e4fb9c20a4eeb9ba1a9cac8cb'/>
<id>urn:sha1:e2b5aa03d6f42d2e4fb9c20a4eeb9ba1a9cac8cb</id>
<content type='text'>
In certain cases crypto code functions need to zeroize their local
sm3_ctx structure after use to avoid leaking sensitive material. Provide
a sm3_zeroize_ctx() helper function that e.g. can be used with __cleanup()
to automatically zeroize the structure when it goes out of scope.

While we're at it, replace the related memzero_explicit() call in
lib/crypto/sm3.c with a call to the new helper function.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Link: https://patch.msgid.link/20260916095022.604354-7-thuth@redhat.com
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/crypto: md5: Provide functions for zeroizing hmac_md5 structures</title>
<updated>2026-09-30T16:33:54Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-09-16T09:50:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=91b4ebff7a88ee3a0570b0058b054ecf527cefa2'/>
<id>urn:sha1:91b4ebff7a88ee3a0570b0058b054ecf527cefa2</id>
<content type='text'>
In certain cases crypto code functions need to zeroize their local
hmac_md5_key or hmac_md5_ctx structures after use to avoid leaking
sensitive material on the stack.
Provide hmac_md5_zeroize_key() and hmac_md5_zeroize_ctx() helper
functions that e.g. can be used with __cleanup() to automatically
zeroize the structure when it goes out of scope.

While we're at it, replace the related memzero_explicit() call in
lib/crypto/md5.c with a call to the new helper function.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Link: https://patch.msgid.link/20260916095022.604354-6-thuth@redhat.com
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/crypto: aes-ccm: Provide functions for zeroizing aes_ccm* structures</title>
<updated>2026-09-30T16:33:54Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-09-16T09:50:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=dbb5091fb6c937ff312257aaf9b772216c3ca8f6'/>
<id>urn:sha1:dbb5091fb6c937ff312257aaf9b772216c3ca8f6</id>
<content type='text'>
In certain cases crypto code needs to zeroize their local aes_ccm_key
or aes_ccm_ctx structures after use to avoid leaking sensitive material.
Provide aes_ccm_zeroize_key() and aes_ccm_zeroize_ctx() helper functions
that e.g. can be used with __cleanup() to automatically zeroize the
structures when they go out of scope.

While we're at it, replace the related memzero_explicit() calls in
lib/crypto/aes.c with calls to the new helper functions.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Link: https://patch.msgid.link/20260916095022.604354-5-thuth@redhat.com
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
<entry>
<title>lib/crypto: aes-gcm: Provide functions for zeroizing aes_gcm* structures</title>
<updated>2026-09-30T16:33:54Z</updated>
<author>
<name>Thomas Huth</name>
<email>thuth@redhat.com</email>
</author>
<published>2026-09-16T09:50:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=f0bcf2d3ef935d0fdb76ca23786fe9880ad80827'/>
<id>urn:sha1:f0bcf2d3ef935d0fdb76ca23786fe9880ad80827</id>
<content type='text'>
In certain cases crypto code needs to zeroize their local aes_gcm_key
or aes_gcm_ctx structures after use to avoid leaking sensitive material.
Provide aes_gcm_zeroize_key() and aes_gcm_zeroize_ctx() helper functions
that e.g. can be used with __cleanup() to automatically zeroize the
structures when they go out of scope.

While we're at it, replace the related memzero_explicit() calls in
lib/crypto/aes.c with calls to the new helper functions.

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Link: https://patch.msgid.link/20260916095022.604354-4-thuth@redhat.com
Signed-off-by: Eric Biggers &lt;ebiggers@kernel.org&gt;
</content>
</entry>
</feed>
