#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <gtest/gtest.h>
#include <openssl/bn.h>
#include <openssl/bytestring.h>
#include <openssl/crypto.h>
#include <openssl/ec_key.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include <openssl/nid.h>
#include <openssl/obj.h>
#include <openssl/span.h>
#include "../../ec_extra/internal.h"
#include "../../test/file_test.h"
#include "../../test/test_util.h"
#include "../bn/internal.h"
#include "internal.h"
static const uint8_t kECKeyWithoutPublic[] = …;
static const uint8_t kECKeySpecifiedCurve[] = …;
static const uint8_t kECKeyMissingZeros[] = …;
static const uint8_t kECKeyWithZeros[] = …;
static const uint8_t kECKeyWithZerosPublic[] = …;
static const uint8_t kECKeyWithZerosRawPrivate[] = …;
static bssl::UniquePtr<EC_KEY> DecodeECPrivateKey(const uint8_t *in,
size_t in_len) { … }
static bool EncodeECPrivateKey(std::vector<uint8_t> *out, const EC_KEY *key) { … }
static bool EncodeECPoint(std::vector<uint8_t> *out, const EC_GROUP *group,
const EC_POINT *p, point_conversion_form_t form) { … }
TEST(ECTest, Encoding) { … }
TEST(ECTest, ZeroPadding) { … }
TEST(ECTest, SpecifiedCurve) { … }
TEST(ECTest, ArbitraryCurve) { … }
TEST(ECTest, SetKeyWithoutGroup) { … }
TEST(ECTest, SetNULLKey) { … }
TEST(ECTest, GroupMismatch) { … }
TEST(ECTest, EmptyKey) { … }
static bssl::UniquePtr<BIGNUM> HexToBIGNUM(const char *hex) { … }
TEST(ECTest, BrainpoolP256r1) { … }
class ECCurveTest : public testing::TestWithParam<int> { … };
TEST_P(ECCurveTest, SetAffine) { … }
TEST_P(ECCurveTest, IsOnCurve) { … }
TEST_P(ECCurveTest, Compare) { … }
TEST_P(ECCurveTest, GenerateFIPS) { … }
TEST_P(ECCurveTest, AddingEqualPoints) { … }
TEST_P(ECCurveTest, MulZero) { … }
TEST_P(ECCurveTest, MulOrder) { … }
TEST_P(ECCurveTest, MulOutOfRange) { … }
TEST_P(ECCurveTest, Mul) { … }
TEST_P(ECCurveTest, MulNonMinimal) { … }
TEST_P(ECCurveTest, SetInvalidPrivateKey) { … }
TEST_P(ECCurveTest, IgnoreOct2PointReturnValue) { … }
TEST_P(ECCurveTest, DoubleSpecialCase) { … }
TEST_P(ECCurveTest, P224Bug) { … }
TEST_P(ECCurveTest, GPlusMinusG) { … }
TEST_P(ECCurveTest, EncodeInfinity) { … }
static std::vector<int> AllCurves() { … }
static std::string CurveToString(const testing::TestParamInfo<int> ¶ms) { … }
INSTANTIATE_TEST_SUITE_P(…);
static const EC_GROUP *GetCurve(FileTest *t, const char *key) { … }
static bssl::UniquePtr<BIGNUM> GetBIGNUM(FileTest *t, const char *key) { … }
TEST(ECTest, ScalarBaseMultVectors) { … }
TEST(ECTest, DISABLED_ScalarBaseMultVectorsTwoPoint) { … }
static std::vector<uint8_t> HexToBytes(const char *str) { … }
TEST(ECTest, DeriveFromSecret) { … }
TEST(ECTest, HashToCurve) { … }
TEST(ECTest, HashToScalar) { … }