• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2023 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "quiche/blind_sign_auth/anonymous_tokens/cpp/crypto/crypto_utils.h"
16 
17 #include <memory>
18 #include <string>
19 #include <utility>
20 #include <vector>
21 
22 #include "quiche/common/platform/api/quiche_test.h"
23 #include "quiche/common/test_tools/quiche_test_utils.h"
24 #include "absl/strings/escaping.h"
25 #include "quiche/blind_sign_auth/anonymous_tokens/cpp/testing/utils.h"
26 #include "quiche/blind_sign_auth/anonymous_tokens/proto/anonymous_tokens.pb.h"
27 #include "openssl/base.h"
28 #include "openssl/rsa.h"
29 
30 namespace private_membership {
31 namespace anonymous_tokens {
32 namespace {
33 
34 struct IetfNewPublicExponentWithPublicMetadataTestVector {
35   RSAPublicKey public_key;
36   std::string public_metadata;
37   std::string new_e;
38 };
39 
TEST(AnonymousTokensCryptoUtilsTest,BignumToStringAndBack)40 TEST(AnonymousTokensCryptoUtilsTest, BignumToStringAndBack) {
41   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(BnCtxPtr ctx, GetAndStartBigNumCtx());
42 
43   // Create a new BIGNUM using the context and set it
44   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> bn_1, NewBigNum());
45   ASSERT_EQ(BN_set_u64(bn_1.get(), 0x124435435), 1);
46   EXPECT_NE(bn_1, nullptr);
47   EXPECT_EQ(BN_is_zero(bn_1.get()), 0);
48   EXPECT_EQ(BN_is_one(bn_1.get()), 0);
49 
50   // Convert bn_1 to string from BIGNUM
51   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
52       const std::string converted_str,
53       BignumToString(*bn_1, BN_num_bytes(bn_1.get())));
54   // Convert the string version of bn_1 back to BIGNUM
55   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> bn_2,
56                                    StringToBignum(converted_str));
57   // Check whether the conversion back worked
58   EXPECT_EQ(BN_cmp(bn_1.get(), bn_2.get()), 0);
59 }
60 
TEST(AnonymousTokensCryptoUtilsTest,PowerOfTwoAndRsaSqrtTwo)61 TEST(AnonymousTokensCryptoUtilsTest, PowerOfTwoAndRsaSqrtTwo) {
62   // Compute 2^(10-1/2).
63   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> sqrt2,
64                                    GetRsaSqrtTwo(10));
65   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> small_pow2,
66                                    ComputePowerOfTwo(9));
67   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> large_pow2,
68                                    ComputePowerOfTwo(10));
69   EXPECT_GT(BN_cmp(sqrt2.get(), small_pow2.get()), 0);
70   EXPECT_LT(BN_cmp(sqrt2.get(), large_pow2.get()), 0);
71 }
72 
TEST(AnonymousTokensCryptoUtilsTest,ComputeHashAcceptsNullStringView)73 TEST(AnonymousTokensCryptoUtilsTest, ComputeHashAcceptsNullStringView) {
74   absl::StatusOr<std::string> null_hash =
75       ComputeHash(absl::string_view(nullptr, 0), *EVP_sha512());
76   absl::StatusOr<std::string> empty_hash = ComputeHash("", *EVP_sha512());
77   std::string str;
78   absl::StatusOr<std::string> empty_str_hash = ComputeHash(str, *EVP_sha512());
79 
80   QUICHE_EXPECT_OK(null_hash);
81   QUICHE_EXPECT_OK(empty_hash);
82   QUICHE_EXPECT_OK(empty_str_hash);
83 
84   EXPECT_EQ(*null_hash, *empty_hash);
85   EXPECT_EQ(*null_hash, *empty_str_hash);
86 }
87 
TEST(AnonymousTokensCryptoUtilsTest,ComputeCarmichaelLcm)88 TEST(AnonymousTokensCryptoUtilsTest, ComputeCarmichaelLcm) {
89   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(BnCtxPtr ctx, GetAndStartBigNumCtx());
90 
91   // Suppose that N = 1019 * 1187.
92   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> phi_p, NewBigNum());
93   ASSERT_TRUE(BN_set_word(phi_p.get(), 1019 - 1));
94   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> phi_q, NewBigNum());
95   ASSERT_TRUE(BN_set_word(phi_q.get(), 1187 - 1));
96   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> expected_lcm,
97                                    NewBigNum());
98   ASSERT_TRUE(BN_set_word(expected_lcm.get(), (1019 - 1) * (1187 - 1) / 2));
99 
100   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> lcm,
101                                    ComputeCarmichaelLcm(*phi_p, *phi_q, *ctx));
102   EXPECT_EQ(BN_cmp(lcm.get(), expected_lcm.get()), 0);
103 }
104 
105 struct ComputeHashTestParam {
106   const EVP_MD* hasher;
107   absl::string_view input_hex;
108   absl::string_view expected_digest_hex;
109 };
110 
111 using ComputeHashTest = testing::TestWithParam<ComputeHashTestParam>;
112 
113 // Returns the test parameters for ComputeHashTestParam from NIST's
114 // samples.
GetComputeHashTestParams()115 std::vector<ComputeHashTestParam> GetComputeHashTestParams() {
116   std::vector<ComputeHashTestParam> params;
117   params.push_back({
118       EVP_sha256(),
119       "af397a8b8dd73ab702ce8e53aa9f",
120       "d189498a3463b18e846b8ab1b41583b0b7efc789dad8a7fb885bbf8fb5b45c5c",
121   });
122   params.push_back({
123       EVP_sha256(),
124       "59eb45bbbeb054b0b97334d53580ce03f699",
125       "32c38c54189f2357e96bd77eb00c2b9c341ebebacc2945f97804f59a93238288",
126   });
127   params.push_back({
128       EVP_sha512(),
129       "16b17074d3e3d97557f9ed77d920b4b1bff4e845b345a922",
130       "6884134582a760046433abcbd53db8ff1a89995862f305b887020f6da6c7b903a314721e"
131       "972bf438483f452a8b09596298a576c903c91df4a414c7bd20fd1d07",
132   });
133   params.push_back({
134       EVP_sha512(),
135       "7651ab491b8fa86f969d42977d09df5f8bee3e5899180b52c968b0db057a6f02a886ad61"
136       "7a84915a",
137       "f35e50e2e02b8781345f8ceb2198f068ba103476f715cfb487a452882c9f0de0c720b2a0"
138       "88a39d06a8a6b64ce4d6470dfeadc4f65ae06672c057e29f14c4daf9",
139   });
140   return params;
141 }
142 
TEST_P(ComputeHashTest,ComputesHash)143 TEST_P(ComputeHashTest, ComputesHash) {
144   const ComputeHashTestParam& params = GetParam();
145   ASSERT_NE(params.hasher, nullptr);
146   std::string data = absl::HexStringToBytes(params.input_hex);
147   std::string expected_digest =
148       absl::HexStringToBytes(params.expected_digest_hex);
149   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(auto computed_hash,
150                                    ComputeHash(data, *params.hasher));
151   EXPECT_EQ(computed_hash, expected_digest);
152 }
153 
154 INSTANTIATE_TEST_SUITE_P(ComputeHashTests, ComputeHashTest,
155                          testing::ValuesIn(GetComputeHashTestParams()));
156 
TEST(PublicMetadataCryptoUtilsInternalTest,PublicMetadataHashWithHKDF)157 TEST(PublicMetadataCryptoUtilsInternalTest, PublicMetadataHashWithHKDF) {
158   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(BnCtxPtr ctx, GetAndStartBigNumCtx());
159   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> max_value,
160                                    NewBigNum());
161   ASSERT_TRUE(BN_set_word(max_value.get(), 4294967295));
162   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(auto key_pair, GetStrongRsaKeys2048());
163   std::string input1 = "ro1";
164   std::string input2 = "ro2";
165   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
166       bssl::UniquePtr<BIGNUM> output1,
167       internal::PublicMetadataHashWithHKDF(input1, key_pair.first.n(),
168                                            1 + input1.size()));
169   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
170       bssl::UniquePtr<BIGNUM> another_output1,
171       internal::PublicMetadataHashWithHKDF(input1, key_pair.first.n(),
172                                            1 + input1.size()));
173   EXPECT_EQ(BN_cmp(output1.get(), another_output1.get()), 0);
174 
175   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
176       bssl::UniquePtr<BIGNUM> output2,
177       internal::PublicMetadataHashWithHKDF(input2, key_pair.first.n(),
178                                            1 + input2.size()));
179   EXPECT_NE(BN_cmp(output1.get(), output2.get()), 0);
180 
181   EXPECT_LE(BN_cmp(output1.get(), max_value.get()), 0);
182   EXPECT_LE(BN_cmp(output2.get(), max_value.get()), 0);
183 }
184 
TEST(PublicMetadataCryptoUtilsTest,PublicExponentHashDifferentModulus)185 TEST(PublicMetadataCryptoUtilsTest, PublicExponentHashDifferentModulus) {
186   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(auto key_pair_1, GetStrongRsaKeys2048());
187   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(auto key_pair_2,
188                                    GetAnotherStrongRsaKeys2048());
189   std::string metadata = "md";
190   // Check that same metadata and different modulus result in different
191   // hashes.
192   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> rsa_modulus_1,
193                                    StringToBignum(key_pair_1.first.n()));
194   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
195       bssl::UniquePtr<BIGNUM> exp1,
196       PublicMetadataExponent(*rsa_modulus_1.get(), metadata));
197   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(auto rsa_modulus_2,
198                                    StringToBignum(key_pair_2.first.n()));
199   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
200       bssl::UniquePtr<BIGNUM> exp2,
201       PublicMetadataExponent(*rsa_modulus_2.get(), metadata));
202   EXPECT_NE(BN_cmp(exp1.get(), exp2.get()), 0);
203 }
204 
205 std::vector<IetfNewPublicExponentWithPublicMetadataTestVector>
GetIetfNewPublicExponentWithPublicMetadataTestVectors()206 GetIetfNewPublicExponentWithPublicMetadataTestVectors() {
207   std::vector<IetfNewPublicExponentWithPublicMetadataTestVector> test_vectors;
208 
209   RSAPublicKey public_key;
210   public_key.set_n(absl::HexStringToBytes(
211       "d6930820f71fe517bf3259d14d40209b02a5c0d3d61991c731dd7da39f8d69821552e231"
212       "8d6c9ad897e603887a476ea3162c1205da9ac96f02edf31df049bd55f142134c17d4382a"
213       "0e78e275345f165fbe8e49cdca6cf5c726c599dd39e09e75e0f330a33121e73976e4facb"
214       "a9cfa001c28b7c96f8134f9981db6750b43a41710f51da4240fe03106c12acb1e7bb53d7"
215       "5ec7256da3fddd0718b89c365410fce61bc7c99b115fb4c3c318081fa7e1b65a37774e8e"
216       "50c96e8ce2b2cc6b3b367982366a2bf9924c4bafdb3ff5e722258ab705c76d43e5f1f121"
217       "b984814e98ea2b2b8725cd9bc905c0bc3d75c2a8db70a7153213c39ae371b2b5dc1dafcb"
218       "19d6fae9"));
219   public_key.set_e(absl::HexStringToBytes("010001"));
220 
221   // Test vector 1
222   test_vectors.push_back(
223       {.public_key = public_key,
224        .public_metadata = absl::HexStringToBytes("6d65746164617461"),
225        .new_e = absl::HexStringToBytes(
226            "30584b72f5cb557085106232f051d039e23358feee9204cf30ea567620e90d79e4a"
227            "7a81388b1f390e18ea5240a1d8cc296ce1325128b445c48aa5a3b34fa07c324bf17"
228            "bc7f1b3efebaff81d7e032948f1477493bc183d2f8d94c947c984c6f0757527615b"
229            "f2a2f0ef0db5ad80ce99905beed0440b47fa5cb9a2334fea40ad88e6ef1")});
230 
231   // Test vector 2
232   test_vectors.push_back(
233       {.public_key = public_key,
234        .public_metadata = "",
235        .new_e = absl::HexStringToBytes(
236            "2ed5a8d2592a11bbeef728bb39018ef5c3cf343507dd77dd156d5eec7f06f04732e"
237            "4be944c5d2443d244c59e52c9fa5e8de40f55ffd0e70fbe9093d3f7be2aafd77c14"
238            "b263b71c1c6b3ca2b9629842a902128fee4878392a950906fae35d6194e0d2548e5"
239            "8bbc20f841188ca2fceb20b2b1b45448da5c7d1c73fb6e83fa58867397b")});
240 
241   return test_vectors;
242 }
243 
TEST(PublicMetadataCryptoUtilsTest,IetfNewPublicExponentWithPublicMetadataTests)244 TEST(PublicMetadataCryptoUtilsTest,
245      IetfNewPublicExponentWithPublicMetadataTests) {
246   const auto test_vectors =
247       GetIetfNewPublicExponentWithPublicMetadataTestVectors();
248   for (const IetfNewPublicExponentWithPublicMetadataTestVector& test_vector :
249        test_vectors) {
250     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
251         bssl::UniquePtr<BIGNUM> rsa_modulus,
252         StringToBignum(test_vector.public_key.n()));
253     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
254         bssl::UniquePtr<BIGNUM> rsa_e,
255         StringToBignum(test_vector.public_key.e()));
256     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> expected_new_e,
257                                      StringToBignum(test_vector.new_e));
258     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
259         bssl::UniquePtr<BIGNUM> modified_e,
260         ComputeFinalExponentUnderPublicMetadata(
261             *rsa_modulus.get(), *rsa_e.get(), test_vector.public_metadata));
262 
263     EXPECT_EQ(BN_cmp(modified_e.get(), expected_new_e.get()), 0);
264   }
265 }
266 
267 using CreateTestKeyPairFunction =
268     absl::StatusOr<std::pair<RSAPublicKey, RSAPrivateKey>>();
269 
270 class CryptoUtilsTest
271     : public testing::TestWithParam<CreateTestKeyPairFunction*> {
272  protected:
SetUp()273   void SetUp() override {
274     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(auto keys_pair, (*GetParam())());
275     public_key_ = std::move(keys_pair.first);
276     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(rsa_modulus_,
277                                      StringToBignum(keys_pair.second.n()));
278     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(rsa_e_,
279                                      StringToBignum(keys_pair.second.e()));
280     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(rsa_p_,
281                                      StringToBignum(keys_pair.second.p()));
282     ANON_TOKENS_ASSERT_OK_AND_ASSIGN(rsa_q_,
283                                      StringToBignum(keys_pair.second.q()));
284   }
285 
286   bssl::UniquePtr<BIGNUM> rsa_modulus_;
287   bssl::UniquePtr<BIGNUM> rsa_e_;
288   bssl::UniquePtr<BIGNUM> rsa_p_;
289   bssl::UniquePtr<BIGNUM> rsa_q_;
290   RSAPublicKey public_key_;
291 };
292 
TEST_P(CryptoUtilsTest,PublicExponentCoprime)293 TEST_P(CryptoUtilsTest, PublicExponentCoprime) {
294   std::string metadata = "md";
295   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
296       bssl::UniquePtr<BIGNUM> exp,
297       PublicMetadataExponent(*rsa_modulus_.get(), metadata));
298   int rsa_mod_size_bits = BN_num_bits(rsa_modulus_.get());
299   // Check that exponent is odd.
300   EXPECT_EQ(BN_is_odd(exp.get()), 1);
301   // Check that exponent is small enough.
302   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> sqrt2,
303                                    GetRsaSqrtTwo(rsa_mod_size_bits / 2));
304   EXPECT_LT(BN_cmp(exp.get(), sqrt2.get()), 0);
305   EXPECT_LT(BN_cmp(exp.get(), rsa_p_.get()), 0);
306   EXPECT_LT(BN_cmp(exp.get(), rsa_q_.get()), 0);
307 }
308 
TEST_P(CryptoUtilsTest,PublicExponentHash)309 TEST_P(CryptoUtilsTest, PublicExponentHash) {
310   std::string metadata1 = "md1";
311   std::string metadata2 = "md2";
312   // Check that hash is deterministic.
313   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
314       bssl::UniquePtr<BIGNUM> exp1,
315       PublicMetadataExponent(*rsa_modulus_.get(), metadata1));
316   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
317       bssl::UniquePtr<BIGNUM> another_exp1,
318       PublicMetadataExponent(*rsa_modulus_.get(), metadata1));
319   EXPECT_EQ(BN_cmp(exp1.get(), another_exp1.get()), 0);
320   // Check that hashes are distinct for different metadata.
321   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
322       bssl::UniquePtr<BIGNUM> exp2,
323       PublicMetadataExponent(*rsa_modulus_.get(), metadata2));
324   EXPECT_NE(BN_cmp(exp1.get(), exp2.get()), 0);
325 }
326 
TEST_P(CryptoUtilsTest,FinalExponentCoprime)327 TEST_P(CryptoUtilsTest, FinalExponentCoprime) {
328   std::string metadata = "md";
329   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
330       bssl::UniquePtr<BIGNUM> final_exponent,
331       ComputeFinalExponentUnderPublicMetadata(*rsa_modulus_.get(),
332                                               *rsa_e_.get(), metadata));
333   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(BnCtxPtr ctx, GetAndStartBigNumCtx());
334 
335   // Check that exponent is odd.
336   EXPECT_EQ(BN_is_odd(final_exponent.get()), 1);
337   // Check that exponent is co-prime to factors of the rsa modulus.
338   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> gcd_p_fe,
339                                    NewBigNum());
340   ASSERT_EQ(
341       BN_gcd(gcd_p_fe.get(), rsa_p_.get(), final_exponent.get(), ctx.get()), 1);
342   EXPECT_EQ(BN_cmp(gcd_p_fe.get(), BN_value_one()), 0);
343   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> gcd_q_fe,
344                                    NewBigNum());
345   ASSERT_EQ(
346       BN_gcd(gcd_q_fe.get(), rsa_q_.get(), final_exponent.get(), ctx.get()), 1);
347   EXPECT_EQ(BN_cmp(gcd_q_fe.get(), BN_value_one()), 0);
348 }
349 
TEST_P(CryptoUtilsTest,DeterministicModificationOfPublicExponentWithMetadata)350 TEST_P(CryptoUtilsTest, DeterministicModificationOfPublicExponentWithMetadata) {
351   std::string metadata = "md";
352   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
353       bssl::UniquePtr<BIGNUM> public_exp_1,
354       ComputeFinalExponentUnderPublicMetadata(*rsa_modulus_.get(),
355                                               *rsa_e_.get(), metadata));
356   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
357       bssl::UniquePtr<BIGNUM> public_exp_2,
358       ComputeFinalExponentUnderPublicMetadata(*rsa_modulus_.get(),
359                                               *rsa_e_.get(), metadata));
360 
361   EXPECT_EQ(BN_cmp(public_exp_1.get(), public_exp_2.get()), 0);
362 }
363 
TEST_P(CryptoUtilsTest,DifferentPublicExponentWithDifferentPublicMetadata)364 TEST_P(CryptoUtilsTest, DifferentPublicExponentWithDifferentPublicMetadata) {
365   std::string metadata_1 = "md1";
366   std::string metadata_2 = "md2";
367   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
368       bssl::UniquePtr<BIGNUM> public_exp_1,
369       ComputeFinalExponentUnderPublicMetadata(*rsa_modulus_.get(),
370                                               *rsa_e_.get(), metadata_1));
371   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(
372       bssl::UniquePtr<BIGNUM> public_exp_2,
373       ComputeFinalExponentUnderPublicMetadata(*rsa_modulus_.get(),
374                                               *rsa_e_.get(), metadata_2));
375   // Check that exponent is different in all keys
376   EXPECT_NE(BN_cmp(public_exp_1.get(), public_exp_2.get()), 0);
377   EXPECT_NE(BN_cmp(public_exp_1.get(), rsa_e_.get()), 0);
378   EXPECT_NE(BN_cmp(public_exp_2.get(), rsa_e_.get()), 0);
379 }
380 
TEST_P(CryptoUtilsTest,ModifiedPublicExponentWithEmptyPublicMetadata)381 TEST_P(CryptoUtilsTest, ModifiedPublicExponentWithEmptyPublicMetadata) {
382   ANON_TOKENS_ASSERT_OK_AND_ASSIGN(bssl::UniquePtr<BIGNUM> new_public_exp,
383                                    ComputeFinalExponentUnderPublicMetadata(
384                                        *rsa_modulus_.get(), *rsa_e_.get(), ""));
385 
386   EXPECT_NE(BN_cmp(new_public_exp.get(), rsa_e_.get()), 0);
387 }
388 
389 INSTANTIATE_TEST_SUITE_P(CryptoUtilsTest, CryptoUtilsTest,
390                          testing::Values(&GetStrongRsaKeys2048,
391                                          &GetAnotherStrongRsaKeys2048,
392                                          &GetStrongRsaKeys3072,
393                                          &GetStrongRsaKeys4096));
394 
395 }  // namespace
396 }  // namespace anonymous_tokens
397 }  // namespace private_membership
398