Deleted Added
full compact
ec_lcl.h (302408) ec_lcl.h (340704)
1/* crypto/ec/ec_lcl.h */
2/*
3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */
5/* ====================================================================
1/* crypto/ec/ec_lcl.h */
2/*
3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */
5/* ====================================================================
6 * Copyright (c) 1998-2010 The OpenSSL Project. All rights reserved.
6 * Copyright (c) 1998-2018 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *

--- 194 unchanged lines hidden (view full) ---

209struct ec_group_st {
210 const EC_METHOD *meth;
211 EC_POINT *generator; /* optional */
212 BIGNUM order, cofactor;
213 int curve_name; /* optional NID for named curve */
214 int asn1_flag; /* flag to control the asn1 encoding */
215 /*
216 * Kludge: upper bit of ans1_flag is used to denote structure
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *

--- 194 unchanged lines hidden (view full) ---

209struct ec_group_st {
210 const EC_METHOD *meth;
211 EC_POINT *generator; /* optional */
212 BIGNUM order, cofactor;
213 int curve_name; /* optional NID for named curve */
214 int asn1_flag; /* flag to control the asn1 encoding */
215 /*
216 * Kludge: upper bit of ans1_flag is used to denote structure
217 * version. Is set, then last field is present. This is done
217 * version. If set, then last field is present. This is done
218 * for interoperation with FIPS code.
219 */
220#define EC_GROUP_ASN1_FLAG_MASK 0x7fffffff
221#define EC_GROUP_VERSION(p) (p->asn1_flag&~EC_GROUP_ASN1_FLAG_MASK)
222 point_conversion_form_t asn1_form;
223 unsigned char *seed; /* optional seed for parameters (appears in
224 * ASN1) */
225 size_t seed_len;

--- 318 unchanged lines hidden (view full) ---

544 void (*felem_contract) (void
545 *out,
546 const
547 void
548 *in));
549void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign,
550 unsigned char *digit, unsigned char in);
551#endif
218 * for interoperation with FIPS code.
219 */
220#define EC_GROUP_ASN1_FLAG_MASK 0x7fffffff
221#define EC_GROUP_VERSION(p) (p->asn1_flag&~EC_GROUP_ASN1_FLAG_MASK)
222 point_conversion_form_t asn1_form;
223 unsigned char *seed; /* optional seed for parameters (appears in
224 * ASN1) */
225 size_t seed_len;

--- 318 unchanged lines hidden (view full) ---

544 void (*felem_contract) (void
545 *out,
546 const
547 void
548 *in));
549void ec_GFp_nistp_recode_scalar_bits(unsigned char *sign,
550 unsigned char *digit, unsigned char in);
551#endif
552int ec_precompute_mont_data(EC_GROUP *);
553
554#ifdef ECP_NISTZ256_ASM
555/** Returns GFp methods using montgomery multiplication, with x86-64 optimized
556 * P256. See http://eprint.iacr.org/2013/816.
557 * \return EC_METHOD object
558 */
559const EC_METHOD *EC_GFp_nistz256_method(void);
560#endif
561
562#ifdef OPENSSL_FIPS
563EC_GROUP *FIPS_ec_group_new_curve_gfp(const BIGNUM *p, const BIGNUM *a,
564 const BIGNUM *b, BN_CTX *ctx);
565EC_GROUP *FIPS_ec_group_new_curve_gf2m(const BIGNUM *p, const BIGNUM *a,
566 const BIGNUM *b, BN_CTX *ctx);
567EC_GROUP *FIPS_ec_group_new_by_curve_name(int nid);
568#endif
552
553#ifdef ECP_NISTZ256_ASM
554/** Returns GFp methods using montgomery multiplication, with x86-64 optimized
555 * P256. See http://eprint.iacr.org/2013/816.
556 * \return EC_METHOD object
557 */
558const EC_METHOD *EC_GFp_nistz256_method(void);
559#endif
560
561#ifdef OPENSSL_FIPS
562EC_GROUP *FIPS_ec_group_new_curve_gfp(const BIGNUM *p, const BIGNUM *a,
563 const BIGNUM *b, BN_CTX *ctx);
564EC_GROUP *FIPS_ec_group_new_curve_gf2m(const BIGNUM *p, const BIGNUM *a,
565 const BIGNUM *b, BN_CTX *ctx);
566EC_GROUP *FIPS_ec_group_new_by_curve_name(int nid);
567#endif