Aashish Sharma | 54fa654e | 2024-11-15 03:07:00 | [diff] [blame^] | 1 | // 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 | |
| 17 | syntax = "proto3"; |
| 18 | |
| 19 | option optimize_for = LITE_RUNTIME; |
| 20 | |
| 21 | package userfeedback; |
| 22 | |
| 23 | enum 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 | |
| 31 | enum HpkeKdf { |
| 32 | KDF_UNKNOWN = 0; |
| 33 | HKDF_SHA256 = 1; |
| 34 | HKDF_SHA384 = 2; |
| 35 | HKDF_SHA512 = 3; |
| 36 | } |
| 37 | |
| 38 | enum HpkeAead { |
| 39 | AEAD_UNKNOWN = 0; |
| 40 | AES_128_GCM = 1; |
| 41 | AES_256_GCM = 2; |
| 42 | CHACHA20_POLY1305 = 3; |
| 43 | } |
| 44 | |
| 45 | message HpkeParams { |
| 46 | HpkeKem kem = 1; |
| 47 | HpkeKdf kdf = 2; |
| 48 | HpkeAead aead = 3; |
| 49 | } |
| 50 | |
| 51 | message 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 | |
| 59 | message 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 | |
| 67 | message HpkeKeyFormat { |
| 68 | HpkeParams params = 1; |
| 69 | } |