14#define PROJECT_NAME "IdSignature"
17#define DEFAULT_SEC_LVL 80
18#define DEFAULT_HASH_TYPE sha_1
22 "Usage: %s [options] <operation> [<input data> ...]\n\
23Use -h to know more informations\n\
25\tsetup - generate all the parameters for the scheme and outputs them\n\
26\tkeygen <pairing params> <identity> [identity ...] - generate a new key pair for the provided identities\n\
27\tdelegate <pairing params> <key> <from> <to> - generate a delegation for the 'to' identity made valid through the use of the secret key belonging to the 'from' identity\n\
28\tdel_verify <pairing params> <delegation file> - checks if the delegation in the provided file is valid\n\
29\tpk_gen <pairing params> <key> <delegation file> - generate a signing key the delegated user can use to sign on behalf of the original user\n\
30\tp_sign <pairing params> <delegation file> <p_sig file> <message> - sign the provided message with the proxy key in the provided file\n\
31\tsign_verify <pairing params> <delegation file> <signature file> - verify the signature in the provided file\n"
35 "---------------------------------------------------------------------\n\
36" PROJECT_NAME ", version " VERSION "\n\
38---------------------------------------------------------------------\n\
40\tsetup - generate all the parameters for the scheme and outputs them\n\
41\tkeygen <pairing params> <identity> [identity ...] - generate a new key pair for the provided identities\n\
42\tdelegate <pairing params> <key> <from> <to> - generate a delegation for the 'to' identity made valid through the use of the secret key belonging to the 'from' identity\n\
43\tdel_verify <pairing params> <delegation file> - checks if the delegation in the provided file is valid\n\
44\tpk_gen <pairing params> <key> <delegation file> - generate a signing key the delegated user can use to sign on behalf of the original user\n\
45\tp_sign <pairing params> <delegation file> <p_sig file> <message> - sign the provided message with the proxy key in the provided file\n\
46\tsign_verify <pairing params> <delegation file> <signature file> - verify the signature in the provided file\n\
47---------------------------------------------------------------------\n\
49\t-h - shows the help tooltip\n\
50\t-v - use verbose output\n\
51\t-p - use precomputation where possible\n\
52\t-i - use the improved version of the scheme\n\
53\t-a - hash algorithm [sha1, sha256, sha512] (sha1)\n\
54\t-l - security level (80)\n\
55\t-o - redirect output of the application to this file\n\
56\t-s - if set, use the seed for random functions\n"
59#define VERBOSE_PRINT(...) \
62 printf(__VA_ARGS__); \
65#define VERBOSE_PRINT(...)
68#define PARAMS_ERROR(expected, actual, argv) \
69 if (actual < expected) \
71 fprintf(stderr, "Expected %d parameters, got %d\n", expected, actual); \
72 fprintf(stderr, USAGE, argv[0]); \