Browse Source

update comments

[skip ci]
Steffen Jaeckel 8 years ago
parent
commit
1819a02d5a
3 changed files with 14 additions and 12 deletions
  1. 1 2
      src/headers/tomcrypt_pk.h
  2. 6 5
      src/pk/dh/dh_set.c
  3. 7 5
      src/pk/dsa/dsa_set.c

+ 1 - 2
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 */

+ 6 - 5
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
 */

+ 7 - 5
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.
 */