test_key
static u8 test_key[FSCRYPT_MAX_RAW_KEY_SIZE];
get_random_once(test_key, sizeof(test_key));
secret->size = sizeof(test_key);
memcpy(secret->bytes, test_key, sizeof(test_key));
static inline bool keys_match(void *key, void *test_key, unsigned key_size)
if (memcmp(key, test_key, key_size))
u32 idx, key_hash, test_key;
test_key = entry->key;
if (test_key && test_key == key_hash) {
if (!test_key) {
static u8 test_key[POLY1305_KEY_SIZE];
poly1305_init(ctx, test_key);
poly1305(test_key, data, len, out);
rand_bytes_seeded_from_len(test_key, POLY1305_KEY_SIZE);
static struct polyval_key test_key;
polyval_init(ctx, &test_key);
polyval_preparekey(&test_key, raw_key);
polyval(&test_key, data, len, out);
struct test_key static_key_tests[] = {
.test_key = &old_true_key_static_key_true,
.test_key = &old_false_key_static_key_false,
.test_key = &true_key_static_branch_likely,
.test_key = &true_key_static_branch_unlikely,
.test_key = &false_key_static_branch_likely,
.test_key = &false_key_static_branch_unlikely,
.test_key = &base_old_true_key_static_key_true,
.test_key = &base_inv_old_true_key_static_key_true,
.test_key = &base_old_false_key_static_key_false,
.test_key = &base_inv_old_false_key_static_key_false,
.test_key = &base_true_key_static_branch_likely,
.test_key = &base_true_key_static_branch_unlikely,
.test_key = &base_inv_true_key_static_branch_likely,
.test_key = &base_inv_true_key_static_branch_unlikely,
.test_key = &base_false_key_static_branch_likely,
.test_key = &base_false_key_static_branch_unlikely,
.test_key = &base_inv_false_key_static_branch_likely,
.test_key = &base_inv_false_key_static_branch_unlikely,
bool (*test_key)(void);
static void invert_keys(struct test_key *keys, int size)
static int verify_keys(struct test_key *keys, int size, bool invert)
ret = keys[i].test_key();
struct test_key *keys;
struct test_key *key = &collection.keys[index];
static void test_key_error(const char *msg, struct test_key *key)
struct test_key *key = &collection.keys[i];
struct test_key *key = &collection.keys[i];
struct test_key *key = &collection.keys[i];
struct test_key *key;