blob: 329de5e4ab7da20bccffef407d88c5660af835bd [file] [log] [blame]
Aashish Sharma54fa654e2024-11-15 03:07:001// Copyright 2024 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// http://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////////////////////////////////////////////////////////////////////////////////
16
17syntax = "proto3";
18
19option optimize_for = LITE_RUNTIME;
20
21package userfeedback;
22
23enum HpkeKem {
24 KEM_UNKNOWN = 0;
25 DHKEM_X25519_HKDF_SHA256 = 1;
26 DHKEM_P256_HKDF_SHA256 = 2;
27 DHKEM_P384_HKDF_SHA384 = 3;
28 DHKEM_P521_HKDF_SHA512 = 4;
29}
30
31enum HpkeKdf {
32 KDF_UNKNOWN = 0;
33 HKDF_SHA256 = 1;
34 HKDF_SHA384 = 2;
35 HKDF_SHA512 = 3;
36}
37
38enum HpkeAead {
39 AEAD_UNKNOWN = 0;
40 AES_128_GCM = 1;
41 AES_256_GCM = 2;
42 CHACHA20_POLY1305 = 3;
43}
44
45message HpkeParams {
46 HpkeKem kem = 1;
47 HpkeKdf kdf = 2;
48 HpkeAead aead = 3;
49}
50
51message HpkePublicKey {
52 uint32 version = 1;
53 HpkeParams params = 2;
54 // KEM-encoding of public key (i.e., SerializePublicKey() ) as described in
55 // https://www.rfc-editor.org/rfc/rfc9180.html#name-cryptographic-dependencies.
56 bytes public_key = 3;
57}
58
59message HpkePrivateKey {
60 uint32 version = 1;
61 HpkePublicKey public_key = 2;
62 // KEM-encoding of private key (i.e., SerializePrivateKey() ) as described in
63 // https://www.rfc-editor.org/rfc/rfc9180.html#name-cryptographic-dependencies.
64 bytes private_key = 3;
65}
66
67message HpkeKeyFormat {
68 HpkeParams params = 1;
69}