chromium/third_party/boringssl/src/crypto/trust_token/trust_token_test.cc

/* Copyright (c) 2020, Google Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <time.h>

#include <algorithm>
#include <limits>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#include <gtest/gtest.h>

#include <openssl/bytestring.h>
#include <openssl/curve25519.h>
#include <openssl/evp.h>
#include <openssl/mem.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include <openssl/trust_token.h>

#include "../ec_extra/internal.h"
#include "../fipsmodule/ec/internal.h"
#include "../internal.h"
#include "../test/test_util.h"
#include "internal.h"


BSSL_NAMESPACE_BEGIN

namespace {

const uint8_t kMessage[] =;

TEST(TrustTokenTest, KeyGenExp1) {}

TEST(TrustTokenTest, KeyGenExp2VOPRF) {}

TEST(TrustTokenTest, KeyGenExp2PMB) {}

// Test that H in |TRUST_TOKEN_experiment_v1| was computed correctly.
TEST(TrustTokenTest, HExp1) {}

// Test that H in |TRUST_TOKEN_experiment_v2_pmb| was computed correctly.
TEST(TrustTokenTest, HExp2) {}

// Test that H in |TRUST_TOKEN_pst_v1_pmb| was computed correctly.
TEST(TrustTokenTest, HPST1) {}

static int ec_point_uncompressed_from_compressed(
    const EC_GROUP *group, uint8_t out[EC_MAX_UNCOMPRESSED], size_t *out_len,
    const uint8_t *in, size_t len) {}

static bool setup_voprf_test_key(const EC_GROUP *group,
                                 TRUST_TOKEN_ISSUER_KEY *out) {}

TEST(TrustTokenTest, PSTV1VOPRFTestVector1) {}

TEST(TrustTokenTest, PSTV1VOPRFTestVector2) {}

TEST(TrustTokenTest, PSTV1VOPRFTestVector3) {}

static std::vector<const TRUST_TOKEN_METHOD *> AllMethods() {}

class TrustTokenProtocolTestBase : public ::testing::Test {};

class TrustTokenProtocolTest
    : public TrustTokenProtocolTestBase,
      public testing::WithParamInterface<
          std::tuple<const TRUST_TOKEN_METHOD *, bool>> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(TrustTokenProtocolTest, InvalidToken) {}

TEST_P(TrustTokenProtocolTest, TruncatedIssuanceRequest) {}

TEST_P(TrustTokenProtocolTest, TruncatedIssuanceResponse) {}

TEST_P(TrustTokenProtocolTest, ExtraDataIssuanceResponse) {}

TEST_P(TrustTokenProtocolTest, TruncatedRedemptionRequest) {}

TEST_P(TrustTokenProtocolTest, IssuedWithBadKeyID) {}

class TrustTokenMetadataTest
    : public TrustTokenProtocolTestBase,
      public testing::WithParamInterface<
    std::tuple<const TRUST_TOKEN_METHOD *, bool, int, bool>> {};

TEST_P(TrustTokenMetadataTest, SetAndGetMetadata) {}

TEST_P(TrustTokenMetadataTest, TooManyRequests) {}


TEST_P(TrustTokenMetadataTest, TruncatedProof) {}

TEST_P(TrustTokenMetadataTest, ExcessDataProof) {}

INSTANTIATE_TEST_SUITE_P();

class TrustTokenBadKeyTest
    : public TrustTokenProtocolTestBase,
      public testing::WithParamInterface<
          std::tuple<const TRUST_TOKEN_METHOD *, bool, bool, int>> {};

TEST_P(TrustTokenBadKeyTest, BadKey) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace
BSSL_NAMESPACE_END