1 
2 /*
3  * Licensed Materials - Property of IBM
4  *
5  * trousers - An open source TCG Software Stack
6  *
7  * (C) Copyright International Business Machines Corp. 2006
8  *
9  */
10 
11 #ifndef DAA_PARAMETER_H_
12 #define DAA_PARAMETER_H_
13 
14 // for message digest
15 //#include <openssl/evp.h>
16 #include "trousers/tss.h"
17 //#include "spi_internal_types.h"
18 #include "spi_utils.h"
19 
20 #define DAA_PARAM_TSS_VERSION_LENGTH (4)
21 static const BYTE DAA_PARAM_TSS_VERSION[] =  { 1, 2, 0, 0 };
22 
23 #define DAA_PARAM_DEFAULT_CRYPTO_PROVIDER_NAME "BC"
24 
25 // Name of default hash function
26 #define DAA_PARAM_MESSAGE_DIGEST_ALGORITHM "SHA1"
27 
28 //  Name of hash function used independently in TSS
29 #define DAA_PARAM_MESSAGE_DIGEST_ALGORITHM_TSS "SHA1"
30 
31 // l_n (bits)
32 #define DAA_PARAM_SIZE_RSA_MODULUS (2048)
33 
34 // l_f (bits)
35 #define DAA_PARAM_SIZE_F_I (104)
36 
37 // l_q  (2 * SIZE_F_I)
38 #define DAA_PARAM_SIZE_RHO (208)
39 
40 // l_e
41 #define DAA_PARAM_SIZE_EXPONENT_CERTIFICATE (368)
42 
43 // lPrime_e
44 #define DAA_PARAM_SIZE_INTERVAL_EXPONENT_CERTIFICATE (120)
45 
46 // l_zero
47 #define DAA_PARAM_SAFETY_MARGIN (80)
48 
49 //  Byte length of TPM message digest (sha-1)
50 #define DAA_PARAM_LENGTH_MESSAGE_DIGEST (20)
51 
52 //  Byte length of TSS message digest (sha-256)
53 #define DAA_PARAM_LENGTH_MESSAGE_DIGEST_TSS (32)
54 
55 //  l_H depends on the message digest algo
56 #define DAA_PARAM_SIZE_MESSAGE_DIGEST (160)
57 // 8 * LENGTH_MESSAGE_DIGEST;
58 
59 //   l_GAMMA
60 #define DAA_PARAM_SIZE_MODULUS_GAMMA (1632)
61 
62 #define DAA_PARAM_SIZE_SPLIT_EXPONENT (1024)
63 
64 // TPM asym key size (bits)
65 #define DAA_PARAM_KEY_SIZE (2048)
66 
67 //  Default RSA public key exponent (Fermat 4)
68 #define DAA_PARAM_LENGTH_MFG1_ANONYMITY_REVOCATION (25)
69 // (SIZE_RHO-1)/8;
70 
71 #define DAA_PARAM_LENGTH_MFG1_GAMMA (214)
72 // (SIZE_MODULUS_GAMMA + SIZE_SAFETY_MARGIN)/8;
73 
74 #define DAA_PARAM_SIZE_RND_VALUE_CERTIFICATE (2536)
75 
76 // (bits)
77 #define DAA_PARAM_SIZE_RANDOMIZED_ATTRIBUTES (DAA_PARAM_SIZE_F_I+DAA_PARAM_SAFETY_MARGIN+DAA_PARAM_SIZE_MESSAGE_DIGEST)
78 
79 #define TSS_FLAG_DAA_SIGN_IDENTITY_KEY 0
80 #define TSS_FLAG_DAA_SIGN_MESSAGE_HASH 1
81 
82 
83 extern EVP_MD *DAA_PARAM_get_message_digest(void);
84 
85 extern char *err_string(TSS_RESULT r);
86 
87 #endif /*DAA_PARAMETER_H_*/
88