xref: /netbsd-src/crypto/external/cpl/trousers/dist/src/include/daa/verifier.h (revision 1023804e3833a0bd94414f2545512128f6502c74)
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 VERIFIER_H_
12 #define VERIFIER_H_
13 
14 #include "bi.h"
15 #include "daa_structs.h"
16 #include "anonymity_revocation.h"
17 #include "daa_parameter.h"
18 #include "tsplog.h"
19 
20 /*
21  * Transaction of a DAA Verifier to verify a signature (VerifierTransaction.java)
22  */
23 typedef struct {
24 	BYTE *baseName;
25 	int baseName_length;
26 	EVP_MD *digest;
27 	BYTE *nonce;
28 	int nonce_length;
29 	int is_anonymity_revocation_enabled; // boolean
30 	BYTE *anonymity_revocation_condition;
31 	int anonymity_revocation_condition_length;
32 	CS_PUBLIC_KEY *anonymity_revocator_pk;
33 	// private TssDaaSelectedAttrib[] selectedAttributes2Commit;
34 	TSS_DAA_SELECTED_ATTRIB **selected_attributes2commit;
35 	int selected_attributes2commitLength;
36 } DAA_VERIFIER_TRANSACTION;
37 
38 /* the return (BYTE *) should be free after usage */
39 BYTE *compute_bytes( int seedLength, BYTE *seed, int length, const EVP_MD *digest);
40 
41 bi_ptr compute_zeta( int nameLength, unsigned char *name, TSS_DAA_PK_internal *issuer_pk);
42 
43 bi_ptr project_into_group_gamma( bi_ptr base, TSS_DAA_PK_internal *issuer_pk);
44 #if 0
45 TSPICALL Tspi_DAA_VerifyInit_internal
46 (
47 	TSS_HDAA hDAA,	// in
48 	UINT32* nonceVerifierLength,	// out
49 	BYTE** nonceVerifier,	// out
50 	UINT32 baseNameLength,	// out
51 	BYTE ** baseName		// out
52 );
53 
54 TSPICALL Tspi_DAA_VerifySignature_internal
55 (	TSS_HDAA hDAA,	// in
56 	TSS_DAA_SIGNATURE signature, // in
57 	TSS_HKEY hPubKeyIssuer,	// in
58 	TSS_DAA_SIGN_DATA sign_data,	// in
59 	UINT32 attributes_length,	// in
60 	BYTE **attributes,	// in
61 	UINT32 nonce_verifierLength,	// out
62 	BYTE *nonce_verifier,	// out
63 	UINT32 base_nameLength,	// out
64 	BYTE *base_name,	// out
65 	TSS_BOOL *isCorrect	// out
66 );
67 #else
68 TSS_RESULT
69 Tspi_DAA_VerifySignature
70 (
71     TSS_HDAA_CREDENTIAL           hDAACredential,                // in
72     TSS_HDAA_ISSUER_KEY           hIssuerKey,                    // in
73     TSS_HDAA_ARA_KEY              hARAKey,                       // in
74     TSS_HHASH                     hARACondition,                 // in
75     UINT32                        attributesLength,              // in
76     UINT32                        attributesLength2,             // in
77     BYTE**                        attributes,                    // in
78     UINT32                        verifierNonceLength,           // in
79     BYTE*                         verifierNonce,                 // in
80     UINT32                        verifierBaseNameLength,        // in
81     BYTE*                         verifierBaseName,              // in
82     TSS_HOBJECT                   signData,                      // in
83     TSS_DAA_SIGNATURE*            daaSignature,                  // in
84     TSS_BOOL*                     isCorrect                      // out
85 );
86 
87 #endif
88 
89 BYTE *compute_sign_challenge_host(
90 	int *result_length,
91 	EVP_MD *digest,
92 	TSS_DAA_PK_internal *issuer_pk,
93 	int nonce_verifierLength,
94 	BYTE *nonce_verifier,
95 	int selected_attributes2commitLength,
96 	TSS_DAA_SELECTED_ATTRIB **selected_attributes2commit,
97 	int is_anonymity_revocation_enabled,
98 	bi_ptr zeta,
99 	bi_ptr capital_t,
100 	bi_ptr capital_tilde,
101 	int attribute_commitmentsLength,
102 	TSS_DAA_ATTRIB_COMMIT_internal **attribute_commitments,
103 	TSS_DAA_ATTRIB_COMMIT_internal **attribute_commitment_proofs,
104 	bi_ptr capital_nv,
105 	bi_ptr capital_tilde_v,
106 	CS_PUBLIC_KEY *anonymity_revocator_pk,
107 	CS_ENCRYPTION_RESULT *encryption_result_rand,
108 	CS_ENCRYPTION_RESULT *encryption_result_proof);
109 
110 #endif /*VERIFIER_H_*/
111