noisy

package
v0.0.0-...-a536860 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStruct

type KeyStruct struct {
	TheSecKey *OTNHMultiIPESecKey
}

type MyKeyStruct

type MyKeyStruct struct {
	TheSecKey *NHMultiIPESecKey
}

type NHMultiIPE

type NHMultiIPE struct {
	Params *NHMultiIPEParams
}

NHMultiIPE represents a Function Hiding Multi-input Inner Product Encryption scheme based on the paper by P. Datta, T. Okamoto, and J. Tomida: "Full-Hiding (Unbounded) Multi-Input Inner Product Functional Encryption from the 𝒌-Linear Assumption". It allows clients to encrypt vectors {x_1,...,x_m} and derive a secret key based on an inner product vectors {y_1,...,y_m} so that a decryptor can decrypt the sum of inner products <x_1,y_1> + ... + <x_m, y_m> without revealing vectors x_i or y_i. The scheme is slightly modified from the original one to achieve a better performance. The difference is in storing the secret master key as matrices B, BStar, instead of matrices of elliptic curve elements g_1^B, g_2^BStar. This replaces elliptic curves operations with matrix multiplication.

This struct contains the shared choice for parameters on which the functionality of the scheme depend.

func NewNHMultiIPE

func NewNHMultiIPE(secLevel, numClients, vecLen int, boundX, boundY *big.Int) *NHMultiIPE

NewNHMultiIPE configures a new instance of the scheme. See struct NHMultiIPEParams for the description of the parameters. It returns a new NHMultiIPE instance.

func NewNHMultiIPEFromParams

func NewNHMultiIPEFromParams(params *NHMultiIPEParams) *NHMultiIPE

NewNHMultiIPEFromParams takes configuration parameters of an existing NHMultiIPE scheme instance, and reconstructs the scheme with the same configuration parameters. It returns a new NHMultiIPE instance.

func (*NHMultiIPE) Decrypt

func (f *NHMultiIPE) Decrypt(cipher data.MatrixG1, key data.MatrixG2, pubKey *bn256.GT) (*big.Int, error)

Decrypt accepts the ciphertext as a matrix whose rows are encryptions of vectors x_1,...,x_m and a functional encryption key corresponding to vectors y_1,...,y_m. It returns the sum of inner products <x_1,y_1> + ... + <x_m, y_m>. If decryption failed, an error is returned.

func (NHMultiIPE) DeriveKey

func (f NHMultiIPE) DeriveKey(y data.Matrix, secKey *NHMultiIPESecKey, noise int64) (data.MatrixG2, error)

DeriveKey takes a matrix y whose rows are input vector y_1,...,y_m and master secret key, and returns the functional encryption key. That is a key that for encrypted x_1,...,x_m allows to calculate the sum of inner products <x_1,y_1> + ... + <x_m, y_m>. In case the key could not be derived, it returns an error.

func (NHMultiIPE) DeriveKeyFake

func (f NHMultiIPE) DeriveKeyFake(a *int64)

func (NHMultiIPE) Encrypt

func (f NHMultiIPE) Encrypt(x data.Vector, partSecKey data.Matrix) (data.VectorG1, error)

Encrypt encrypts input vector x with the provided part of the master secret key. It returns a ciphertext vector. If encryption failed, error is returned.

func (NHMultiIPE) GenerateKeys

func (f NHMultiIPE) GenerateKeys() (*NHMultiIPESecKey, *bn256.GT, error)

GenerateKeys generates a pair of master secret key and public key for the scheme. It returns an error in case keys could not be generated.

type NHMultiIPEParams

type NHMultiIPEParams struct {
	SecLevel   int
	NumClients int
	VecLen     int
	BoundX     *big.Int
	BoundY     *big.Int
}

NHMultiIPEParams represents configuration parameters for the NHMultiIPE scheme instance. SecLevel (int): The parameter defines the security assumption of the scheme, so called k-Lin assumption, where k is the specified SecLevel. NumClients (int): The number of clients participating VecLen (int): The length of vectors that clients encrypt. BoundX (int): The value by which the coordinates of encrypted vectors are bounded. BoundY (int): The value by which the coordinates of inner product vectors are bounded.

