diff --git a/src/headers/tomcrypt_pk.h b/src/headers/tomcrypt_pk.h index 49b9a9b..00a6c13 100644 --- a/src/headers/tomcrypt_pk.h +++ b/src/headers/tomcrypt_pk.h @@ -232,8 +232,7 @@ int dh_shared_secret(dh_key *private_key, dh_key *public_key, void dh_free(dh_key *key); -int dh_export_key(void *out, unsigned long *outlen, - int type, dh_key *key); +int dh_export_key(void *out, unsigned long *outlen, int type, dh_key *key); #ifdef LTC_SOURCE /* internal helper functions */ diff --git a/src/pk/dh/dh_set.c b/src/pk/dh/dh_set.c index 8dd3f0d..8d0af7d 100644 --- a/src/pk/dh/dh_set.c +++ b/src/pk/dh/dh_set.c @@ -78,12 +78,13 @@ LBL_ERR: } /** - Import DH key parts pub and priv from raw numbers + Import DH public or private key part from raw numbers - @param pub DH's pub (public key) (can be NULL if priv is valid) - @param publen DH's pub's length - @param priv DH's priv (private key) (can be NULL if pub is valid) - @param privlen DH's priv's length + NB: The p & g parts must be set beforehand + + @param in The key-part to import, either public or private. + @param inlen The key-part's length + @param type Which type of key (PK_PRIVATE or PK_PUBLIC) @param key [out] the destination for the imported key @return CRYPT_OK if successful */ diff --git a/src/pk/dsa/dsa_set.c b/src/pk/dsa/dsa_set.c index fd18341..a630974 100644 --- a/src/pk/dsa/dsa_set.c +++ b/src/pk/dsa/dsa_set.c @@ -58,11 +58,13 @@ LBL_ERR: } /** - Import DSA public or private key from raw numbers - @param pub DSA's y (public key) in binary representation - @param publen The length of pub - @param priv DSA's x (private key) in binary representation (can be NULL when importing public key) - @param privlen The length of priv + Import DSA public or private key-part from raw numbers + + NB: The p, q & g parts must be set beforehand + + @param in The key-part to import, either public or private. + @param inlen The key-part's length + @param type Which type of key (PK_PRIVATE or PK_PUBLIC) @param key [out] the destination for the imported key @return CRYPT_OK if successful. */