Define MODP_CUSTOM constructors as variadic functions
They now match the dh_constructor_t signature. This is a follow up for
the changes merged with b668bf3f9e and should fix use of MODP_CUSTOM on
Apple's ARM64 platform.
This commit is contained in:
@@ -272,7 +272,7 @@ static gmp_diffie_hellman_t *create_generic(diffie_hellman_group_t group,
|
||||
}
|
||||
|
||||
/*
|
||||
* Described in header.
|
||||
* Described in header
|
||||
*/
|
||||
gmp_diffie_hellman_t *gmp_diffie_hellman_create(diffie_hellman_group_t group)
|
||||
{
|
||||
@@ -287,12 +287,17 @@ gmp_diffie_hellman_t *gmp_diffie_hellman_create(diffie_hellman_group_t group)
|
||||
params->generator, params->prime);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Described in header
|
||||
*/
|
||||
gmp_diffie_hellman_t *gmp_diffie_hellman_create_custom(
|
||||
diffie_hellman_group_t group, chunk_t g, chunk_t p)
|
||||
diffie_hellman_group_t group, ...)
|
||||
{
|
||||
if (group == MODP_CUSTOM)
|
||||
{
|
||||
chunk_t g, p;
|
||||
|
||||
VA_ARGS_GET(group, g, p);
|
||||
return create_generic(MODP_CUSTOM, p.len, g, p);
|
||||
}
|
||||
return NULL;
|
||||
|
||||
@@ -49,12 +49,11 @@ gmp_diffie_hellman_t *gmp_diffie_hellman_create(diffie_hellman_group_t group);
|
||||
* Creates a new gmp_diffie_hellman_t object for MODP_CUSTOM.
|
||||
*
|
||||
* @param group MODP_CUSTOM
|
||||
* @param g generator
|
||||
* @param p prime
|
||||
* @param ... expects generator and prime as chunk_t
|
||||
* @return gmp_diffie_hellman_t object, NULL if not supported
|
||||
*/
|
||||
gmp_diffie_hellman_t *gmp_diffie_hellman_create_custom(
|
||||
diffie_hellman_group_t group, chunk_t g, chunk_t p);
|
||||
diffie_hellman_group_t group, ...);
|
||||
|
||||
#endif /** GMP_DIFFIE_HELLMAN_H_ @}*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user