xref: /aosp_15_r20/external/anonymous-counting-tokens/act/act_v0/parameters.h (revision a26f13018b999b025c962678da434c0a5aec4dae)
1*a26f1301SXin Li /*
2*a26f1301SXin Li  * Copyright 2023 Google LLC.
3*a26f1301SXin Li  * Licensed under the Apache License, Version 2.0 (the "License");
4*a26f1301SXin Li  * you may not use this file except in compliance with the License.
5*a26f1301SXin Li  * You may obtain a copy of the License at
6*a26f1301SXin Li  *
7*a26f1301SXin Li  *     https://www.apache.org/licenses/LICENSE-2.0
8*a26f1301SXin Li  *
9*a26f1301SXin Li  * Unless required by applicable law or agreed to in writing, software
10*a26f1301SXin Li  * distributed under the License is distributed on an "AS IS" BASIS,
11*a26f1301SXin Li  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*a26f1301SXin Li  * See the License for the specific language governing permissions and
13*a26f1301SXin Li  * limitations under the License.
14*a26f1301SXin Li  */
15*a26f1301SXin Li 
16*a26f1301SXin Li #ifndef PRIVATE_JOIN_AND_COMPUTE_ANONYMOUS_COUNTING_TOKENS_ACT_V0_PARAMETERS_H_
17*a26f1301SXin Li #define PRIVATE_JOIN_AND_COMPUTE_ANONYMOUS_COUNTING_TOKENS_ACT_V0_PARAMETERS_H_
18*a26f1301SXin Li 
19*a26f1301SXin Li #include <string>
20*a26f1301SXin Li 
21*a26f1301SXin Li #include "act/act.pb.h"
22*a26f1301SXin Li #include "private_join_and_compute/crypto/openssl.inc"
23*a26f1301SXin Li 
24*a26f1301SXin Li namespace private_join_and_compute {
25*a26f1301SXin Li namespace anonymous_counting_tokens {
26*a26f1301SXin Li 
27*a26f1301SXin Li const int kDefaultSecurityParameter = 128;
28*a26f1301SXin Li const int kDefaultChallengeLength = 128;
29*a26f1301SXin Li const int kDefaultCamenischShoupS = 1;
30*a26f1301SXin Li const int kDefaultCurveId = NID_X9_62_prime256v1;
31*a26f1301SXin Li const int kDefaultModulusLengthBits = 3072;
32*a26f1301SXin Li 
33*a26f1301SXin Li // Returns parameters appropriate only for testing (smaller modulus of 1536
34*a26f1301SXin Li // bits, smaller batch size of 3).
35*a26f1301SXin Li SchemeParameters ActV0TestSchemeParameters();
36*a26f1301SXin Li 
37*a26f1301SXin Li // Returns parameters supporting 16 messages in a batch, with both Pedersen and
38*a26f1301SXin Li // CS parameters set to 16, and modulus length 3072.
39*a26f1301SXin Li SchemeParameters ActV0Batch16SchemeParameters();
40*a26f1301SXin Li 
41*a26f1301SXin Li // Returns parameters supporting 32 messages in a batch, with both Pedersen and
42*a26f1301SXin Li // CS parameters set to 32, and modulus length 3072.
43*a26f1301SXin Li SchemeParameters ActV0Batch32SchemeParameters();
44*a26f1301SXin Li 
45*a26f1301SXin Li // Returns parameters supporting 32 messages in a batch, with CS vector
46*a26f1301SXin Li // encryption length set to 2, and modulus length 2048.
47*a26f1301SXin Li //
48*a26f1301SXin Li // These parameters are currently the best-optimized for performance.
49*a26f1301SXin Li SchemeParameters
50*a26f1301SXin Li ActV0SchemeParametersPedersen32Modulus2048CamenischShoupVector2();
51*a26f1301SXin Li 
52*a26f1301SXin Li // Returns custom parameters.
53*a26f1301SXin Li SchemeParameters ActV0SchemeParameters(int pedersen_batch_size,
54*a26f1301SXin Li                                        int modulus_length_bits,
55*a26f1301SXin Li                                        int camenisch_shoup_vector_length);
56*a26f1301SXin Li 
57*a26f1301SXin Li }  // namespace anonymous_counting_tokens
58*a26f1301SXin Li }  // namespace private_join_and_compute
59*a26f1301SXin Li 
60*a26f1301SXin Li #endif  // PRIVATE_JOIN_AND_COMPUTE_ANONYMOUS_COUNTING_TOKENS_ACT_V0_PARAMETERS_H_
61