Commit 9ce9c53e authored by Niels Möller's avatar Niels Möller
Browse files

Don't use WITH_PUBLIC_KEY / WITH_HOGWEED, then Makefile sorts out

which files should be compiled.

Rev: nettle/der2rsa.c:1.2
Rev: nettle/dsa-keygen.c:1.2
Rev: nettle/dsa-sign.c:1.2
Rev: nettle/dsa-verify.c:1.2
Rev: nettle/dsa.c:1.2
Rev: nettle/pkcs1-rsa-md5.c:1.2
Rev: nettle/pkcs1-rsa-sha1.c:1.2
Rev: nettle/pkcs1-rsa-sha256.c:1.2
Rev: nettle/pkcs1.c:1.2
Rev: nettle/rsa-compat.c:1.2
Rev: nettle/rsa-decrypt.c:1.2
Rev: nettle/rsa-encrypt.c:1.2
Rev: nettle/rsa-keygen.c:1.2
Rev: nettle/rsa-md5-sign.c:1.2
Rev: nettle/rsa-md5-verify.c:1.2
Rev: nettle/rsa-sha1-sign.c:1.2
Rev: nettle/rsa-sha1-verify.c:1.2
Rev: nettle/rsa-sha256-sign.c:1.2
Rev: nettle/rsa-sha256-verify.c:1.2
Rev: nettle/rsa-sign.c:1.2
Rev: nettle/rsa-verify.c:1.2
Rev: nettle/rsa.c:1.2
Rev: nettle/rsa2openpgp.c:1.2
Rev: nettle/rsa2sexp.c:1.2
Rev: nettle/sexp2dsa.c:1.2
Rev: nettle/sexp2rsa.c:1.2
parent 274df193
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include "rsa.h" #include "rsa.h"
#include "bignum.h" #include "bignum.h"
...@@ -133,5 +131,3 @@ rsa_keypair_from_der(struct rsa_public_key *pub, ...@@ -133,5 +131,3 @@ rsa_keypair_from_der(struct rsa_public_key *pub,
else else
return rsa_public_key_from_der_iterator(pub, limit, &i); return rsa_public_key_from_der_iterator(pub, limit, &i);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <stdlib.h> #include <stdlib.h>
#include "dsa.h" #include "dsa.h"
...@@ -249,5 +247,3 @@ dsa_generate_keypair(struct dsa_public_key *pub, ...@@ -249,5 +247,3 @@ dsa_generate_keypair(struct dsa_public_key *pub,
return 1; return 1;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <stdlib.h> #include <stdlib.h>
#include "dsa.h" #include "dsa.h"
...@@ -93,5 +91,3 @@ dsa_sign(const struct dsa_public_key *pub, ...@@ -93,5 +91,3 @@ dsa_sign(const struct dsa_public_key *pub,
dsa_sign_digest(pub, key, random_ctx, random, dsa_sign_digest(pub, key, random_ctx, random,
digest, signature); digest, signature);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <stdlib.h> #include <stdlib.h>
#include "dsa.h" #include "dsa.h"
...@@ -108,5 +106,3 @@ dsa_verify(const struct dsa_public_key *key, ...@@ -108,5 +106,3 @@ dsa_verify(const struct dsa_public_key *key,
return dsa_verify_digest(key, digest, signature); return dsa_verify_digest(key, digest, signature);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include "dsa.h" #include "dsa.h"
#include "bignum.h" #include "bignum.h"
...@@ -78,5 +76,3 @@ dsa_signature_clear(struct dsa_signature *signature) ...@@ -78,5 +76,3 @@ dsa_signature_clear(struct dsa_signature *signature)
mpz_clear(signature->r); mpz_clear(signature->r);
mpz_clear(signature->s); mpz_clear(signature->s);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -92,5 +90,3 @@ pkcs1_rsa_md5_encode_digest(mpz_t m, unsigned length, const uint8_t *digest) ...@@ -92,5 +90,3 @@ pkcs1_rsa_md5_encode_digest(mpz_t m, unsigned length, const uint8_t *digest)
memcpy(em + length - MD5_DIGEST_SIZE, digest, MD5_DIGEST_SIZE); memcpy(em + length - MD5_DIGEST_SIZE, digest, MD5_DIGEST_SIZE);
nettle_mpz_set_str_256_u(m, length, em); nettle_mpz_set_str_256_u(m, length, em);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -92,5 +90,3 @@ pkcs1_rsa_sha1_encode_digest(mpz_t m, unsigned length, const uint8_t *digest) ...@@ -92,5 +90,3 @@ pkcs1_rsa_sha1_encode_digest(mpz_t m, unsigned length, const uint8_t *digest)
memcpy(em + length - SHA1_DIGEST_SIZE, digest, SHA1_DIGEST_SIZE); memcpy(em + length - SHA1_DIGEST_SIZE, digest, SHA1_DIGEST_SIZE);
nettle_mpz_set_str_256_u(m, length, em); nettle_mpz_set_str_256_u(m, length, em);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -90,5 +88,3 @@ pkcs1_rsa_sha256_encode_digest(mpz_t m, unsigned length, const uint8_t *digest) ...@@ -90,5 +88,3 @@ pkcs1_rsa_sha256_encode_digest(mpz_t m, unsigned length, const uint8_t *digest)
memcpy(em + length - SHA256_DIGEST_SIZE, digest, SHA256_DIGEST_SIZE); memcpy(em + length - SHA256_DIGEST_SIZE, digest, SHA256_DIGEST_SIZE);
nettle_mpz_set_str_256_u(m, length, em); nettle_mpz_set_str_256_u(m, length, em);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
...@@ -57,5 +55,3 @@ pkcs1_signature_prefix(unsigned length, ...@@ -57,5 +55,3 @@ pkcs1_signature_prefix(unsigned length,
memset(buffer + 1, 0xff, length - 1); memset(buffer + 1, 0xff, length - 1);
buffer[0] = 1; buffer[0] = 1;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include "rsa-compat.h" #include "rsa-compat.h"
#include "bignum.h" #include "bignum.h"
...@@ -154,5 +152,3 @@ R_VerifyFinal(R_SIGNATURE_CTX *ctx, ...@@ -154,5 +152,3 @@ R_VerifyFinal(R_SIGNATURE_CTX *ctx,
return res; return res;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -80,5 +78,3 @@ rsa_decrypt(const struct rsa_private_key *key, ...@@ -80,5 +78,3 @@ rsa_decrypt(const struct rsa_private_key *key,
return 1; return 1;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -83,5 +81,3 @@ rsa_encrypt(const struct rsa_public_key *key, ...@@ -83,5 +81,3 @@ rsa_encrypt(const struct rsa_public_key *key,
return 1; return 1;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -332,5 +330,3 @@ rsa_generate_keypair(struct rsa_public_key *pub, ...@@ -332,5 +330,3 @@ rsa_generate_keypair(struct rsa_public_key *pub,
return 1; return 1;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include "rsa.h" #include "rsa.h"
...@@ -59,5 +57,3 @@ rsa_md5_sign_digest(const struct rsa_private_key *key, ...@@ -59,5 +57,3 @@ rsa_md5_sign_digest(const struct rsa_private_key *key,
rsa_compute_root(key, s, s); rsa_compute_root(key, s, s);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include "rsa.h" #include "rsa.h"
...@@ -74,5 +72,3 @@ rsa_md5_verify_digest(const struct rsa_public_key *key, ...@@ -74,5 +72,3 @@ rsa_md5_verify_digest(const struct rsa_public_key *key,
return res; return res;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include "rsa.h" #include "rsa.h"
...@@ -59,5 +57,3 @@ rsa_sha1_sign_digest(const struct rsa_private_key *key, ...@@ -59,5 +57,3 @@ rsa_sha1_sign_digest(const struct rsa_private_key *key,
rsa_compute_root(key, s, s); rsa_compute_root(key, s, s);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include "rsa.h" #include "rsa.h"
...@@ -73,5 +71,3 @@ rsa_sha1_verify_digest(const struct rsa_public_key *key, ...@@ -73,5 +71,3 @@ rsa_sha1_verify_digest(const struct rsa_public_key *key,
return res; return res;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include "rsa.h" #include "rsa.h"
...@@ -59,5 +57,3 @@ rsa_sha256_sign_digest(const struct rsa_private_key *key, ...@@ -59,5 +57,3 @@ rsa_sha256_sign_digest(const struct rsa_private_key *key,
rsa_compute_root(key, s, s); rsa_compute_root(key, s, s);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <assert.h> #include <assert.h>
#include "rsa.h" #include "rsa.h"
...@@ -73,5 +71,3 @@ rsa_sha256_verify_digest(const struct rsa_public_key *key, ...@@ -73,5 +71,3 @@ rsa_sha256_verify_digest(const struct rsa_public_key *key,
return res; return res;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include "rsa.h" #include "rsa.h"
#include "bignum.h" #include "bignum.h"
...@@ -138,5 +136,3 @@ rsa_compute_root(const struct rsa_private_key *key, ...@@ -138,5 +136,3 @@ rsa_compute_root(const struct rsa_private_key *key,
mpz_clear(xp); mpz_clear(xq); mpz_clear(xp); mpz_clear(xq);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include "rsa.h" #include "rsa.h"
#include "bignum.h" #include "bignum.h"
...@@ -57,5 +55,3 @@ _rsa_verify(const struct rsa_public_key *key, ...@@ -57,5 +55,3 @@ _rsa_verify(const struct rsa_public_key *key,
return res; return res;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include "rsa.h" #include "rsa.h"
#include "bignum.h" #include "bignum.h"
...@@ -80,5 +78,3 @@ rsa_public_key_prepare(struct rsa_public_key *key) ...@@ -80,5 +78,3 @@ rsa_public_key_prepare(struct rsa_public_key *key)
return (key->size > 0); return (key->size > 0);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <string.h> #include <string.h>
#include <time.h> #include <time.h>
...@@ -102,4 +100,3 @@ rsa_keypair_to_openpgp(struct nettle_buffer *buffer, ...@@ -102,4 +100,3 @@ rsa_keypair_to_openpgp(struct nettle_buffer *buffer,
PGP_SIGN_CERTIFICATION, PGP_SIGN_CERTIFICATION,
&signature_hash); &signature_hash);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include "rsa.h" #include "rsa.h"
#include "sexp.h" #include "sexp.h"
...@@ -52,5 +50,3 @@ rsa_keypair_to_sexp(struct nettle_buffer *buffer, ...@@ -52,5 +50,3 @@ rsa_keypair_to_sexp(struct nettle_buffer *buffer,
return sexp_format(buffer, "(public-key(%0s(n%b)(e%b)))", return sexp_format(buffer, "(public-key(%0s(n%b)(e%b)))",
algorithm_name, pub->n, pub->e); algorithm_name, pub->n, pub->e);
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <string.h> #include <string.h>
#include "dsa.h" #include "dsa.h"
...@@ -102,5 +100,3 @@ dsa_signature_from_sexp(struct dsa_signature *rs, ...@@ -102,5 +100,3 @@ dsa_signature_from_sexp(struct dsa_signature *rs,
return 1; return 1;
} }
#endif /* WITH_PUBLIC_KEY */
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
# include "config.h" # include "config.h"
#endif #endif
#if WITH_PUBLIC_KEY
#include <string.h> #include <string.h>
#include "rsa.h" #include "rsa.h"
...@@ -108,5 +106,3 @@ rsa_keypair_from_sexp(struct rsa_public_key *pub, ...@@ -108,5 +106,3 @@ rsa_keypair_from_sexp(struct rsa_public_key *pub,
return rsa_keypair_from_sexp_alist(pub, priv, limit, &i); return rsa_keypair_from_sexp_alist(pub, priv, limit, &i);
} }
#endif /* WITH_PUBLIC_KEY */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment