Afhe class

Abstract Fully Homomorphic Encryption

It provides the ability to generate encryption contexts, keys, and perform operations on plaintexts and ciphertexts.

Implementers

Constructors

Afhe(String backendName, String schemeName)
Default Constructor initializes Backend with Scheme.
Afhe.noScheme(String backendName)
Initializes the Backend without a Scheme.

Properties

backend Backend
The backend library used for the encryption scheme.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
library Pointer<NativeType>
A pointer to the memory address of the underlying C++ object.
getter/setter pair
publicKey Key
Fetch the public key.
no setter
relinKeys Key
Fetch the relinearization keys.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scheme Scheme
The encryption scheme used by the backend.
getter/setter pair
secretKey Key
Fetch the secret key.
no setter
slotCount int
Returns the number of slots based on parameters.
no setter

Methods

add(Ciphertext a, Ciphertext b) Ciphertext
Adds two Ciphertexts.
addPlain(Ciphertext a, Plaintext b) Ciphertext
Adds value of Plaintext to the value of Ciphertext.
decodeVecDouble(Plaintext plaintext, int arrayLength) List<double>
Decodes a Plaintext into a list of doubles.
decodeVecInt(Plaintext plaintext, int arrayLength) List<int>
Decodes a Plaintext into a list of integers.
decrypt(Ciphertext ciphertext) Plaintext
Decrypts the ciphertext message.
encodeDouble(double value) Plaintext
Encodes a double into a Plaintext.
encodeVecDouble(List<double> vec) Plaintext
Encodes a list of doubles into a Plaintext.
encodeVecInt(List<int> vec) Plaintext
Encodes a list of integers into a Plaintext.
encrypt(Plaintext plaintext) Ciphertext
Encrypts the plaintext message.
genContext(Map context) String
Generates a context for the encryption scheme.
genContextFromParameters(Map parameters) String
Loads the encryption context from a string.
genKeys() → void
Generates the public and secret keys for the encryption and decryption.
genRelinKeys() → void
Generates the relinearization keys derived from the secret key.
invariantNoiseBudget(Ciphertext ciphertext) int
Returns the invariant noise budget of the Ciphertext.
loadCiphertext(Pointer<Uint8> data, int size) Ciphertext
Loads a Ciphertext from a non-human-readable format.
modSwitchNext(Ciphertext ciphertext) Ciphertext
Modulus switches the Ciphertext to a next lower level.
multiply(Ciphertext a, Ciphertext b) Ciphertext
Multiplies two Ciphertexts.
multiplyPlain(Ciphertext a, Plaintext b) Ciphertext
Multiplies a Ciphertext by a Plaintext.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
power(Ciphertext a, int power) Ciphertext
Raises the Ciphertext to a power.
relinearize(Ciphertext ciphertext) Ciphertext
Relinearizes the Ciphertext.
saveParameters() Map
Returns the string representation of FHE parameters.
square(Ciphertext a) Ciphertext
Squares the Ciphertext.
subtract(Ciphertext a, Ciphertext b) Ciphertext
Subtracts two Ciphertexts.
subtractPlain(Ciphertext a, Plaintext b) Ciphertext
Subtracts value of Plaintext from the value of Ciphertext.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited