Module concrete_core::specification::engines
source · [−]Expand description
A module containing specifications of the concrete FHE engines.
In essence, engines are types which can be used to perform operations on fhe entities. These
engines contain all the side-resources needed to execute the operations they declare.
An engine must implement at least the AbstractEngine
super-trait, and can implement any
number of *Engine
traits.
Every fhe operation is defined by a *Engine
operation trait which always expose two entry
points:
- A safe entry point, returning a result, with an operation-dedicated error. When using this entry point, the user relies on the backend to check that the necessary preconditions are verified by the inputs, at the cost of a small overhead.
- An unsafe entry point, returning the raw result if any. When using this entry point, it is the user responsibility to ensure that the necessary preconditions are verified by the inputs. Breaking one of those preconditions will result in either a panic, or an FHE UB.
Engine errors
Implementing the AbstractEngine
trait for a given type implies specifying an associated
EngineError
which should be able to represent all the
possible error cases specific to this engine.
Each *Engine
trait is associated with a specialized *Error<E>
type (for example
LweCiphertextDiscardingKeyswitchError
is associated with
LweCiphertextDiscardingKeyswitchEngine
), which contains:
- Multiple general error variants which can be potentially produced by any backend
(see the
LweCiphertextDiscardingKeyswitchError::InputLweDimensionMismatch
variant for an example) - One specific variant which encapsulate the generic argument error
E
(see theEngine
variant for an example)
When implementing a particular *Engine
trait, this E
argument will be forced to be the
EngineError
from the AbstractEngine
super-trait, by the
signature of the operation entry point
(see LweCiphertextDiscardingKeyswitchEngine::discard_keyswitch_lwe_ciphertext
for instance).
This design makes it possible for each operation, to match the error exhaustively against both general error variants, and backend-related error variants.
Operation semantics
For each possible operation, we try to support the three following semantics:
- Pure operations take their inputs as arguments, allocate an object
holding the result, and return it (example:
LweCiphertextEncryptionEngine
). They usually require more resources than other, because of the allocation. - Discarding operations take both their inputs and outputs as arguments
(example:
LweCiphertextDiscardingAdditionEngine
). In those operations, the data originally available in the outputs is not used for the computation. They are usually the fastest ones. - Fusing operations take both their inputs and outputs as arguments
(example:
LweCiphertextFusingAdditionEngine
). In those operations though, the data originally contained in the output is used for computation.
Enums
An error used with the CleartextConversionEngine
trait.
An error used with the CleartextCreationEngine
trait.
An error used with the CleartextDiscardingConversionEngine
trait.
An error used with the CleartextDiscardingRetrievalEngine
trait.
An error used with the CleartextEncodingEngine
trait.
An error used with the CleartextRetrievalEngine
trait.
An error used with the CleartextVectorConversionEngine
trait.
An error used with the CleartextVectorCreationEngine
trait.
An error used with the CleartextVectorDiscardingConversionEngine
trait.
An error used with the CleartextVectorDiscardingRetrievalEngine
trait.
An error used with the CleartextVectorEncodingEngine
trait.
An error used with the CleartextVectorRetrievalEngine
trait.
An error used with the DestructionEngine
trait.
An error used with the GlweCiphertextConversionEngine
trait.
An error used with the GlweCiphertextDecryptionEngine
trait.
An error used with the GlweCiphertextDiscardingConversionEngine
trait.
An error used with the GlweCiphertextDiscardingDecryptionEngine
trait.
An error used with the GlweCiphertextDiscardingEncryptionEngine
trait.
An error used with the GlweCiphertextEncryptionEngine
trait.
An error used with the GlweCiphertextTrivialEncryptionEngine
trait.
An error used with the GlweCiphertextVectorConversionEngine
trait.
An error used with the GlweCiphertextVectorDecryptionEngine
trait.
An error used with the GlweCiphertextVectorDiscardingConversionEngine
trait.
An error used with the GlweCiphertextVectorDiscardingDecryptionEngine
trait.
An error used with the GlweCiphertextVectorDiscardingEncryptionEngine
trait.
An error used with the GlweCiphertextVectorEncryptionEngine
trait.
An error used with the GlweCiphertextVectorZeroEncryptionEngine
trait.
An error used with the GlweCiphertextZeroEncryptionEngine
trait.
An error used with the GlweSecretKeyConversionEngine
trait.
An error used with the GlweSecretKeyCreationEngine
trait.
An error used with the GlweSecretKeyDiscardingConversionEngine
trait.
An error used with the GlweToLweSecretKeyTransmutationEngine
trait.
An error used with the LweBootstrapKeyConversionEngine
trait.
An error used with the LweBootstrapKeyCreationEngine
trait.
An error used with the LweBootstrapKeyDiscardingConversionEngine
trait.
An error used with the LweCiphertextCleartextDiscardingMultiplicationEngine
trait.
An error used with the LweCiphertextCleartextFusingMultiplicationEngine
trait.
An error used with the LweCiphertextConversionEngine
trait.
An error used with the LweCiphertextDecryptionEngine
trait.
An error used with the LweCiphertextDiscardingAdditionEngine
trait.
An error used with the LweCiphertextDiscardingBootstrapEngine
trait.
An error used with the LweCiphertextDiscardingConversionEngine
trait.
An error used with the LweCiphertextDiscardingDecryptionEngine
trait.
An error used with the LweCiphertextDiscardingEncryptionEngine
trait.
An error used with the LweCiphertextDiscardingExtractionEngine
trait.
An error used with the LweCiphertextDiscardingKeyswitchEngine
trait.
An error used with the LweCiphertextDiscardingLoadingEngine
trait.
An error used with the LweCiphertextDiscardingNegationEngine
trait.
An error used with the LweCiphertextDiscardingStoringEngine
trait.
An error used with the LweCiphertextEncryptionEngine
trait.
An error used with the LweCiphertextFusingAdditionEngine
trait.
An error used with the LweCiphertextFusingNegationEngine
trait.
An error used with the LweCiphertextLoadingEngine
trait.
An error used with the LweCiphertextPlaintextDiscardingAdditionEngine
trait.
An error used with the LweCiphertextPlaintextFusingAdditionEngine
trait.
An error used with the LweCiphertextTrivialEncryptionEngine
trait.
An error used with the LweCiphertextVectorConversionEngine
trait.
An error used with the LweCiphertextVectorDecryptionEngine
trait.
An error used with the LweCiphertextVectorDiscardingAdditionEngine
trait.
An error used with the LweCiphertextVectorDiscardingAffineTransformationEngine
trait.
An error used with the LweCiphertextVectorDiscardingBootstrapEngine
trait.
An error used with the LweCiphertextVectorDiscardingConversionEngine
trait.
An error used with the LweCiphertextVectorDiscardingDecryptionEngine
trait.
An error used with the LweCiphertextVectorDiscardingEncryptionEngine
trait.
An error used with the LweCiphertextVectorDiscardingKeyswitchEngine
trait.
An error used with the LweCiphertextVectorDiscardingLoadingEngine
trait.
An error used with the LweCiphertextVectorDiscardingNegationEngine
trait.
An error used with the LweCiphertextVectorEncryptionEngine
trait.
An error used with the LweCiphertextVectorFusingAdditionEngine
trait.
An error used with the LweCiphertextVectorFusingNegationEngine
trait.
An error used with the LweCiphertextVectorLoadingEngine
trait.
An error used with the LweCiphertextVectorTrivialEncryptionEngine
trait.
An error used with the LweCiphertextVectorZeroEncryptionEngine
trait.
An error used with the LweCiphertextZeroEncryptionEngine
trait.
An error used with the LweKeyswitchKeyConversionEngine
trait.
An error used with the LweKeyswitchKeyCreationEngine
trait.
An error used with the LweKeyswitchKeyDiscardingConversionEngine
trait.
An error used with the LweSecretKeyConversionEngine
trait.
An error used with the LweSecretKeyCreationEngine
trait.
An error used with the LweSecretKeyDiscardingConversionEngine
trait.
An error used with the PlaintextConversionEngine
trait.
An error used with the PlaintextCreationEngine
trait.
An error used with the PlaintextDecodingEngine
trait.
An error used with the PlaintextDiscardingConversionEngine
trait.
An error used with the PlaintextDiscardingRetrievalEngine
trait.
An error used with the PlaintextRetrievalEngine
trait.
An error used with the PlaintextVectorConversionEngine
trait.
An error used with the PlaintextVectorCreationEngine
trait.
An error used with the PlaintextVectorDecodingEngine
trait.
An error used with the PlaintextVectorDiscardingConversionEngine
trait.
An error used with the PlaintextVectorDiscardingRetrievalEngine
trait.
An error used with the PlaintextVectorRetrievalEngine
trait.
Traits
A top-level abstraction for engines of the concrete scheme.
A trait for engines converting cleartexts.
A trait for engines creating cleartexts from arbitrary values.
A trait for engines converting (discarding) cleartexts .
A trait for engines retrieving (discarding) arbitrary values from cleartexts .
A trait for engines encoding cleartexts.
A trait for engines retrieving arbitrary values from cleartexts.
A trait for engines converting (discard) cleartext vectors.
A trait for engines creating cleartext vectors from arbitrary values.
A trait for engines converting (discarding) cleartexts vector.
A trait for engines retrieving (discarding) arbitrary values from cleartext vectors.
A trait for engines encoding cleartext vectors.
A trait for engines retrieving arbitrary values from cleartext vectors.
A trait for engines destructing entities.
A trait for engines converting GLWE ciphertexts.
A trait for engines decrypting GLWE ciphertexts.
A trait for engines converting (discarding) GLWE ciphertexts .
A trait for engines decrypting (discarding) GLWE ciphertexts.
A trait for engines encrypting (discarding) GLWE ciphertexts.
A trait for engines encrypting GLWE ciphertexts.
A trait for engines trivially encrypting GLWE ciphertext.
A trait for engines converting GLWE ciphertext vectors.
A trait for engines decrypting GLWE ciphertext vectors.
A trait for engines converting (discarding) GLWE ciphertext vectors .
A trait for engines decrypting (discarding) GLWE ciphertext vectors.
A trait for engines encrypting (discarding) GLWE ciphertext vectors.
A trait for engines encrypting GLWE ciphertext vectors.
A trait for engines encrypting zero in GLWE ciphertext vectors.
A trait for engines encrypting zeros in GLWE ciphertexts.
A trait for engines converting GLWE secret keys.
A trait for engines creating GLWE secret keys.
A trait for engines converting (discarding) GLWE secret keys .
A trait for engines transmuting GLWE secret keys into LWE secret keys.
A trait for engines converting LWE bootstrap keys.
A trait for engines creating LWE bootstrap keys.
A trait for engines converting (discarding) LWE bootstrap keys .
A trait for engines multiplying (discarding) LWE ciphertext by cleartexts.
A trait for engines multiplying (fusing) LWE ciphertexts by cleartexts.
A trait for engines converting LWE ciphertexts.
A trait for engines decrypting LWE ciphertexts.
A trait for engines adding (discarding) LWE ciphertexts.
A trait for engines bootstrapping (discarding) LWE ciphertexts.
A trait for engines converting (discarding) LWE ciphertexts .
A trait for engines decrypting (discarding) LWE ciphertexts.
A trait for engines encrypting (discarding) LWE ciphertexts.
A trait for engines extracting (discarding) LWE ciphertext from GLWE ciphertexts.
A trait for engines keyswitching (discarding) LWE ciphertexts.
A trait for engines loading (discarding) an LWE ciphertext from a LWE ciphertext vector.
A trait for engines negating (discarding) LWE ciphertexts.
A trait for engines storing (discarding) LWE ciphertexts in LWE ciphertext vectors.
A trait for engines encrypting LWE ciphertexts.
A trait for engines adding (fusing) LWE ciphertexts.
A trait for engines negating (fusing) LWE ciphertexts.
A trait for engines loading LWE ciphertexts from LWE ciphertext vectors.
A trait for engines adding (discarding) plaintext to LWE ciphertexts.
A trait for engines adding (fusing) plaintexts to LWE ciphertexts.
A trait for engines trivially encrypting LWE ciphertext.
A trait for engines converting LWE ciphertext vectors.
A trait for engines decrypting LWE ciphertext vectors.
A trait for engines adding (discarding) LWE ciphertext vectors.
A trait for engines performing (discarding) affine transformation of LWE ciphertexts.
A trait for engines bootstrapping (discarding) LWE ciphertext vectors.
A trait for engines converting (discarding) LWE ciphertext vectors .
A trait for engines decrypting (discarding) LWE ciphertext vectors.
A trait for engines encrypting (discarding) LWE ciphertext vectors.
A trait for engines keyswitching (discarding) LWE ciphertext vectors.
A trait for engines loading (discarding) a sub LWE ciphertext vector from another one.
A trait for engines negating (discarding) LWE ciphertext vectors.
A trait for engines encrypting LWE ciphertext vectors.
A trait for engines adding (fusing) LWE ciphertexts vectors.
A trait for engines negating (fusing) LWE ciphertext vectors.
A trait for engines loading a sub LWE ciphertext vector from another one.
A trait for engines trivially encrypting LWE ciphertext vectors.
A trait for engines encrypting zero in LWE ciphertext vectors.
A trait for engines encrypting zero in LWE ciphertexts.
A trait for engines converting LWE keyswitch keys.
A trait for engines creating LWE keyswitch keys.
A trait for engines converting (discarding) LWE keyswitch keys .
A trait for engines converting LWE secret keys.
A trait for engines creating LWE secret keys.
A trait for engines converting (discarding) LWE secret keys .
A trait for engines converting plaintexts.
A trait for engines creating plaintexts from an arbitrary value.
A trait for engines decoding plaintexts.
A trait for engines converting (discarding) plaintexts .
A trait for engines retrieving (discarding) arbitrary values from plaintexts.
A trait for engines retrieving arbitrary values from plaintexts.
A trait for engines converting plaintext vectors.
A trait for engines creating plaintext vectors from arbitrary values.
A trait for engines decoding plaintext vectors.
A trait for engines converting (discarding) plaintext vectors.
A trait for engines retrieving (discarding) arbitrary values from plaintext vectors.
A trait for engines retrieving arbitrary values from plaintext vectors.