CiFEr
Data Structures | Typedefs | Functions
dippe.h File Reference

This is a decentralized inner-product predicate encryption scheme by Yan Michalevsky and Marc Joye: "Decentralized Policy-Hiding Attribute-Based Encryption with Receiver Privacy". More...

Go to the source code of this file.

Data Structures

struct  cfe_dippe
 
struct  cfe_dippe_cipher
 
struct  cfe_dippe_pub_key
 
struct  cfe_dippe_sec_key
 
struct  cfe_dippe_user_sec_key
 

Typedefs

typedef struct cfe_dippe cfe_dippe
 
typedef struct cfe_dippe_cipher cfe_dippe_cipher
 
typedef struct cfe_dippe_pub_key cfe_dippe_pub_key
 
typedef struct cfe_dippe_sec_key cfe_dippe_sec_key
 
typedef struct cfe_dippe_user_sec_key cfe_dippe_user_sec_key
 

Functions

void cfe_dippe_init (cfe_dippe *dippe, size_t assump_size)
 
void cfe_dippe_free (cfe_dippe *dippe)
 
cfe_error cfe_dippe_attribute_vector_init (cfe_vec *av, size_t num_attrib, size_t pattern[], size_t pat_len)
 
cfe_error cfe_dippe_exact_threshold_policy_vector_init (cfe_vec *pv, cfe_dippe *dippe, size_t num_attrib, size_t pattern[], size_t pat_len, size_t threshold)
 
cfe_error cfe_dippe_conjunction_policy_vector_init (cfe_vec *pv, cfe_dippe *dippe, size_t num_attrib, size_t pattern[], size_t pat_len)
 
void cfe_dippe_cipher_init (cfe_dippe_cipher *cipher, cfe_dippe *dippe, size_t pol_size)
 
void cfe_dippe_cipher_free (cfe_dippe_cipher *cipher)
 
void cfe_dippe_pub_key_init (cfe_dippe_pub_key *pk, cfe_dippe *dippe)
 
void cfe_dippe_pub_key_free (cfe_dippe_pub_key *pk)
 
void cfe_dippe_sec_key_init (cfe_dippe_sec_key *sk, cfe_dippe *dippe)
 
void cfe_dippe_sec_key_free (cfe_dippe_sec_key *sk)
 
void cfe_dippe_user_sec_key_init (cfe_dippe_user_sec_key *usk, cfe_dippe *dippe)
 
void cfe_dippe_user_sec_key_free (cfe_dippe_user_sec_key *usk)
 
void cfe_dippe_generate_master_keys (cfe_dippe_pub_key *pk, cfe_dippe_sec_key *sk, cfe_dippe *dippe)
 
cfe_error cfe_dippe_encrypt (cfe_dippe_cipher *cipher, cfe_dippe *dippe, cfe_dippe_pub_key *pks[], size_t pks_len, cfe_vec *pv, FP12_BN254 *msg)
 
cfe_error cfe_dippe_keygen (cfe_dippe_user_sec_key *usk, cfe_dippe *dippe, size_t usk_id, cfe_dippe_pub_key *pks[], size_t pks_len, cfe_dippe_sec_key *sk, cfe_vec *av, char *gid, size_t gid_len)
 
cfe_error cfe_dippe_decrypt (FP12_BN254 *result, cfe_dippe *dippe, cfe_dippe_user_sec_key *usks, size_t usks_len, cfe_dippe_cipher *cipher, cfe_vec *av, char gid[], size_t gid_len)
 

Detailed Description

This is a decentralized inner-product predicate encryption scheme by Yan Michalevsky and Marc Joye: "Decentralized Policy-Hiding Attribute-Based Encryption with Receiver Privacy".

Typedef Documentation

◆ cfe_dippe

typedef struct cfe_dippe cfe_dippe

cfe_dippe represents the DIPPE scheme

◆ cfe_dippe_cipher

cfe_dippe_cipher represents the ciphertext of the DIPPE scheme

◆ cfe_dippe_pub_key