type NHMultiIPESecKey

type NHMultiIPESecKey struct {
	BHat     []data.Matrix
	BStarHat []data.Matrix
}

NHMultiIPESecKey represents a master secret key in NHMultiIPE scheme.

type OTNHMultiIPE

type OTNHMultiIPE struct {
	Params *OTNHMultiIPEParams
}

OTNHMultiIPE represents a onte time noise Hiding Multi-input Inner Product Encryption scheme based on the paper by P. Datta, T. Okamoto, and J. Tomida: This struct contains the shared choice for parameters on which the functionality of the scheme depend.

func NewOTNHMultiIPE

func NewOTNHMultiIPE(secLevel, numClients, vecLen int, boundX, boundY *big.Int) *OTNHMultiIPE

NewOTNHMultiIPE configures a new instance of the scheme. See struct OTNHMultiIPEParams for the description of the parameters. It returns a new OTNHMultiIPE instance.

func NewOTNHMultiIPEFromParams

func NewOTNHMultiIPEFromParams(params *OTNHMultiIPEParams) *OTNHMultiIPE

NewOTNHMultiIPEFromParams takes configuration parameters of an existing OTNHMultiIPE scheme instance, and reconstructs the scheme with the same configuration parameters. It returns a new OTNHMultiIPE instance.

func (*OTNHMultiIPE) Decrypt

func (f *OTNHMultiIPE) Decrypt(cipher data.MatrixG1, key data.MatrixG2, pubKey *bn256.GT) (*big.Int, error)

Decrypt accepts the ciphertext as a matrix whose rows are encryptions of vectors x_1,...,x_m and a functional encryption key corresponding to vectors y_1,...,y_m. It returns the sum of inner products <x_1,y_1> + ... + <x_m, y_m>. If decryption failed, an error is returned.

func (OTNHMultiIPE) DeriveKey

func (f OTNHMultiIPE) DeriveKey(y data.Matrix, secKey *OTNHMultiIPESecKey, noise int64) (data.MatrixG2, error)

DeriveKey takes a matrix y whose rows are input vector y_1,...,y_m and master secret key, and returns the functional encryption key. That is a key that for encrypted x_1,...,x_m allows to calculate the sum of inner products <x_1,y_1> + ... + <x_m, y_m>. In case the key could not be derived, it returns an error.

func (OTNHMultiIPE) DeriveKeyFake

func (f OTNHMultiIPE) DeriveKeyFake(a *int64)

func (OTNHMultiIPE) Encrypt

func (f OTNHMultiIPE) Encrypt(x data.Vector, partSecKey data.Matrix) (data.VectorG1, error)

Encrypt encrypts input vector x with the provided part of the master secret key. It returns a ciphertext vector. If encryption failed, error is returned.

func (OTNHMultiIPE) GenerateKeys

func (f OTNHMultiIPE) GenerateKeys() (*OTNHMultiIPESecKey, *bn256.GT, error)

GenerateKeys generates a pair of master secret key and public key for the scheme. It returns an error in case keys could not be generated.

type OTNHMultiIPEParams

type OTNHMultiIPEParams struct {
	SecLevel   int
	NumClients int
	VecLen     int
	BoundX     *big.Int
	BoundY     *big.Int
}

OTNHMultiIPEParams represents configuration parameters for the oTNHMultiIPE scheme instance. SecLevel (int): The parameter defines the security assumption of the scheme, so called k-Lin assumption, where k is the specified SecLevel. NumClients (int): The number of clients participating VecLen (int): The length of vectors that clients encrypt. BoundX (int): The value by which the coordinates of encrypted vectors are bounded. BoundY (int): The value by which the coordinates of inner product vectors are bounded.

type OTNHMultiIPESecKey

type OTNHMultiIPESecKey struct {
	BHat     []data.Matrix
	BStarHat []data.Matrix
}

OTNHMultiIPESecKey represents a master secret key in OTNHMultiIPE scheme.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL