Improved ID-based Proxy Signature Scheme with Message Recovery
Improved version provided by Caixue Zhou of the Singh and Verma’s proxy signature scheme with message recovery.
|
Header file containing the data structures used by the scheme and the functions used to manage them. More...
Go to the source code of this file.
Data Structures | |
struct | sv_public_params_struct |
struct | sv_secret_params_struct |
struct | sv_user_struct |
struct | warrant_struct |
struct | delegation_struct |
struct | proxy_signature_struct |
Typedefs | |
typedef uint8_t | sv_identity_t[IDENTITY_SIZE] |
typedef uint8_t | serialized_warrant_t[WARRANT_SIZE] |
typedef struct sv_public_params_struct * | sv_public_params_ptr |
typedef struct sv_public_params_struct | sv_public_params_t[1] |
typedef struct sv_secret_params_struct * | sv_secret_params_ptr |
typedef struct sv_secret_params_struct | sv_secret_params_t[1] |
typedef struct sv_user_struct * | sv_user_ptr |
typedef struct sv_user_struct | sv_user_t[1] |
typedef struct warrant_struct * | warrant_ptr |
typedef struct warrant_struct | warrant_t[1] |
typedef struct delegation_struct * | delegation_ptr |
typedef struct delegation_struct | delegation_t[1] |
typedef struct proxy_signature_struct * | proxy_signature_ptr |
typedef struct proxy_signature_struct | proxy_signature_t[1] |
Enumerations | |
enum | hash_type_t { sha_1 , sha_256 , sha_512 } |
Functions | |
long | read_binary_file (uint8_t **data, const char file_path[]) |
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 are set to 0, so it is easy to check if they have been extracted. More... | |
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. Both the secret and public keys are set to 0, so it is easy to check if they have been extracted. More... | |
void | delegation_init (delegation_t w, sv_public_params_t public_p) |
Initialize the warrant struct. Make sure all elements are initialized. More... | |
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. More... | |
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 storage of the warrant. More... | |
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. More... | |
int | serialize_delegation (uint8_t **data, delegation_t w) |
Serialize the delegation structure converting it into a byte array. The buffer is allocated inside the function and must be freed by the caller. More... | |
void | deserialize_delegation (delegation_t w, uint8_t data[]) |
Read a serialized delegation from a buffer and deserialize it, obtaining a delegation structure. More... | |
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. More... | |
void | delegation_printf (delegation_t w) |
Print the delegation structure to stdout in binary format. More... | |
void | delegation_fprintf (FILE *stream, delegation_t w) |
Print the delegation structure to the provided stream in binary format. More... | |
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 inside the function and must be freed by the caller. More... | |
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 structure. More... | |
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 structure. More... | |
void | proxy_signature_printf (proxy_signature_t p_sign) |
Print the proxy signature structure to stdout in binary format. More... | |
void | proxy_signature_fprintf (FILE *stream, proxy_signature_t p_sign) |
Print the proxy signature structure to the provided stream in binary format. More... | |
void | public_param_clear (sv_public_params_t public_p) |
Clear the public param struct. Makes sure all elements are cleared. More... | |
void | secret_param_clear (sv_secret_params_t secret_p) |
Clear the secret param struct. Make sure all elements are cleared. More... | |
void | user_clear (sv_user_t user) |
Clear the user struct. Make sure all elements are cleared. More... | |
void | delegation_clear (delegation_t w) |
Clear the warrant struct. Make sure all elements are cleared. More... | |
void | proxy_signature_clear (proxy_signature_t p_sig) |
Clear the proxy signature struct. Make sure all elements are cleared. More... | |
Header file containing the data structures used by the scheme and the functions used to manage them.
void delegation_clear | ( | delegation_t | w | ) |
Clear the warrant struct. Make sure all elements are cleared.
w | Warrant to be cleared. |
void delegation_fprintf | ( | FILE * | stream, |
delegation_t | w | ||
) |
Print the delegation structure to the provided stream in binary format.
stream | file stream where to print the delegation structure. |
w | delegation structure to be printed. |
void delegation_init | ( | delegation_t | w, |
sv_public_params_t | public_p | ||
) |
Initialize the warrant struct. Make sure all elements are initialized.
w | Warrant to be initialized. |
public_p | Public parameters of the scheme. |
void delegation_printf | ( | delegation_t | w | ) |
Print the delegation structure to stdout in binary format.
w | delegation structure to be printed. |
void deserialize_delegation | ( | delegation_t | w, |
uint8_t | data[] | ||
) |
Read a serialized delegation from a buffer and deserialize it, obtaining a delegation structure.
w | delegation structure read from the buffer. |
data | buffer containing the serialized delegation. |
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.
w | delegation structure read from the file. |
file_path | path to the file containing the serialized delegation. |
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 structure.
p_sign | proxy signature structure read from the buffer. |
data | buffer containing the serialized proxy signature. |
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 structure.
p_sig | proxy signature structure read from the file. |
file_path | path to the file containing the serialized proxy signature. |
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.
m | warrant structure to be serialized. |
buffer | buffer to store the serialized warrant. |
void proxy_signature_clear | ( | proxy_signature_t | p_sig | ) |
Clear the proxy signature struct. Make sure all elements are cleared.
p_sig | Proxy signature to be cleared. |
void proxy_signature_fprintf | ( | FILE * | stream, |
proxy_signature_t | p_sign | ||
) |
Print the proxy signature structure to the provided stream in binary format.
stream | file stream where to print the proxy signature structure. |
p_sign | proxy signature structure to be printed. |
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.
p_sig | Proxy signature to be initialized. |
public_p | Public parameters of the scheme. |
void proxy_signature_printf | ( | proxy_signature_t | p_sign | ) |
Print the proxy signature structure to stdout in binary format.
p_sign | proxy signature structure to be printed. |
void public_param_clear | ( | sv_public_params_t | public_p | ) |
Clear the public param struct. Makes sure all elements are cleared.
public_p | Public parameters of the scheme to be cleared. |
void secret_param_clear | ( | sv_secret_params_t | secret_p | ) |
Clear the secret param struct. Make sure all elements are cleared.
secret_p | Secret parameters of the scheme to be cleared. |
int serialize_delegation | ( | uint8_t ** | data, |
delegation_t | w | ||
) |
Serialize the delegation structure converting it into a byte array. The buffer is allocated inside the function and must be freed by the caller.
data | newly allocated buffer containing the serialized delegation. |
w | delegation structure to be serialized. |
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 inside the function and must be freed by the caller.
data | buffer to store the serialized proxy signature. |
p_sign | proxy signature structure to be serialized. |
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 storage of the warrant.
buffer | buffer to store the serialized warrant. It must be at least IDENTITY_SIZE * 2 bytes long. |
m | warrant structure to be serialized. |
void user_clear | ( | sv_user_t | user | ) |
Clear the user struct. Make sure all elements are cleared.
user | User to be cleared. |
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 are set to 0, so it is easy to check if they have been extracted.
user | User to be initialized. |
identity | Identity of the user. |
public_p | Public parameters of the scheme. |
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. Both the secret and public keys are set to 0, so it is easy to check if they have been extracted.
user | User to be initialized. |
identity | Identity of the user represented as a string. |
public_p | Public parameters of the scheme. |