cfe_dippe_pub_key represents the public key of the DIPPE scheme

◆ cfe_dippe_sec_key

cfe_dippe_sec_key represents the secret key of the DIPPE scheme

◆ cfe_dippe_user_sec_key

cfe_dippe_sec_key represents the user secret key of the DIPPE scheme

Function Documentation

◆ cfe_dippe_init()

void cfe_dippe_init ( cfe_dippe dippe,
size_t  assump_size 
)

Initializes the DIPPE scheme and generates the global parameters

Parameters
dippeA pointer to a cfe_dippe struct
assump_sizeThe size of the underlying assumption

◆ cfe_dippe_free()

void cfe_dippe_free ( cfe_dippe dippe)

Clears the scheme and frees allocated memory

Parameters
dippeA pointer to a cfe_dippe struct

◆ cfe_dippe_attribute_vector_init()

cfe_error cfe_dippe_attribute_vector_init ( cfe_vec av,
size_t  num_attrib,
size_t  pattern[],
size_t  pat_len 
)

Prepares an attribute vector

Parameters
avA pointer to a cfe_vec struct; Represents the resulting attribute vector
num_attribNumber of attributes
patternArray of indices to define the attribute vector
pat_lenLength of the pattern array
Returns
Error code

◆ cfe_dippe_exact_threshold_policy_vector_init()

cfe_error cfe_dippe_exact_threshold_policy_vector_init ( cfe_vec pv,
cfe_dippe dippe,
size_t  num_attrib,
size_t  pattern[],
size_t  pat_len,
size_t  threshold 
)

Prepares an exact threshold policy vector

Parameters
pvA pointer to a cfe_vec struct; Represents the resulting policy vector
dippeA pointer to a cfe_dippe struct
num_attribNumber of attributes
patternArray of indices to define the policy vector
pat_lenLength of the pattern array
thresholdThreshold value
Returns
Error code

◆ cfe_dippe_conjunction_policy_vector_init()

cfe_error cfe_dippe_conjunction_policy_vector_init ( cfe_vec pv,
cfe_dippe dippe,
size_t  num_attrib,
size_t  pattern[],
size_t  pat_len 
)

Prepares a conjunction policy vector

Parameters
pvA pointer to a cfe_vec struct; Represents the resulting policy vector
dippeA pointer to a cfe_dippe struct
num_attribNumber of attributes
patternArray of indices to define the policy vector
pat_lenLength of the pattern array
Returns
Error code

◆ cfe_dippe_cipher_init()

void cfe_dippe_cipher_init ( cfe_dippe_cipher cipher,
cfe_dippe dippe,
size_t  pol_size 
)

Prepares a cipher struct

Parameters
cipherA pointer to a cfe_dippe_cipher struct
dippeA pointer to a cfe_dippe struct
pol_sizeLength of the cipher

◆ cfe_dippe_cipher_free()

void cfe_dippe_cipher_free ( cfe_dippe_cipher cipher)

Clears the ciphertext and frees allocated memory

Parameters
cipherA pointer to a cfe_dippe_cipher struct

◆ cfe_dippe_pub_key_init()

void cfe_dippe_pub_key_init ( cfe_dippe_pub_key pk,
cfe_dippe dippe 
)

Prepares a public key struct

Parameters
pkA pointer to a cfe_dippe_pub_key struct
dippeA pointer to a cfe_dippe struct

◆ cfe_dippe_pub_key_free()

void cfe_dippe_pub_key_free ( cfe_dippe_pub_key pk)

Clears the public key and frees allocated memory

Parameters
pkA pointer to a cfe_dippe_pub_key struct

◆ cfe_dippe_sec_key_init()

void cfe_dippe_sec_key_init ( cfe_dippe_sec_key sk,
cfe_dippe dippe 
)

Prepares a secret key struct

Parameters
skA pointer to a cfe_dippe_sec_key struct
dippeA pointer to a cfe_dippe struct

◆ cfe_dippe_sec_key_free()

