Преглед изворни кода

Merge pull request #224 from libtom/pr/fix-154-dsa-api

Do not expose dsa_make_params as a public API
karel-m пре 8 година
родитељ
комит
3922868082
2 измењених фајлова са 2 додато и 4 уклоњено
  1. 0 2
      src/headers/tomcrypt_pk.h
  2. 2 2
      src/pk/dsa/dsa_make_key.c

+ 0 - 2
src/headers/tomcrypt_pk.h

@@ -410,8 +410,6 @@ int dsa_make_key(prng_state *prng, int wprng, int group_size, int modulus_size,
 
 int dsa_make_key_ex(prng_state *prng, int wprng, int group_size, int modulus_size, dsa_key *key, char* p_hex, char* q_hex, char* g_hex);
 
-int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g);
-
 void dsa_free(dsa_key *key);
 
 int dsa_sign_hash_raw(const unsigned char *in,  unsigned long inlen,

+ 2 - 2
src/pk/dsa/dsa_make_key.c

@@ -18,7 +18,7 @@
 #ifdef LTC_MDSA
 
 /**
-  Create DSA parameters
+  Create DSA parameters (INTERNAL ONLY, not part of public API)
   @param prng          An active PRNG state
   @param wprng         The index of the PRNG desired
   @param group_size    Size of the multiplicative group (octets)
@@ -28,7 +28,7 @@
   @param g             [out] bignum where generated 'g' is stored (must be initialized by caller)
   @return CRYPT_OK if successful, upon error this function will free all allocated memory
 */
-int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g)
+static int dsa_make_params(prng_state *prng, int wprng, int group_size, int modulus_size, void *p, void *q, void *g)
 {
   unsigned long L, N, n, outbytes, seedbytes, counter, j, i;
   int err, res, mr_tests_q, mr_tests_p, found_p, found_q, hash;