#include "config.h"
#endif
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
#include "rsa.h"
#include "bignum.h"
return 1;
}
-#endif /* HAVE_LIBGMP */
+#endif /* WITH_PUBLIC_KEY */
#include "config.h"
#endif
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
#include "rsa.h"
mpz_clear(xp); mpz_clear(xq);
}
-#endif /* HAVE_LIBGMP */
+#endif /* WITH_PUBLIC_KEY */
#include "config.h"
#endif
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
#include "rsa.h"
"public-key", "rsa", "n", pub->n, "e", pub->e);
}
-#endif /* HAVE_LIBGMP */
+#endif /* WITH_PUBLIC_KEY */
#include "config.h"
#endif
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
#include "rsa.h"
nettle_mpz_set_str_256(m, length, em);
}
-#endif /* HAVE_LIBGMP */
+#endif /* WITH_PUBLIC_KEY */
#include "config.h"
#endif
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
#include "rsa.h"
nettle_mpz_set_str_256(m, length, em);
}
-#endif /* HAVE_LIBGMP */
+#endif /* WITH_PUBLIC_KEY */
#include "config.h"
#endif
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
#include "rsa.h"
return 1;
}
-#endif /* HAVE_LIBGMP */
+#endif /* WITH_PUBLIC_KEY */
int
test_main(void)
{
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
struct rsa_public_key pub;
struct rsa_private_key key;
SUCCESS();
-#else /* !HAVE_LIBGMP */
+#else /* !WITH_PUBLIC_KEY */
SKIP();
-#endif /* !HAVE_LIBGMP */
+#endif /* !WITH_PUBLIC_KEY */
}
int
test_main(void)
{
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
struct rsa_public_key pub;
struct rsa_private_key key;
SUCCESS();
-#else /* !HAVE_LIBGMP */
+#else /* !WITH_PUBLIC_KEY */
SKIP();
-#endif /* !HAVE_LIBGMP */
+#endif /* !WITH_PUBLIC_KEY */
}
int
test_main(void)
{
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
struct rsa_public_key pub;
struct rsa_private_key priv;
SUCCESS();
-#else /* !HAVE_LIBGMP */
+#else /* !WITH_PUBLIC_KEY */
SKIP();
-#endif /* !HAVE_LIBGMP */
+#endif /* !WITH_PUBLIC_KEY */
}
int
test_main(void)
{
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
struct rsa_public_key pub;
struct rsa_private_key priv;
SUCCESS();
-#else /* !HAVE_LIBGMP */
+#else /* !WITH_PUBLIC_KEY */
SKIP();
-#endif /* !HAVE_LIBGMP */
+#endif /* !WITH_PUBLIC_KEY */
}
/* testutils.c */
-
#include "testutils.h"
#include "cbc.h"
}
#if HAVE_LIBGMP
-#define SIGN(key, hash, msg, signature) do { \
- hash##_update(&hash, LDATA(msg)); \
- rsa_##hash##_sign(key, &hash, signature); \
-} while(0)
-
-#define VERIFY(key, hash, msg, signature) ( \
- hash##_update(&hash, LDATA(msg)), \
- rsa_##hash##_verify(key, &hash, signature) \
-)
-
-
/* Missing in current gmp */
static void
mpz_togglebit (mpz_t x, unsigned long int bit)
else
mpz_setbit(x, bit);
}
+#endif /* HAVE_LIBGMP */
+
+#if WITH_PUBLIC_KEY
+#define SIGN(key, hash, msg, signature) do { \
+ hash##_update(&hash, LDATA(msg)); \
+ rsa_##hash##_sign(key, &hash, signature); \
+} while(0)
+
+#define VERIFY(key, hash, msg, signature) ( \
+ hash##_update(&hash, LDATA(msg)), \
+ rsa_##hash##_verify(key, &hash, signature) \
+)
void
test_rsa_md5(struct rsa_public_key *pub,
mpz_clear(signature);
}
-#if HAVE_LIBGMP
void
test_rsa_key(struct rsa_public_key *pub,
struct rsa_private_key *key)
mpz_clear(tmp); mpz_clear(phi);
}
-#endif /* HAVE_LIBGMP */
+#endif /* WITH_PUBLIC_KEY */
-#endif /* HAVE_LIBGMP */
#include <stdio.h>
#if HAVE_LIBGMP
+# include "bignum.h"
+#endif
+
+#if WITH_PUBLIC_KEY
# include "rsa.h"
#endif
const uint8_t *data,
const uint8_t *ascii);
-#if HAVE_LIBGMP
+#if WITH_PUBLIC_KEY
void
test_rsa_md5(struct rsa_public_key *pub,
struct rsa_private_key *key,
test_rsa_key(struct rsa_public_key *pub,
struct rsa_private_key *key);
-#endif /* HAVE_LIBGMP */
+#endif /* WITH_PUBLIC_KEY */
#define H2(d, s) decode_hex((d), (s))
#define H(x) decode_hex_dup(x)