File: ecies_aead_hkdf.proto

package info (click to toggle)
golang-github-tink-crypto-tink-go 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,952 kB
  • sloc: sh: 864; makefile: 6
file content (114 lines) | stat: -rw-r--r-- 3,704 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////

// Definitions for Elliptic Curve Digital Signature Algorithm (ECDSA).
syntax = "proto3";

package google.crypto.tink;

import "proto/common.proto";
import "proto/tink.proto";

option java_package = "com.google.crypto.tink.proto";
option java_multiple_files = true;
option go_package = "github.com/tink-crypto/tink-go/v2/proto/ecies_aead_hkdf_go_proto";

// Protos for keys for ECIES with HKDF and AEAD encryption.
//
// These definitions follow loosely ECIES ISO 18033-2 standard
// (Elliptic Curve Integrated Encryption Scheme, see
// http://www.shoup.net/iso/std6.pdf), with but with some differences:
//  * use of HKDF key derivation function (instead of KDF1 and KDF2) enabling
//  the use
//    of optional parameters to the key derivation function, which strenghten
//    the overall security and allow for binding the key material to
//    application-specific information (cf. RFC 5869,
//    https://tools.ietf.org/html/rfc5869)
//  * use of modern AEAD schemes rather than "manual composition" of symmetric
//  encryption
//    with message authentication codes (as in DEM1, DEM2, and DEM3 schemes of
//    ISO 18033-2)
//
// ECIES-keys represent HybridEncryption resp. HybridDecryption primitives.

// Parameters of KEM (Key Encapsulation Mechanism)
message EciesHkdfKemParams {
  // Required.
  EllipticCurveType curve_type = 1;

  // Required.
  HashType hkdf_hash_type = 2;

  // Optional.
  bytes hkdf_salt = 11;
}

// Parameters of AEAD DEM (Data Encapsulation Mechanism).
message EciesAeadDemParams {
  // Required.
  // Contains an Aead or DeterministicAead key format (e.g:
  // AesCtrHmacAeadKeyFormat, AesGcmKeyFormat or AesSivKeyFormat).
  // The output_prefix_type in this template here is ignored (RAW is assumed).
  KeyTemplate aead_dem = 2;
}

message EciesAeadHkdfParams {
  // Key Encapsulation Mechanism.
  // Required.
  EciesHkdfKemParams kem_params = 1;

  // Data Encapsulation Mechanism.
  // Required.
  EciesAeadDemParams dem_params = 2;

  // EC point format.
  // Required.
  EcPointFormat ec_point_format = 3;
}

// EciesAeadHkdfPublicKey represents HybridEncryption primitive.
// key_type: type.googleapis.com/google.crypto.tink.EciesAeadHkdfPublicKey
message EciesAeadHkdfPublicKey {
  // Required.
  uint32 version = 1;
  // Required.
  EciesAeadHkdfParams params = 2;

  // Affine coordinates of the public key in bigendian representation.
  // The public key is a point (x, y) on the curve defined by
  // params.kem_params.curve. Required.
  bytes x = 3;
  // Required.
  bytes y = 4;
}

// EciesKdfAeadPrivateKey represents HybridDecryption primitive.
// key_type: type.googleapis.com/google.crypto.tink.EciesAeadHkdfPrivateKey
message EciesAeadHkdfPrivateKey {
  // Required.
  uint32 version = 1;

  // Required.
  EciesAeadHkdfPublicKey public_key = 2;

  // Required.
  bytes key_value = 3 ;  // Placeholder for multi-line ctype and debug_redact.  // Big integer in bigendian representation.
}

message EciesAeadHkdfKeyFormat {
  // Required.
  EciesAeadHkdfParams params = 1;
}