11 static const char * _message =
"Hello world";
12 static char * message;
13 static int key_size = 1024;
20 message = strdup(_message);
23 while((opt = getopt(argc, argv,
"m:k:l:s:")) != -1){
27 message = strdup(optarg);
30 k = strtol(optarg, NULL, 10);
33 l = strtol(optarg, NULL, 10);
36 key_size = strtol(optarg, NULL, 10);
44 int main(
int argc,
char ** argv)
56 printf(
"Document: %s\n", b64);
61 for (
int i=0; i<l; i++) {
62 signatures[i] =
tc_node_sign(shares[i], doc_pkcs1, info);
72 printf(
"Signature: %s\n", b64);
77 for(
int i=0; i<l; i++) {
bytes_t * tc_prepare_document(const bytes_t *doc, tc_hash_type_t hash_type, const key_metainfo_t *metainfo)
void set_parameters(int argc, char **argv)
void tc_clear_bytes(bytes_t *bytes)
void tc_clear_key_metainfo(key_metainfo_t *info)
char * tc_bytes_b64(const bytes_t *b)
Structure that's stores a pointer that points to data_len bytes.
Structure that represents a signature share, to be joined generating a standard RSA signatures...
signature_share_t * tc_node_sign(const key_share_t *share, const bytes_t *doc, const key_metainfo_t *info)
void tc_clear_bytes_n(bytes_t *bytes,...)
int tc_verify_signature(const signature_share_t *signature, const bytes_t *doc, const key_metainfo_t *info)
void tc_clear_key_shares(key_share_t **shares, key_metainfo_t *info)
Structure that represents one key share, to be used to generate a signature share.
key_share_t ** tc_generate_keys(key_metainfo_t **out, size_t bit_size, uint16_t k, uint16_t l, bytes_t *public_e)
int tc_rsa_verify(bytes_t *signature, bytes_t *doc, key_metainfo_t *info, tc_hash_type_t hashtype)
bytes_t * tc_join_signatures(const signature_share_t **signatures, const bytes_t *document, const key_metainfo_t *info)
int main(int argc, char **argv)
bytes_t * tc_init_bytes(void *bs, size_t len)
void tc_clear_signature_share(signature_share_t *ss)