void cfe_dippe_sec_key_free ( cfe_dippe_sec_key sk)

Clears the secret key and frees allocated memory

Parameters
skA pointer to a cfe_dippe_sec_key struct

◆ cfe_dippe_user_sec_key_init()

void cfe_dippe_user_sec_key_init ( cfe_dippe_user_sec_key usk,
cfe_dippe dippe 
)

Prepares a user secret key struct

Parameters
uskA pointer to a cfe_dippe_user_sec_key struct
dippeA pointer to a cfe_dippe struct

◆ cfe_dippe_user_sec_key_free()

void cfe_dippe_user_sec_key_free ( cfe_dippe_user_sec_key usk)

Clears the user secret key and frees allocated memory

Parameters
uskA pointer to a cfe_dippe_user_sec_key struct

◆ cfe_dippe_generate_master_keys()

void cfe_dippe_generate_master_keys ( cfe_dippe_pub_key pk,
cfe_dippe_sec_key sk,
cfe_dippe dippe 
)

Initializes an authority and generates its public and private key

Parameters
pkA pointer to a cfe_dippe_pub_key struct; Represents the public key that is about to be populated
skA pointer to a cfe_dippe_sec_key struct; Represents the secret key that is about to be populated
dippeA pointer to a cfe_dippe struct

◆ cfe_dippe_encrypt()

cfe_error cfe_dippe_encrypt ( cfe_dippe_cipher cipher,
cfe_dippe dippe,
cfe_dippe_pub_key pks[],
size_t  pks_len,
cfe_vec pv,
FP12_BN254 *  msg 
)

Encrypts a given message under the provided policy

Parameters
cipherA pointer to a cfe_dippe_cipher struct; Represents the ciphertext that is about to be populated
dippeA pointer to a cfe_dippe struct
pksAn array containing references to cfe_dippe_pub_key structs;
pks_lenLength of the public key array
pvA reference to a cfe_vec struct; Represents the policy under which the message will be encrypted
msgA reference to a FP12_BN254 struct; Represents the message that is about to be encrypted
Returns
Error code

◆ cfe_dippe_keygen()

cfe_error cfe_dippe_keygen ( cfe_dippe_user_sec_key usk,
cfe_dippe dippe,
size_t  usk_id,
cfe_dippe_pub_key pks[],
size_t  pks_len,
cfe_dippe_sec_key sk,
cfe_vec av,
char *  gid,
size_t  gid_len 
)

Used with an authority's secret key to create a new user secret key for a given attribute vector

Parameters
uskA pointer to a cfe_dippe_user_sec_key struct; Represents the user secret key that is about to be populated
dippeA pointer to a cfe_dippe struct
usk_idIndex of the given attribute vector for which a user secret key will be created
pksAn array containing references to cfe_dippe_pub_key structs
pks_lenLength of the public key array
skSecret key
avA pointer to a cfe_vec struct; Represents the attribute vector
gidString that represents a unique user; Required for collusion prevention
gid_lenLength of gid to prevent non NULL terminated strings
Returns
Error code

◆ cfe_dippe_decrypt()

cfe_error cfe_dippe_decrypt ( FP12_BN254 *  result,
cfe_dippe dippe,
cfe_dippe_user_sec_key usks,
size_t  usks_len,
cfe_dippe_cipher cipher,
cfe_vec av,
char  gid[],
size_t  gid_len 
)

Restores the underlying message of a given ciphertext

Parameters
resultA pointer to a FP12_BN254 struct; Represents the resulting message
dippeA pointer to a cfe_dippe struct
usksAn array containing cfe_dippe_user_sec_key structs; Represents the set of user secretes key used for decryption
usks_lenLength of the user secret key array
cipherA pointer to a cfe_dippe_cipher struct; Represents the ciphertext that is about to be decrypted
avA pointer to a cfe_vec struct; Represents the attribute vector
gidString that represents a unique user; Required for collusion prevention
gid_lenLength of gid to prevent non NULL terminated strings