14#define IDENTITY_SIZE 32
15#define WARRANT_SIZE 64
16#define MAX_DIGEST_SIZE 64
17#define MAX_PARAM_LINE_SIZE 4096
18#define generic_dlog_secure_size_by_security_level(level) ((level)*2)
19#define STR_IDENTITY_SIZE(string) strlen(string) > IDENTITY_SIZE ? IDENTITY_SIZE : strlen(string)
28typedef uint8_t sv_identity_t[IDENTITY_SIZE];
29typedef uint8_t serialized_warrant_t[WARRANT_SIZE];
39 hash_type_t hash_type;
95long read_binary_file(uint8_t **data,
const char file_path[]);
106void user_init(sv_user_t user,
const sv_identity_t identity, sv_public_params_t public_p);
117void user_init_str(sv_user_t user,
const char identity[], sv_public_params_t public_p);
void delegation_init(delegation_t w, sv_public_params_t public_p)
Initialize the warrant struct. Make sure all elements are initialized.
Definition: data.c:43
void public_param_clear(sv_public_params_t public_p)
Clear the public param struct. Makes sure all elements are cleared.
Definition: data.c:174
void delegation_printf(delegation_t w)
Print the delegation structure to stdout in binary format.
Definition: data.c:104
int serialize_delegation(uint8_t **data, delegation_t w)
Serialize the delegation structure converting it into a byte array. The buffer is allocated inside th...
Definition: data.c:70
void proxy_signature_printf(proxy_signature_t p_sign)
Print the proxy signature structure to stdout in binary format.
Definition: data.c:160
void user_clear(sv_user_t user)
Clear the user struct. Make sure all elements are cleared.
Definition: data.c:194
void user_init(sv_user_t user, const sv_identity_t identity, sv_public_params_t public_p)
Initialize the user struct. Make sure all elements are initialized. Both the secret and public keys a...
Definition: data.c:24
void deserialize_delegation(delegation_t w, uint8_t data[])
Read a serialized delegation from a buffer and deserialize it, obtaining a delegation structure.
Definition: data.c:84
void deserialize_delegation_from_file(delegation_t w, const char file_path[])
Read a serialized delegation from a file and deserialize it, obtaining a delegation structure.
Definition: data.c:94
void user_init_str(sv_user_t user, const char identity[], sv_public_params_t public_p)
Initialize the user struct using a string as identity. Make sure all elements are initialized....
Definition: data.c:35
void deserialize_proxy_signature(proxy_signature_t p_sign, uint8_t data[])
Read a serialized proxy signature from a buffer and deserialize it, obtaining a proxy signature struc...
Definition: data.c:135
void proxy_signature_init(proxy_signature_t p_sig, sv_public_params_t public_p)
Initialize the proxy signature struct. Make sure all elements are initialized.
Definition: data.c:49
uint16_t deserialize_warrant(warrant_t m, const uint8_t buffer[WARRANT_SIZE])
Deserialize a warrant structure converting it from a byte array to a warrant structure.
Definition: data.c:63
void delegation_clear(delegation_t w)
Clear the warrant struct. Make sure all elements are cleared.
Definition: data.c:202
void deserialize_proxy_signature_from_file(proxy_signature_t p_sig, const char file_path[])
Read a serialized proxy signature from a file and deserialize it, obtaining a proxy signature structu...
Definition: data.c:150
uint16_t serialize_warrant(uint8_t buffer[WARRANT_SIZE], const warrant_t m)
Serialize a warrant structure converting it into a byte array. This allows for easy hashing and stora...
Definition: data.c:56
int serialize_proxy_signature(uint8_t **data, proxy_signature_t p_sign)
Serialize the proxy signature structure converting it into a byte array. The buffer is allocated insi...
Definition: data.c:118
void proxy_signature_clear(proxy_signature_t p_sig)
Clear the proxy signature struct. Make sure all elements are cleared.
Definition: data.c:208
void delegation_fprintf(FILE *stream, delegation_t w)
Print the delegation structure to the provided stream in binary format.
Definition: data.c:109
void secret_param_clear(sv_secret_params_t secret_p)
Clear the secret param struct. Make sure all elements are cleared.
Definition: data.c:189
void proxy_signature_fprintf(FILE *stream, proxy_signature_t p_sign)
Print the proxy signature structure to the provided stream in binary format.
Definition: data.c:165
Header file containing some utility macros and constants.
void p_sign(proxy_signature_t p_sig, element_t k_sign, delegation_t w, const uint8_t msg[], size_t msg_size, sv_public_params_t public_p)
The proxy signer signs a message m. After choosing a random k in Zq*, the proxy signer computes the f...
Definition: sv-scheme.c:3