Expand description
This crate contains the types and functions for executing a Sunscreen FHE or ZKP program.
Modules§
- marker
- Marker traits.
Structs§
- BFVEncryption
Components - Components needed to perform BFV encryption. Specifically, BFV is defined by the following equation in SEAL:
- Call
Signature - 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.
- Compiled
FheProgram - An FHE program with its associated metadata.
- Fhe
- A surrogate type for creating FHE-enabled
Runtime
s. - FheProgram
Metadata - A serializable list of requirements for an Fhe Program.
- FheZkp
- A surrogate type for creating
Runtime
s supporting both FHE and ZKP. - Generic
Runtime - The generalized runtime type that provides ZKP and FHE functionality
depending on the generic parameter
T
. As a user, you should instead useFheRuntime
,ZkpRuntime
, orFheZkpRuntime
depending on your needs. SeeRuntime
. - 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.
- Private
Key - The private key used to decrypt ciphertexts.
- Proof
Builder - A builder for creating a proof.
- Public
Key - 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.
- Verification
Builder - A builder for verifying a proof.
- Version
- SemVer version as defined by https://semver.org.
- With
Context - A data type that contains parameters for reconstructing a context during deserialization (needed by SEAL).
- Zkp
- A surrogate type for creating ZKP-enabled
Runtime
s. - ZkpProgram
Input - An input argument to a ZKP program.
Enums§
- Error
- Represents an error that can occur in this crate.
- FheProgram
Input - An input argument to an Fhe Program. See
crate::Runtime::run
. - FheProgram
RunFailure - An error that occurs while running an Fhe Program.
- Inner
Ciphertext - The underlying backend implementation of a ciphertext (e.g SEAL’s
Ciphertext
). - Inner
Plaintext - The underlying backend implementation of a plaintext (e.g. SEAL’s
Plaintext
). - Required
Keys - A key type required for an Fhe Program to function correctly.
- Seal
Data - A type that can be either a SEAL plaintext or a ciphertext.
Traits§
- BfvType
- Denotes the given type is valid under the BFV scheme.
- FheProgram
Input Trait - 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.
- ToNative
Fields - A trait for converting values into fields used by ZKPs.
- TryFrom
Plaintext - This trait specifies one may attempt to convert a plaintext into this type.
- TryInto
Plaintext - This trait denotes one may attempt to turn this type into a plaintext.
- Type
Name - A trait the gives a name an version to a given type
- Type
Name Instance - A trait the gives a name an version to a given type
- ZkpProgram
Input Trait - 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.
- FheZkp
Runtime - 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.