crypto/krb5/selftest_data.c

Source file repositories/reference/linux-study-clean/crypto/krb5/selftest_data.c

File Facts

System
Linux kernel
Corpus path
crypto/krb5/selftest_data.c
Extension
.c
Size
10598 bytes
Lines
292
Domain
Kernel Services
Bucket
crypto
Inferred role
Kernel Services: implementation source
Status
source implementation candidate

Why This File Exists

Shared kernel service surface used by multiple subsystems, including helpers, cryptography, virtualization support, and async I/O infrastructure.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0-or-later
/* Data for Kerberos library self-testing
 *
 * Copyright (C) 2025 Red Hat, Inc. All Rights Reserved.
 * Written by David Howells (dhowells@redhat.com)
 */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include "internal.h"

/*
 * Pseudo-random function tests.
 */
const struct krb5_prf_test krb5_prf_tests[] = {
	/* rfc8009 Appendix A */
	{
		.etype	= KRB5_ENCTYPE_AES128_CTS_HMAC_SHA256_128,
		.name	= "prf",
		.key	= "3705D96080C17728A0E800EAB6E0D23C",
		.octet	= "74657374",
		.prf	= "9D188616F63852FE86915BB840B4A886FF3E6BB0F819B49B893393D393854295",
	}, {
		.etype	= KRB5_ENCTYPE_AES256_CTS_HMAC_SHA384_192,
		.name	= "prf",
		.key	= "6D404D37FAF79F9DF0D33568D320669800EB4836472EA8A026D16B7182460C52",
		.octet	= "74657374",
		.prf	=
		"9801F69A368C2BF675E59521E177D9A07F67EFE1CFDE8D3C8D6F6A0256E3B17D"
		"B3C1B62AD1B8553360D17367EB1514D2",
	},
	{/* END */}
};

/*
 * Key derivation tests.
 */
const struct krb5_key_test krb5_key_tests[] = {
	/* rfc8009 Appendix A */
	{
		.etype	= KRB5_ENCTYPE_AES128_CTS_HMAC_SHA256_128,
		.name	= "key",
		.key	= "3705D96080C17728A0E800EAB6E0D23C",
		.Kc.use	= 0x00000002,
		.Kc.key	= "B31A018A48F54776F403E9A396325DC3",
		.Ke.use	= 0x00000002,
		.Ke.key	= "9B197DD1E8C5609D6E67C3E37C62C72E",
		.Ki.use	= 0x00000002,
		.Ki.key	= "9FDA0E56AB2D85E1569A688696C26A6C",
	}, {
		.etype	= KRB5_ENCTYPE_AES256_CTS_HMAC_SHA384_192,
		.name	= "key",
		.key	= "6D404D37FAF79F9DF0D33568D320669800EB4836472EA8A026D16B7182460C52",
		.Kc.use	= 0x00000002,
		.Kc.key	= "EF5718BE86CC84963D8BBB5031E9F5C4BA41F28FAF69E73D",
		.Ke.use	= 0x00000002,
		.Ke.key	= "56AB22BEE63D82D7BC5227F6773F8EA7A5EB1C825160C38312980C442E5C7E49",
		.Ki.use	= 0x00000002,
		.Ki.key	= "69B16514E3CD8E56B82010D5C73012B622C4D00FFC23ED1F",
	},
	/* rfc6803 sec 10 */
	{
		.etype	= KRB5_ENCTYPE_CAMELLIA128_CTS_CMAC,
		.name	= "key",
		.key	= "57D0297298FFD9D35DE5A47FB4BDE24B",
		.Kc.use	= 0x00000002,
		.Kc.key	= "D155775A209D05F02B38D42A389E5A56",
		.Ke.use	= 0x00000002,
		.Ke.key	= "64DF83F85A532F17577D8C37035796AB",
		.Ki.use	= 0x00000002,
		.Ki.key	= "3E4FBDF30FB8259C425CB6C96F1F4635",
	},
	{
		.etype	= KRB5_ENCTYPE_CAMELLIA256_CTS_CMAC,
		.name	= "key",
		.key	= "B9D6828B2056B7BE656D88A123B1FAC68214AC2B727ECF5F69AFE0C4DF2A6D2C",
		.Kc.use	= 0x00000002,
		.Kc.key	= "E467F9A9552BC7D3155A6220AF9C19220EEED4FF78B0D1E6A1544991461A9E50",
		.Ke.use	= 0x00000002,
		.Ke.key	= "412AEFC362A7285FC3966C6A5181E7605AE675235B6D549FBFC9AB6630A4C604",
		.Ki.use	= 0x00000002,
		.Ki.key	= "FA624FA0E523993FA388AEFDC67E67EBCD8C08E8A0246B1D73B0D1DD9FC582B0",
	},
	{/* END */}
};

/*
 * Encryption tests.
 */
const struct krb5_enc_test krb5_enc_tests[] = {

Annotation

Implementation Notes