xref: /aosp_15_r20/external/anonymous-counting-tokens/act/act_v0/act_v0.proto (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 Lisyntax = "proto3";
17*a26f1301SXin Li
18*a26f1301SXin Lipackage private_join_and_compute.anonymous_counting_tokens;
19*a26f1301SXin Li
20*a26f1301SXin Liimport "private_join_and_compute/crypto/dodis_yampolskiy_prf/bb_oblivious_signature.proto";
21*a26f1301SXin Liimport "private_join_and_compute/crypto/dodis_yampolskiy_prf/dy_verifiable_random_function.proto";
22*a26f1301SXin Liimport "private_join_and_compute/crypto/proto/big_num.proto";
23*a26f1301SXin Liimport "private_join_and_compute/crypto/proto/camenisch_shoup.proto";
24*a26f1301SXin Liimport "private_join_and_compute/crypto/proto/pedersen.proto";
25*a26f1301SXin Li
26*a26f1301SXin Lioption java_multiple_files = true;
27*a26f1301SXin Li
28*a26f1301SXin Li// The parameters for ACTv0.
29*a26f1301SXin Limessage SchemeParametersV0 {
30*a26f1301SXin Li  // How many masking bits (more than the challenge bits) to add in the sigma
31*a26f1301SXin Li  // protocols.
32*a26f1301SXin Li  uint64 security_parameter = 1;
33*a26f1301SXin Li  // How many bits the challenge has.
34*a26f1301SXin Li  uint64 challenge_length_bits = 2;
35*a26f1301SXin Li  // Length for the RSA modulus.
36*a26f1301SXin Li  uint64 modulus_length_bits = 3;
37*a26f1301SXin Li  // Camenisch Shoup Damgard-Jurik parameter (message space is n^s).
38*a26f1301SXin Li  uint64 camenisch_shoup_s = 4;
39*a26f1301SXin Li  // Camenisch-Shoup vector-encryption parameter.
40*a26f1301SXin Li  uint64 vector_encryption_length = 5;
41*a26f1301SXin Li  // Number of messages that can be committed in a single Pedersen commitment.
42*a26f1301SXin Li  uint64 pedersen_batch_size = 6;
43*a26f1301SXin Li  // Specification of the EC Group in which the DY-PRF and Boneh Boyen Oblivious
44*a26f1301SXin Li  // Signature will be computed.
45*a26f1301SXin Li  uint64 prf_ec_group = 7;
46*a26f1301SXin Li  // Prefix to attach to any random oracle query (optional).
47*a26f1301SXin Li  string random_oracle_prefix = 8;
48*a26f1301SXin Li}
49*a26f1301SXin Li
50*a26f1301SXin Li// The Server's public parameters for the ACTv0 scheme.
51*a26f1301SXin Limessage ServerPublicParametersV0 {
52*a26f1301SXin Li  reserved 1, 4, 5;
53*a26f1301SXin Li
54*a26f1301SXin Li  // Parameters to use for commitments.
55*a26f1301SXin Li  private_join_and_compute.proto.PedersenParameters pedersen_parameters = 2;
56*a26f1301SXin Li  // Camenisch Shoup public key (for the Boneh-Boyen Oblivious Signature).
57*a26f1301SXin Li  private_join_and_compute.proto.CamenischShoupPublicKey camenisch_shoup_public_key = 3;
58*a26f1301SXin Li  // Public key for the Boneh-Boyen oblivious signature.
59*a26f1301SXin Li  private_join_and_compute.proto.BbObliviousSignaturePublicKey
60*a26f1301SXin Li      bb_oblivious_signature_public_key = 6;
61*a26f1301SXin Li
62*a26f1301SXin Li  // Serialized ECPoint corresponding to the base g to use for the DY PRF and
63*a26f1301SXin Li  // Boneh-Boyen oblivious signature.
64*a26f1301SXin Li  bytes prf_base_g = 7;
65*a26f1301SXin Li
66*a26f1301SXin Li}
67*a26f1301SXin Li
68*a26f1301SXin Li// The Server's private parameters for the ACTv0 scheme.
69*a26f1301SXin Limessage ServerPrivateParametersV0 {
70*a26f1301SXin Li  reserved 2, 3;
71*a26f1301SXin Li  // Camenisch Shoup private key (for the Boneh-Boyen Oblivious Signature).
72*a26f1301SXin Li  private_join_and_compute.proto.CamenischShoupPrivateKey camenisch_shoup_private_key = 1;
73*a26f1301SXin Li  // Private key for the Boneh-Boyen Oblivious Signature.
74*a26f1301SXin Li  private_join_and_compute.proto.BbObliviousSignaturePrivateKey
75*a26f1301SXin Li      bb_oblivious_signature_private_key = 4;
76*a26f1301SXin Li}
77*a26f1301SXin Li
78*a26f1301SXin Li// The Client's public parameters for the ACT scheme.
79*a26f1301SXin Limessage ClientPublicParametersV0 {
80*a26f1301SXin Li  // Public key for the DY Verifiable Random Function.
81*a26f1301SXin Li  private_join_and_compute.proto.DyVrfPublicKey dy_vrf_public_key = 1;
82*a26f1301SXin Li  private_join_and_compute.proto.DyVrfGenerateKeysProof dy_vrf_generate_keys_proof = 2;
83*a26f1301SXin Li}
84*a26f1301SXin Li
85*a26f1301SXin Li// The Client's private parameters for the ACT scheme.
86*a26f1301SXin Limessage ClientPrivateParametersV0 {
87*a26f1301SXin Li  // Private key for the DY Verifiable Random Function.
88*a26f1301SXin Li  private_join_and_compute.proto.DyVrfPrivateKey dy_vrf_private_key = 1;
89*a26f1301SXin Li}
90*a26f1301SXin Li
91*a26f1301SXin Li// The Client's token request. Can correspond to a batch of tokens.
92*a26f1301SXin Limessage TokensRequestV0 {
93*a26f1301SXin Li  message Part1 {
94*a26f1301SXin Li    bytes commit_messages = 1;
95*a26f1301SXin Li    bytes commit_client_nonces = 2;
96*a26f1301SXin Li
97*a26f1301SXin Li    // Proofs that the fingerprints on the messages were generated correctly.
98*a26f1301SXin Li    // The fingerprints correspond to PRF evaluations on the messages.
99*a26f1301SXin Li    private_join_and_compute.proto.DyVrfApplyProof fingerprints_proof = 3;
100*a26f1301SXin Li  }
101*a26f1301SXin Li
102*a26f1301SXin Li  // Part1 of the tokens request feeds into the Random Oracle to produce the
103*a26f1301SXin Li  // client-independent portion of the nonces. (The nonce per-token consists
104*a26f1301SXin Li  // of a client-chosen part, and a client-independent/not-chosen part. The
105*a26f1301SXin Li  // latter is generated by a random oracle call.)
106*a26f1301SXin Li  Part1 part_1 = 1;
107*a26f1301SXin Li
108*a26f1301SXin Li  // Boneh-Boyen Oblivious Signature request and proof for nonces.
109*a26f1301SXin Li  private_join_and_compute.proto.BbObliviousSignatureRequest bb_oblivious_signature_request = 2;
110*a26f1301SXin Li  private_join_and_compute.proto.BbObliviousSignatureRequestProof
111*a26f1301SXin Li      bb_oblivious_signature_request_proof = 3;
112*a26f1301SXin Li}
113*a26f1301SXin Li
114*a26f1301SXin Li// Private state corresponding to the Client's token request, needed to recover
115*a26f1301SXin Li// the tokens from the server's response.
116*a26f1301SXin Limessage TokensRequestPrivateStateV0 {
117*a26f1301SXin Li  private_join_and_compute.proto.BbObliviousSignatureRequestPrivateState
118*a26f1301SXin Li      bb_oblivious_signature_request_private_state = 1;
119*a26f1301SXin Li  // Stores the nonces generated as part of the request (includes the
120*a26f1301SXin Li  // client-generated and random-oracle-generated portions combined).
121*a26f1301SXin Li  private_join_and_compute.proto.BigNumVector nonces = 2;
122*a26f1301SXin Li}
123*a26f1301SXin Li
124*a26f1301SXin Li// The Server's response to a TokensRequest. Can correspond to a batch of
125*a26f1301SXin Li// tokens.
126*a26f1301SXin Limessage TokensResponseV0 {
127*a26f1301SXin Li  // Boneh-Boyen Oblivious signature response and proof.
128*a26f1301SXin Li  private_join_and_compute.proto.BbObliviousSignatureResponse bb_oblivious_signature_response =
129*a26f1301SXin Li      1;
130*a26f1301SXin Li  private_join_and_compute.proto.BbObliviousSignatureResponseProof
131*a26f1301SXin Li      bb_oblivious_signature_response_proof = 2;
132*a26f1301SXin Li}
133*a26f1301SXin Li
134*a26f1301SXin Li// An actual token recovered from the TokenResponse.
135*a26f1301SXin Limessage TokenV0 {
136*a26f1301SXin Li  // The nonce is stored in the enclosing Token proto.
137*a26f1301SXin Li
138*a26f1301SXin Li  // Serialized Boneh-Boyen signature on the message and nonce. Serialized
139*a26f1301SXin Li  // ECPoint.
140*a26f1301SXin Li  bytes bb_signature = 1;
141*a26f1301SXin Li}
142