1/* 2 * Copyright 2017 Google Inc. 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 * https://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 16syntax = "proto2"; 17 18option optimize_for = LITE_RUNTIME; 19 20package rlwe; 21 22// NTT Polynomial 23message SerializedNttPolynomial { 24 // Coefficients of the polynomial 25 optional bytes coeffs = 1; 26 27 // Number of coefficients of the polynomial. 28 optional int32 num_coeffs = 2; 29} 30 31// RLWE Ciphertext 32message SerializedSymmetricRlweCiphertext { 33 // Polynomials composing the ciphertext 34 repeated SerializedNttPolynomial c = 1; 35 36 // The power of the secret key that the ciphertext is encrypted with. 37 optional int32 power_of_s = 2; 38 39 // A heuristic on the amount of error in the ciphertext. 40 optional double error = 3; 41} 42 43// RLWE RelinearizationKey 44message SerializedRelinearizationKey { 45 // Polynomial composing the matrix 46 repeated SerializedNttPolynomial c = 1; 47 48 // The modulus used to decompose the coefficients of the polynomials. Ranges 49 // from 1 to the number of bits of the modulus. 50 optional int32 log_decomposition_modulus = 2; 51 52 // For n parts, the key can relinearize an n-component ciphertext to a 53 // 2-component ciphertext. 54 optional int32 num_parts = 3; 55 56 // Seed used to compress this key. 57 optional bytes prng_seed = 4; // Required 58 59 // The power of s that corresponds to the key. The field is 1 if the key is 60 // RelinearizationKey. 61 optional int32 power_of_s = 5; 62} 63 64// RLWE GaloisKeys. 65message SerializedGaloisKey { 66 // The key-switching matrix 67 optional SerializedRelinearizationKey key = 1; 68} 69