Verify that GCD(m,n) != 1 when n is an RSA modulus
[oweals/gnunet.git] / src / pq / pq_query_helper.c
index 13c71446ccae34726fbd90a5ae83ce4c6a610787..d80a3d99a61b77354cf7f5f168c37d59afc134aa 100644 (file)
@@ -75,6 +75,18 @@ GNUNET_PQ_query_param_fixed_size (const void *ptr,
 }
 
 
+/**
+ * Generate query parameter for a string.
+ *
+ * @param ptr pointer to the string query parameter to pass
+ */
+struct GNUNET_PQ_QueryParam
+GNUNET_PQ_query_param_string (const char *ptr)
+{
+  return GNUNET_PQ_query_param_fixed_size (ptr, strlen (ptr));
+}
+
+
 /**
  * Function called to convert input argument into SQL parameters.
  *
@@ -254,7 +266,7 @@ GNUNET_PQ_query_param_uint64 (const uint64_t *x)
  * @param scratch_length number of entries left in @a scratch
  * @return -1 on error, number of offsets used in @a scratch otherwise
  */
-static int 
+static int
 qconv_rsa_public_key (void *cls,
                      const void *data,
                      size_t data_len,
@@ -265,7 +277,7 @@ qconv_rsa_public_key (void *cls,
                      void *scratch[],
                      unsigned int scratch_length)
 {
-  const struct GNUNET_CRYPTO_rsa_PublicKey *rsa = data;
+  const struct GNUNET_CRYPTO_RsaPublicKey *rsa = data;
   char *buf;
   size_t buf_size;
 
@@ -290,7 +302,7 @@ qconv_rsa_public_key (void *cls,
  * @return array entry for the query parameters to use
  */
 struct GNUNET_PQ_QueryParam
-GNUNET_PQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_rsa_PublicKey *x)
+GNUNET_PQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x)
 {
   struct GNUNET_PQ_QueryParam res =
     { &qconv_rsa_public_key, NULL, (x), 0, 1 };
@@ -323,7 +335,7 @@ qconv_rsa_signature (void *cls,
                     void *scratch[],
                     unsigned int scratch_length)
 {
-  const struct GNUNET_CRYPTO_rsa_Signature *sig = data;
+  const struct GNUNET_CRYPTO_RsaSignature *sig = data;
   char *buf;
   size_t buf_size;
 
@@ -348,7 +360,7 @@ qconv_rsa_signature (void *cls,
  * @return array entry for the query parameters to use
  */
 struct GNUNET_PQ_QueryParam
-GNUNET_PQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_rsa_Signature *x)
+GNUNET_PQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x)
 {
   struct GNUNET_PQ_QueryParam res =
     { &qconv_rsa_signature, NULL, (x), 0, 1 };