Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An attempt to fix #449 (ECDSA forcing DER/ASN.1) #450

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions libtomcrypt_VS2008.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -2510,6 +2510,22 @@
RelativePath="src\pk\ecc\ecc_sign_hash.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_sign_hash_eth27.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_sign_hash_internal.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_sign_hash_rfc5656.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_sign_hash_rfc7518.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_sizes.c"
>
Expand All @@ -2522,6 +2538,22 @@
RelativePath="src\pk\ecc\ecc_verify_hash.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_verify_hash_eth27.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_verify_hash_internal.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_verify_hash_rfc5656.c"
>
</File>
<File
RelativePath="src\pk\ecc\ecc_verify_hash_rfc7518.c"
>
</File>
<File
RelativePath="src\pk\ecc\ltc_ecc_export_point.c"
>
Expand Down
8 changes: 6 additions & 2 deletions makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,12 @@ src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_import_openssl.
src/pk/ecc/ecc_import_pkcs8.o src/pk/ecc/ecc_import_x509.o src/pk/ecc/ecc_make_key.o \
src/pk/ecc/ecc_recover_key.o src/pk/ecc/ecc_set_curve.o src/pk/ecc/ecc_set_curve_internal.o \
src/pk/ecc/ecc_set_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_ssh_ecdsa_encode_name.o src/pk/ecc/ecc_verify_hash.o \
src/pk/ecc/ltc_ecc_export_point.o src/pk/ecc/ltc_ecc_import_point.o src/pk/ecc/ltc_ecc_is_point.o \
src/pk/ecc/ecc_sign_hash_eth27.o src/pk/ecc/ecc_sign_hash_internal.o \
src/pk/ecc/ecc_sign_hash_rfc5656.o src/pk/ecc/ecc_sign_hash_rfc7518.o src/pk/ecc/ecc_sizes.o \
src/pk/ecc/ecc_ssh_ecdsa_encode_name.o src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ecc_verify_hash_eth27.o \
src/pk/ecc/ecc_verify_hash_internal.o src/pk/ecc/ecc_verify_hash_rfc5656.o \
src/pk/ecc/ecc_verify_hash_rfc7518.o src/pk/ecc/ltc_ecc_export_point.o \
src/pk/ecc/ltc_ecc_import_point.o src/pk/ecc/ltc_ecc_is_point.o \
src/pk/ecc/ltc_ecc_is_point_at_infinity.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
Expand Down
8 changes: 6 additions & 2 deletions makefile.msvc
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,12 @@ src/pk/ecc/ecc_get_size.obj src/pk/ecc/ecc_import.obj src/pk/ecc/ecc_import_open
src/pk/ecc/ecc_import_pkcs8.obj src/pk/ecc/ecc_import_x509.obj src/pk/ecc/ecc_make_key.obj \
src/pk/ecc/ecc_recover_key.obj src/pk/ecc/ecc_set_curve.obj src/pk/ecc/ecc_set_curve_internal.obj \
src/pk/ecc/ecc_set_key.obj src/pk/ecc/ecc_shared_secret.obj src/pk/ecc/ecc_sign_hash.obj \
src/pk/ecc/ecc_sizes.obj src/pk/ecc/ecc_ssh_ecdsa_encode_name.obj src/pk/ecc/ecc_verify_hash.obj \
src/pk/ecc/ltc_ecc_export_point.obj src/pk/ecc/ltc_ecc_import_point.obj src/pk/ecc/ltc_ecc_is_point.obj \
src/pk/ecc/ecc_sign_hash_eth27.obj src/pk/ecc/ecc_sign_hash_internal.obj \
src/pk/ecc/ecc_sign_hash_rfc5656.obj src/pk/ecc/ecc_sign_hash_rfc7518.obj src/pk/ecc/ecc_sizes.obj \
src/pk/ecc/ecc_ssh_ecdsa_encode_name.obj src/pk/ecc/ecc_verify_hash.obj src/pk/ecc/ecc_verify_hash_eth27.obj \
src/pk/ecc/ecc_verify_hash_internal.obj src/pk/ecc/ecc_verify_hash_rfc5656.obj \
src/pk/ecc/ecc_verify_hash_rfc7518.obj src/pk/ecc/ltc_ecc_export_point.obj \
src/pk/ecc/ltc_ecc_import_point.obj src/pk/ecc/ltc_ecc_is_point.obj \
src/pk/ecc/ltc_ecc_is_point_at_infinity.obj src/pk/ecc/ltc_ecc_map.obj src/pk/ecc/ltc_ecc_mul2add.obj \
src/pk/ecc/ltc_ecc_mulmod.obj src/pk/ecc/ltc_ecc_mulmod_timing.obj src/pk/ecc/ltc_ecc_points.obj \
src/pk/ecc/ltc_ecc_projective_add_point.obj src/pk/ecc/ltc_ecc_projective_dbl_point.obj \
Expand Down
8 changes: 6 additions & 2 deletions makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_import_openssl.
src/pk/ecc/ecc_import_pkcs8.o src/pk/ecc/ecc_import_x509.o src/pk/ecc/ecc_make_key.o \
src/pk/ecc/ecc_recover_key.o src/pk/ecc/ecc_set_curve.o src/pk/ecc/ecc_set_curve_internal.o \
src/pk/ecc/ecc_set_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_ssh_ecdsa_encode_name.o src/pk/ecc/ecc_verify_hash.o \
src/pk/ecc/ltc_ecc_export_point.o src/pk/ecc/ltc_ecc_import_point.o src/pk/ecc/ltc_ecc_is_point.o \
src/pk/ecc/ecc_sign_hash_eth27.o src/pk/ecc/ecc_sign_hash_internal.o \
src/pk/ecc/ecc_sign_hash_rfc5656.o src/pk/ecc/ecc_sign_hash_rfc7518.o src/pk/ecc/ecc_sizes.o \
src/pk/ecc/ecc_ssh_ecdsa_encode_name.o src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ecc_verify_hash_eth27.o \
src/pk/ecc/ecc_verify_hash_internal.o src/pk/ecc/ecc_verify_hash_rfc5656.o \
src/pk/ecc/ecc_verify_hash_rfc7518.o src/pk/ecc/ltc_ecc_export_point.o \
src/pk/ecc/ltc_ecc_import_point.o src/pk/ecc/ltc_ecc_is_point.o \
src/pk/ecc/ltc_ecc_is_point_at_infinity.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
Expand Down
8 changes: 6 additions & 2 deletions makefile_include.mk
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,12 @@ src/pk/ecc/ecc_get_size.o src/pk/ecc/ecc_import.o src/pk/ecc/ecc_import_openssl.
src/pk/ecc/ecc_import_pkcs8.o src/pk/ecc/ecc_import_x509.o src/pk/ecc/ecc_make_key.o \
src/pk/ecc/ecc_recover_key.o src/pk/ecc/ecc_set_curve.o src/pk/ecc/ecc_set_curve_internal.o \
src/pk/ecc/ecc_set_key.o src/pk/ecc/ecc_shared_secret.o src/pk/ecc/ecc_sign_hash.o \
src/pk/ecc/ecc_sizes.o src/pk/ecc/ecc_ssh_ecdsa_encode_name.o src/pk/ecc/ecc_verify_hash.o \
src/pk/ecc/ltc_ecc_export_point.o src/pk/ecc/ltc_ecc_import_point.o src/pk/ecc/ltc_ecc_is_point.o \
src/pk/ecc/ecc_sign_hash_eth27.o src/pk/ecc/ecc_sign_hash_internal.o \
src/pk/ecc/ecc_sign_hash_rfc5656.o src/pk/ecc/ecc_sign_hash_rfc7518.o src/pk/ecc/ecc_sizes.o \
src/pk/ecc/ecc_ssh_ecdsa_encode_name.o src/pk/ecc/ecc_verify_hash.o src/pk/ecc/ecc_verify_hash_eth27.o \
src/pk/ecc/ecc_verify_hash_internal.o src/pk/ecc/ecc_verify_hash_rfc5656.o \
src/pk/ecc/ecc_verify_hash_rfc7518.o src/pk/ecc/ltc_ecc_export_point.o \
src/pk/ecc/ltc_ecc_import_point.o src/pk/ecc/ltc_ecc_is_point.o \
src/pk/ecc/ltc_ecc_is_point_at_infinity.o src/pk/ecc/ltc_ecc_map.o src/pk/ecc/ltc_ecc_mul2add.o \
src/pk/ecc/ltc_ecc_mulmod.o src/pk/ecc/ltc_ecc_mulmod_timing.o src/pk/ecc/ltc_ecc_points.o \
src/pk/ecc/ltc_ecc_projective_add_point.o src/pk/ecc/ltc_ecc_projective_dbl_point.o \
Expand Down
8 changes: 8 additions & 0 deletions sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,17 @@ src/pk/ecc/ecc_set_curve_internal.c
src/pk/ecc/ecc_set_key.c
src/pk/ecc/ecc_shared_secret.c
src/pk/ecc/ecc_sign_hash.c
src/pk/ecc/ecc_sign_hash_eth27.c
src/pk/ecc/ecc_sign_hash_internal.c
src/pk/ecc/ecc_sign_hash_rfc5656.c
src/pk/ecc/ecc_sign_hash_rfc7518.c
src/pk/ecc/ecc_sizes.c
src/pk/ecc/ecc_ssh_ecdsa_encode_name.c
src/pk/ecc/ecc_verify_hash.c
src/pk/ecc/ecc_verify_hash_eth27.c
src/pk/ecc/ecc_verify_hash_internal.c
src/pk/ecc/ecc_verify_hash_rfc5656.c
src/pk/ecc/ecc_verify_hash_rfc7518.c
src/pk/ecc/ltc_ecc_export_point.c
src/pk/ecc/ltc_ecc_import_point.c
src/pk/ecc/ltc_ecc_is_point.c
Expand Down
6 changes: 4 additions & 2 deletions src/headers/tomcrypt_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,11 @@
#define LTC_PKCS_8
#endif

