/* * Copyright 2002-2018 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_MODEintEC_GROUP_get_basis_type(constEC_GROUP*group){inti;if(EC_METHOD_get_field_type(EC_GROUP_method_of(group))!=NID_X9_62_characteristic_two_field)/* everything else is currently not supported */return0;/* Find the last non-zero element of group->poly[] */for(i=0;i<(int)OSSL_NELEM(group->poly)&&group->poly[i]!=0;i++)continue;if(i==4)returnNID_X9_62_ppBasis;elseif(i==2)returnNID_X9_62_tpBasis;else/* everything else is currently not supported */return0;}#ifndef OPENSSL_NO_EC2MintEC_GROUP_get_trinomial_basis(constEC_GROUP*group,unsignedint*k){if(group==NULL)return0;if(EC_METHOD_get_field_type(EC_GROUP_method_of(group))!=NID_X9_62_characteristic_two_field||!((group->poly[0]!=