Crate sunscreen_runtime

Source
Expand description

This crate contains the types and functions for executing a Sunscreen FHE or ZKP program.

Modules§

marker
Marker traits.

Structs§

BFVEncryptionComponents
Components needed to perform BFV encryption. Specifically, BFV is defined by the following equation in SEAL:
CallSignature
Indicates the type signature of an FHE or ZKP program.
Ciphertext
An encryption of the given data type. Note, the data type is stored in plaintext and is considered part of Sunscreen’s runtime protocol.
CompiledFheProgram
An FHE program with its associated metadata.
Fhe
A surrogate type for creating FHE-enabled Runtimes.
FheProgramMetadata
A serializable list of requirements for an Fhe Program.
FheZkp
A surrogate type for creating Runtimes supporting both FHE and ZKP.
GenericRuntime
The generalized runtime type that provides ZKP and FHE functionality depending on the generic parameter T. As a user, you should instead use FheRuntime, ZkpRuntime, or FheZkpRuntime depending on your needs. See Runtime.
Params
The parameter set required for a given FHE program to run efficiently and correctly.
Plaintext
Represents an encoded plaintext suitable for use in the underlying scheme.
PrivateKey
The private key used to decrypt ciphertexts.
ProofBuilder
A builder for creating a proof.
PublicKey
A bundle of public keys. These may be freely shared with other parties without risk of compromising data security.
Type
A type which represents the fully qualified name and version of a datatype.
VerificationBuilder
A builder for verifying a proof.
Version
SemVer version as defined by https://semver.org.
WithContext
A data type that contains parameters for reconstructing a context during deserialization (needed by SEAL).
Zkp
A surrogate type for creating ZKP-enabled Runtimes.
ZkpProgramInput
An input argument to a ZKP program.

Enums§

Error
Represents an error that can occur in this crate.
FheProgramInput
An input argument to an Fhe Program. See crate::Runtime::run.
FheProgramRunFailure
An error that occurs while running an Fhe Program.
InnerCiphertext
The underlying backend implementation of a ciphertext (e.g SEAL’s Ciphertext).
InnerPlaintext
The underlying backend implementation of a plaintext (e.g. SEAL’s Plaintext).
RequiredKeys
A key type required for an Fhe Program to function correctly.
SealData
A type that can be either a SEAL plaintext or a ciphertext.

Traits§

BfvType
Denotes the given type is valid under the BFV scheme.
FheProgramInputTrait
A trait that denotes this type can be used as an argument to an FHE program.
FheType
Denotes the given rust type is an encoding in an FHE scheme
NumCiphertexts
Declare how many ciphertexts an FheType decomposes into. The runtime needs this to correctly bundle return values from an Fhe Program.
ToNativeFields
A trait for converting values into fields used by ZKPs.
TryFromPlaintext
This trait specifies one may attempt to convert a plaintext into this type.
TryIntoPlaintext
This trait denotes one may attempt to turn this type into a plaintext.
TypeName
A trait the gives a name an version to a given type
TypeNameInstance
A trait the gives a name an version to a given type
ZkpProgramInputTrait
Denotes this type can be used as an input to a ZKP program.

Functions§

run_program_unchecked
You probably should instead use Runtime::run().
traverse
Traverses the FheProgram’s nodes in topological order, executing callback on each node.

Type Aliases§

FheRuntime
A runtime capable of only FHE operations.
FheZkpRuntime
A runtime capable of both FHE and ZKP operations.
Result
Wrapper around Result with this crate’s error type.
Runtime
A type containing the Runtime::new_* constructor methods to create the appropriate runtime:
ZkpRuntime
A runtime capable of only ZKP operations.