Lines Matching +full:permit +full:-

1 // SPDX-License-Identifier: GPL-2.0-or-later
17 if (!dst || size > end - dst) in dh_pack_data()
31 return p->key_size + p->p_size + p->g_size; in dh_data_size()
50 return -EINVAL; in crypto_dh_encode_key()
53 ptr = dh_pack_data(ptr, end, &params->key_size, in crypto_dh_encode_key()
54 sizeof(params->key_size)); in crypto_dh_encode_key()
55 ptr = dh_pack_data(ptr, end, &params->p_size, sizeof(params->p_size)); in crypto_dh_encode_key()
56 ptr = dh_pack_data(ptr, end, &params->g_size, sizeof(params->g_size)); in crypto_dh_encode_key()
57 ptr = dh_pack_data(ptr, end, params->key, params->key_size); in crypto_dh_encode_key()
58 ptr = dh_pack_data(ptr, end, params->p, params->p_size); in crypto_dh_encode_key()
59 ptr = dh_pack_data(ptr, end, params->g, params->g_size); in crypto_dh_encode_key()
61 return -EINVAL; in crypto_dh_encode_key()
72 return -EINVAL; in __crypto_dh_decode_key()
76 return -EINVAL; in __crypto_dh_decode_key()
78 ptr = dh_unpack_data(&params->key_size, ptr, sizeof(params->key_size)); in __crypto_dh_decode_key()
79 ptr = dh_unpack_data(&params->p_size, ptr, sizeof(params->p_size)); in __crypto_dh_decode_key()
80 ptr = dh_unpack_data(&params->g_size, ptr, sizeof(params->g_size)); in __crypto_dh_decode_key()
82 return -EINVAL; in __crypto_dh_decode_key()
87 params->key = (void *)ptr; in __crypto_dh_decode_key()
88 params->p = (void *)(ptr + params->key_size); in __crypto_dh_decode_key()
89 params->g = (void *)(ptr + params->key_size + params->p_size); in __crypto_dh_decode_key()
103 * Don't permit the buffer for 'key' or 'g' to be larger than 'p', since in crypto_dh_decode_key()
106 if (params->key_size > params->p_size || in crypto_dh_decode_key()
107 params->g_size > params->p_size) in crypto_dh_decode_key()
108 return -EINVAL; in crypto_dh_decode_key()
111 * Don't permit 'p' to be 0. It's not a prime number, and it's subject in crypto_dh_decode_key()
115 if (memchr_inv(params->p, 0, params->p_size) == NULL) in crypto_dh_decode_key()
116 return -EINVAL; in crypto_dh_decode_key()