[PATCH 0/3] crypto: share and use the DH public key range check
From: Ryan Prinz
Date: Fri Dec 04 2026 - 16:26:00 EST
This regroups three previously-independent patches into one series,
per Herbert's request on the QAT thread so Sashiko (and everyone
else) can review them together: patches 2 and 3 both depend on the
helper patch 1 adds.
1/3 adds a shared SP800-56A rev3 5.6.2.3.2 range check,
crypto_dh_pubkey_in_range(), in crypto/dh_helper.c, instead of
QAT and HPRE each carrying a byte-for-byte identical private
copy.
2/3 is the QAT missing-DH-validation fix (previously posted alone as
v1-v3), now calling the shared helper from 1/3 instead of its own
copy of the comparison.
3/3 is the HPRE missing-DH/ECDH-validation fix (previously posted
alone as v1-v4), with its DH half now calling the shared helper
from 1/3 the same way; the ECDH half (ecc_is_pubkey_valid_partial())
is unchanged.
No functional changes from the last individually-posted revision of
any of the three patches; this is just resending as a linked series.
Ryan Prinz (3):
crypto: dh - add shared DH public key range check
crypto: qat - fix missing DH public key validation
crypto: hisilicon/hpre - fix missing DH/ECDH public key validation
crypto/dh_helper.c | 32 ++++++++
drivers/crypto/hisilicon/hpre/hpre_crypto.c | 124 +++++++++++++++++++
drivers/crypto/intel/qat/qat_common/qat_asym_algs.c | 43 +++++++
include/crypto/dh.h | 22 ++++
4 files changed, 221 insertions(+)