Lines Matching refs:params
40 int crypto_dh_encode_key(char *buf, unsigned int len, const struct dh *params) in crypto_dh_encode_key() argument
53 ptr = dh_pack_data(ptr, end, ¶ms->key_size, in crypto_dh_encode_key()
54 sizeof(params->key_size)); in crypto_dh_encode_key()
55 ptr = dh_pack_data(ptr, end, ¶ms->p_size, sizeof(params->p_size)); in crypto_dh_encode_key()
56 ptr = dh_pack_data(ptr, end, ¶ms->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()
66 int __crypto_dh_decode_key(const char *buf, unsigned int len, struct dh *params) in __crypto_dh_decode_key() argument
78 ptr = dh_unpack_data(¶ms->key_size, ptr, sizeof(params->key_size)); in __crypto_dh_decode_key()
79 ptr = dh_unpack_data(¶ms->p_size, ptr, sizeof(params->p_size)); in __crypto_dh_decode_key()
80 ptr = dh_unpack_data(¶ms->g_size, ptr, sizeof(params->g_size)); in __crypto_dh_decode_key()
81 if (secret.len != crypto_dh_key_len(params)) 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()
94 int crypto_dh_decode_key(const char *buf, unsigned int len, struct dh *params) in crypto_dh_decode_key() argument
98 err = __crypto_dh_decode_key(buf, len, params); 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()
115 if (memchr_inv(params->p, 0, params->p_size) == NULL) in crypto_dh_decode_key()