From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A010C37F014; Mon, 25 May 2026 18:46:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779734782; cv=none; b=L49Og/iE/rk7VfFjaXrmsopvpXdGPqsHVvYdwyv0sf8uFFlO2SdWPFjg4ARP6wzzsiKd3PUB6KaCm+GHEaZVr7r9X+0kGGPEqLO9EXC9xpEX1/FOsCUhxO6aoovaMWEFc71FKHu77H+ig4+MSSkBq7hEIbgxz33lbZ+q0xX9qVM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779734782; c=relaxed/simple; bh=qIUqrB55wJ2TcD3jEHeCh1TGrwVwdI2eCxZV91bYSeU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EapSjEFuJ2T76r9qnHak5t4kXeBCeEq4nRgcLDir9MwcjcWkDouU4XSPZvsTwsUzX28V8rI+D9eEx2qplNytW5n/6CHssCs5+6cTETBLLM4xKnCb7LBLMFwv1Rw2gcjFDKHua92hhUxilnQA9yK+bDGUFfI0abWtynw97zFAdeg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bj5RcVPM; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bj5RcVPM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E4A51F00A3C; Mon, 25 May 2026 18:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779734773; bh=XqGSYLfaljFAKhzIt6vZvhWqHyJ31TmPt+/g83SMNnk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bj5RcVPM3bclNOvmwMFAuk3/kLzl/Ey6KxvFg5wHP+Tlo8AEQ7+oOMx4uka5eTu2g lzbQFdP2bN8J1sND99FJkrk8DABUA1DB/OMASCqFQ4B6ci2BrhNN6743zQqaSFTbFf yQndptHNDgKtQgwOVn89FR78kZiC6l6bBaXVzPD6v21VT4ypnrL/nOxCq3G760CUEL SpCN4sNjcwbh2gX97evn/j9tGWC5CXjzU9K5m4SUWT7o/HBKJTEx/uZmjbEdSB2mEV QvOYmfVFWd+cYVoHIkYBbu0S5cdYCJ060KrLFcB9eoqMxfV/PTM98ZDDo2ame0aB5U cWnSq1p5Tow8Q== From: Eric Biggers To: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel , "Jason A . Donenfeld" , Herbert Xu , Ryan Appel , Chris Leech , Eric Biggers Subject: [PATCH 3/5] lib/crypto: mlkem: Add FIPS 140-3 tests Date: Mon, 25 May 2026 13:44:01 -0500 Message-ID: <20260525184403.101818-4-ebiggers@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260525184403.101818-1-ebiggers@kernel.org> References: <20260525184403.101818-1-ebiggers@kernel.org> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add the ML-KEM self-tests required by FIPS 140-3: - Pairwise Consistency Test (PCT) at KeyGen time - Cryptographic Algorithm Self-Test (CAST) at initialization time As with the other crypto algorithms, these are implemented separately from the KUnit test suite, due to the very different requirements. Signed-off-by: Eric Biggers --- lib/crypto/fips-mlkem.h | 523 ++++++++++++++++++++++++ lib/crypto/mlkem.c | 115 ++++++ scripts/crypto/import-mlkem-testvecs.py | 62 +++ 3 files changed, 700 insertions(+) create mode 100644 lib/crypto/fips-mlkem.h diff --git a/lib/crypto/fips-mlkem.h b/lib/crypto/fips-mlkem.h new file mode 100644 index 000000000000..bb91c97d4b28 --- /dev/null +++ b/lib/crypto/fips-mlkem.h @@ -0,0 +1,523 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* This file was generated by import-mlkem-testvecs.py */ +/* clang-format off */ + +static const u8 fips_test_mlkem768_seed[MLKEM_SEED_BYTES] __initconst __maybe_unused = { + 0x7f, 0x9c, 0x2b, 0xa4, 0xe8, 0x8f, 0x82, 0x7d, 0x61, 0x60, 0x45, 0x50, + 0x76, 0x05, 0x85, 0x3e, 0xd7, 0x3b, 0x80, 0x93, 0xf6, 0xef, 0xbc, 0x88, + 0xeb, 0x1a, 0x6e, 0xac, 0xfa, 0x66, 0xef, 0x26, 0x3c, 0xb1, 0xee, 0xa9, + 0x88, 0x00, 0x4b, 0x93, 0x10, 0x3c, 0xfb, 0x0a, 0xee, 0xfd, 0x2a, 0x68, + 0x6e, 0x01, 0xfa, 0x4a, 0x58, 0xe8, 0xa3, 0x63, 0x9c, 0xa8, 0xa1, 0xe3, + 0xf9, 0xae, 0x57, 0xe2, +}; + +static const u8 fips_test_mlkem768_eseed[MLKEM_ESEED_BYTES] __initconst __maybe_unused = { + 0x35, 0xb8, 0xcc, 0x87, 0x3c, 0x23, 0xdc, 0x62, 0xb8, 0xd2, 0x60, 0x16, + 0x9a, 0xfa, 0x2f, 0x75, 0xab, 0x91, 0x6a, 0x58, 0xd9, 0x74, 0x91, 0x88, + 0x35, 0xd2, 0x5e, 0x6a, 0x43, 0x50, 0x85, 0xb2, +}; + +static const u8 fips_test_mlkem768_pk[MLKEM768_PUBLIC_KEY_BYTES] __initconst __maybe_unused = { + 0x78, 0x20, 0x32, 0x02, 0x30, 0x23, 0x8e, 0x44, 0x7a, 0xcf, 0xa9, 0x9b, + 0x63, 0x32, 0xb7, 0x53, 0x1c, 0x7c, 0xe5, 0x42, 0x03, 0x1b, 0x93, 0xca, + 0x14, 0x25, 0x8f, 0x5f, 0x98, 0xb3, 0x0c, 0x87, 0x3f, 0x6d, 0x01, 0xb2, + 0xc5, 0x85, 0x3f, 0x34, 0x02, 0x69, 0x18, 0x04, 0x80, 0x47, 0x08, 0xa7, + 0xec, 0xfa, 0x5b, 0xa5, 0x98, 0x0f, 0xef, 0x88, 0x36, 0xce, 0xf5, 0xa8, + 0x2d, 0xac, 0x83, 0x75, 0xe0, 0x62, 0x34, 0xcb, 0xbe, 0xd6, 0x4c, 0xc5, + 0xa4, 0xb2, 0xac, 0x06, 0x84, 0xa0, 0xb4, 0xd9, 0x86, 0x3e, 0x66, 0x44, + 0xa8, 0x33, 0x48, 0x49, 0xc0, 0xcf, 0xdb, 0xfb, 0x85, 0x1b, 0x84, 0xb0, + 0xe4, 0x8c, 0x6f, 0xb0, 0x48, 0x01, 0xd0, 0x52, 0x2f, 0xd5, 0x76, 0x68, + 0x9b, 0x16, 0x44, 0x67, 0x60, 0x4a, 0xb4, 0xda, 0x2e, 0x34, 0xab, 0xcf, + 0x76, 0xdc, 0x92, 0x44, 0x67, 0x4c, 0x4e, 0x57, 0x30, 0xf5, 0x78, 0x7c, + 0x67, 0x90, 0x21, 0x42, 0x4c, 0x13, 0x40, 0x15, 0x4d, 0x24, 0x49, 0x33, + 0x0d, 0xbc, 0x94, 0x0e, 0xba, 0x7b, 0xe1, 0x03, 0x99, 0xec, 0x94, 0x0a, + 0x6b, 0x35, 0x40, 0x60, 0x14, 0x99, 0x66, 0x50, 0xb1, 0x48, 0xa1, 0x89, + 0x43, 0x47, 0x7f, 0x5e, 0x95, 0x0f, 0x41, 0xa0, 0x1a, 0xb6, 0x34, 0x88, + 0xfa, 0xf2, 0x06, 0xf0, 0xf2, 0x25, 0xa7, 0x31, 0x09, 0x67, 0x77, 0x84, + 0x79, 0x1b, 0x6d, 0xec, 0x98, 0x0e, 0x60, 0xeb, 0x8f, 0x96, 0xbb, 0xbf, + 0x47, 0x22, 0x22, 0xb0, 0x24, 0x8a, 0x12, 0xf9, 0x61, 0x88, 0xa1, 0x7d, + 0x68, 0xb8, 0x3e, 0x52, 0xc9, 0x82, 0x7b, 0xa2, 0xc6, 0xbc, 0x82, 0x75, + 0x0b, 0x31, 0xae, 0x46, 0xb9, 0x82, 0x7a, 0x28, 0x77, 0xfc, 0xb3, 0x38, + 0x00, 0x3a, 0x68, 0xb8, 0xc1, 0xaa, 0x9c, 0x96, 0x6b, 0x55, 0xd2, 0x03, + 0x78, 0x74, 0x11, 0x57, 0x77, 0x05, 0xf6, 0xdb, 0x15, 0x59, 0xf9, 0xb4, + 0x25, 0x8a, 0x57, 0x18, 0x20, 0x50, 0x5d, 0x83, 0xc1, 0x00, 0x9a, 0xa2, + 0xb2, 0x84, 0xb3, 0x75, 0xa7, 0xac, 0x61, 0x6a, 0x1b, 0x29, 0x42, 0xa2, + 0xb4, 0x94, 0xc4, 0x3e, 0xb3, 0x70, 0xc1, 0xb9, 0x4a, 0xcd, 0x52, 0x2b, + 0x20, 0x8c, 0x17, 0xc7, 0x35, 0x07, 0x7e, 0x60, 0x2f, 0x41, 0x41, 0x0c, + 0xfb, 0x1b, 0x3e, 0xa1, 0x09, 0x21, 0x58, 0xc3, 0xb6, 0xea, 0x43, 0xcc, + 0x7a, 0xa7, 0x03, 0x09, 0xa6, 0x0f, 0xa9, 0x64, 0x47, 0x21, 0x33, 0x2a, + 0x0d, 0xc4, 0x55, 0xbd, 0xb5, 0x63, 0xd5, 0xe6, 0x6e, 0xe2, 0x12, 0x10, + 0x87, 0x2a, 0x59, 0x8d, 0x13, 0xa9, 0x51, 0x83, 0x11, 0x9a, 0x50, 0x7a, + 0x76, 0x34, 0x3b, 0x45, 0x4b, 0xb3, 0x20, 0x4b, 0xad, 0x83, 0x46, 0x9b, + 0x56, 0x27, 0x52, 0xa7, 0x3a, 0x00, 0xe5, 0xe8, 0xc5, 0xa6, 0xd9, 0x87, + 0x0a, 0xca, 0x93, 0x78, 0x69, 0x05, 0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0x1b, 0xd4, 0x8c, 0x9a, 0x64, 0x8b, 0x4f, 0x60, 0x8e, + 0x4f, 0xeb, 0x37, 0x8e, 0x65, 0x54, 0xb7, 0x3c, 0xa8, 0xe3, 0x7b, 0x9d, + 0x5f, 0xa7, 0x6b, 0x44, 0x1c, 0x03, 0x97, 0xf8, 0xc0, 0xaa, 0x39, 0xb2, + 0x34, 0x8a, 0xbc, 0x3c, 0x6d, 0x0d, 0x13, 0xa6, 0xbd, 0x91, 0xd6, 0x2a, + 0x43, 0xc6, 0x51, 0x60, 0x63, 0xdf, 0xd5, 0xbf, 0x77, 0xf0, 0xf1, 0x08, + 0x42, 0x24, 0x43, 0x7b, 0x47, 0xa8, 0x2b, 0xa2, +}; + +static const u8 fips_test_mlkem768_sk[MLKEM768_SECRET_KEY_BYTES] __initconst __maybe_unused = { + 0xe7, 0xfa, 0x46, 0xcd, 0x07, 0xc1, 0xb4, 0xda, 0x48, 0xcb, 0x48, 0xa3, + 0xaf, 0xe1, 0x47, 0x9f, 0x96, 0x71, 0x1b, 0xac, 0x5c, 0xd2, 0x62, 0xc4, + 0x3d, 0xaa, 0xc5, 0xbc, 0x68, 0x66, 0x2d, 0x5c, 0x5d, 0x0b, 0x83, 0x55, + 0x1b, 0xda, 0xb9, 0xd1, 0x48, 0xa4, 0xd7, 0xe4, 0x3d, 0xc6, 0x16, 0x56, + 0x1f, 0xb2, 0x7f, 0x58, 0x42, 0x83, 0x8c, 0x71, 0x47, 0x22, 0x45, 0x6c, + 0x4c, 0x7c, 0x44, 0xb2, 0x48, 0xa8, 0xe0, 0x66, 0x37, 0xad, 0x40, 0x30, + 0xe5, 0x39, 0x5b, 0xd2, 0xa7, 0x81, 0x36, 0x1a, 0x9e, 0x23, 0x61, 0xc1, + 0x19, 0x38, 0x39, 0x04, 0x87, 0x81, 0x2e, 0xdb, 0x21, 0xbd, 0x04, 0x8c, + 0x45, 0xe9, 0x83, 0xb2, 0x33, 0x94, 0x98, 0x5c, 0x5a, 0x2b, 0x60, 0x7e, + 0xfc, 0x97, 0x50, 0x57, 0x3c, 0x7e, 0x9f, 0x74, 0x90, 0xce, 0x42, 0x66, + 0x79, 0x59, 0x92, 0x97, 0xc5, 0x8c, 0xe6, 0x42, 0x0f, 0x2a, 0x67, 0x33, + 0xb9, 0x01, 0x81, 0x9a, 0xe2, 0x59, 0x9e, 0x50, 0x70, 0xf9, 0xf0, 0x77, + 0xb9, 0xe0, 0xb9, 0x94, 0x73, 0x80, 0x55, 0x2c, 0xc4, 0xb6, 0x24, 0x2b, + 0x30, 0xf2, 0x88, 0x46, 0xd5, 0x0e, 0x62, 0x38, 0xbd, 0xcb, 0x0b, 0x74, + 0x2f, 0x17, 0x5c, 0xfe, 0xbb, 0xab, 0xc6, 0x47, 0xa2, 0xf0, 0x32, 0x93, + 0x99, 0x8c, 0x7d, 0x96, 0x41, 0x13, 0xdd, 0x5a, 0x79, 0xe4, 0x7b, 0x40, + 0x7c, 0x6b, 0x9c, 0x23, 0x25, 0x2d, 0xa4, 0xf3, 0x40, 0x1e, 0xb5, 0x02, + 0x1f, 0x3c, 0xc1, 0xfd, 0x43, 0xc7, 0x87, 0x01, 0xb9, 0x72, 0x87, 0x71, + 0x00, 0x12, 0xb9, 0x85, 0x44, 0xac, 0x0f, 0x35, 0xc0, 0x78, 0x8b, 0x7a, + 0xa5, 0x14, 0x94, 0x5d, 0x41, 0x80, 0xce, 0x44, 0x9d, 0x12, 0x28, 0x01, + 0x77, 0x79, 0xb7, 0xf3, 0xb5, 0x16, 0xf1, 0x97, 0x58, 0x5a, 0x75, 0x29, + 0x90, 0x2a, 0x57, 0xd3, 0x08, 0xc0, 0x00, 0xc1, 0x42, 0xe3, 0x96, 0x08, + 0xd3, 0xba, 0x70, 0x81, 0x21, 0x8b, 0x3a, 0x1a, 0x29, 0xe4, 0xe3, 0x9e, + 0x4f, 0x21, 0x0c, 0x27, 0xa9, 0x2c, 0x30, 0xd0, 0xbf, 0x61, 0x1a, 0x28, + 0x03, 0x3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46, 0x87, 0xb1, 0xf8, 0x03, 0x24, + 0x37, 0x98, 0xca, 0x37, 0x35, 0x80, 0x9f, 0x06, 0x14, 0xe1, 0xd8, 0x6d, + 0x1d, 0xab, 0x06, 0xce, 0xe8, 0x95, 0xaa, 0xa7, 0x46, 0xeb, 0xb5, 0x96, + 0xce, 0x12, 0x68, 0xa5, 0xc3, 0xcd, 0xbf, 0xb2, 0x57, 0xe9, 0xfc, 0xa7, + 0x52, 0x13, 0x38, 0x70, 0x33, 0x0c, 0x8e, 0x7c, 0x22, 0x29, 0xe4, 0x21, + 0x29, 0xe1, 0x58, 0x60, 0xb5, 0xc7, 0xe9, 0x17, 0xaf, 0x4b, 0x30, 0x42, + 0x9c, 0xdc, 0xb6, 0x86, 0x57, 0x54, 0x6c, 0x06, 0x73, 0xe5, 0xa8, 0x46, + 0xec, 0xa7, 0x64, 0xcc, 0x1c, 0xb1, 0x77, 0xb1, 0x3b, 0x9d, 0x33, 0x21, + 0x3e, 0x20, 0x39, 0xe8, 0xf1, 0x8b, 0x80, 0xd2, 0x8e, 0xc0, 0x73, 0x7c, + 0xa0, 0x5c, 0x10, 0x14, 0x5b, 0x00, 0xd0, 0x44, 0x6e, 0x49, 0xf3, 0x0e, + 0xfa, 0x23, 0x9e, 0xef, 0x00, 0x7f, 0x37, 0x82, 0x85, 0x92, 0x75, 0x04, + 0xa3, 0x25, 0x89, 0xf4, 0x3a, 0x77, 0x72, 0xe3, 0x6c, 0x52, 0x05, 0x9c, + 0xad, 0xe9, 0x54, 0x08, 0xf8, 0x17, 0x9f, 0x89, 0x4e, 0xc2, 0xf5, 0xc7, + 0xef, 0xda, 0x05, 0x14, 0x37, 0x58, 0x09, 0xf6, 0x2d, 0x93, 0x11, 0xa7, + 0x79, 0xbb, 0xb1, 0xec, 0x50, 0x35, 0x5a, 0x87, 0x75, 0xa6, 0xc7, 0x8b, + 0xe5, 0x63, 0xc5, 0x3f, 0xfb, 0x51, 0x9b, 0xa4, 0x9f, 0x60, 0x21, 0xc5, + 0xd7, 0xca, 0x5f, 0x94, 0x13, 0x70, 0x00, 0x48, 0x40, 0x58, 0x4a, 0x7b, + 0x58, 0x78, 0xa3, 0xfc, 0x38, 0x49, 0x3a, 0xd0, 0x72, 0x99, 0xb5, 0x58, + 0x81, 0x62, 0x83, 0xd3, 0x7a, 0x03, 0x08, 0x76, 0xb3, 0xcf, 0x27, 0xa9, + 0x88, 0xc8, 0xae, 0x35, 0xdb, 0x0d, 0x50, 0x6a, 0xa8, 0xa2, 0x31, 0x4f, + 0x3a, 0x6b, 0x5f, 0x04, 0x37, 0x54, 0xbe, 0x51, 0xb8, 0x92, 0xb7, 0x02, + 0x5a, 0x06, 0x50, 0xee, 0x40, 0xa5, 0xff, 0x76, 0x6c, 0x63, 0x09, 0xc9, + 0x26, 0x5c, 0x16, 0x61, 0xca, 0x5a, 0xe5, 0xb1, 0xaa, 0xe1, 0xf3, 0x84, + 0xd3, 0x29, 0x25, 0x9a, 0xf7, 0x4c, 0xed, 0xc6, 0x0f, 0x29, 0xfc, 0x04, + 0xb2, 0x28, 0x24, 0xe3, 0x78, 0x86, 0xed, 0x08, 0x49, 0x5c, 0xd6, 0xb5, + 0x50, 0x4c, 0xbe, 0x0e, 0x13, 0xcc, 0x94, 0x71, 0xcf, 0x99, 0x04, 0x3e, + 0x6e, 0x75, 0x07, 0x83, 0x2c, 0x1b, 0x47, 0xcb, 0xac, 0x22, 0x68, 0xa8, + 0x78, 0x20, 0x32, 0x02, 0x30, 0x23, 0x8e, 0x44, 0x7a, 0xcf, 0xa9, 0x9b, + 0x63, 0x32, 0xb7, 0x53, 0x1c, 0x7c, 0xe5, 0x42, 0x03, 0x1b, 0x93, 0xca, + 0x14, 0x25, 0x8f, 0x5f, 0x98, 0xb3, 0x0c, 0x87, 0x3f, 0x6d, 0x01, 0xb2, + 0xc5, 0x85, 0x3f, 0x34, 0x02, 0x69, 0x18, 0x04, 0x80, 0x47, 0x08, 0xa7, + 0xec, 0xfa, 0x5b, 0xa5, 0x98, 0x0f, 0xef, 0x88, 0x36, 0xce, 0xf5, 0xa8, + 0x2d, 0xac, 0x83, 0x75, 0xe0, 0x62, 0x34, 0xcb, 0xbe, 0xd6, 0x4c, 0xc5, + 0xa4, 0xb2, 0xac, 0x06, 0x84, 0xa0, 0xb4, 0xd9, 0x86, 0x3e, 0x66, 0x44, + 0xa8, 0x33, 0x48, 0x49, 0xc0, 0xcf, 0xdb, 0xfb, 0x85, 0x1b, 0x84, 0xb0, + 0xe4, 0x8c, 0x6f, 0xb0, 0x48, 0x01, 0xd0, 0x52, 0x2f, 0xd5, 0x76, 0x68, + 0x9b, 0x16, 0x44, 0x67, 0x60, 0x4a, 0xb4, 0xda, 0x2e, 0x34, 0xab, 0xcf, + 0x76, 0xdc, 0x92, 0x44, 0x67, 0x4c, 0x4e, 0x57, 0x30, 0xf5, 0x78, 0x7c, + 0x67, 0x90, 0x21, 0x42, 0x4c, 0x13, 0x40, 0x15, 0x4d, 0x24, 0x49, 0x33, + 0x0d, 0xbc, 0x94, 0x0e, 0xba, 0x7b, 0xe1, 0x03, 0x99, 0xec, 0x94, 0x0a, + 0x6b, 0x35, 0x40, 0x60, 0x14, 0x99, 0x66, 0x50, 0xb1, 0x48, 0xa1, 0x89, + 0x43, 0x47, 0x7f, 0x5e, 0x95, 0x0f, 0x41, 0xa0, 0x1a, 0xb6, 0x34, 0x88, + 0xfa, 0xf2, 0x06, 0xf0, 0xf2, 0x25, 0xa7, 0x31, 0x09, 0x67, 0x77, 0x84, + 0x79, 0x1b, 0x6d, 0xec, 0x98, 0x0e, 0x60, 0xeb, 0x8f, 0x96, 0xbb, 0xbf, + 0x47, 0x22, 0x22, 0xb0, 0x24, 0x8a, 0x12, 0xf9, 0x61, 0x88, 0xa1, 0x7d, + 0x68, 0xb8, 0x3e, 0x52, 0xc9, 0x82, 0x7b, 0xa2, 0xc6, 0xbc, 0x82, 0x75, + 0x0b, 0x31, 0xae, 0x46, 0xb9, 0x82, 0x7a, 0x28, 0x77, 0xfc, 0xb3, 0x38, + 0x00, 0x3a, 0x68, 0xb8, 0xc1, 0xaa, 0x9c, 0x96, 0x6b, 0x55, 0xd2, 0x03, + 0x78, 0x74, 0x11, 0x57, 0x77, 0x05, 0xf6, 0xdb, 0x15, 0x59, 0xf9, 0xb4, + 0x25, 0x8a, 0x57, 0x18, 0x20, 0x50, 0x5d, 0x83, 0xc1, 0x00, 0x9a, 0xa2, + 0xb2, 0x84, 0xb3, 0x75, 0xa7, 0xac, 0x61, 0x6a, 0x1b, 0x29, 0x42, 0xa2, + 0xb4, 0x94, 0xc4, 0x3e, 0xb3, 0x70, 0xc1, 0xb9, 0x4a, 0xcd, 0x52, 0x2b, + 0x20, 0x8c, 0x17, 0xc7, 0x35, 0x07, 0x7e, 0x60, 0x2f, 0x41, 0x41, 0x0c, + 0xfb, 0x1b, 0x3e, 0xa1, 0x09, 0x21, 0x58, 0xc3, 0xb6, 0xea, 0x43, 0xcc, + 0x7a, 0xa7, 0x03, 0x09, 0xa6, 0x0f, 0xa9, 0x64, 0x47, 0x21, 0x33, 0x2a, + 0x0d, 0xc4, 0x55, 0xbd, 0xb5, 0x63, 0xd5, 0xe6, 0x6e, 0xe2, 0x12, 0x10, + 0x87, 0x2a, 0x59, 0x8d, 0x13, 0xa9, 0x51, 0x83, 0x11, 0x9a, 0x50, 0x7a, + 0x76, 0x34, 0x3b, 0x45, 0x4b, 0xb3, 0x20, 0x4b, 0xad, 0x83, 0x46, 0x9b, + 0x56, 0x27, 0x52, 0xa7, 0x3a, 0x00, 0xe5, 0xe8, 0xc5, 0xa6, 0xd9, 0x87, + 0x0a, 0xca, 0x93, 0x78, 0x69, 0x05, 0xc2, 0x0b, 0x85, 0x02, 0xf4, 0x5d, + 0x91, 0x14, 0xa8, 0xd2, 0xc7, 0xbd, 0x2e, 0xe0, 0x08, 0x7f, 0xb7, 0x80, + 0xfa, 0x50, 0x78, 0x58, 0x8b, 0x02, 0x6f, 0x14, 0x19, 0x6c, 0xc0,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xfd, 0x39, 0x24, 0x8f, 0x16, 0x5a, 0xbb, 0x02, 0x7a, + 0xfd, 0x68, 0x17, 0xe0, 0x0c, 0x8d, 0xad, 0xaa, 0xcb, 0x29, 0xcb, 0x25, + 0xe4, 0x24, 0x75, 0x09, 0x32, 0xae, 0x27, 0x75, 0x6a, 0x98, 0xb7, 0xb7, + 0x49, 0x28, 0x53, 0x90, 0x9c, 0xa9, 0x5a, 0x56, 0x92, 0x2a, 0x13, 0x36, + 0x90, 0x6c, 0x02, 0xb8, 0x12, 0x05, 0xbb, 0x58, 0x69, 0x4d, 0xe8, 0xc0, + 0x2a, 0x00, 0x5c, 0x23, 0x26, 0x09, 0xc8, 0x79, 0x97, 0xb1, 0x6a, 0xb6, + 0xbc, 0x79, 0x0d, 0xd3, 0x29, 0x30, 0x03, 0xb9, 0xb4, 0x86, 0x7b, 0x2b, + 0x6e, 0x04, 0xc4, 0x56, 0x18, 0x50, 0x35, 0x94, 0xaa, 0x26, 0x9c, 0x9d, + 0x4f, 0xc3, 0x9a, 0xa1, 0xec, 0x36, 0x3f, 0xbc, 0x57, 0xc7, 0x02, 0x41, + 0x31, 0x0b, 0x1d, 0x6b, 0x44, 0x98, 0xe8, 0xa5, 0x56, 0xc4, 0x87, 0xb1, + 0x6e, 0x45, 0xaa, 0x9b, 0xb9, 0xb1, 0xa6, 0xa9, 0xbb, 0x2a, 0x44, 0x6f, + 0x6e, 0xe3, 0x09, 0xed, 0xec, 0x1d, 0x55, 0x32, 0x99, 0x7a, 0x86, 0x94, + 0xdd, 0xb9, 0x91, 0xe3, 0xa6, 0x77, 0xf8, 0x95, 0x88, 0x5f, 0xa9, 0x34, + 0x81, 0xea, 0x21, 0x7e, 0xba, 0x1c, 0x47, 0x4b, 0xc4, 0x81, 0x88, 0x14, + 0x7f, 0xdc, 0x03, 0x22, 0x81, 0xcc, 0xa5, 0xc3, 0x0d, 0x5b, 0x1c, 0x3e, + 0xd9, 0x09, 0x32, 0xbd, 0xe1, 0x48, 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0xf8, 0xc0, 0xaa, 0x39, 0xb2, + 0x34, 0x8a, 0xbc, 0x3c, 0x6d, 0x0d, 0x13, 0xa6, 0xbd, 0x91, 0xd6, 0x2a, + 0x43, 0xc6, 0x51, 0x60, 0x63, 0xdf, 0xd5, 0xbf, 0x77, 0xf0, 0xf1, 0x08, + 0x42, 0x24, 0x43, 0x7b, 0x47, 0xa8, 0x2b, 0xa2, 0x28, 0xb8, 0x74, 0x69, + 0xd4, 0xee, 0x89, 0x06, 0xec, 0x34, 0xdb, 0xa7, 0x6c, 0x68, 0xd8, 0xa8, + 0x22, 0x8d, 0xf3, 0x3c, 0xcf, 0x3a, 0x80, 0xbf, 0x15, 0x6b, 0x29, 0x53, + 0xa5, 0x31, 0x26, 0x9f, 0x3c, 0xb1, 0xee, 0xa9, 0x88, 0x00, 0x4b, 0x93, + 0x10, 0x3c, 0xfb, 0x0a, 0xee, 0xfd, 0x2a, 0x68, 0x6e, 0x01, 0xfa, 0x4a, + 0x58, 0xe8, 0xa3, 0x63, 0x9c, 0xa8, 0xa1, 0xe3, 0xf9, 0xae, 0x57, 0xe2, +}; + +static const u8 fips_test_mlkem768_ct[MLKEM768_CIPHERTEXT_BYTES] __initconst __maybe_unused = { + 0x1d, 0x3b, 0xe0, 0x4a, 0x6a, 0x14, 0xb4, 0x98, 0xe3, 0x65, 0xde, 0x61, + 0xa7, 0x00, 0xb2, 0x3a, 0x20, 0x01, 0xdb, 0xc3, 0xdc, 0xd3, 0x87, 0xcf, + 0xa1, 0xf1, 0x69, 0x5f, 0x11, 0x1a, 0xad, 0x47, 0x4b, 0x34, 0x22, 0x3e, + 0x10, 0x0a, 0x29, 0xe5, 0x3c, 0x3d, 0x16, 0xa5, 0xd7, 0x69, 0xe1, 0xa6, + 0x4f, 0x50, 0xbe, 0x02, 0x9a, 0x09, 0x84, 0x54, 0x23, 0x67, 0x49, 0xa2, + 0xc7, 0x03, 0xc0, 0x32, 0xfb, 0x19, 0x9d, 0x2d, 0xee, 0x02, 0x50, 0x90, + 0xbb, 0xbc, 0x60, 0x9a, 0x14, 0x28, 0x4c, 0x13, 0x5f, 0xf2, 0xf8, 0xfe, + 0xa9, 0x99, 0x3a, 0x36, 0x68, 0x82, 0x37, 0xb0, 0x38, 0x54, 0x7e, 0x77, + 0xa7, 0xd5, 0xca, 0xc0, 0x43, 0x11, 0x44, 0xde, 0x34, 0xf7, 0x79, 0x01, + 0xfe, 0x25, 0x27, 0xf0, 0x98, 0xd4, 0xca, 0xc1, 0x59, 0x67, 0x4b, 0x99, + 0x04, 0xe6, 0xa7, 0x21, 0x90, 0xc8, 0x86, 0xd1, 0x41, 0x0c, 0x5a, 0x53, + 0x07, 0x8b, 0xb7, 0xc1, 0x8d, 0x74, 0x9c, 0x21, 0x3d, 0xe4, 0x2d, 0xab, + 0xe6, 0xc8, 0x3b, 0x8c, 0x1f, 0xfe, 0xc8, 0xac, 0xb9, 0x32, 0xd0, 0x47, + 0x52, 0xa5, 0xe1, 0x6e, 0x0e, 0x58, 0x71, 0x1b, 0xf3, 0xc7, 0xe7, 0x01, + 0x19, 0x9f, 0x49, 0x57, 0x45, 0xe0, 0x74, 0x40, 0x93, 0xa8, 0xdd, 0x88, + 0x6c, 0xa0, 0x6b, 0xa5, 0xbb, 0x4e, 0x09, 0x36, 0x5f, 0x58, 0xe9, 0x9e, + 0x08, 0xe6, 0xb6, 0x90, 0x2a, 0x0c, 0x1b, 0x06, 0x42, 0xe8, 0xfd, 0x42, + 0x71, 0x41, 0x6a, 0x25, 0x12, 0x2e, 0x21, 0x9a, 0x19, 0xa8, 0xcd, 0xce, + 0x6e, 0x66, 0xaa, 0x62, 0xff, 0x30, 0x2d, 0xf8, 0x57, 0xb4, 0x65, 0x54, + 0x79, 0xcf, 0x29, 0x2b, 0xe9, 0xa7, 0xea, 0x31, 0x2b, 0xa4, 0x7c, 0xb7, + 0x7e, 0x73, 0xad, 0x9b, 0x2d, 0x4b, 0x56, 0xea, 0xca, 0x24, 0x0c, 0x35, + 0x27, 0x16, 0x96, 0xcd, 0xad, 0x56, 0x0f, 0x75, 0xb1, 0xb0, 0x64, 0x16, + 0x0c, 0x3c, 0xf5, 0xe6, 0x2f, 0x93, 0x03, 0xab, 0x95, 0x92, 0x44, 0x76, + 0x80, 0xd6, 0x7c, 0xc7, 0x57, 0x15, 0x92, 0xef, 0xdf, 0xb4, 0xe3, 0x05, + 0xc4, 0x4d, 0x5e, 0x4f, 0xe4, 0x65, 0x5e, 0x7c, 0xf9, 0xed, 0x78, 0xcf, + 0x70, 0xb6, 0xea, 0x82, 0x3d, 0x69, 0x24, 0x91, 0x66, 0x62, 0x0d, 0x19, + 0xf5, 0xe0, 0x33, 0x46, 0xf0, 0x6b, 0x9b, 0x9a, 0xef, 0x26, 0x59, 0x84, + 0xdd, 0x61, 0xf0, 0x2b, 0x94, 0xc6, 0xb0, 0x69, 0xdd, 0x4a, 0x44, 0x66, + 0x2f, 0xfd, 0x55, 0x02, 0x12, 0x68, 0x5a, 0x48, 0x3e, 0x9e, 0xd7, 0x01, + 0x3e, 0xc3, 0x67, 0x73, 0xaa, 0xc6, 0xdc, 0x45, 0xce, 0x1d, 0xa8, 0x5b, + 0x14, 0x04, 0x5c, 0x13, 0xd2, 0x59, 0x32, 0x94, 0x0e, 0xc1, 0xfd, 0xbf, + 0xac, 0xaa, 0x7f, 0x66, 0x03, 0xdc, 0x1a, 0xef, 0xf9, 0xf5, 0x2f, 0xae, + 0xdb, 0x87, 0x2f, 0xac, 0x14, 0x73, 0xf5, 0xcb, 0x8f, 0xb2, 0x0c, 0xff, + 0x71, 0x24, 0x85, 0x59, 0x79, 0x38, 0x90, 0x3a, 0x7d, 0x1e, 0x48, 0x95, + 0x22, 0x62, 0x62, 0x94, 0xd4, 0x77, 0x3b, 0x71, 0xcb, 0xdc, 0x01, 0x79, + 0xc8, 0x13, 0x08, 0x75, 0x5f, 0x3f, 0x3f, 0x11, 0x5b, 0xc1, 0x78, 0xc2, + 0x95, 0xdc, 0xfb, 0x1c, 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x70, 0xa6, 0xc1, 0x9b, 0xaf, 0xce, 0x46, 0x6e, 0x48, + 0x36, 0x35, 0xf1, 0x0a, 0x90, 0x68, 0x22, 0x06, 0xa0, 0x5c, 0x0d, 0x24, + 0x99, 0x4b, 0x39, 0x79, 0x34, 0xfe, 0xcc, 0x8f, 0x08, 0x44, 0x63, 0x26, + 0xa4, 0x9d, 0x3e, 0xba, 0xec, 0x72, 0x22, 0xcd, 0xcf, 0x76, 0xb2, 0x99, + 0x80, 0x07, 0x52, 0x82, 0x97, 0xb4, 0xfe, 0x04, 0xa2, 0x1d, 0x8b, 0xfe, + 0x76, 0x27, 0xec, 0xe4, 0xbe, 0xd4, 0x89, 0xde, 0x02, 0x70, 0x57, 0x89, + 0xda, 0xc5, 0xe6, 0x00, 0x26, 0x48, 0x6f, 0x79, 0xde, 0x2f, 0x93, 0x14, + 0x76, 0xd8, 0x09, 0x9e, 0xe2, 0x7d, 0x2d, 0xd8, 0x75, 0x86, 0xb9, 0xe2, + 0xeb, 0x0d, 0xa2, 0x24, 0x19, 0xe9, 0x48, 0xc1, 0x87, 0x99, 0x8e, 0xde, + 0x7f, 0xac, 0xb0, 0x6a, 0xc9, 0x2b, 0xdc, 0xfc, 0xe4, 0x13, 0x82, 0xb2, + 0x9a, 0xf1, 0xcb, 0x62, 0xb4, 0x1a, 0x16, 0xd4, 0xd8, 0xd9, 0xe5, 0x95, + 0x80, 0xfe, 0x03, 0x3b, 0x0b, 0xee, 0xd4, 0x5e, 0x23, 0xb0, 0xee, 0x74, + 0xc4, 0x0c, 0xa9, 0x00, 0x4d, 0x79, 0x3a, 0x09, 0x68, 0xc9, 0xda, 0x52, + 0xbe, 0xad, 0x79, 0x30, 0x9c, 0x4f, 0x84, 0xb4, 0xe8, 0x52, 0x15, 0x14, + 0xca, 0xa0, 0x16, 0x30, 0x8d, 0x74, 0x72, 0x6f, 0x89, 0x9f, 0xbc, 0x91, + 0x00, 0xe3, 0x52, 0x7d, 0xd9, 0x2e, 0xca,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, 0xfa, 0xf7, 0x60, + 0x39, 0xc8, 0xe3, 0x2d, 0x36, 0x38, 0x4e, 0x67, 0x18, 0xbe, 0xab, 0x6f, + 0xce, 0xf8, 0x38, 0xf3, 0x91, 0x3a, 0x34, 0xe0, 0x05, 0xfb, 0x4c, 0x19, + 0xa8, 0x6a, 0x9c, 0xff, 0x2f, 0x52, 0xff, 0xc6, 0x69, 0x4b, 0xd7, 0x72, + 0x14, 0x40, 0x51, 0x86, 0x7c, 0x2c, 0x21, 0x6e, 0xe7, 0x12, 0xe5, 0x9d, + 0x8a, 0x02, 0xaa, 0x37, 0x3e, 0xab, 0x4a, 0x13, 0x17, 0x8e, 0xa3, 0xe6, + 0x8b, 0xff, 0x5f, 0x96, 0xbf, 0x77, 0x68, 0x6d, 0xa2, 0xf9, 0x27, 0x14, + 0x34, 0xf9, 0xcc, 0x7e, 0x38, 0xfd, 0xcd, 0x06, 0x47, 0x58, 0xd6, 0x39, + 0xe7, 0xa1, 0xbd, 0x8a, 0x89, 0x7d, 0xf5, 0xfa, 0xb7, 0x57, 0x18, 0xe4, + 0x2f, 0x85, 0x8f, 0xe9, 0xba, 0x52, 0x56, 0x79, +}; + +static const u8 fips_test_mlkem768_ss[MLKEM_SHARED_SECRET_BYTES] __initconst __maybe_unused = { + 0xfe, 0x62, 0x76, 0x21, 0xfe, 0x29, 0x61, 0x86, 0xfc, 0xe3, 0x22, 0x43, + 0xdd, 0x55, 0x4b, 0xdd, 0xa3, 0x89, 0x71, 0xb4, 0x7f, 0x18, 0x46, 0x1f, + 0x21, 0x32, 0x37, 0x82, 0xdf, 0xe5, 0xff, 0x89, +}; + +static const u8 fips_test_mlkem768_ct_invalid[MLKEM768_CIPHERTEXT_BYTES] __initconst __maybe_unused = { + 0xba, 0xdf, 0xd6, 0xdf, 0xaa, 0xc3, 0x59, 0xa5, 0xef, 0xbb, 0x7b, 0xcc, + 0x4b, 0x59, 0xd5, 0x38, 0xdf, 0x9a, 0x04, 0x30, 0x2e, 0x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 0x1a, 0xf3, 0xfe, 0xc5, 0xa6, 0xee, 0x1b, 0x8a, 0xdc, 0xd2, 0x5e, 0x72, + 0xde, 0x36, 0x43, 0x45, 0x84, 0xef, 0x56, 0x7c, 0x64, 0x3d, 0x34, 0x42, + 0x94, 0xe8, 0xb2, 0x08, 0x6b, 0x87, 0xf6, 0x9c, 0x3b, 0xdc, 0x0d, 0x59, + 0x69, 0x85, 0x70, 0x82, 0x98, 0x7c, 0xa1, 0xc6, 0x3b, 0x71, 0x82, 0xe8, + 0x68, 0x98, 0xfb, 0x9b, 0x80, 0x39, 0xe7, 0x5e, 0xda, 0x21, 0x9e, 0x28, + 0x93, 0x31, 0x61, 0x03, 0x69, 0x27, 0x18, 0x67, 0xb1, 0x45, 0xb2, 0x90, + 0x82, 0x93, 0x96, 0x3c, 0xd6, 0x77, 0xc9, 0xa1, 0xae, 0x6c, 0xeb, 0x28, + 0x28, 0x9b, 0x25, 0x4c, 0xde, 0xb7, 0x6b, 0x12, 0xf3, 0x3c, 0xe5, 0xcf, + 0x37, 0x43, 0x13, 0x1b, 0xfb, 0x55, 0x0f, 0x01, 0x97, 0xbf, 0xe1, 0x6a, + 0xff, 0x92, 0x36, 0x72, 0x27, 0xad, 0xc5, 0x07, 0x4f, 0xe3, 0xdc, 0x0d, + 0x8d, 0x11, 0x62, 0x53, 0x98, 0x0a, 0x38, 0x63, 0x6b, 0xc9, 0xd2, 0x9f, + 0x79, 0x9b, 0xbb, 0x2d, 0x76, 0xa0, 0xa5, 0xf1, 0x38, 0xb8, 0xc7, 0x3b, + 0xa4, 0x84, 0xd6, 0x58, 0x87, 0x64, 0xe3, 0x31, 0xd7, 0x0c, 0x37, 0x8c, + 0x06, 0x41, 0xf2, 0xd9, 0xb6, 0xfd, 0x7c, 0x09, 0x0d, 0xf5, 0xa7, 0x46, + 0x04, 0xa1, 0x32, 0x4b, 0xa0, 0xcc, 0x5c, 0x44, 0x7b, 0x2d, 0xca, 0x64, + 0x4a, 0x50, 0xf1, 0xad, 0x04, 0x77, 0xa7, 0x01, 0xb9, 0x05, 0x2e, 0xe9, + 0xbe, 0xf2, 0x88, 0x33, 0x47, 0x63, 0x43, 0xc8, 0x2a, 0xf2, 0x9f, 0xf3, + 0xa9, 0xb1, 0xc4, 0xcf, 0x12, 0xde, 0x55, 0x9c, 0xb9, 0xd9, 0x41, 0x1f, + 0x62, 0xbe, 0xc8, 0x38, 0x12, 0x1f, 0xd7, 0x4b, 0xc1, 0xfa, 0x71, 0x2d, + 0x8a, 0xdd, 0x51, 0x50, 0x5c, 0x55, 0xe8, 0x9a, 0x35, 0xde, 0xaf, 0x7a, + 0x69, 0xdc, 0x0a, 0x18, 0xad, 0x27, 0x39, 0x60, 0x29, 0xcb, 0xf8, 0x9f, + 0x51, 0x3e, 0x1b, 0x8f, 0x48, 0xbc, 0x01, 0x78, 0x3d, 0x68, 0x49, 0xfb, + 0x32, 0xf2, 0x11, 0xa4, 0xc8, 0x7e, 0x16, 0xbc, 0xce, 0x0c, 0x41, 0x24, + 0x0a, 0x22, 0x3b, 0xa6, 0xd6, 0x9e, 0x0c, 0x51, 0x56, 0x9f, 0x73, 0xcb, + 0x10, 0x7e, 0xad, 0x84, 0xd1, 0x4d, 0xee, 0x92, 0x70, 0x2e, 0x3a, 0x95, + 0xeb, 0x84, 0x4c, 0x71, 0x6a, 0xec, 0x98, 0x29, 0xd0, 0x65, 0x91, 0xeb, + 0xd2, 0x50, 0x1a, 0x32, 0x83, 0xcc, 0x0f, 0xfc, 0x0f, 0xdc, 0xc0, 0x31, + 0xfe, 0x8d, 0x86, 0x5e, 0x77, 0xfa, 0xe5, 0xd6, 0xbb, 0x73, 0x81, 0x5d, + 0x9a, 0xe3, 0x76, 0x00, 0x6d, 0x0a, 0xe3, 0x20, +}; + +static const u8 fips_test_mlkem768_ss_rejected[MLKEM_SHARED_SECRET_BYTES] __initconst __maybe_unused = { + 0xb8, 0x77, 0xda, 0x79, 0x2d, 0x89, 0xf2, 0x80, 0x49, 0xb5, 0x90, 0x12, + 0x16, 0x01, 0x20, 0x2d, 0x2b, 0xc8, 0xf5, 0xf1, 0xaf, 0x83, 0x82, 0xbf, + 0x4f, 0x39, 0x41, 0x05, 0x0d, 0xd5, 0x17, 0x2b, +}; diff --git a/lib/crypto/mlkem.c b/lib/crypto/mlkem.c index 5e499e5de636..d2183a526956 100644 --- a/lib/crypto/mlkem.c +++ b/lib/crypto/mlkem.c @@ -10,15 +10,17 @@ #include #include #include #include #include +#include #include #include #include #include #include +#include "fips-mlkem.h" #define Q 3329 /* The prime q = 2^8 * 13 + 1 */ #define N 256 /* Number of coefficients per ring element */ #define MAX_K 4 /* Max matrix dimension (k parameter) for any parameter set */ #define MAX_CIPHERTEXT_BYTES 1568 /* Max ciphertext length for any param set */ @@ -627,10 +629,24 @@ static int k_pke_decrypt(u8 m[32], const u8 *sk, const u8 *ct, /* Decode the plaintext m from the polynomial w. */ compress_and_encode(m, &ws->tmp, 1); return 0; } +static int mlkem_encaps_internal(u8 *ct, u8 ss[MLKEM_SHARED_SECRET_BYTES], + const u8 *pk, + const u8 eseed[MLKEM_ESEED_BYTES], + const struct mlkem_parameter_set *params); +static int mlkem_decaps(u8 ss[MLKEM_SHARED_SECRET_BYTES], const u8 *ct, + const u8 *sk, const struct mlkem_parameter_set *params); + +struct mlkem_fips140_pct_workspace { + u8 eseed[MLKEM_ESEED_BYTES]; + u8 ct[MLKEM1024_CIPHERTEXT_BYTES]; + u8 ss1[MLKEM_SHARED_SECRET_BYTES]; + u8 ss2[MLKEM_SHARED_SECRET_BYTES]; +}; + /* * Generate an ML-KEM key pair (@pk, @sk) from the random seed @seed. * The lengths of @pk and @sk are determined by the chosen @params. * * Reference: FIPS 203 Algorithm 16, ML-KEM.KeyGen_internal. Formally it takes @@ -660,10 +676,31 @@ static int mlkem_keygen_internal(u8 *pk, u8 *sk, sk_ptr += params->pk_len; sha3_256(pk, params->pk_len, sk_ptr); sk_ptr += SHA3_256_DIGEST_SIZE; memcpy(sk_ptr, &seed[32], 32); + if (fips_enabled) { + /* Do the Pairwise Consistency Test required by FIPS 140-3. */ + struct mlkem_fips140_pct_workspace *ws __free(kfree_sensitive) = + kmalloc_obj(*ws); + if (!ws) + return -ENOMEM; /* Out of memory, not a PCT failure */ + get_random_bytes(ws->eseed, sizeof(ws->eseed)); + err = mlkem_encaps_internal(ws->ct, ws->ss1, pk, ws->eseed, + params); + if (err == -ENOMEM) + return -ENOMEM; /* Out of memory, not a PCT failure */ + if (err) + panic("mlkem: FIPS PCT failed (encaps): %d", err); + err = mlkem_decaps(ws->ss2, ws->ct, sk, params); + if (err == -ENOMEM) + return -ENOMEM; /* Out of memory, not a PCT failure */ + if (err) + panic("mlkem: FIPS PCT failed (decaps): %d", err); + if (crypto_memneq(ws->ss1, ws->ss2, MLKEM_SHARED_SECRET_BYTES)) + panic("mlkem: FIPS PCT failed (compare)"); + } return 0; } int mlkem768_keygen_internal(u8 pk[MLKEM768_PUBLIC_KEY_BYTES], u8 sk[MLKEM768_SECRET_KEY_BYTES], @@ -889,10 +926,88 @@ int mlkem1024_decaps(u8 ss[MLKEM_SHARED_SECRET_BYTES], { return mlkem_decaps(ss, ct, sk, &mlkem1024); } EXPORT_SYMBOL_NS_GPL(mlkem1024_decaps, "CRYPTO_INTERNAL"); +#ifdef CONFIG_CRYPTO_FIPS +/* + * This function implements the ML-KEM cryptographic algorithm self-tests + * required by FIPS 140-3, or rather the FIPS 140-3 Implementation Guidance + * document which is where they are actually specified. The requirement is that + * for one ML-KEM parameter set, one test be done for keygen and encapsulation, + * and two tests be done for decapsulation to exercise both the normal case and + * the implicit rejection case. It's worded in such a way that the tests don't + * necessarily have to be "known-answer tests", but those are what we use. + * + * This is just for FIPS compliance. Normal testing done by kernel developers + * and integrators should use the much more comprehensive KUnit test suite. + */ +static int __init mlkem_mod_init(void) +{ + struct { + u8 pk[MLKEM768_PUBLIC_KEY_BYTES]; + u8 sk[MLKEM768_SECRET_KEY_BYTES]; + u8 ct[MLKEM768_CIPHERTEXT_BYTES]; + u8 ss[MLKEM_SHARED_SECRET_BYTES]; + } *bufs __free(kfree_sensitive) = NULL; + int err; + + if (!fips_enabled) + return 0; + + bufs = kmalloc_obj(*bufs); + if (!bufs) + panic("mlkem: fips test failed: ENOMEM"); + + err = mlkem768_keygen_internal(bufs->pk, bufs->sk, + fips_test_mlkem768_seed); + if (err) + panic("mlkem: fips test failed: keygen failed with err=%d", + err); + if (crypto_memneq(bufs->pk, fips_test_mlkem768_pk, sizeof(bufs->pk))) + panic("mlkem: fips test failed: wrong public key"); + if (crypto_memneq(bufs->sk, fips_test_mlkem768_sk, sizeof(bufs->sk))) + panic("mlkem: fips test failed: wrong secret key"); + + err = mlkem768_encaps_internal(bufs->ct, bufs->ss, bufs->pk, + fips_test_mlkem768_eseed); + if (err) + panic("mlkem: fips test failed: encaps failed with err=%d", + err); + + if (crypto_memneq(bufs->ct, fips_test_mlkem768_ct, sizeof(bufs->ct))) + panic("mlkem: fips test failed: wrong ciphertext"); + if (crypto_memneq(bufs->ss, fips_test_mlkem768_ss, sizeof(bufs->ss))) + panic("mlkem: fips test failed: wrong shared secret after encaps"); + + memset(bufs->ss, 0, sizeof(bufs->ss)); + err = mlkem768_decaps(bufs->ss, bufs->ct, bufs->sk); + if (err) + panic("mlkem: fips test failed: valid decaps failed with err=%d", + err); + if (crypto_memneq(bufs->ss, fips_test_mlkem768_ss, sizeof(bufs->ss))) + panic("mlkem: fips test failed: wrong shared secret after valid decaps"); + + err = mlkem768_decaps(bufs->ss, fips_test_mlkem768_ct_invalid, + bufs->sk); + if (err) + panic("mlkem: fips test failed: invalid decaps failed with err=%d", + err); + if (crypto_memneq(bufs->ss, fips_test_mlkem768_ss_rejected, + sizeof(bufs->ss))) + panic("mlkem: fips test failed: wrong shared secret after invalid decaps"); + + return 0; +} +subsys_initcall(mlkem_mod_init); + +static void __exit mlkem_mod_exit(void) +{ +} +module_exit(mlkem_mod_exit); +#endif /* CONFIG_CRYPTO_FIPS */ + #if IS_ENABLED(CONFIG_CRYPTO_LIB_MLKEM_KUNIT_TEST) u16 mlkem_reduce_once(u16 x) { return reduce_once(x); } diff --git a/scripts/crypto/import-mlkem-testvecs.py b/scripts/crypto/import-mlkem-testvecs.py index 1d5681ccfee1..ebc76ab218e4 100755 --- a/scripts/crypto/import-mlkem-testvecs.py +++ b/scripts/crypto/import-mlkem-testvecs.py @@ -11,10 +11,11 @@ # $PATH_TO_THIS_SCRIPT ./test/ # # This script generates the following files: # # lib/crypto/tests/mlkem-testvecs.h +# lib/crypto/fips-mlkem.h import hashlib import os import sys @@ -32,10 +33,13 @@ MLKEM_LENGTHS = { "sk_len": 3168, "ct_len": 1568, }, } +MLKEM_SEED_BYTES = 64 +MLKEM_ESEED_BYTES = 32 + def print_header(file): print("/* SPDX-License-Identifier: GPL-2.0-or-later */", file=file) print(f"/* This file was generated by {SCRIPT_NAME} */", file=file) print(f"/* clang-format off */", file=file) @@ -97,10 +101,66 @@ def hash_testvecs(testvecs): h.update(tv.ss) # From decapsulation h.update(tv.ss_rejected) return h.digest(length=32) +def gen_fips_file(tv): + with open(LINUX_DIR + "/lib/crypto/fips-mlkem.h", "w") as file: + ct_len = MLKEM_LENGTHS[768]["ct_len"] + print_header(file) + attribs = " __initconst __maybe_unused" + + # The test vectors were generated deterministically using the SHAKE128 + # of an empty string as the randomness. Take the first MLKEM_SEED_BYTES + # + MLKEM_ESEED_BYTES to get the seeds used by the first test vector. + # Take an additional ct_len bytes to get the invalid ciphertext. + rnd_data = hashlib.shake_128().digest( + MLKEM_SEED_BYTES + MLKEM_ESEED_BYTES + ct_len + ) + + print_static_u8_array_definition( + file, + f"fips_test_mlkem768_seed[MLKEM_SEED_BYTES]{attribs}", + rnd_data[:MLKEM_SEED_BYTES], + ) + print_static_u8_array_definition( + file, + f"fips_test_mlkem768_eseed[MLKEM_ESEED_BYTES]{attribs}", + rnd_data[MLKEM_SEED_BYTES : MLKEM_SEED_BYTES + MLKEM_ESEED_BYTES], + ) + print_static_u8_array_definition( + file, + f"fips_test_mlkem768_pk[MLKEM768_PUBLIC_KEY_BYTES]{attribs}", + tv.pk, + ) + print_static_u8_array_definition( + file, + f"fips_test_mlkem768_sk[MLKEM768_SECRET_KEY_BYTES]{attribs}", + tv.sk, + ) + print_static_u8_array_definition( + file, + f"fips_test_mlkem768_ct[MLKEM768_CIPHERTEXT_BYTES]{attribs}", + tv.ct, + ) + print_static_u8_array_definition( + file, + f"fips_test_mlkem768_ss[MLKEM_SHARED_SECRET_BYTES]{attribs}", + tv.ss, + ) + print_static_u8_array_definition( + file, + f"fips_test_mlkem768_ct_invalid[MLKEM768_CIPHERTEXT_BYTES]{attribs}", + rnd_data[MLKEM_SEED_BYTES + MLKEM_ESEED_BYTES :], + ) + print_static_u8_array_definition( + file, + f"fips_test_mlkem768_ss_rejected[MLKEM_SHARED_SECRET_BYTES]{attribs}", + tv.ss_rejected, + ) + + if len(sys.argv) != 2: sys.stderr.write(f"Usage: {SCRIPT_NAME} TESTVECS_DIR\n") sys.exit(2) testvecs_dir = sys.argv[1] @@ -113,5 +173,7 @@ with open(LINUX_DIR + "/lib/crypto/tests/mlkem-testvecs.h", "w") as file: num_testvecs = min(len(testvecs), 1000) testvecs = testvecs[:num_testvecs] hash = hash_testvecs(testvecs) print(f"\n#define MLKEM{paramset}_NUM_TESTVECS {num_testvecs}", file=file) print_static_u8_array_definition(file, f"mlkem{paramset}_hash[32]", hash) + if paramset == 768: # FIPS only requires tests for one parameter set + gen_fips_file(testvecs[0]) -- 2.54.0