/linux/tools/testing/selftests/bpf/ |
H A D | test_lru_map.c | 1 // SPDX-License-Identifier: GPL-2.0-only 36 if (map_fd == -1) in create_map() 42 static int bpf_map_lookup_elem_with_ref_bit(int fd, unsigned long long key, in bpf_map_lookup_elem_with_ref_bit() argument 48 BPF_LD_IMM64(BPF_REG_3, key), in bpf_map_lookup_elem_with_ref_bit() 50 BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8), in bpf_map_lookup_elem_with_ref_bit() 71 return -1; in bpf_map_lookup_elem_with_ref_bit() 78 return -1; in bpf_map_lookup_elem_with_ref_bit() 83 ret = -1; in bpf_map_lookup_elem_with_ref_bit() 103 printf("key:%llu not found from map. %s(%d)\n", in map_subset() 108 printf("key:%llu value0:%llu != value1:%llu\n", in map_subset() [all …]
|
H A D | test_maps.c | 1 // SPDX-License-Identifier: GPL-2.0-only 35 long long key, next_key, first_key, value; in test_hashmap() local 38 fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, sizeof(key), sizeof(value), 2, &map_opts); in test_hashmap() 44 key = 1; in test_hashmap() 46 /* Insert key=1 element. */ in test_hashmap() 47 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0); in test_hashmap() 51 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 && in test_hashmap() 52 /* key=1 already exists. */ in test_hashmap() 55 /* -1 is an invalid flag. */ in test_hashmap() 56 assert(bpf_map_update_elem(fd, &key, &value, -1) < 0 && in test_hashmap() [all …]
|
H A D | test_lpm_map.c |
|
/linux/include/linux/platform_data/ |
H A D | keyboard-spear.h | 6 * License version 2. This program is licensed "as is" without any 20 KEY(0, 0, KEY_ESC), \ 21 KEY(0, 1, KEY_1), \ 22 KEY(0, 2, KEY_2), \ 23 KEY(0, 3, KEY_3), \ 24 KEY(0, 4, KEY_4), \ 25 KEY(0, 5, KEY_5), \ 26 KEY(0, 6, KEY_6), \ 27 KEY(0, 7, KEY_7), \ 28 KEY(0, 8, KEY_8), \ [all …]
|
/linux/drivers/input/keyboard/ |
H A D | pinephone-keyboard.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 // Copyright (C) 2021-2022 Samuel Holland <samuel@sholland.org> 18 #define DRV_NAME "pinephone-keyboard" 46 KEY(0, 0, KEY_ESC), 47 KEY(0, 1, KEY_1), 48 KEY(0, 2, KEY_2), 49 KEY(0, 3, KEY_3), 50 KEY(0, 4, KEY_4), 51 KEY(0, 5, KEY_5), 52 KEY(0, 6, KEY_6), [all …]
|
/linux/drivers/s390/crypto/ |
H A D | zcrypt_cca_key.h | 1 /* SPDX-License-Identifier: GPL-2.0+ */ 21 * mapping for the cca private ME key token. 25 * mapping for the cca key token header 40 * In a private key, the modulus doesn't appear in the public 48 unsigned char reserved[2]; 51 unsigned short modulus_byte_len; /* In a private key, this is 0 */ 55 * mapping for the cca private CRT key 'token' 92 * Set up private key fields of a type6 MEX message. 95 * @p: pointer to memory area for the key 97 * Returns the size of the key area or negative errno value. [all …]
|
H A D | zcrypt_ccamisc.h | 1 /* SPDX-License-Identifier: GPL-2.0+ */ 17 /* Key token types */ 18 #define TOKTYPE_NON_CCA 0x00 /* Non-CCA key token */ 19 #define TOKTYPE_CCA_INTERNAL 0x01 /* CCA internal sym key token */ 20 #define TOKTYPE_CCA_INTERNAL_PKA 0x1f /* CCA internal asym key token */ 23 #define TOKVER_PROTECTED_KEY 0x01 /* Protected key token */ 24 #define TOKVER_CLEAR_KEY 0x02 /* Clear key token */ 27 #define TOKVER_CCA_AES 0x04 /* CCA AES key token */ 28 #define TOKVER_CCA_VLSC 0x05 /* var length sym cipher key token */ 30 /* Max size of a cca variable length cipher key token */ [all …]
|
/linux/crypto/asymmetric_keys/ |
H A D | restrict.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* Instantiate a public key crypto key from an X.509 Certificate 31 size_t hexlen = (strlen(str) - 3) / 2; in ca_keys_setup() 43 ca_keyid = p; /* owner key 'id:xxxxxx' */ in ca_keys_setup() 54 * restrict_link_by_signature - Restrict additions to a ring of public keys 56 * @type: The type of key being added. 57 * @payload: The payload of the new key. 61 * those is the signing key and validates the new certificate, then mark the 64 * Returns 0 if the new certificate was accepted, -ENOKEY if we couldn't find a 65 * matching parent certificate in the trusted list, -EKEYREJECTED if the [all …]
|
H A D | asymmetric_type.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* Asymmetric public-key cryptography key type 4 * See Documentation/crypto/asymmetric-keys.rst 9 #include <keys/asymmetric-subtype.h> 10 #include <keys/asymmetric-parser.h> 17 #include <keys/user-type.h> 25 [VERIFYING_KEY_SIGNATURE] = "key sig", 26 [VERIFYING_KEY_SELF_SIGNATURE] = "key self sig", 35 * find_asymmetric_key - Find a key by ID. 40 * @id_2: The fallback ID to match against @keyring keys' id[2] if both of the [all …]
|
/linux/lib/crypto/ |
H A D | poly1305-donna32.c | 1 // SPDX-License-Identifier: GPL-2.0 OR MIT 3 * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. 5 * This is based in part on Andrew Moon's poly1305-donna, which is in the 13 void poly1305_core_setkey(struct poly1305_core_key *key, in poly1305_core_setkey() argument 17 key->key.r[0] = (get_unaligned_le32(&raw_key[0])) & 0x3ffffff; in poly1305_core_setkey() 18 key->key.r[1] = (get_unaligned_le32(&raw_key[3]) >> 2) & 0x3ffff03; in poly1305_core_setkey() 19 key->key.r[2] = (get_unaligned_le32(&raw_key[6]) >> 4) & 0x3ffc0ff; in poly1305_core_setkey() 20 key->key.r[3] = (get_unaligned_le32(&raw_key[9]) >> 6) & 0x3f03fff; in poly1305_core_setkey() 21 key->key.r[4] = (get_unaligned_le32(&raw_key[12]) >> 8) & 0x00fffff; in poly1305_core_setkey() 24 key->precomputed_s.r[0] = key->key.r[1] * 5; in poly1305_core_setkey() [all …]
|
/linux/lib/ |
H A D | siphash.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) 2 /* Copyright (C) 2016-2022 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. 4 * SipHash: a fast short-input PRF 7 * This implementation is specifically for SipHash2-4 for a secure PRF 8 * and HalfSipHash1-3/SipHash1-3 for an insecure PRF only suitable for 17 #include <asm/word-at-a-time.h> 28 v3 ^= key->key[1]; \ 29 v2 ^= key->key[0]; \ 30 v1 ^= key->key[1]; \ 31 v0 ^= key->key[0]; [all …]
|
H A D | hashtable_test.c | 1 // SPDX-License-Identifier: GPL-2.0 13 int key; member 22 DEFINE_HASHTABLE(hash1, 2); in hashtable_test_hash_init() 41 a.key = 1; in hashtable_test_hash_empty() 43 hash_add(hash, &a.node, a.key); in hashtable_test_hash_empty() 54 a.key = 1; in hashtable_test_hash_hashed() 56 hash_add(hash, &a.node, a.key); in hashtable_test_hash_hashed() 57 b.key = 1; in hashtable_test_hash_hashed() 58 b.data = 2; in hashtable_test_hash_hashed() 59 hash_add(hash, &b.node, b.key); in hashtable_test_hash_hashed() [all …]
|
/linux/tools/perf/ui/tui/ |
H A D | util.c | 1 // SPDX-License-Identifier: GPL-2.0 23 ui_browser__write_nstring(browser, *arg, browser->width); in ui_browser__argv_write() 28 int key; in popup_menu__run() local 30 if (ui_browser__show(menu, " ", "ESC: exit, ENTER|->: Select option") < 0) in popup_menu__run() 31 return -1; in popup_menu__run() 34 key = ui_browser__run(menu, 0); in popup_menu__run() 36 switch (key) { in popup_menu__run() 39 key = menu->index; in popup_menu__run() 45 key = -1; in popup_menu__run() 49 *keyp = key; in popup_menu__run() [all …]
|
/linux/tools/testing/selftests/bpf/progs/ |
H A D | test_tunnel_kern.c | 1 // SPDX-License-Identifier: GPL-2.0 6 * modify it under the terms of version 2 of the GNU General Public 53 __type(key, __u32); 61 struct bpf_tunnel_key key; in gre_set_tunnel() local 63 __builtin_memset(&key, 0x0, sizeof(key)); in gre_set_tunnel() 64 key.remote_ipv4 = 0xac100164; /* 172.16.1.100 */ in gre_set_tunnel() 65 key.tunnel_id = 2; in gre_set_tunnel() 66 key.tunnel_tos = 0; in gre_set_tunnel() 67 key.tunnel_ttl = 64; in gre_set_tunnel() 69 ret = bpf_skb_set_tunnel_key(skb, &key, sizeof(key), in gre_set_tunnel() [all …]
|
/linux/include/linux/ |
H A D | siphash.h | 1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 2 /* Copyright (C) 2016-2022 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. 4 * SipHash: a fast short-input PRF 7 * This implementation is specifically for SipHash2-4 for a secure PRF 8 * and HalfSipHash1-3/SipHash1-3 for an insecure PRF only suitable for 20 u64 key[2]; member 25 static inline bool siphash_key_is_zero(const siphash_key_t *key) in siphash_key_is_zero() argument 27 return !(key->key[0] | key->key[1]); in siphash_key_is_zero() 30 u64 __siphash_aligned(const void *data, size_t len, const siphash_key_t *key); 31 u64 __siphash_unaligned(const void *data, size_t len, const siphash_key_t *key); [all …]
|
/linux/arch/arm/mach-omap1/ |
H A D | board-ams-delta.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * linux/arch/arm/mach-omap1/board-ams-delta.c 5 * Modified from board-generic.c 19 #include <linux/mtd/nand-gpio.h> 29 #include <linux/platform_data/gpio-omap.h> 30 #include <linux/soc/ti/omap1-mux.h> 33 #include <asm/mach-types.h> 37 #include <linux/platform_data/keypad-omap.h> 41 #include "ams-delta-fiq.h" 42 #include "board-ams-delta.h" [all …]
|
H A D | board-sx1.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * linux/arch/arm/mach-omap1/board-sx1.c 5 * Modified from board-generic.c 9 * Original version : Vladimir Ananiev (Vovan888-at-gmail com) 29 #include <linux/platform_data/keypad-omap.h> 30 #include <linux/omap-dma.h> 33 #include <asm/mach-types.h> 39 #include "board-sx1.h" 50 unsigned char data[2]; in sx1_i2c_write_byte() 54 return -ENODEV; in sx1_i2c_write_byte() [all …]
|
/linux/crypto/ |
H A D | cast6_generic.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * cast6.c - Cast6 cipher algorithm [rfc2612]. 5 * CAST-256 (*cast6*) is a DES like Substitution-Permutation Network (SPN) 6 * cryptosystem built upon the CAST-128 (*cast5*) [rfc2144] encryption 28 (((s1[I >> 24] ^ s2[(I>>16)&0xff]) - s3[(I>>8)&0xff]) + s4[I&0xff])) 30 (((s1[I >> 24] - s2[(I>>16)&0xff]) + s3[(I>>8)&0xff]) ^ s4[I&0xff])) 31 #define F3(D, r, m) ((I = ((m) - (D))), (I = rol32(I, (r))), \ 32 (((s1[I >> 24] + s2[(I>>16)&0xff]) ^ s3[(I>>8)&0xff]) - s4[I&0xff])) 93 static inline void W(u32 *key, unsigned int i) in W() argument 96 key[6] ^= F1(key[7], Tr[i % 4][0], Tm[i][0]); in W() [all …]
|
H A D | nhpoly1305.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * NHPoly1305 - ε-almost-∆-universal hash function for Adiantum 15 * ε-almost-∆-universal (ε-∆U) hash function for equal-length inputs over 16 * Z/(2^{128}Z), where the "∆" operation is addition. It hashes 1024-byte 17 * chunks of the input with the NH hash function [2], reducing the input length 19 * GF(2^{130}-5), like in the Poly1305 MAC [3]. Note that the polynomial 20 * evaluation by itself would suffice to achieve the ε-∆U property; NH is used 25 * [1] Adiantum: length-preserving encryption for entry-level processors 27 * [2] UMAC: Fast and Secure Message Authentication 29 * [3] The Poly1305-AES message-authentication code [all …]
|
H A D | rsa.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* RSA asymmetric public-key algorithm [RFC3447] 32 return -EINVAL; in rsa_check_payload() 36 return -ENOMEM; in rsa_check_payload() 40 return -EINVAL; in rsa_check_payload() 51 static int _rsa_enc(const struct rsa_mpi_key *key, MPI c, MPI m) in _rsa_enc() argument 54 * Even though (1) in RFC3447 only requires 0 <= m <= n - 1, we are in _rsa_enc() 55 * slightly more conservative and require 1 < m < n - 1. This is in line in _rsa_enc() 56 * with SP 800-56Br2, Section 7.1.1. in _rsa_enc() 58 if (rsa_check_payload(m, key->n)) in _rsa_enc() [all …]
|
/linux/tools/bpf/bpftool/ |
H A D | map.c | 1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 /* Copyright (C) 2017-2018 Netronome Systems, Inc. */ 59 return -1; in map_type_from_str() 64 if (map_is_per_cpu(info->type)) in alloc_value() 65 return malloc(round_up(info->value_size, 8) * in alloc_value() 68 return malloc(info->value_size); in alloc_value() 72 struct bpf_map_info *map_info, void *key, in do_dump_btf() argument 78 /* start of key-value pair */ in do_dump_btf() 79 jsonw_start_object(d->jw); in do_dump_btf() 81 if (map_info->btf_key_type_id) { in do_dump_btf() [all …]
|
/linux/net/rxrpc/ |
H A D | key.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* RxRPC key management 17 #include <linux/key-type.h> 22 #include <keys/rxrpc-type.h> 23 #include <keys/user-type.h> 24 #include "ar-internal.h" 28 static void rxrpc_destroy(struct key *); 29 static void rxrpc_describe(const struct key *, struct seq_file *); 30 static long rxrpc_read(const struct key *, char *, size_t); 50 * - the caller guarantees we have at least 4 words [all …]
|
/linux/include/uapi/linux/ |
H A D | keyctl.h | 1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 10 * 2 of the License, or (at your option) any later version. 19 #define KEY_SPEC_THREAD_KEYRING -1 /* - key ID for thread-specific keyring */ 20 #define KEY_SPEC_PROCESS_KEYRING -2 /* - key ID for process-specific keyring */ 21 #define KEY_SPEC_SESSION_KEYRING -3 /* - key ID for session-specific keyring */ 22 #define KEY_SPEC_USER_KEYRING -4 /* - key ID for UID-specific keyring */ 23 #define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */ 24 #define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */ 25 #define KEY_SPEC_REQKEY_AUTH_KEY -7 /* - key ID for assumed request_key auth key */ 26 #define KEY_SPEC_REQUESTOR_KEYRING -8 /* - key ID for request_key() dest keyring */ [all …]
|
/linux/arch/x86/crypto/ |
H A D | nh-avx2-x86_64.S | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * NH - ε-almost-universal hash function, x86_64 AVX2 accelerated 35 #define KEY %rdi macro 42 // Add message words to key words 68 * void nh_avx2(const u32 *key, const u8 *message, size_t message_len, 75 vmovdqu 0x00(KEY), K0 76 vmovdqu 0x10(KEY), K1 77 add $0x20, KEY 87 vmovdqu 0x00(KEY), K2 88 vmovdqu 0x10(KEY), K3 [all …]
|
/linux/Documentation/security/keys/ |
H A D | trusted-encrypted.rst | 5 Trusted and Encrypted Keys are two new key types added to the existing kernel 6 key ring service. Both of these new types are variable length symmetric keys, 30 Rooted to Storage Root Key (SRK) which never leaves the TPM that 33 (2) TEE (Trusted Execution Environment: OP-TEE based on Arm TrustZone) 35 Rooted to Hardware Unique Key (HUK) which is generally burnt in on-chip 41 mode, trust is rooted to the OTPMK, a never-disclosed 256-bit key 43 Otherwise, a common fixed test key is used instead. 45 (4) DCP (Data Co-Processor: crypto accelerator of various i.MX SoCs) 47 Rooted to a one-time programmable key (OTP) that is generally burnt 48 in the on-chip fuses and is accessible to the DCP encryption engine only. [all …]
|