xref: /aosp_15_r20/external/tink/proto/hpke.proto (revision e7b1675dde1b92d52ec075b0a92829627f2c52a5)
1// Copyright 2021 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
19package google.crypto.tink;
20
21option java_package = "com.google.crypto.tink.proto";
22option java_multiple_files = true;
23option go_package = "github.com/google/tink/go/proto/hpke_proto";
24
25enum HpkeKem {
26  KEM_UNKNOWN = 0;
27  DHKEM_X25519_HKDF_SHA256 = 1;
28  DHKEM_P256_HKDF_SHA256 = 2;
29  DHKEM_P384_HKDF_SHA384 = 3;
30  DHKEM_P521_HKDF_SHA512 = 4;
31}
32
33enum HpkeKdf {
34  KDF_UNKNOWN = 0;
35  HKDF_SHA256 = 1;
36  HKDF_SHA384 = 2;
37  HKDF_SHA512 = 3;
38}
39
40enum HpkeAead {
41  AEAD_UNKNOWN = 0;
42  AES_128_GCM = 1;
43  AES_256_GCM = 2;
44  CHACHA20_POLY1305 = 3;
45}
46
47message HpkeParams {
48  HpkeKem kem = 1;
49  HpkeKdf kdf = 2;
50  HpkeAead aead = 3;
51}
52
53message HpkePublicKey {
54  uint32 version = 1;
55  HpkeParams params = 2;
56  // KEM-encoding of public key (i.e., SerializePublicKey() ) as described in
57  // https://www.rfc-editor.org/rfc/rfc9180.html#name-cryptographic-dependencies.
58  bytes public_key = 3;
59}
60
61message HpkePrivateKey {
62  uint32 version = 1;
63  HpkePublicKey public_key = 2;
64  // KEM-encoding of private key (i.e., SerializePrivateKey() ) as described in
65  // https://www.rfc-editor.org/rfc/rfc9180.html#name-cryptographic-dependencies.
66  bytes private_key = 3;
67}
68
69message HpkeKeyFormat {
70  HpkeParams params = 1;
71}
72