1// Copyright 2019 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// Package hybrid provides implementations of the Hybrid Encryption primitive. 18// 19// The functionality of Hybrid Encryption is represented as a pair of 20// interfaces: 21// 22// * HybridEncrypt for encryption of data 23// * HybridDecrypt for decryption of data 24// 25// Implementations of these interfaces are secure against adaptive chosen 26// ciphertext attacks. In addition to plaintext the encryption takes an extra 27// parameter contextInfo, which usually is public data implicit from the 28// context, but should be bound to the resulting ciphertext, i.e. the 29// ciphertext allows for checking the integrity of contextInfo (but there are 30// no guarantees wrt. the secrecy or authenticity of contextInfo). 31package hybrid 32 33import ( 34 "fmt" 35 36 "github.com/google/tink/go/core/registry" 37) 38 39func init() { 40 if err := registry.RegisterKeyManager(new(hpkePublicKeyManager)); err != nil { 41 panic(fmt.Sprintf("hybrid.init() failed: %v", err)) 42 } 43 if err := registry.RegisterKeyManager(new(hpkePrivateKeyManager)); err != nil { 44 panic(fmt.Sprintf("hybrid.init() failed: %v", err)) 45 } 46 47 if err := registry.RegisterKeyManager(new(eciesAEADHKDFPrivateKeyKeyManager)); err != nil { 48 panic(fmt.Sprintf("hybrid.init() failed: %v", err)) 49 } 50 if err := registry.RegisterKeyManager(new(eciesAEADHKDFPublicKeyKeyManager)); err != nil { 51 panic(fmt.Sprintf("hybrid.init() failed: %v", err)) 52 } 53} 54