AesKey#
- class AesKey#
A class to hold the AES secret key encrypted under FHE, required for decryption of AES ciphertexts under FHE.
- he_encrypt(self: pyhelayers.AesKey, plain_key: bytes, compress: bool = True) None #
Encrypt the given plaintext AES key under FHE.
- Parameters:
plain_key – The plaintext AES key, of size 128, 192 or 256 bits (16, 24 or 32 bytes, respectively).
compress – Whether to store the key in a compressed fashion (recommended). This will result in much smaller object when saving to binary, but will require more time to uncompress when loading the key.
-
class AesKey : public helayers::Saveable#
Public Functions
-
void heEncrypt(const std::vector<unsigned char> &plainKey, bool compress = true)#
Encrypt the given plaintext AES key under FHE.
- Parameters:
plainKey – The plaintext AES key, of size 128, 192 or 256 bits (16, 24 or 32 bytes, respectively).
compress – Whether to store the key in a compressed fashion (recommended). This will result in much smaller object when saving to binary, but will require more time to uncompress when loading the key.
-
void setChainIndex(int chainIndex)#
Update the chain index of this AES key.
The normal usage requires not using this method and leaving the chain index of the key in the chain index it was encrypted in.
- Parameters:
chainIndex – The desired chain index.
-
int getChainIndex() const#
Returns the chain index of this AES key.
-
void heEncrypt(const std::vector<unsigned char> &plainKey, bool compress = true)#