#ifdef LTC_PKCS_8
#if defined(LTC_PKCS_8) && defined(LTC_DER)
#define LTC_PADDING
#define LTC_PBES
#else
#undef LTC_PKCS_8
#endif

#if defined(LTC_CLEAN_STACK)
Expand Down Expand Up @@ -664,7 +666,7 @@
#error ASN.1 DER requires MPI functionality
#endif

#if (defined(LTC_MDSA) || defined(LTC_MRSA) || defined(LTC_MECC)) && !defined(LTC_DER)
#if (defined(LTC_MDSA) || defined(LTC_MRSA)) && !defined(LTC_DER)
#error PK requires ASN.1 DER functionality, make sure LTC_DER is enabled
#endif

Expand Down
58 changes: 43 additions & 15 deletions src/headers/tomcrypt_pk.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,22 +312,27 @@ int ecc_make_key(prng_state *prng, int wprng, int keysize, ecc_key *key);
int ecc_make_key_ex(prng_state *prng, int wprng, ecc_key *key, const ltc_ecc_curve *cu);
void ecc_free(ecc_key *key);

#if defined(LTC_DER)
int ecc_export(unsigned char *out, unsigned long *outlen, int type, const ecc_key *key);
int ecc_import(const unsigned char *in, unsigned long inlen, ecc_key *key);
int ecc_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, const ltc_ecc_curve *cu);
#endif

