xref: /aosp_15_r20/external/private-join-and-compute/private_join_and_compute/crypto/paillier.proto (revision a6aa18fbfbf9cb5cd47356a9d1b057768998488c)
1/*
2 * Copyright 2019 Google LLC.
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
16syntax = "proto2";
17
18package private_join_and_compute;
19
20// Holds a Paillier Public Key.
21message PaillierPublicKey {
22  // Contains a serialized BigNum encoding the Paillier modulus n.
23  optional bytes n = 1;
24  // Contains the Damgard-Jurik exponent corresponding to this key. The Paillier
25  // modulus will be n^(s+1), and the message space will be n^s.
26  optional int32 s = 2;
27}
28
29message PaillierPrivateKey {
30  // p and q contain serialized BigNums, such that the Paillier modulus n=pq.
31  optional bytes p = 1;
32  optional bytes q = 2;
33
34  // Contains the Damgard-Jurik exponent corresponding to this key. The Paillier
35  // modulus will be n^(s+1), and the message space will be n^s.
36  optional int32 s = 3;
37}
38