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 functions used by both scheme's implementations. More...
#include <string.h>
#include <assert.h>
#include <pbc/pbc.h>
#include <nettle/sha1.h>
#include <nettle/sha2.h>
#include "data.h"
Go to the source code of this file.
Functions | |
unsigned int | non_generic_dlog_secure_size_by_security_level (unsigned int sec_lvl) |
Get the size of the non generic dlog secure size based on the NIST suggestions. More... | |
uint16_t | hash (uint8_t digest[MAX_DIGEST_SIZE], const void *data, size_t len, hash_type_t hash_type) |
Generate the digest of the data using the hash_type algorithm. More... | |
uint16_t | hash_element (uint8_t digest[MAX_DIGEST_SIZE], element_t e, hash_type_t hash_type) |
Generate the digest of the element using the hash_type algorithm. More... | |
void | hash_warrant_and_r (element_t h, element_t r, warrant_t m, hash_type_t hash_type) |
hash both the warrant and the random value r and return the result in h, an element of Zq*. More... | |
void | calculate_beta (uint8_t beta[], const uint8_t msg[], size_t msg_size, sv_public_params_t public_p) |
Calculate the value of beta. Starting from the message to be signed and the public parameters of the scheme, beta is obtained as: beta = F1(msg) || F2(F1(msg)) (+) msg) More... | |
void | params_init (pbc_param_t pairings_p, int sec_lvl) |
Initialize the pairings parameters. More... | |
void | setup (sv_public_params_t public_p, sv_secret_params_t secret_p, int sec_lvl, hash_type_t hash_type) |
Initialization function for the scheme. It takes as input a security parameter lambda and the hash function to use. It will take care of generating the parameters of the pairing. Produces the master key msk and the system's parameters (G1, G2, H0, H1, H2, F1, F2, e, P, pk, q, l1, l2). More... | |
void | setup_from_params (sv_public_params_t public_p, sv_secret_params_t secret_p, hash_type_t hash_type, pbc_param_t pairing_p) |
Initialization function for the scheme. It takes as input the hash function to use and the parameters of the pairing. Produces the master key msk and the system's parameters (G1, G2, H0, H1, H2, F1, F2, e, P, pk, q, l1, l2). More... | |
void | setup_from_str (sv_public_params_t public_p, sv_secret_params_t secret_p, char pairing_p_str[]) |
Initialization function for the scheme. It takes as input the string representation of the parameters of the pairing, as well as the hash function to use. Produces the master key msk and the system's parameters (G1, G2, H0, H1, H2, F1, F2, e, P, pk, q, l1, l2). More... | |
void | public_params_pp (sv_public_params_t public_p) |
Apply all possible precomputations on the public parameters. More... | |
void | extract_p (sv_user_t user, sv_public_params_t public_p) |
Produces the public key pk_id from an identity. It uses the hash function H0 to map the any string {0, 1}*, representing the identity, to an element of G1: pk_id = H0(identity). More... | |
void | extract_s (sv_user_t user, sv_secret_params_t secret_p) |
Produces the secret key sk_id from an identity. It uses the hash function H0 to map the any string {0, 1}*, representing the identity, to an element of G1. Then multiplies the master key sk with the result of the hash function: sk_id = sk * H0(identity). More... | |
void | delegate (delegation_t w, sv_user_t from, sv_user_t to, sv_public_params_t public_p) |
Delegates the right to sign messages to the identity id. The original signer selects k in Zq* and computes the following values: More... | |
int | del_verify (delegation_t w, sv_public_params_t public_p) |
Verifies the validity of a delegation. After receiving the delegation W = (m, r, S), the verifier computes the following values: More... | |
void | pk_gen (element_t k_sign, sv_user_t user, delegation_t w, sv_public_params_t public_p) |
Produces a proxy signing key from a delegation. If the delegate used accepts the delegation, it can produce a proxy signing key. It does so by computing the following values: More... | |
Header file containing the functions used by both scheme's implementations.
void calculate_beta | ( | uint8_t | beta[], |
const uint8_t | msg[], | ||
size_t | msg_size, | ||
sv_public_params_t | public_p | ||
) |
Calculate the value of beta. Starting from the message to be signed and the public parameters of the scheme, beta is obtained as: beta = F1(msg) || F2(F1(msg)) (+) msg)
beta | output of the hash function. |
msg | message to be hashed. |
msg_size | size of the message to be signed in bytes. |
public_p | public parameters of the scheme. |
int del_verify | ( | delegation_t | w, |
sv_public_params_t | public_p | ||
) |
Verifies the validity of a delegation. After receiving the delegation W = (m, r, S), the verifier computes the following values:
w | delegation to be verified. |
public_p | All the public parameters of the scheme. |
identity
user (1) or not (0). void delegate | ( | delegation_t | w, |
sv_user_t | from, | ||
sv_user_t | to, | ||
sv_public_params_t | public_p | ||
) |
Delegates the right to sign messages to the identity id. The original signer selects k in Zq* and computes the following values:
w | delegation to be created. |
from | user creating a delegation. The sk must be initialized. |
to | user receiving the delegation. |
public_p | All the public parameters of the scheme. |
void extract_p | ( | sv_user_t | user, |
sv_public_params_t | public_p | ||
) |
Produces the public key pk_id from an identity. It uses the hash function H0 to map the any string {0, 1}*, representing the identity, to an element of G1: pk_id = H0(identity).
user | User struct that will contain the public key. |
public_p | All the public parameters of the scheme. |
void extract_s | ( | sv_user_t | user, |
sv_secret_params_t | secret_p | ||
) |
Produces the secret key sk_id from an identity. It uses the hash function H0 to map the any string {0, 1}*, representing the identity, to an element of G1. Then multiplies the master key sk with the result of the hash function: sk_id = sk * H0(identity).
user | User struct that will contain the secret key. |
secret_p | All the secret parameters of the user. |
uint16_t hash | ( | uint8_t | digest[MAX_DIGEST_SIZE], |
const void * | data, | ||
size_t | len, | ||
hash_type_t | hash_type | ||
) |
Generate the digest of the data using the hash_type algorithm.
digest | ouput digest obtained by applying the hash_type algorithm to data. |
data | data to be hashed. |
len | length of the data buffer in bytes. |
hash_type | hash algorithm to be used. |
uint16_t hash_element | ( | uint8_t | digest[MAX_DIGEST_SIZE], |
element_t | e, | ||
hash_type_t | hash_type | ||
) |
Generate the digest of the element using the hash_type algorithm.
digest | output digest obtained by applying the hash_type algorithm to the element. |
e | element to be hashed. |
hash_type | hash algorithm to be used. |
void hash_warrant_and_r | ( | element_t | h, |
element_t | r, | ||
warrant_t | m, | ||
hash_type_t | hash_type | ||
) |
hash both the warrant and the random value r and return the result in h, an element of Zq*.
h | element of Zq* where the hash is stored. |
r | element r that will be hashed. |
m | warrant to be hashed. |
hash_type | hash algorithm to be used. |
unsigned int non_generic_dlog_secure_size_by_security_level | ( | unsigned int | sec_lvl | ) |
Get the size of the non generic dlog secure size based on the NIST suggestions.
sec_lvl | security expressed as a number of bits. |
void params_init | ( | pbc_param_t | pairings_p, |
int | sec_lvl | ||
) |
Initialize the pairings parameters.
pairings_p | Structure where the parameters are stored. |
sec_lvl | The security level the scheme is expected to have. |
void pk_gen | ( | element_t | k_sign, |
sv_user_t | user, | ||
delegation_t | w, | ||
sv_public_params_t | public_p | ||
) |
Produces a proxy signing key from a delegation. If the delegate used accepts the delegation, it can produce a proxy signing key. It does so by computing the following values:
k_sign | proxy signing key to be created. |
user | delegated user who wants to sign a message. The sk must be initialized. |
w | delegation that validates the proxy signing key. |
public_p | All the public parameters of the scheme. |
void public_params_pp | ( | sv_public_params_t | public_p | ) |
Apply all possible precomputations on the public parameters.
public_p | All the public parameters of the scheme. |
void setup | ( | sv_public_params_t | public_p, |
sv_secret_params_t | secret_p, | ||
int | sec_lvl, | ||
hash_type_t | hash_type | ||
) |
Initialization function for the scheme. It takes as input a security parameter lambda and the hash function to use. It will take care of generating the parameters of the pairing. Produces the master key msk and the system's parameters (G1, G2, H0, H1, H2, F1, F2, e, P, pk, q, l1, l2).
public_p | All the public parameters created through the setup. |
secret_p | Secret parameters created through the setup. |
sec_lvl | The security level the scheme is expected to have. |
hash_type | The hash function used by the scheme. |
void setup_from_params | ( | sv_public_params_t | public_p, |
sv_secret_params_t | secret_p, | ||
hash_type_t | hash_type, | ||
pbc_param_t | pairing_p | ||
) |
Initialization function for the scheme. It takes as input the hash function to use and the parameters of the pairing. Produces the master key msk and the system's parameters (G1, G2, H0, H1, H2, F1, F2, e, P, pk, q, l1, l2).
public_p | All the public parameters created through the setup. |
secret_p | Secret parameters created through the setup. |
hash_type | The hash function used by the scheme. |
pairing_p | Parameters of the pairing. |
void setup_from_str | ( | sv_public_params_t | public_p, |
sv_secret_params_t | secret_p, | ||
char | pairing_p_str[] | ||
) |
Initialization function for the scheme. It takes as input the string representation of the parameters of the pairing, as well as the hash function to use. Produces the master key msk and the system's parameters (G1, G2, H0, H1, H2, F1, F2, e, P, pk, q, l1, l2).
public_p | All the public parameters created through the setup. |
secret_p | Secret parameters created through the setup. |
pairing_p_str | String representation of the parameters of the pairing. |