int ecc_ansi_x963_export(const ecc_key *key, unsigned char *out, unsigned long *outlen);
int ecc_ansi_x963_import(const unsigned char *in, unsigned long inlen, ecc_key *key);
int ecc_ansi_x963_import_ex(const unsigned char *in, unsigned long inlen, ecc_key *key, const ltc_ecc_curve *cu);

#if defined(LTC_DER)
int ecc_export_openssl(unsigned char *out, unsigned long *outlen, int type, const ecc_key *key);
int ecc_import_openssl(const unsigned char *in, unsigned long inlen, ecc_key *key);
int ecc_import_pkcs8(const unsigned char *in, unsigned long inlen, const password_ctx *pw_ctx, ecc_key *key);
int ecc_import_x509(const unsigned char *in, unsigned long inlen, ecc_key *key);
#endif

int ecc_shared_secret(const ecc_key *private_key, const ecc_key *public_key,
unsigned char *out, unsigned long *outlen);

#if defined(LTC_DER)
int ecc_encrypt_key(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
prng_state *prng, int wprng, int hash,
Expand All @@ -337,26 +342,49 @@ int ecc_decrypt_key(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
const ecc_key *key);

#define ecc_sign_hash_rfc7518(in_, inlen_, out_, outlen_, prng_, wprng_, key_) \
ecc_sign_hash_ex(in_, inlen_, out_, outlen_, prng_, wprng_, LTC_ECCSIG_RFC7518, NULL, key_)
int ecc_sign_hash(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
prng_state *prng, int wprng, const ecc_key *key);
#endif

#define ecc_sign_hash(in_, inlen_, out_, outlen_, prng_, wprng_, key_) \
ecc_sign_hash_ex(in_, inlen_, out_, outlen_, prng_, wprng_, LTC_ECCSIG_ANSIX962, NULL, key_)
int ecc_sign_hash_rfc7518(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
prng_state *prng, int wprng, const ecc_key *key);

#define ecc_verify_hash_rfc7518(sig_, siglen_, hash_, hashlen_, stat_, key_) \
ecc_verify_hash_ex(sig_, siglen_, hash_, hashlen_, LTC_ECCSIG_RFC7518, stat_, key_)
int ecc_sign_hash_rfc7518_ex(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
prng_state *prng, int wprng,
int *recid, const ecc_key *key);

#define ecc_verify_hash(sig_, siglen_, hash_, hashlen_, stat_, key_) \
ecc_verify_hash_ex(sig_, siglen_, hash_, hashlen_, LTC_ECCSIG_ANSIX962, stat_, key_)
#if defined(LTC_SSH)
int ecc_sign_hash_rfc5656(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
prng_state *prng, int wprng, const ecc_key *key);
#endif

int ecc_sign_hash_ex(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
prng_state *prng, int wprng, ecc_signature_type sigformat,
int *recid, const ecc_key *key);
int ecc_sign_hash_eth27(const unsigned char *in, unsigned long inlen,
unsigned char *out, unsigned long *outlen,
prng_state *prng, int wprng, const ecc_key *key);

#if defined(LTC_DER)
int ecc_verify_hash(const unsigned char *sig, unsigned long siglen,
const unsigned char *hash, unsigned long hashlen,
int *stat, const ecc_key *key);
#endif

int ecc_verify_hash_rfc7518(const unsigned char *sig, unsigned long siglen,
const unsigned char *hash, unsigned long hashlen,
int *stat, const ecc_key *key);

#if defined(LTC_SSH)
int ecc_verify_hash_rfc5656(const unsigned char *sig, unsigned long siglen,
const unsigned char *hash, unsigned long hashlen,
int *stat, const ecc_key *key);
#endif

int ecc_verify_hash_ex(const unsigned char *sig, unsigned long siglen,
const unsigned char *hash, unsigned long hashlen,
ecc_signature_type sigformat, int *stat, const ecc_key *key);
int ecc_verify_hash_eth27(const unsigned char *sig, unsigned long siglen,
const unsigned char *hash, unsigned long hashlen,
int *stat, const ecc_key *key);

int ecc_recover_key(const unsigned char *sig, unsigned long siglen,
const unsigned char *hash, unsigned long hashlen,
Expand Down
21 changes: 20 additions & 1 deletion src/headers/tomcrypt_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ typedef int (*fn_kdf_t)(const struct password *pwd,
int iteration_count, int hash_idx,
unsigned char *out, unsigned long *outlen);

#if defined(LTC_PBES)
typedef struct {
/* KDF */
fn_kdf_t kdf;
Expand All @@ -103,6 +104,7 @@ typedef struct
/* only used for RC2 */
unsigned long key_bits;
} pbes_arg;
#endif

/*
* Internal functions
Expand Down Expand Up @@ -356,11 +358,14 @@ struct get_char {
void copy_or_zeromem(const unsigned char* src, unsigned char* dest, unsigned long len, int coz);
void password_free(struct password *pw, const struct password_ctx *ctx);

#if defined(LTC_PBES)
int pbes_decrypt(const pbes_arg *arg, unsigned char *dec_data, unsigned long *dec_size);

int pbes1_extract(const ltc_asn1_list *s, pbes_arg *res);
int pbes2_extract(const ltc_asn1_list *s, pbes_arg *res);
#endif

#ifdef LTC_PEM
int pem_decrypt(unsigned char *data, unsigned long *datalen,
unsigned char *key, unsigned long keylen,
unsigned char *iv, unsigned long ivlen,
Expand All @@ -372,6 +377,7 @@ int pem_get_char_from_file(struct get_char *g);
#endif /* LTC_NO_FILE */
int pem_get_char_from_buf(struct get_char *g);
int pem_read(void *pem, unsigned long *w, struct pem_headers *hdr, struct get_char *g);
#endif

/* tomcrypt_pk.h */

Expand All @@ -381,10 +387,14 @@ int rand_bn_upto(void *N, void *limit, prng_state *prng, int wprng);
int pk_get_oid(enum ltc_oid_id id, const char **st);
int pk_get_pka_id(enum ltc_oid_id id, enum ltc_pka_id *pka);
int pk_get_oid_id(enum ltc_pka_id pka, enum ltc_oid_id *oid);
#ifdef LTC_DER
int pk_get_oid_from_asn1(const ltc_asn1_list *oid, enum ltc_oid_id *id);
#endif
int pk_oid_str_to_num(const char *OID, unsigned long *oid, unsigned long *oidlen);
int pk_oid_num_to_str(const unsigned long *oid, unsigned long oidlen, char *OID, unsigned long *outlen);

int pk_oid_cmp_with_ulong(const char *o1, const unsigned long *o2, unsigned long o2size);

/* ---- DH Routines ---- */
#ifdef LTC_MRSA
int rsa_init(rsa_key *key);
Expand All @@ -410,10 +420,20 @@ int ecc_set_curve_from_mpis(void *a, void *b, void *prime, void *order, void *gx
int ecc_copy_curve(const ecc_key *srckey, ecc_key *key);
int ecc_set_curve_by_size(int size, ecc_key *key);
int ecc_import_subject_public_key_info(const unsigned char *in, unsigned long inlen, ecc_key *key);
#ifdef LTC_DER
int ecc_import_pkcs8_asn1(ltc_asn1_list *alg_id, ltc_asn1_list *priv_key, ecc_key *key);
#endif
int ecc_import_with_curve(const unsigned char *in, unsigned long inlen, int type, ecc_key *key);
int ecc_import_with_oid(const unsigned char *in, unsigned long inlen, unsigned long *oid, unsigned long oid_len, int type, ecc_key *key);

int ecc_sign_hash_internal(const unsigned char *in, unsigned long inlen,
void *r, void *s, prng_state *prng, int wprng,
int *recid, const ecc_key *key);

int ecc_verify_hash_internal(void *r, void *s,
const unsigned char *hash, unsigned long hashlen,
int *stat, const ecc_key *key);

#ifdef LTC_SSH
int ecc_ssh_ecdsa_encode_name(char *buffer, unsigned long *buflen, const ecc_key *key);
#endif
Expand Down Expand Up @@ -598,7 +618,6 @@ int x509_decode_subject_public_key_info(const unsigned char *in, unsigned long i
enum ltc_oid_id algorithm, void *public_key, unsigned long *public_key_len,
ltc_asn1_type parameters_type, ltc_asn1_list* parameters, unsigned long *parameters_len);

int pk_oid_cmp_with_ulong(const char *o1, const unsigned long *o2, unsigned long o2size);
int pk_oid_cmp_with_asn1(const char *o1, const ltc_asn1_list *o2);

#endif /* LTC_DER */
Expand Down
4 changes: 2 additions & 2 deletions src/pk/asn1/oid/pk_oid_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/* SPDX-License-Identifier: Unlicense */
#include "tomcrypt_private.h"

#ifdef LTC_DER

/*
Compare an OID string to an array of `unsigned long`.
@return CRYPT_OK if equal
Expand All @@ -28,6 +26,8 @@ int pk_oid_cmp_with_ulong(const char *o1, const unsigned long *o2, unsigned long
return CRYPT_OK;
}

#ifdef LTC_DER

/*
Compare an OID string to an OID element decoded from ASN.1.
@return CRYPT_OK if equal
Expand Down
2 changes: 1 addition & 1 deletion src/pk/ecc/ecc_decrypt_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ECC Crypto, Tom St Denis
*/

#ifdef LTC_MECC
#if defined(LTC_MECC) && defined(LTC_DER)

/**
Decrypt an ECC encrypted key
Expand Down
2 changes: 1 addition & 1 deletion src/pk/ecc/ecc_encrypt_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ECC Crypto, Tom St Denis
*/

#ifdef LTC_MECC
#if defined(LTC_MECC) && defined(LTC_DER)

/**
Encrypt a symmetric key with ECC
Expand Down
2 changes: 1 addition & 1 deletion src/pk/ecc/ecc_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ECC Crypto, Tom St Denis
*/

#ifdef LTC_MECC
#if defined(LTC_MECC) && defined(LTC_DER)

/**
Export an ECC key as a binary packet
Expand Down
2 changes: 1 addition & 1 deletion src/pk/ecc/ecc_export_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "tomcrypt_private.h"

#ifdef LTC_MECC
#if defined(LTC_MECC) && defined(LTC_DER)

/**
Export an ECC key as a binary packet
Expand Down
2 changes: 1 addition & 1 deletion src/pk/ecc/ecc_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ECC Crypto, Tom St Denis
*/

#ifdef LTC_MECC
#if defined(LTC_MECC) && defined(LTC_DER)

/**
Import an ECC key from a binary packet
Expand Down
2 changes: 1 addition & 1 deletion src/pk/ecc/ecc_import_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "tomcrypt_private.h"

#ifdef LTC_MECC
#if defined(LTC_MECC) && defined(LTC_DER)

static int s_ecc_import_private_with_oid(const unsigned char *in, unsigned long inlen, ecc_key *key)
{
Expand Down
Loading