blob: 9cb31bf15da457b6916f3ad4ec503ee4ba96289c [file] [log] [blame]
Avi Drissman8ba1bad2022-09-13 19:22:361// Copyright 2017 The Chromium Authors
Carlos IL3e5dd762017-10-06 22:35:102// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5
6syntax = "proto2";
7
8package encrypted_messages;
9
10// Chrome requires this.
11option optimize_for = LITE_RUNTIME;
12
13// This protobuffer is intended to store an encrypted message.
14// Messages are encrypted with a secret derived from a client key pair (which
15// should be generated fresh randomly for each message) and a server public
16// key. The remote message recipient can decrypt the message by performing the
17// same key exchange using the included client public key to recover the shared
18// secret.
19message EncryptedMessage {
20 // An encrypted, serialized message.
21 required bytes encrypted_message = 1;
22 // The server public key version that was used to derive the shared secret.
23 required uint32 server_public_key_version = 2;
24 // The client public key that corresponds to the private key that was used
25 // to derive the shared secret.
26 required bytes client_public_key = 3;
27 // The encryption algorithm used to encrypt the message.
28 enum Algorithm {
29 UNKNOWN_ALGORITHM = 0;
30 AEAD_ECDH_AES_128_CTR_HMAC_SHA256 = 1;
31 }
32 optional Algorithm algorithm = 4
33 [default = AEAD_ECDH_AES_128_CTR_HMAC_SHA256];
34};