From b34b93dbf7e799d24bb381b3e15ef0d98f4adebb Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 8 Apr 2010 15:08:35 +0200 Subject: Store DH generator in a chunk, hide non-public data in a private struct --- src/libstrongswan/crypto/diffie_hellman.h | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'src/libstrongswan/crypto/diffie_hellman.h') diff --git a/src/libstrongswan/crypto/diffie_hellman.h b/src/libstrongswan/crypto/diffie_hellman.h index 9d3b604cc..7a0c9b204 100644 --- a/src/libstrongswan/crypto/diffie_hellman.h +++ b/src/libstrongswan/crypto/diffie_hellman.h @@ -112,36 +112,21 @@ struct diffie_hellman_t { * Parameters for a specific diffie hellman group. */ struct diffie_hellman_params_t { - /** - * DH group. - */ - diffie_hellman_group_t group; - - /** - * The prime as byte array. - */ - const u_int8_t *prime; /** - * Length of the prime (in bytes). + * The prime of the group */ - size_t prime_len; + const chunk_t prime; /** - * Optimal length of the exponent (in bytes), as specified in RFC 3526. + * Generator of the group */ - size_t opt_exp_len; + const chunk_t generator; /** - * Length of the exponent (in bytes) that should be used, depending on - * the dh_exponent_ansi_x9_42 setting in strongswan.conf. + * Exponent length to use */ size_t exp_len; - - /** - * Generator. - */ - u_int16_t generator; }; /** -- cgit v1.2.3