chromium/third_party/anonymous_tokens/src/anonymous_tokens/cpp/crypto/crypto_utils_test.cc

// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "anonymous_tokens/cpp/crypto/crypto_utils.h"

#include <memory>
#include <string>
#include <utility>
#include <vector>

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/strings/escaping.h"
#include "anonymous_tokens/cpp/testing/utils.h"
#include <openssl/base.h>
#include <openssl/rsa.h>

namespace anonymous_tokens {
namespace {

struct IetfNewPublicExponentWithPublicMetadataTestVector {};

TEST(AnonymousTokensCryptoUtilsTest, BignumToStringAndBack) {}

TEST(AnonymousTokensCryptoUtilsTest, PowerOfTwoAndRsaSqrtTwo) {}

TEST(AnonymousTokensCryptoUtilsTest, ComputeHashAcceptsNullStringView) {}

TEST(AnonymousTokensCryptoUtilsTest, ComputeCarmichaelLcm) {}

struct ComputeHashTestParam {};

ComputeHashTest;

// Returns the test parameters for ComputeHashTestParam from NIST's
// samples.
std::vector<ComputeHashTestParam> GetComputeHashTestParams() {}

TEST_P(ComputeHashTest, ComputesHash) {}

INSTANTIATE_TEST_SUITE_P();

TEST(PublicMetadataCryptoUtilsInternalTest, PublicMetadataHashWithHKDF) {}

TEST(PublicMetadataCryptoUtilsTest, PublicExponentHashDifferentModulus) {}

std::vector<IetfNewPublicExponentWithPublicMetadataTestVector>
GetIetfNewPublicExponentWithPublicMetadataTestVectors(
    bool use_rsa_public_exponent) {}

TEST(PublicMetadataCryptoUtilsTest,
     IetfNewPublicExponentWithPublicMetadataTests) {}

TEST(PublicMetadataCryptoUtilsTest,
     IetfNewPublicExponentWithPublicMetadataNoPublicExponentTests) {}

TEST(AnonymousTokensCryptoUtilsTest, RsaPssDerEncoding) {}

// The public key used in this test is taken from the test vectors found here:
// https://www.ietf.org/archive/id/draft-ietf-privacypass-protocol-10.html#name-issuance-protocol-2-blind-rs
TEST(AnonymousTokensCryptoUtilsTest, IetfPrivacyPassBlindRsaPublicKeyToDer) {}

TEST(AnonymousTokensCryptoUtilsTest,
     PrivacyPassTruncatedTokenKeyIdCollisionSelf) {}

TEST(AnonymousTokensCryptoUtilsTest,
     PrivacyPassTruncatedTokenKeyIdCollisionFalse) {}

TEST(AnonymousTokensCryptoUtilsTest,
     PrivacyPassTruncatedTokenKeyIdCollisionTrue) {}

CreateTestKeyPairFunction;

class CryptoUtilsTest
    : public testing::TestWithParam<CreateTestKeyPairFunction*> {};

TEST_P(CryptoUtilsTest, PublicExponentCoprime) {}

TEST_P(CryptoUtilsTest, PublicExponentHash) {}

TEST_P(CryptoUtilsTest, FinalExponentCoprime) {}

TEST_P(CryptoUtilsTest, DeterministicModificationOfPublicExponentWithMetadata) {}

TEST_P(CryptoUtilsTest, DifferentPublicExponentWithDifferentPublicMetadata) {}

TEST_P(CryptoUtilsTest, ModifiedPublicExponentWithEmptyPublicMetadata) {}

TEST_P(CryptoUtilsTest, CreateRsaPublicKeyWithPublicMetadataSuccessfully) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace
}  // namespace anonymous_tokens