SIFE — Single-Input Functional Encryption¶
Single-input functional encryption schemes.
- class pyfe4ai.schemes.sife.SIFE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for DDH-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the SIFE crypto system.
- Parameters:
config (
dict) – Must containkeyswithpp(public parameters) and eithersk(encryption keys) ordk(decryption key).- Return type:
None
- encrypt(lst_pt)[source]¶
Encrypt a plaintext vector under the DDH-based scheme.
- Parameters:
lst_pt (
list) – Integer plaintext vector of length ≤eta.- Return type:
- Returns:
Dict with
ct0(group element) andct1(list of group elements).- Raises:
FEKeyError – If public parameters or private keys are missing.
FEValidationError – If plaintext length exceeds
eta.
- decrypt(dct_ct, dk, fusion_weight)[source]¶
Decrypt a ciphertext to recover the inner product ⟨x, y⟩.
- Parameters:
dk (
dict) – Decryption key dict fromSIFEKeyGenerator.get_decryption_keys().fusion_weight (
list) – Integer weight vector y.
- Returns:
The inner product as an integer, or
Noneif out of bound.- Raises:
FEKeyError – If public parameters or decryption key is missing.
- class pyfe4ai.schemes.sife.SIFEKeyGenerator(config, **kwargs)[source]¶
Bases:
DDHKeyGeneratorBaseKey generator for DDH-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the SIFE key generator.
- Parameters:
config (
dict) – Scheme configuration. Recognised keys:sec_param,eta(plaintext vector length).- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters (g, p, eta, sec_param).
- Return type:
- Returns:
Dict of public parameters.
- get_decryption_keys(sid, **kwargs)[source]¶
Derive a functional decryption key for the given fusion weights.
- Parameters:
sid (
str) – Session identifier.**kwargs – Must include
credentialswithfusion_weight(list of int).
- Return type:
- Returns:
Dict with
z(the inner product of secret key and weights).- Raises:
FEKeyError – If credentials are missing.
FEValidationError – If fusion weights are invalid.
- pyfe4ai.schemes.sife.DynamicSIFE¶
alias of
SIFEDynamic
- pyfe4ai.schemes.sife.DynamicSIFEKeyGenerator¶
alias of
SIFEDynamicKeyGenerator
- class pyfe4ai.schemes.sife.SIFEFHIPE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for function-hiding inner-product encryption over pairings.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- class pyfe4ai.schemes.sife.SIFEFHIPEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for function-hiding inner-product encryption over pairings.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- class pyfe4ai.schemes.sife.SIFEPartFHIPE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for partially function-hiding inner-product encryption over pairings.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- class pyfe4ai.schemes.sife.SIFEPartFHIPEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for partially function-hiding inner-product encryption over pairings.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- class pyfe4ai.schemes.sife.SIFEPaillier(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for Paillier-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- class pyfe4ai.schemes.sife.SIFEPaillierKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for Paillier-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- pyfe4ai.schemes.sife.SIFEDamgardDDH¶
alias of
SIFEDamgard
- pyfe4ai.schemes.sife.SIFEDamgardDDHKeyGenerator¶
alias of
SIFEDamgardKeyGenerator
- class pyfe4ai.schemes.sife.SIFEFullySecLWE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for fully secure LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the fully secure SIFE LWE crypto system.
- Parameters:
config (
dict) – Must containkeyswithpp(public parameters) and optionallysk(encryption keys).- Return type:
None
- encrypt(lst_pt)[source]¶
Encrypt a plaintext vector under the fully-secure LWE scheme.
- Parameters:
lst_pt (
list) – Integer plaintext vector of lengtheta.- Return type:
- Returns:
Dict with
ct0andct1(serialised LWE ciphertext vectors).- Raises:
FEKeyError – If public parameters or encryption keys are missing.
FEValidationError – If plaintext length or values are invalid.
- decrypt(dct_ct, dk, fusion_weight)[source]¶
Decrypt a ciphertext to recover the inner product ⟨x, y⟩.
- Parameters:
dk (
dict) – Decryption key fromSIFEFullySecLWEKeyGenerator.get_decryption_keys().fusion_weight (
list) – Integer weight vector y.
- Returns:
The inner product as an integer.
- Raises:
FEKeyError – If decryption key is missing.
FEValidationError – If fusion weight length or values are invalid.
- encrypt_lst_ndarray(lst_ndarray, **kwargs)[source]¶
Encrypt a list of ndarrays element-wise (requires
eta=1).
- compute_lst_ndarray_ct(dict_ndarray_ct, **kwargs)[source]¶
Aggregate ndarray ciphertexts (delegates to
decrypt_lst_ndarray_ct()).
- class pyfe4ai.schemes.sife.SIFEFullySecLWEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for fully secure LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the fully secure SIFE LWE key generator.
- Parameters:
config (
dict) – Scheme configuration. Recognised keys:sec_param,eta,lwe_n,bound_x,bound_y.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
Dict containing
A,k,q,m,eta,lwe_n,bound_x,bound_y, and noise parameters.
- get_private_keys(nid='nid_default', **kwargs)[source]¶
Return encryption keys (public-key matrix
pk).
- get_decryption_keys(sid, **kwargs)[source]¶
Derive a functional decryption key for the given fusion weights.
- Parameters:
sid (
str) – Session identifier.**kwargs – Must include
credentialswithfusion_weight(list of int).
- Return type:
- Returns:
Dict with
sk_y(the projected secret key).- Raises:
FEKeyError – If credentials are missing.
FEValidationError – If fusion weights are invalid or exceed
bound_y.
- class pyfe4ai.schemes.sife.SIFELWE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the SIFE LWE crypto system.
- Parameters:
config (
dict) – Must containkeyswithpp(public parameters) and optionallysk(encryption keys).- Return type:
None
- encrypt(lst_pt)[source]¶
Encrypt a plaintext vector under the LWE-based scheme.
- Parameters:
lst_pt (
list) – Integer plaintext vector of lengtheta.- Return type:
- Returns:
Dict with
ct0andct1(serialised LWE ciphertext vectors).- Raises:
FEKeyError – If public parameters or encryption keys are missing.
FEValidationError – If plaintext length or values are invalid.
- decrypt(dct_ct, dk, fusion_weight)[source]¶
Decrypt a ciphertext to recover the inner product ⟨x, y⟩.
- Parameters:
dk (
dict) – Decryption key dict fromSIFELWEKeyGenerator.get_decryption_keys().fusion_weight (
list) – Integer weight vector y.
- Returns:
The inner product as an integer.
- Raises:
FEKeyError – If decryption key is missing.
FEValidationError – If fusion weight length or values are invalid.
- encrypt_lst_ndarray(lst_ndarray, **kwargs)[source]¶
Encrypt a list of ndarrays element-wise (requires
eta=1).
- compute_lst_ndarray_ct(dict_ndarray_ct, **kwargs)[source]¶
Aggregate ndarray ciphertexts (delegates to
decrypt_lst_ndarray_ct()).
- class pyfe4ai.schemes.sife.SIFELWEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the SIFE LWE key generator.
- Parameters:
config (
dict) – Scheme configuration. Recognised keys:sec_param,eta,lwe_n,bound_x,bound_y.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
Dict containing
A,p,q,m,eta,lwe_n,bound_x,bound_y,sec_param.
- get_private_keys(nid='nid_default', **kwargs)[source]¶
Return encryption keys (public-key matrix
pk).
- get_decryption_keys(sid, **kwargs)[source]¶
Derive a functional decryption key for the given fusion weights.
- Parameters:
sid (
str) – Session identifier.**kwargs – Must include
credentialswithfusion_weight(list of int).
- Return type:
- Returns:
Dict with
sk_y(the projected secret key).- Raises:
FEKeyError – If credentials are missing.
FEValidationError – If fusion weights are invalid or exceed
bound_y.
- class pyfe4ai.schemes.sife.SIFERingLWE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for Ring-LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- class pyfe4ai.schemes.sife.SIFERingLWEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for Ring-LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
DDH¶
Simple Single Input Functional Encryption | From “Simple Functional Encryption Schemes for Inner Products” | Published in: PKC 2015 | By Michel Abdalla, Florian Bourse, Angelo De Caro, and David Pointcheval | URL: https://eprint.iacr.org/2015/017.pdf
type: public-key encryption
setting: Integer based
- class pyfe4ai.schemes.sife.ddh.SIFEKeyGenerator(config, **kwargs)[source]¶
Bases:
DDHKeyGeneratorBaseKey generator for DDH-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the SIFE key generator.
- Parameters:
config (
dict) – Scheme configuration. Recognised keys:sec_param,eta(plaintext vector length).- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters (g, p, eta, sec_param).
- Return type:
- Returns:
Dict of public parameters.
- get_decryption_keys(sid, **kwargs)[source]¶
Derive a functional decryption key for the given fusion weights.
- Parameters:
sid (
str) – Session identifier.**kwargs – Must include
credentialswithfusion_weight(list of int).
- Return type:
- Returns:
Dict with
z(the inner product of secret key and weights).- Raises:
FEKeyError – If credentials are missing.
FEValidationError – If fusion weights are invalid.
- class pyfe4ai.schemes.sife.ddh.SIFE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for DDH-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the SIFE crypto system.
- Parameters:
config (
dict) – Must containkeyswithpp(public parameters) and eithersk(encryption keys) ordk(decryption key).- Return type:
None
- encrypt(lst_pt)[source]¶
Encrypt a plaintext vector under the DDH-based scheme.
- Parameters:
lst_pt (
list) – Integer plaintext vector of length ≤eta.- Return type:
- Returns:
Dict with
ct0(group element) andct1(list of group elements).- Raises:
FEKeyError – If public parameters or private keys are missing.
FEValidationError – If plaintext length exceeds
eta.
- decrypt(dct_ct, dk, fusion_weight)[source]¶
Decrypt a ciphertext to recover the inner product ⟨x, y⟩.
- Parameters:
dk (
dict) – Decryption key dict fromSIFEKeyGenerator.get_decryption_keys().fusion_weight (
list) – Integer weight vector y.
- Returns:
The inner product as an integer, or
Noneif out of bound.- Raises:
FEKeyError – If public parameters or decryption key is missing.
DDH Dynamic¶
Simple Single Input Functional Encryption | From “Simple Functional Encryption Schemes for Inner Products” | Published in: PKC 2015 | By Michel Abdalla, Florian Bourse, Angelo De Caro, and David Pointcheval | URL: https://eprint.iacr.org/2015/017.pdf
type: public-key encryption
setting: Integer based
- class pyfe4ai.schemes.sife.ddh_dynamic.SIFEDynamicKeyGenerator(config, **kwargs)[source]¶
Bases:
DDHKeyGeneratorBaseKey generator for DDH-based single-input FE with dynamic key derivation.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- class pyfe4ai.schemes.sife.ddh_dynamic.SIFEDynamic(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for DDH-based single-input FE with dynamic key derivation.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
Damgård DDH¶
Single-Input Inner-Product Functional Encryption | Inspired by the fully secure Damgard/DDH instantiation exposed in CiFEr / GoFE | From “Fully Secure Functional Encryption for Inner Products, | from Standard Assumptions” | By Shweta Agrawal, Benoit Libert, and Damien Stehle | Published in: CRYPTO 2016
type: public-key encryption
setting: Integer based
- note: research-oriented Python prototype aligned with the existing
crypto-ipfe API style
- class pyfe4ai.schemes.sife.damgard_ddh.SIFEDamgardKeyGenerator(config, **kwargs)[source]¶
Bases:
DamgardDDHKeyGeneratorBaseKey generator for Damgard DDH-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- class pyfe4ai.schemes.sife.damgard_ddh.SIFEDamgard(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for Damgard DDH-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
LWE¶
LWE-Based Single-Input Inner-Product Functional Encryption | From “Simple Functional Encryption Schemes for Inner Products” | By Michel Abdalla, Florian Bourse, Angelo De Caro, David Pointcheval | Published in: PKC 2015 | | This module implements the generic simple FE construction instantiated | under the LWE assumption as a research-oriented Python prototype.
type: public-key encryption
setting: Integer based
note: prototype implementation aligned with the existing crypto-ipfe API
- class pyfe4ai.schemes.sife.lwe.SIFELWEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the SIFE LWE key generator.
- Parameters:
config (
dict) – Scheme configuration. Recognised keys:sec_param,eta,lwe_n,bound_x,bound_y.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
Dict containing
A,p,q,m,eta,lwe_n,bound_x,bound_y,sec_param.
- get_private_keys(nid='nid_default', **kwargs)[source]¶
Return encryption keys (public-key matrix
pk).
- get_decryption_keys(sid, **kwargs)[source]¶
Derive a functional decryption key for the given fusion weights.
- Parameters:
sid (
str) – Session identifier.**kwargs – Must include
credentialswithfusion_weight(list of int).
- Return type:
- Returns:
Dict with
sk_y(the projected secret key).- Raises:
FEKeyError – If credentials are missing.
FEValidationError – If fusion weights are invalid or exceed
bound_y.
- class pyfe4ai.schemes.sife.lwe.SIFELWE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the SIFE LWE crypto system.
- Parameters:
config (
dict) – Must containkeyswithpp(public parameters) and optionallysk(encryption keys).- Return type:
None
- encrypt(lst_pt)[source]¶
Encrypt a plaintext vector under the LWE-based scheme.
- Parameters:
lst_pt (
list) – Integer plaintext vector of lengtheta.- Return type:
- Returns:
Dict with
ct0andct1(serialised LWE ciphertext vectors).- Raises:
FEKeyError – If public parameters or encryption keys are missing.
FEValidationError – If plaintext length or values are invalid.
- decrypt(dct_ct, dk, fusion_weight)[source]¶
Decrypt a ciphertext to recover the inner product ⟨x, y⟩.
- Parameters:
dk (
dict) – Decryption key dict fromSIFELWEKeyGenerator.get_decryption_keys().fusion_weight (
list) – Integer weight vector y.
- Returns:
The inner product as an integer.
- Raises:
FEKeyError – If decryption key is missing.
FEValidationError – If fusion weight length or values are invalid.
- encrypt_lst_ndarray(lst_ndarray, **kwargs)[source]¶
Encrypt a list of ndarrays element-wise (requires
eta=1).
- compute_lst_ndarray_ct(dict_ndarray_ct, **kwargs)[source]¶
Aggregate ndarray ciphertexts (delegates to
decrypt_lst_ndarray_ct()).
Fully-Secure LWE¶
Fully Secure LWE-Based Single-Input Inner-Product Functional Encryption | Based on the LWE variant of | “Fully Secure Functional Encryption for Inner Products, | from Standard Assumptions” | By Shweta Agrawal, Benoit Libert, Damien Stehle | Published in: CRYPTO 2016 | | This module follows the GoFE innerprod/fullysec/lwe.go organization while | adapting it to the repository’s Python key-generator and crypto API.
type: public-key encryption
setting: Integer based
note: research prototype aligned with the existing crypto-ipfe API
- class pyfe4ai.schemes.sife.fullysec_lwe.SIFEFullySecLWEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for fully secure LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the fully secure SIFE LWE key generator.
- Parameters:
config (
dict) – Scheme configuration. Recognised keys:sec_param,eta,lwe_n,bound_x,bound_y.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
Dict containing
A,k,q,m,eta,lwe_n,bound_x,bound_y, and noise parameters.
- get_private_keys(nid='nid_default', **kwargs)[source]¶
Return encryption keys (public-key matrix
pk).
- get_decryption_keys(sid, **kwargs)[source]¶
Derive a functional decryption key for the given fusion weights.
- Parameters:
sid (
str) – Session identifier.**kwargs – Must include
credentialswithfusion_weight(list of int).
- Return type:
- Returns:
Dict with
sk_y(the projected secret key).- Raises:
FEKeyError – If credentials are missing.
FEValidationError – If fusion weights are invalid or exceed
bound_y.
- class pyfe4ai.schemes.sife.fullysec_lwe.SIFEFullySecLWE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for fully secure LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Initialise the fully secure SIFE LWE crypto system.
- Parameters:
config (
dict) – Must containkeyswithpp(public parameters) and optionallysk(encryption keys).- Return type:
None
- encrypt(lst_pt)[source]¶
Encrypt a plaintext vector under the fully-secure LWE scheme.
- Parameters:
lst_pt (
list) – Integer plaintext vector of lengtheta.- Return type:
- Returns:
Dict with
ct0andct1(serialised LWE ciphertext vectors).- Raises:
FEKeyError – If public parameters or encryption keys are missing.
FEValidationError – If plaintext length or values are invalid.
- decrypt(dct_ct, dk, fusion_weight)[source]¶
Decrypt a ciphertext to recover the inner product ⟨x, y⟩.
- Parameters:
dk (
dict) – Decryption key fromSIFEFullySecLWEKeyGenerator.get_decryption_keys().fusion_weight (
list) – Integer weight vector y.
- Returns:
The inner product as an integer.
- Raises:
FEKeyError – If decryption key is missing.
FEValidationError – If fusion weight length or values are invalid.
- encrypt_lst_ndarray(lst_ndarray, **kwargs)[source]¶
Encrypt a list of ndarrays element-wise (requires
eta=1).
- compute_lst_ndarray_ct(dict_ndarray_ct, **kwargs)[source]¶
Aggregate ndarray ciphertexts (delegates to
decrypt_lst_ndarray_ct()).
Ring-LWE¶
Ring-LWE-Based Single-Input Inner-Product Functional Encryption | Based on | “Efficient Lattice-Based Inner-Product Functional Encryption” | By Bermudo Mera, Karmakar, Marc, Soleimanian | ePrint: 2021/046 | | This module follows the ring-LWE inner-product FE line and is additionally | informed by the GoFE reference implementation in innerprod/simple/ringlwe.go.
type: public-key encryption
setting: Integer based
note: research prototype with SIMD-style matrix encryption
- class pyfe4ai.schemes.sife.ring_lwe.SIFERingLWEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for Ring-LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- class pyfe4ai.schemes.sife.ring_lwe.SIFERingLWE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for Ring-LWE-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
Paillier¶
Paillier-Based Single-Input Inner-Product Functional Encryption | Inspired by the fully secure Paillier instantiation exposed in CiFEr / GoFE | From “Fully Secure Functional Encryption for Inner Products, | from Standard Assumptions” | By Shweta Agrawal, Benoit Libert, and Damien Stehle | Published in: CRYPTO 2016
type: public-key encryption
setting: Integer based
- note: research-oriented Python prototype aligned with the existing
crypto-ipfe API style
- class pyfe4ai.schemes.sife.paillier.SIFEPaillierKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for Paillier-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- class pyfe4ai.schemes.sife.paillier.SIFEPaillier(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for Paillier-based single-input inner-product FE.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
FH-IPE (Pairing)¶
Function-Hiding Inner-Product Encryption over Pairings | Based on | “Function-Hiding Inner Product Encryption is Practical” | By Kim, Lewi, Mandal, Montgomery, Roy, Wu | | This prototype follows the GoFE innerprod/fullysec/fhipe.go structure and | adapts it to the repository’s single-input FE API.
type: public-key encryption
setting: Pairing based
note: research prototype aligned with the existing crypto-ipfe API
- class pyfe4ai.schemes.sife.fh_ipe_pairing.SIFEFHIPEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for function-hiding inner-product encryption over pairings.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- class pyfe4ai.schemes.sife.fh_ipe_pairing.SIFEFHIPE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for function-hiding inner-product encryption over pairings.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
Partial FH-IPE (Pairing)¶
Partially Function-Hiding Inner-Product Encryption over Pairings | Based on | “A New Paradigm for Public-Key Functional Encryption for Degree-2 Polynomials” | By Romain Gay | | This prototype follows the GoFE innerprod/fullysec/part_fh_ipe.go | organization and adapts it to the repository’s single-input FE API.
type: public-key encryption
setting: Pairing based
note: research prototype aligned with the existing crypto-ipfe API
- class pyfe4ai.schemes.sife.part_fh_ipe_pairing.SIFEPartFHIPEKeyGenerator(config, **kwargs)[source]¶
Bases:
IPFEAbsKeyGenerator,ParameterCacheMixinKey generator for partially function-hiding inner-product encryption over pairings.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None
- get_public_parameters()[source]¶
Return serialisable public parameters.
- Return type:
- Returns:
A dict of public parameters, or
Noneon error.
- class pyfe4ai.schemes.sife.part_fh_ipe_pairing.SIFEPartFHIPE(config, **kwargs)[source]¶
Bases:
IPFEAbsCryptoCrypto operations for partially function-hiding inner-product encryption over pairings.
- Parameters:
config (
dict)
- __init__(config, **kwargs)[source]¶
Perform the __init__ operation.
- Parameters:
config (
dict) – Scheme configuration dict.- Return type:
None