#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;
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) { … }
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(…);
}
}