/* * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html *//* * ECDSA low level APIs are deprecated for public use, but still ok for * internal use. */#include"internal/deprecated.h"#include<string.h>#include"ec_local.h"#include<openssl/err.h>#include<openssl/asn1t.h>#include<openssl/objects.h>#include"internal/nelem.h"#include"crypto/asn1_dsa.h"#ifndef FIPS_MODULE/* some structures needed for the asn1 encoding */typedefstructx9_62_pentanomial_st{int32_tk1;int32_tk2;int32_tk3;}X9_62_PENTANOMIAL;typedefstructx9_62_characteristic_two_st{int32_tm;ASN1_OBJECT*type;union{char*ptr;/* NID_X9_62_onBasis */ASN1_NULL*onBasis;/* NID_X9_62_tpBasis */ASN1_INTEGER*tpBasis;/* NID_X9_62_ppBasis */X9_62_PENTANOMIAL*ppBasis;/* anything else */ASN1_TYPE*other;}p;}X9_62_CHARACTERISTIC_TWO;typedefstructx9_62_fieldid_st{ASN1_OBJECT*fieldType;union{char*ptr;/* NID_X9_62_prime_field */ASN1_INTEGER*prime;/* NID_X9_62_characteristic_two_field */X9_62_CHARACTERISTIC_TWO*char_two;/* anything else */ASN1_TYPE*other;}p;}X9_62_FIELDID;typedefstructx9_62_curve_st{ASN1_OCTET_STRING*a;ASN1_OCTET_STRING*b;ASN1_BIT_STRING*seed;}X9_62_CURVE;structec_parameters_st{int32_tversion;X9_62_FIELDID*fieldID;X9_62_CURVE*curve;ASN1_OCTET_STRING*base;ASN1_INTEGER*order;ASN1_INTEGER*cofactor;}/* ECPARAMETERS */;typedefenum{ECPKPARAMETERS_TYPE_NAMED=0,ECPKPARAMETERS_TYPE_EXPLICIT,ECPKPARAMETERS_TYPE_IMPLICIT}ecpk_parameters_type_t;structecpk_parameters_st{inttype;union{ASN1_OBJECT*