aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc A. Valle <marc.a.valle@intel.com>2017-09-15 09:46:09 -0700
committerMarc A. Valle <marc.a.valle@intel.com>2017-09-15 09:46:09 -0700
commit7a6547c302e0428d67d928ffd4997517f46174a5 (patch)
treec0eadb06eb6db1bbc3cde8c78dff496e5ecfd740
parent7d315f0c34d097074bd89cb2722449abee5cc884 (diff)
downloadepid-sdk-7a6547c302e0428d67d928ffd4997517f46174a5.tar.gz
Release SDK 5.0.0
Added * The member implementation now has the option to support signing using a TPM, using the ECDAA capabilities of TPM 2.0. Changed * Member API updated to unify HW and SW use cases. * Added * `ProvisionKey` * `ProvisionCompressed` * `ProvisionCredential` * `Startup` * Parameters changed * `MemberCreate` * `RequestJoin` * Removed or made private * `WritePrecomp` * `SignBasic` * `NrProve` * `AssemblePrivKey` * `EpidRequestJoin` was renamed to `EpidCreateJoinRequest` to make it clear that it is not directly communicating with the issuer. Fixed * `EpidCreateJoinRequest` creates valid join requests. This fixes a regression in `EpidRequestJoin` introduced in 4.0.0. Known Issues * Only the SHA-256 hash algorithm is supported when using the SDK with the IBM TPM simulator due to a defect in version 532 of the simulator. * Basenames are limited to 124 bytes in TPM mode.
-rw-r--r--CHANGELOG.md44
-rw-r--r--Makefile.in68
-rw-r--r--SConstruct67
-rw-r--r--configure.ac36
-rw-r--r--doc/html/1_81_2file__parser_8h.html6
-rw-r--r--doc/html/1_81_2types_8h.html2
-rw-r--r--doc/html/Basenames.html8
-rw-r--r--doc/html/BuildToolsInstallation.html2
-rw-r--r--doc/html/BuildingSdk.html7
-rw-r--r--doc/html/ChangeLog.html44
-rw-r--r--doc/html/EpidOverview.html69
-rw-r--r--doc/html/Glossary.html6
-rw-r--r--doc/html/HowValidated.html2
-rw-r--r--doc/html/ImplementationNotes.html2
-rw-r--r--doc/html/IssuerMaterial.html58
-rw-r--r--doc/html/LegalInformation.html2
-rw-r--r--doc/html/Provisioning.html138
-rw-r--r--doc/html/Revocation.html2
-rw-r--r--doc/html/SdkOverview.html44
-rw-r--r--doc/html/SignVerifyTutorial.html9
-rw-r--r--doc/html/TpmConsiderations.html222
-rw-r--r--doc/html/UserManual_GeneratingAnIntelEpidSignature.html43
-rw-r--r--doc/html/UserManual_VerifyingAnIntelEpidSignature.html8
-rw-r--r--doc/html/UsingiKGF.html (renamed from doc/html/ChoosingiKGF.html)51
-rw-r--r--doc/html/annotated.html16
-rw-r--r--doc/html/base_name.pngbin0 -> 43384 bytes
-rw-r--r--doc/html/basenames_8dox.html2
-rw-r--r--doc/html/bignum_8h.html4
-rw-r--r--doc/html/bitsupplier_8h.html2
-rw-r--r--doc/html/build__tools__installation_8dox.html2
-rw-r--r--doc/html/building__sdk_8dox.html2
-rw-r--r--doc/html/classes.html37
-rw-r--r--doc/html/commit_8c.html135
-rw-r--r--doc/html/commit_8h.html (renamed from doc/html/presig_8h.html)24
-rw-r--r--doc/html/context_8c.html174
-rw-r--r--doc/html/context_8h.html39
-rw-r--r--doc/html/conversion_8c.html309
-rw-r--r--doc/html/conversion_8h.html326
-rw-r--r--doc/html/createprimary_8c.html135
-rw-r--r--doc/html/createprimary_8h.html129
-rw-r--r--doc/html/dir_02c945662023679b89476bd7126bc985.html2
-rw-r--r--doc/html/dir_0d59f1b8006345e373e07b4691e0da76.html (renamed from doc/html/dir_6048dbb18cb271412de4a010207fd345.html)42
-rw-r--r--doc/html/dir_12b90d9c027aaf878a834df729679a56.html2
-rw-r--r--doc/html/dir_512d3e62841a8535b716ec4cf8b9e950.html8
-rw-r--r--doc/html/dir_a32be19bc88f3d7aac6b7249da379f26.html4
-rw-r--r--doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html117
-rw-r--r--doc/html/dir_ef364879bae02db2684040178ed9b186.html2
-rw-r--r--doc/html/dir_f169ebf8da29290a918fa4b3f7151050.html2
-rw-r--r--doc/html/dir_f6bef457d5f671b6e774bfccc16651f6.html4
-rw-r--r--doc/html/ecdsa_8h.html4
-rw-r--r--doc/html/ecgroup_8h.html12
-rw-r--r--doc/html/epid__overview_8dox.html2
-rw-r--r--doc/html/epid_diagram_basic_interaction.pngbin34688 -> 0 bytes
-rw-r--r--doc/html/epid_diagram_generating_member_private_keys.pngbin0 -> 38002 bytes
-rw-r--r--doc/html/epid_diagram_group_public_key_and_issuing_private_key.pngbin0 -> 29556 bytes
-rw-r--r--doc/html/epid_diagram_issuer_functionality.pngbin58672 -> 0 bytes
-rw-r--r--doc/html/epid_diagram_issuer_makes_revocation_lists_available.pngbin0 -> 40167 bytes
-rw-r--r--doc/html/epid_diagram_maintaining_revocation_lists.pngbin0 -> 51634 bytes
-rw-r--r--doc/html/epid_diagram_member_functionality.pngbin25610 -> 0 bytes
-rw-r--r--doc/html/epid_diagram_provisioning.pngbin0 -> 73631 bytes
-rw-r--r--doc/html/epid_diagram_signing_and_verification.pngbin0 -> 72501 bytes
-rw-r--r--doc/html/epid_diagram_verifier_functionality.pngbin36340 -> 0 bytes
-rw-r--r--doc/html/epidstyle.css2
-rw-r--r--doc/html/errors_8h.html2
-rw-r--r--doc/html/examples.html2
-rw-r--r--doc/html/examples_8dox.html2
-rw-r--r--doc/html/file__parser_8h.html8
-rw-r--r--doc/html/files.html40
-rw-r--r--doc/html/finitefield_8h.html6
-rw-r--r--doc/html/functions.html47
-rw-r--r--doc/html/functions_vars.html47
-rw-r--r--doc/html/getrandom_8c.html (renamed from doc/html/join_8h.html)31
-rw-r--r--doc/html/getrandom_8h.html (renamed from doc/html/decompress_8h.html)20
-rw-r--r--doc/html/globals.html2
-rw-r--r--doc/html/globals_b.html16
-rw-r--r--doc/html/globals_c.html2
-rw-r--r--doc/html/globals_d.html2
-rw-r--r--doc/html/globals_defs.html28
-rw-r--r--doc/html/globals_e.html38
-rw-r--r--doc/html/globals_enum.html2
-rw-r--r--doc/html/globals_eval.html2
-rw-r--r--doc/html/globals_f.html2
-rw-r--r--doc/html/globals_func.html136
-rw-r--r--doc/html/globals_g.html2
-rw-r--r--doc/html/globals_h.html2
-rw-r--r--doc/html/globals_i.html5
-rw-r--r--doc/html/globals_k.html2
-rw-r--r--doc/html/globals_m.html4
-rw-r--r--doc/html/globals_n.html2
-rw-r--r--doc/html/globals_o.html2
-rw-r--r--doc/html/globals_p.html6
-rw-r--r--doc/html/globals_r.html10
-rw-r--r--doc/html/globals_s.html2
-rw-r--r--doc/html/globals_t.html92
-rw-r--r--doc/html/globals_type.html4
-rw-r--r--doc/html/globals_v.html2
-rw-r--r--doc/html/globals_vars.html5
-rw-r--r--doc/html/globals_w.html10
-rw-r--r--doc/html/glossary_8dox.html2
-rw-r--r--doc/html/group___big_num_primitives.html4
-rw-r--r--doc/html/group___ec_group_primitives.html23
-rw-r--r--doc/html/group___ec_group_primitives.js2
-rw-r--r--doc/html/group___ecdsa_primitives.html4
-rw-r--r--doc/html/group___epid11_file_parser_module.html16
-rw-r--r--doc/html/group___epid11_pairing_primitives.html18
-rw-r--r--doc/html/group___epid11_types.html8
-rw-r--r--doc/html/group___epid11_verifier_module.html28
-rw-r--r--doc/html/group___epid_common.html9
-rw-r--r--doc/html/group___epid_math.html4
-rw-r--r--doc/html/group___epid_member_module.html463
-rw-r--r--doc/html/group___epid_member_module.js22
-rw-r--r--doc/html/group___epid_module.html8
-rw-r--r--doc/html/group___epid_print.html4
-rw-r--r--doc/html/group___epid_types.html6
-rw-r--r--doc/html/group___epid_types.js2
-rw-r--r--doc/html/group___epid_verifier_module.html12
-rw-r--r--doc/html/group___epid_verifier_module.js2
-rw-r--r--doc/html/group___error_codes.html4
-rw-r--r--doc/html/group___file_parser.html14
-rw-r--r--doc/html/group___file_parser.js2
-rw-r--r--doc/html/group___finite_field_primitives.html4
-rw-r--r--doc/html/group___hash_primitives.html4
-rw-r--r--doc/html/group___pairing_primitives.html8
-rw-r--r--doc/html/group___pairing_primitives.js2
-rw-r--r--doc/html/group___tpm2_module.html762
-rw-r--r--doc/html/group___tpm2_module.js16
-rw-r--r--doc/html/group___tpm_module.html929
-rw-r--r--doc/html/group___tpm_module.js30
-rw-r--r--doc/html/hash_8h.html6
-rw-r--r--doc/html/how__validated_8dox.html2
-rw-r--r--doc/html/implementation__notes_8dox.html2
-rw-r--r--doc/html/index.html4
-rw-r--r--doc/html/issuer__material_8dox.html2
-rw-r--r--doc/html/legal__information_8dox.html2
-rw-r--r--doc/html/load__external_8c.html127
-rw-r--r--doc/html/load__external_8h.html (renamed from doc/html/init_8h.html)21
-rw-r--r--doc/html/mainpage_8dox.html2
-rw-r--r--doc/html/member_2api_8h.html65
-rw-r--r--doc/html/member_host.pngbin0 -> 24364 bytes
-rw-r--r--doc/html/member_private_key.pngbin0 -> 15137 bytes
-rw-r--r--doc/html/modules.html14
-rw-r--r--doc/html/modules.js2
-rw-r--r--doc/html/navtreedata.js70
-rw-r--r--doc/html/navtreeindex0.js434
-rw-r--r--doc/html/navtreeindex1.js492
-rw-r--r--doc/html/navtreeindex2.js188
-rw-r--r--doc/html/nrprove_8h.html103
-rw-r--r--doc/html/nv_8c.html105
-rw-r--r--doc/html/nv_8h.html103
-rw-r--r--doc/html/organization_8dox.html2
-rw-r--r--doc/html/pageorder_8dox.html2
-rw-r--r--doc/html/pages.html26
-rw-r--r--doc/html/pairing_8h.html6
-rw-r--r--doc/html/printtss_8c.html131
-rw-r--r--doc/html/printtss_8h.html129
-rw-r--r--doc/html/printutils_8h.html8
-rw-r--r--doc/html/provisioning_8dox.html (renamed from doc/html/choosing__ikgf_8dox.html)10
-rw-r--r--doc/html/random_base.pngbin0 -> 39173 bytes
-rw-r--r--doc/html/revocation_8dox.html2
-rw-r--r--doc/html/sdk__overview_8dox.html2
-rw-r--r--doc/html/sign_8c.html142
-rw-r--r--doc/html/sign_8h.html34
-rw-r--r--doc/html/sign__verify__tutorial_8dox.html2
-rw-r--r--doc/html/signmsg__walkthrough_8dox.html2
-rw-r--r--doc/html/software__member_8h.html (renamed from doc/html/validatekey_8h.html)30
-rw-r--r--doc/html/state_8h.html93
-rw-r--r--doc/html/stdtypes_8h.html2
-rw-r--r--doc/html/struct_basic_signature.html4
-rw-r--r--doc/html/struct_big_num_str.html4
-rw-r--r--doc/html/struct_compressed_priv_key.html4
-rw-r--r--doc/html/struct_ecdsa_private_key.html4
-rw-r--r--doc/html/struct_ecdsa_public_key.html4
-rw-r--r--doc/html/struct_ecdsa_signature.html4
-rw-r--r--doc/html/struct_epid11_basic_signature.html4
-rw-r--r--doc/html/struct_epid11_g2_elem_str.html4
-rw-r--r--doc/html/struct_epid11_group_pub_key.html4
-rw-r--r--doc/html/struct_epid11_group_rl.html4
-rw-r--r--doc/html/struct_epid11_gt_elem_str.html4
-rw-r--r--doc/html/struct_epid11_nr_proof.html4
-rw-r--r--doc/html/struct_epid11_params.html4
-rw-r--r--doc/html/struct_epid11_priv_rl.html4
-rw-r--r--doc/html/struct_epid11_sig_rl.html4
-rw-r--r--doc/html/struct_epid11_sig_rl_entry.html4
-rw-r--r--doc/html/struct_epid11_signature.html4
-rw-r--r--doc/html/struct_epid11_verifier_precomp.html6
-rw-r--r--doc/html/struct_epid2_params.html4
-rw-r--r--doc/html/struct_epid_ca_certificate.html4
-rw-r--r--doc/html/struct_epid_file_header.html4
-rw-r--r--doc/html/struct_epid_signature.html4
-rw-r--r--doc/html/struct_fp_elem_str.html4
-rw-r--r--doc/html/struct_fq12_elem_str.html4
-rw-r--r--doc/html/struct_fq2_elem_str.html4
-rw-r--r--doc/html/struct_fq3_elem_str.html4
-rw-r--r--doc/html/struct_fq6_elem_str.html4
-rw-r--r--doc/html/struct_fq_elem_str.html4
-rw-r--r--doc/html/struct_g1_elem_str.html4
-rw-r--r--doc/html/struct_g2_elem_str.html4
-rw-r--r--doc/html/struct_group_pub_key.html4
-rw-r--r--doc/html/struct_group_rl.html4
-rw-r--r--doc/html/struct_gt_elem_str.html4
-rw-r--r--doc/html/struct_i_priv_key.html4
-rw-r--r--doc/html/struct_join_request.html4
-rw-r--r--doc/html/struct_member_params.html107
-rw-r--r--doc/html/struct_member_precomp.html4
-rw-r--r--doc/html/struct_membership_credential.html4
-rw-r--r--doc/html/struct_nr_proof.html4
-rw-r--r--doc/html/struct_oct_str128.html4
-rw-r--r--doc/html/struct_oct_str16.html4
-rw-r--r--doc/html/struct_oct_str256.html4
-rw-r--r--doc/html/struct_oct_str32.html4
-rw-r--r--doc/html/struct_oct_str512.html4
-rw-r--r--doc/html/struct_oct_str600.html4
-rw-r--r--doc/html/struct_oct_str64.html4
-rw-r--r--doc/html/struct_oct_str768.html4
-rw-r--r--doc/html/struct_oct_str8.html4
-rw-r--r--doc/html/struct_oct_str80.html4
-rw-r--r--doc/html/struct_priv_key.html4
-rw-r--r--doc/html/struct_priv_rl.html4
-rw-r--r--doc/html/struct_sha256_digest.html4
-rw-r--r--doc/html/struct_sig_rl.html4
-rw-r--r--doc/html/struct_sig_rl_entry.html4
-rw-r--r--doc/html/struct_sign_commit_output.html113
-rw-r--r--doc/html/struct_tpm2_ctx.html (renamed from doc/html/struct_nr_prove_commit_output.html)48
-rw-r--r--doc/html/struct_verifier_precomp.html4
-rw-r--r--doc/html/struct_verifier_rl.html4
-rw-r--r--doc/html/tatepairing_8h.html6
-rw-r--r--doc/html/tpm__considerations_8dox.html82
-rw-r--r--doc/html/tpm__member_8h.html82
-rw-r--r--doc/html/types_8h.html2
-rw-r--r--doc/html/uml_sequence.pngbin0 -> 27955 bytes
-rw-r--r--doc/html/using__ikgf_8dox.html82
-rw-r--r--doc/html/verifier_21_81_2api_8h.html4
-rw-r--r--doc/html/verifier_2api_8h.html4
-rw-r--r--doc/html/verifysig__walkthrough_8dox.html2
-rw-r--r--epid/common-testhelper/1.1/epid_params-testhelper.cc142
-rw-r--r--epid/common-testhelper/1.1/epid_params-testhelper.h10
-rw-r--r--epid/common-testhelper/1.1/testdata/grp01/member0/sig_bsn0_msg_0_255_sha256.inc89
-rw-r--r--epid/common-testhelper/1.1/verifier_wrapper-testhelper.cc4
-rw-r--r--epid/common-testhelper/Makefile2
-rw-r--r--epid/common-testhelper/bignum_wrapper-testhelper.cc4
-rw-r--r--epid/common-testhelper/common-testhelper.parts93
-rw-r--r--epid/common-testhelper/ecgroup_wrapper-testhelper.cc46
-rw-r--r--epid/common-testhelper/ecpoint_wrapper-testhelper.cc4
-rw-r--r--epid/common-testhelper/ecpoint_wrapper-testhelper.h4
-rw-r--r--epid/common-testhelper/epid2params_wrapper-testhelper.cc49
-rw-r--r--epid/common-testhelper/epid2params_wrapper-testhelper.h55
-rw-r--r--epid/common-testhelper/epid_gtest-testhelper.cc2
-rw-r--r--epid/common-testhelper/epid_gtest-testhelper.h2
-rw-r--r--epid/common-testhelper/epid_params-testhelper.cc153
-rw-r--r--epid/common-testhelper/epid_params-testhelper.h15
-rw-r--r--epid/common-testhelper/errors-testhelper.h13
-rw-r--r--epid/common-testhelper/ffelement_wrapper-testhelper.cc4
-rw-r--r--epid/common-testhelper/ffelement_wrapper-testhelper.h4
-rw-r--r--epid/common-testhelper/finite_field_wrapper-testhelper.cc6
-rw-r--r--epid/common-testhelper/mem_params-testhelper.cc35
-rw-r--r--epid/common-testhelper/mem_params-testhelper.h48
-rw-r--r--epid/common-testhelper/octstr-testhelper.cc2
-rw-r--r--epid/common-testhelper/prng-testhelper.h62
-rw-r--r--epid/common-testhelper/testapp-testhelper.cc74
-rw-r--r--epid/common-testhelper/testapp-testhelper.h (renamed from parts-site/configurations/instr_release/intelc_posix-any.py)30
-rw-r--r--epid/common-testhelper/testdata/grp01/member0/sig_bsn0_msg_0_255_sha512.inc72
-rw-r--r--epid/common-testhelper/testdata/grp_x/member0/sig_sha512_huge_bsn_msg0.inc99
-rw-r--r--epid/common-testhelper/testdata/ikgf/groupa/member0/mprecomp.inc4
-rw-r--r--epid/common-testhelper/testdata/ikgf/groupa/member0/mprivkey.inc4
-rw-r--r--epid/common-testhelper/testdata/ikgf/groupa/sigrevokedmember0/mprivkey.inc4
-rw-r--r--epid/common-testhelper/testdata/ikgf/groupb/member0/mprivkey.inc4
-rw-r--r--epid/common-testhelper/unittests/bignum_wrapper-test.cc2
-rw-r--r--epid/common-testhelper/unittests/ecgroup_wrapper-test.cc42
-rw-r--r--epid/common-testhelper/unittests/ecpoint_wrapper-test.cc28
-rw-r--r--epid/common-testhelper/unittests/finite_field_wrapper-test.cc2
-rw-r--r--epid/common-testhelper/verifier_wrapper-testhelper.cc4
-rw-r--r--epid/common/1.1/file_parser.h25
-rw-r--r--epid/common/1.1/src/commitment.c8
-rw-r--r--epid/common/1.1/src/commitment.h4
-rw-r--r--epid/common/1.1/src/epid11params.c4
-rw-r--r--epid/common/1.1/src/file_parser.c4
-rw-r--r--epid/common/1.1/src/grouppubkey.h4
-rw-r--r--epid/common/1.1/types.h6
-rw-r--r--epid/common/1.1/unittests/file_parser-test.cc50
-rw-r--r--epid/common/Makefile2
-rw-r--r--epid/common/bitsupplier.h6
-rw-r--r--epid/common/file_parser.h14
-rw-r--r--epid/common/math/bignum.h2
-rw-r--r--epid/common/math/ecdsa.h2
-rw-r--r--epid/common/math/ecgroup.h6
-rw-r--r--epid/common/math/finitefield.h2
-rw-r--r--epid/common/math/hash.h4
-rw-r--r--epid/common/math/pairing.h4
-rw-r--r--epid/common/math/printutils.h6
-rw-r--r--epid/common/math/src/bignum-internal.h20
-rw-r--r--epid/common/math/src/bignum.c37
-rw-r--r--epid/common/math/src/ecdsa_sign.c4
-rw-r--r--epid/common/math/src/ecgroup-internal.h2
-rw-r--r--epid/common/math/src/ecgroup.c23
-rw-r--r--epid/common/math/src/finitefield-internal.h2
-rw-r--r--epid/common/math/src/finitefield.c4
-rw-r--r--epid/common/math/src/pairing.c4
-rw-r--r--epid/common/math/src/printutils.c2
-rw-r--r--epid/common/math/src/tatepairing.c6
-rw-r--r--epid/common/math/tatepairing.h17
-rw-r--r--epid/common/math/unittests/bignum-test.cc2
-rw-r--r--epid/common/math/unittests/ecgroup-test.cc618
-rw-r--r--epid/common/math/unittests/ffelement-test.cc474
-rw-r--r--epid/common/math/unittests/finitefield-test.cc94
-rw-r--r--epid/common/math/unittests/octstrconvert-test.cc2
-rw-r--r--epid/common/math/unittests/pairing-test.cc8
-rw-r--r--epid/common/math/unittests/printutils-test.cc174
-rw-r--r--epid/common/math/unittests/tatepairing-test.cc2
-rw-r--r--epid/common/src/epid2params.c19
-rw-r--r--epid/common/src/epid2params.h3
-rw-r--r--epid/common/src/errors.c4
-rw-r--r--epid/common/src/file_parser-internal.h6
-rw-r--r--epid/common/src/file_parser.c4
-rw-r--r--epid/common/src/hashsize.c44
-rw-r--r--epid/common/src/hashsize.h46
-rw-r--r--epid/common/src/memory.c4
-rw-r--r--epid/common/src/stack.c6
-rw-r--r--epid/common/src/stack.h13
-rw-r--r--epid/member/Makefile27
-rw-r--r--epid/member/api.h313
-rw-r--r--epid/member/member.parts114
-rw-r--r--epid/member/software_member.h48
-rw-r--r--epid/member/src/assemble_privkey.c123
-rw-r--r--epid/member/src/context.c185
-rw-r--r--epid/member/src/context.h57
-rw-r--r--epid/member/src/decompress_privkey.c319
-rw-r--r--epid/member/src/get_sigsize.c4
-rw-r--r--epid/member/src/hash_basename.c5
-rw-r--r--epid/member/src/hash_basename.h9
-rw-r--r--epid/member/src/join.c116
-rw-r--r--epid/member/src/join_commitment.c2
-rw-r--r--epid/member/src/join_commitment.h3
-rw-r--r--epid/member/src/nrprove.c226
-rw-r--r--epid/member/src/nrprove.h71
-rw-r--r--epid/member/src/nrprove_commitment.c1
-rw-r--r--epid/member/src/nrprove_commitment.h15
-rw-r--r--epid/member/src/precomp.c2
-rw-r--r--epid/member/src/precomp.h3
-rw-r--r--epid/member/src/presig-internal.h (renamed from epid/member/tpm/src/presig-internal.h)21
-rw-r--r--epid/member/src/presig.c (renamed from epid/member/tpm/src/presig.c)148
-rw-r--r--epid/member/src/privateexp.c141
-rw-r--r--epid/member/src/privateexp.h42
-rw-r--r--epid/member/src/provision_bulk.c88
-rw-r--r--epid/member/src/provision_compressed.c41
-rw-r--r--epid/member/src/provision_join.c85
-rw-r--r--epid/member/src/resize.c40
-rw-r--r--epid/member/src/resize.h45
-rw-r--r--epid/member/src/sign.c23
-rw-r--r--epid/member/src/sign_commitment.c1
-rw-r--r--epid/member/src/sign_commitment.h17
-rw-r--r--epid/member/src/signbasic.c278
-rw-r--r--epid/member/src/signbasic.h70
-rw-r--r--epid/member/src/startup.c (renamed from epid/member/tpm/src/init.c)70
-rw-r--r--epid/member/src/storage.c71
-rw-r--r--epid/member/src/storage.h72
-rw-r--r--epid/member/src/validatekey.c (renamed from epid/member/tpm/src/validatekey.c)30
-rw-r--r--epid/member/src/validatekey.h (renamed from epid/member/tpm/validatekey.h)29
-rw-r--r--epid/member/src/write_precomp.c36
-rw-r--r--epid/member/src/write_precomp.h (renamed from epid/member/tpm/presig.h)55
-rw-r--r--epid/member/tpm/context.h129
-rw-r--r--epid/member/tpm/decompress.h78
-rw-r--r--epid/member/tpm/init.h77
-rw-r--r--epid/member/tpm/join.h82
-rw-r--r--epid/member/tpm/nrprove.h106
-rw-r--r--epid/member/tpm/sign.h107
-rw-r--r--epid/member/tpm/src/context.c180
-rw-r--r--epid/member/tpm/src/decompress.c271
-rw-r--r--epid/member/tpm/src/join.c123
-rw-r--r--epid/member/tpm/src/nrprove.c221
-rw-r--r--epid/member/tpm/src/sign.c204
-rw-r--r--epid/member/tpm/src/types.h93
-rw-r--r--epid/member/tpm/unittests/tpm-test.cc212
-rw-r--r--epid/member/tpm/unittests/tpm-testhelper.cc326
-rw-r--r--epid/member/tpm/unittests/tpm-testhelper.h116
-rw-r--r--epid/member/tpm2/commit.h72
-rw-r--r--epid/member/tpm2/context.h123
-rw-r--r--epid/member/tpm2/createprimary.h (renamed from parts-site/configurations/instr_size_optimized_release/intelc_posix-any.py)36
-rw-r--r--epid/member/tpm2/getrandom.h57
-rw-r--r--epid/member/tpm2/ibm_tss/commit.c147
-rw-r--r--epid/member/tpm2/ibm_tss/context.c150
-rw-r--r--epid/member/tpm2/ibm_tss/conversion.c134
-rw-r--r--epid/member/tpm2/ibm_tss/conversion.h117
-rw-r--r--epid/member/tpm2/ibm_tss/createprimary.c100
-rw-r--r--epid/member/tpm2/ibm_tss/getrandom.c78
-rw-r--r--epid/member/tpm2/ibm_tss/load_external.c137
-rw-r--r--epid/member/tpm2/ibm_tss/nv.c166
-rw-r--r--epid/member/tpm2/ibm_tss/printtss.c37
-rw-r--r--epid/member/tpm2/ibm_tss/printtss.h36
-rw-r--r--epid/member/tpm2/ibm_tss/sign.c155
-rw-r--r--epid/member/tpm2/ibm_tss/state.h39
-rw-r--r--epid/member/tpm2/load_external.h54
-rw-r--r--epid/member/tpm2/nv.h110
-rw-r--r--epid/member/tpm2/sign.h85
-rw-r--r--epid/member/tpm2/src/commit.c188
-rw-r--r--epid/member/tpm2/src/context.c119
-rw-r--r--epid/member/tpm2/src/createprimary.c58
-rw-r--r--epid/member/tpm2/src/getrandom.c (renamed from parts-site/configurations/instr_size_optimized_release/g++.py)40
-rw-r--r--epid/member/tpm2/src/load_external.c54
-rw-r--r--epid/member/tpm2/src/nv.c134
-rw-r--r--epid/member/tpm2/src/sign.c127
-rw-r--r--epid/member/tpm2/src/state.h63
-rw-r--r--epid/member/tpm2/tpm2.parts123
-rw-r--r--epid/member/tpm2/unittests/commit-simulator-test.cc292
-rw-r--r--epid/member/tpm2/unittests/commit-test.cc321
-rw-r--r--epid/member/tpm2/unittests/context-test.cc105
-rw-r--r--epid/member/tpm2/unittests/conversion-tss-test.cc160
-rw-r--r--epid/member/tpm2/unittests/createprimary-tss-test.cc69
-rw-r--r--epid/member/tpm2/unittests/getrandom-simulator-test.cc53
-rw-r--r--epid/member/tpm2/unittests/getrandom-test.cc67
-rw-r--r--epid/member/tpm2/unittests/getrandom-tss-test.cc44
-rw-r--r--epid/member/tpm2/unittests/load_external-simulator-test.cc58
-rw-r--r--epid/member/tpm2/unittests/load_external-test.cc60
-rw-r--r--epid/member/tpm2/unittests/main-testhelper.cc64
-rw-r--r--epid/member/tpm2/unittests/nv-test.cc326
-rw-r--r--epid/member/tpm2/unittests/sign-simulator-test.cc75
-rw-r--r--epid/member/tpm2/unittests/sign-test.cc320
-rw-r--r--epid/member/tpm2/unittests/tpm2-testhelper.cc157
-rw-r--r--epid/member/tpm2/unittests/tpm2-testhelper.h78
-rw-r--r--epid/member/tpm2/unittests/tpm2_wrapper-testhelper.cc61
-rw-r--r--epid/member/tpm2/unittests/tpm2_wrapper-testhelper.h58
-rw-r--r--epid/member/tpm_member.h48
-rw-r--r--epid/member/unittests/context-test.cc263
-rw-r--r--epid/member/unittests/iskeyvalid-test.cc198
-rw-r--r--epid/member/unittests/join_request-test.cc368
-rw-r--r--epid/member/unittests/main-test.cc43
-rw-r--r--epid/member/unittests/member-testhelper.cc477
-rw-r--r--epid/member/unittests/member-testhelper.h44
-rw-r--r--epid/member/unittests/nr_prove-test.cc274
-rw-r--r--epid/member/unittests/presig-test.cc6
-rw-r--r--epid/member/unittests/privateexp-test.cc155
-rw-r--r--epid/member/unittests/provision_compressed-test.cc186
-rw-r--r--epid/member/unittests/provision_credential-test.cc337
-rw-r--r--epid/member/unittests/provision_key-test.cc259
-rw-r--r--epid/member/unittests/request_join-test.cc375
-rw-r--r--epid/member/unittests/resize-test.cc63
-rw-r--r--epid/member/unittests/sign-test.cc207
-rw-r--r--epid/member/unittests/signbasic-test.cc361
-rw-r--r--epid/member/unittests/storage-test.cc126
-rw-r--r--epid/verifier/1.1/api.h30
-rw-r--r--epid/verifier/1.1/src/context.c8
-rw-r--r--epid/verifier/1.1/src/context.h6
-rw-r--r--epid/verifier/1.1/src/nrverify.c6
-rw-r--r--epid/verifier/1.1/src/verify.c2
-rw-r--r--epid/verifier/1.1/src/verifybasic.c6
-rw-r--r--epid/verifier/1.1/unittests/check_privrl_entry-test.cc2
-rw-r--r--epid/verifier/1.1/unittests/context-test.cc15
-rw-r--r--epid/verifier/1.1/unittests/nrverify-test.cc18
-rw-r--r--epid/verifier/1.1/unittests/verifier-testhelper.cc149
-rw-r--r--epid/verifier/1.1/unittests/verifier-testhelper.h8
-rw-r--r--epid/verifier/1.1/unittests/verify-test.cc39
-rw-r--r--epid/verifier/1.1/unittests/verifybasic-test.cc14
-rw-r--r--epid/verifier/Makefile2
-rw-r--r--epid/verifier/api.h2
-rw-r--r--epid/verifier/src/context.c22
-rw-r--r--epid/verifier/src/context.h6
-rw-r--r--epid/verifier/src/verify.c2
-rw-r--r--epid/verifier/src/verifybasic.c2
-rw-r--r--epid/verifier/unittests/check_privrl_entry-test.cc4
-rw-r--r--epid/verifier/unittests/context-test.cc36
-rw-r--r--epid/verifier/unittests/nrverify-test.cc17
-rw-r--r--epid/verifier/unittests/sigs_linked-test.cc2
-rw-r--r--epid/verifier/unittests/testdata/sigrl/pub_key_sigrl_verify.inc4
-rw-r--r--epid/verifier/unittests/testdata/sigrl/sigrl_five_entries.inc2
-rw-r--r--epid/verifier/unittests/verifier-testhelper.cc140
-rw-r--r--epid/verifier/unittests/verifier-testhelper.h6
-rw-r--r--epid/verifier/unittests/verify-test.cc169
-rw-r--r--epid/verifier/unittests/verifybasic-test.cc19
-rw-r--r--epid/verifier/verifier.parts5
-rw-r--r--example/Makefile4
-rw-r--r--example/compressed_data/README.md2
-rw-r--r--example/data/README.md2
-rw-r--r--example/signmsg/src/main.c46
-rw-r--r--example/signmsg/src/prng.c4
-rw-r--r--example/signmsg/src/signmsg.c52
-rw-r--r--example/signmsg/src/signmsg.h12
-rw-r--r--example/util/convutil.h49
-rw-r--r--example/util/src/bufutil.c4
-rw-r--r--example/util/src/convutil.c19
-rw-r--r--example/util/src/envutil.c6
-rw-r--r--example/util/strutil.h4
-rw-r--r--example/util/util.parts28
-rw-r--r--example/verifysig/src/main.c26
-rw-r--r--example/verifysig/src/verifysig.c2
-rw-r--r--example/verifysig/src/verifysig.h6
-rw-r--r--example/verifysig/src/verifysig11.c4
-rw-r--r--example/verifysig/src/verifysig11.h8
-rw-r--r--ext/gtest/gtest-all.cc1490
-rw-r--r--ext/gtest/gtest.h2270
-rw-r--r--ext/gtest/gtest.parts6
-rw-r--r--parts-site/configurations/debug/g++.py55
-rw-r--r--parts-site/configurations/debug/g++_win32-any.py (renamed from parts-site/configurations/instr_size_optimized_release/gcc.py)41
-rw-r--r--parts-site/configurations/debug/gcc.py65
-rw-r--r--parts-site/configurations/debug/gcc_win32_any.py60
-rw-r--r--parts-site/configurations/debug/intelc_posix-any.py2
-rw-r--r--parts-site/configurations/instr_release/__init__.py20
-rw-r--r--parts-site/configurations/instr_release/intelc_win32-any.py35
-rw-r--r--parts-site/configurations/instr_release/msvc_win32-any.py35
-rw-r--r--parts-site/configurations/instr_size_optimized_release/__init__.py20
-rw-r--r--parts-site/configurations/instr_size_optimized_release/intelc_win32-any.py35
-rw-r--r--parts-site/configurations/instr_size_optimized_release/msvc_win32-any.py35
-rw-r--r--parts-site/configurations/release/g++.py2
-rw-r--r--parts-site/configurations/release/g++_win32-any.py (renamed from parts-site/configurations/instr_release/g++.py)42
-rw-r--r--parts-site/configurations/release/gcc.py2
-rw-r--r--parts-site/configurations/release/gcc_win32-any.py65
-rw-r--r--parts-site/configurations/release/intelc_posix-any.py2
-rw-r--r--parts-site/configurations/size_optimized_release/__init__.py2
-rw-r--r--parts-site/configurations/size_optimized_release/g++.py2
-rw-r--r--parts-site/configurations/size_optimized_release/g++_win32-any.py (renamed from parts-site/configurations/instr_release/gcc.py)41
-rw-r--r--parts-site/configurations/size_optimized_release/gcc.py2
-rw-r--r--parts-site/configurations/size_optimized_release/gcc_win32-any.py64
-rw-r--r--parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86.py2
-rw-r--r--parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86_64.py2
-rw-r--r--parts-site/pieces/arm_support.py2
-rw-r--r--parts-site/tools/g++.py2
-rw-r--r--parts-site/tools/gcc.py2
-rw-r--r--tools/Makefile10
-rw-r--r--tools/extractgrps/src/main.c20
-rw-r--r--tools/extractkeys/src/main.c18
-rw-r--r--tools/revokegrp/src/main.c21
-rw-r--r--tools/revokekey/src/main.c14
-rw-r--r--tools/revokesig/src/main.c24
521 files changed, 21899 insertions, 9511 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e68978..ec63ce5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,49 @@
# Intel(R) EPID SDK ChangeLog {#ChangeLog}
+## [5.0.0] - 2017-09-15
+
+### Added
+
+* The member implementation now has the option to support signing
+ using a TPM, using the ECDAA capabilities of TPM 2.0.
+
+
+### Changed
+
+* Member API updated to unify HW and SW use cases.
+ * Added
+ * `ProvisionKey`
+ * `ProvisionCompressed`
+ * `ProvisionCredential`
+ * `Startup`
+ * Parameters changed
+ * `MemberCreate`
+ * `RequestJoin`
+ * Removed or made private
+ * `WritePrecomp`
+ * `SignBasic`
+ * `NrProve`
+ * `AssemblePrivKey`
+
+* `EpidRequestJoin` was renamed to `EpidCreateJoinRequest` to make it
+ clear that it is not directly communicating with the issuer.
+
+
+### Fixed
+
+* `EpidCreateJoinRequest` creates valid join requests. This fixes a
+ regression in `EpidRequestJoin` introduced in 4.0.0.
+
+
+### Known Issues
+
+* Only the SHA-256 hash algorithm is supported when using the
+ SDK with the IBM TPM simulator due to a defect in version
+ 532 of the simulator.
+
+* Basenames are limited to 124 bytes in TPM mode.
+
+
## [4.0.0] - 2017-04-25
### Added
diff --git a/Makefile.in b/Makefile.in
index c27ec1c..212be4a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -29,16 +29,29 @@ endif
CC_FLAGS := $(CFLAGS) $(SIZE_CFLAGS) -Werror -Wall -Wextra -Wno-missing-braces \
-Wno-missing-field-initializers -Wno-unknown-pragmas -Wno-unused-function \
-fno-strict-aliasing -Wno-unused-but-set-variable -Wno-comment -Wformat \
- -Wformat-security -fstack-protector -fPIC -DNDEBUG -D_FORTIFY_SOURCE=2
-#g++ flags
-CXX_FLAGS := $(CC_FLAGS) -std=c++0x
+ -Wformat-security -fstack-protector -DNDEBUG -D_FORTIFY_SOURCE=2
#intel c compiler flags
ICC_FLAGS := $(CFLAGS) $(SIZE_CFLAGS) -Werror -Wall -Wextra -DNDEBUG \
- -fstack-protector -fPIC -D_FORTIFY_SOURCE=2 \
+ -fstack-protector -D_FORTIFY_SOURCE=2 \
-Wformat -Wformat-security
+
+ifneq ($(OS),Windows_NT)
+ CC_FLAGS += -fPIC
+ ICC_FLAGS += -fPIC
+ CXX11_FLAG = -std=c++0x
+ EXE_EXTENSION =
+else
+ CC_FLAGS += -D__int64='long long'
+ CXX11_FLAG = -std=gnu++11
+ EXE_EXTENSION = .exe
+endif
+$(info $(EXE_EXTENSION))
+#g++ flags
+CXX_FLAGS := $(CC_FLAGS) $(CXX11_FLAG)
+
#intel c++ compiler flags
-ICPC_FLAGS := $(ICC_FLAGS) -std=c++0x
+ICPC_FLAGS := $(ICC_FLAGS) $(CXX11_FLAG)
#check if architecture was specified
#or take it by shell command
@@ -78,7 +91,10 @@ else
endif
# ld flags
-LDFLAGS += -fstack-protector -z noexecstack -z relro -z now -pie
+LDFLAGS += -fstack-protector
+ifneq ($(OS),Windows_NT)
+ LDFLAGS += -z noexecstack -z relro -z now -pie
+endif
#gtest defines
GTEST_DEFINES := -DGTEST_HAS_PTHREAD=0 -D_VARIADIC_MAX=10
@@ -93,6 +109,7 @@ export CXX CXXFLAGS
export AR RANLIB
export epidinstalldir
export GTEST_FLAGS GTEST_DEFINES IPP_FLAGS
+export EXE_EXTENSION
#just output
$(info $$ccompiler is [${CC}])
@@ -100,7 +117,9 @@ $(info $$cxxcompiler is [${CXX}])
$(info $$architecture is [${ARCH}])
#targets part
-all: ipp common member verifier dropt examples_util examples epid_tools
+all:
+ $(MAKE) ipp common member verifier dropt examples_util
+ $(MAKE) examples epid_tools
clean:
$(MAKE) -C ./ext/ipp/sources/ippcp clean
@@ -132,15 +151,33 @@ uninstall:
ipp:
$(MAKE) -C ./ext/ipp/sources/ippcp all
+common-testhelper:
+ $(MAKE) -C ./epid/common-testhelper/ all
+
+common-testhelper_utest:
+ $(MAKE) -C ./epid/common-testhelper/ utest
+
common:
$(MAKE) -C ./epid/common/ all
+common_utest:
+ $(MAKE) -C ./epid/common/ utest
+
member:
$(MAKE) -C ./epid/member/ all
+member_utest:
+ $(MAKE) -C ./epid/member/ utest
+
verifier:
$(MAKE) -C ./epid/verifier/ all
+verifier_utest:
+ $(MAKE) -C ./epid/verifier/ utest
+
+gtest:
+ $(MAKE) -C ./ext/gtest/ all
+
dropt:
$(MAKE) -C ./ext/dropt/ all
@@ -148,12 +185,8 @@ examples_util:
$(MAKE) -C ./example/util/ all
utest:
- $(MAKE) -C ./ext/gtest/ all
- $(MAKE) -C ./epid/common-testhelper/ all
- $(MAKE) -C ./epid/common-testhelper/ utest
- $(MAKE) -C ./epid/common/ utest
- $(MAKE) -C ./epid/member/ utest
- $(MAKE) -C ./epid/verifier/ utest
+ $(MAKE) gtest common-testhelper
+ $(MAKE) common-testhelper_utest common_utest member_utest verifier_utest
run_utest:
$(MAKE) -C ./epid/common-testhelper/ run_utest
@@ -161,7 +194,9 @@ run_utest:
$(MAKE) -C ./epid/member/ run_utest
$(MAKE) -C ./epid/verifier/ run_utest
-check: utest run_utest
+check:
+ $(MAKE) utest
+ $(MAKE) run_utest
examples:
$(MAKE) -C ./example/ all
@@ -176,4 +211,7 @@ ifneq ("$(wildcard ./ext/google_benchmark/)","")
$(MAKE) -C ./ext/google_benchmark/ run_utest
endif
-build: all check install
+build:
+ $(MAKE) all
+ $(MAKE) check
+ $(MAKE) install
diff --git a/SConstruct b/SConstruct
index 7aacd89..3819297 100644
--- a/SConstruct
+++ b/SConstruct
@@ -28,14 +28,12 @@ import tempfile
import shutil
from collections import OrderedDict
-
def get_parts_versions(env):
"""Get Parts related versions given SCons environment env"""
return OrderedDict({'python': string.split(sys.version, " ", 1)[0],
'scons': str(SCons.__version__),
'parts': str(PartsExtensionVersion())})
-
def get_toolchain_versions(env):
"""Get version of compilation toolchain given SCons environment env"""
versions = OrderedDict()
@@ -48,23 +46,37 @@ def get_toolchain_versions(env):
versions['compiler'] = 'GCC ' + env['GCC_VERSION']
if 'GXX_VERSION' in env:
versions['compiler'] += ' and GXX ' + env['GXX_VERSION']
- cmd = env.subst('echo "int main(){return 0;}"'
- ' | $CXX $CCFLAGS -xc++ -Wl,--verbose -')
+ if os.name == 'nt':
+ cmd = env.subst('echo int main(){return 0;}'
+ ' | $CXX $CCFLAGS -xc++ -Wl,--verbose -')
+ else:
+ cmd = env.subst('echo "int main(){return 0;}"'
+ ' | $CXX $CCFLAGS -xc++ -Wl,--verbose -')
else:
- cmd = env.subst('echo "int main(){return 0;}"'
- ' | $CC $CCFLAGS -xc -Wl,--verbose -')
- defaultlib_regexp = r'[\n(](/.*\.so[-.\da-fA-F]*).*'
+ if os.name == 'nt':
+ cmd = env.subst('echo int main(){return 0;}'
+ ' | $CXX $CCFLAGS -xc++ -Wl,--verbose -')
+ else:
+ cmd = env.subst('echo "int main(){return 0;}"'
+ ' | $CC $CCFLAGS -xc -Wl,--verbose -')
+ if os.name == 'nt':
+ defaultlib_regexp = r'\n.* open (.*) succeeded'
+ else:
+ defaultlib_regexp = r'[\n(](/.*\.so[-.\da-fA-F]*).*'
# Intel C compiler always depends from base toolchain
if 'INTELC_VERSION' in env:
- versions['compiler'] = 'INTELC {0} with {1}'.format(env['INTELC_VERSION'],
- versions['compiler'])
+ versions['compiler'] = 'INTELC {0} with {1}'.format(
+ env['INTELC_VERSION'],
+ versions['compiler'])
+ env['ENV']['PATH'] = str(env['ENV']['PATH'])
temp_dir = tempfile.mkdtemp()
try:
proc = subprocess.Popen(cmd,
cwd=temp_dir,
- env=env['ENV'], shell=True,
+ env=env['ENV'],
+ shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, _ = proc.communicate()
if proc.returncode != 0:
@@ -144,10 +156,12 @@ example_parts = ['ext/dropt/dropt.parts',
'example/signmsg/signmsg.parts',
'example/data/data.parts',
'example/compressed_data/compressed_data.parts']
-sizing_parts = ['example/signmsg/signmsg_shared.parts',
+sizing_parts = ['example/util/util_static.parts',
+ 'example/signmsg/signmsg_shared.parts',
'example/verifysig/verifysig_shared.parts',
'example/verifysig/verifysig11_shared.parts']
-example_static_parts = ['example/signmsg/signmsg_static.parts',
+example_static_parts = ['example/util/util_static.parts',
+ 'example/signmsg/signmsg_static.parts',
'example/verifysig/verifysig_static.parts']
tools_parts = ['tools/revokegrp/revokegrp.parts',
'tools/revokekey/revokekey.parts',
@@ -165,6 +179,7 @@ testbot_test_parts = ['test/testbot/testbot.parts',
'test/testbot/extractkeys/extractkeys_testbot.parts',
'test/testbot/extractgrps/extractgrps_testbot.parts',
'tools/reports/reports.parts']
+tss_test_parts = ['test/tss/tss.parts']
package_parts = ['ext/gtest/gtest.parts',
'ext/ipp/ippcp.parts',
'package.parts']
@@ -212,6 +227,10 @@ def use_commercial_ipp():
return GetOption("use-commercial-ipp")
+def use_tss():
+ return GetOption("use-tss")
+
+
def config_has_instrumentation():
return any(DefaultEnvironment().isConfigBasedOn(config_name)
for config_name in ['instr_release', 'instr_size_optimized_release'])
@@ -241,6 +260,12 @@ AddOption("--use-commercial-ipp",
action='store_true', dest='use-commercial-ipp',
default=False)
+AddOption("--use-tss",
+ help=("Link with TPM TSS. The TSSROOT environment variable "
+ "must be set."),
+ action='store_true', dest='use-tss',
+ default=False)
+
AddOption("--ipp-shared",
help=("Build /ext/ipp as shared library."),
action='store_true', dest='ipp-shared',
@@ -305,13 +330,16 @@ if is_production():
ipp_mode = ['install_lib']
if use_commercial_ipp():
ipp_mode.append('use_commercial_ipp')
+ sdk_mode = ['install_lib']
+ if use_tss():
+ sdk_mode.append('use_tss')
if GetOption('ipp-shared'):
ipp_mode.append('build_ipp_shared')
include_parts(ipp_parts, mode=ipp_mode,
INSTALL_INCLUDE='${INSTALL_IPP_INCLUDE}')
include_parts(utest_parts + common_parts +
member_parts + verifier_parts,
- mode=['install_lib'],
+ mode=sdk_mode,
INSTALL_INCLUDE='${INSTALL_EPID_INCLUDE}')
include_parts(util_parts + example_parts,
INSTALL_INCLUDE='${INSTALL_EPID_INCLUDE}',
@@ -321,13 +349,20 @@ if is_production():
INSTALL_BIN='${INSTALL_TOOLS_BIN}',
INSTALL_DATA='${INSTALL_TOOLS_DATA}')
Default('all')
- Default('run_utest::')
+ Default('utest::')
+ if not use_tss():
+ Default('run_utest::')
if is_internal_test():
set_default_production_options()
+ sdk_mode = []
+ if use_tss():
+ sdk_mode.append('use_tss')
+ include_parts(tss_test_parts)
include_parts(ipp_parts)
include_parts(utest_parts + common_parts +
- member_parts + verifier_parts)
+ member_parts + verifier_parts,
+ mode=sdk_mode)
include_parts(util_parts + example_parts,
INSTALL_BIN='${INSTALL_SAMPLE_BIN}',
INSTALL_DATA='${INSTALL_SAMPLE_DATA}')
@@ -339,7 +374,7 @@ if is_internal_test():
if is_internal_tools():
set_default_production_options()
- include_parts(ipp_parts + utest_parts + common_parts + util_parts)
+ include_parts(ipp_parts + utest_parts + common_parts + verifier_parts + member_parts + util_parts)
include_parts(internal_tools_parts + memory_profiler_parts,
INSTALL_BIN='${INSTALL_TOOLS_BIN}')
Default('ikgfwrapper', 'memory_profiler')
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 55a113e..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,36 +0,0 @@
-AC_INIT([Intel(R) EPID SDK],[ ])
-
-# save flags
-CFLAGS_OLD="$CFLAGS"
-CPPFLAGS_OLD="$CPPFLAGS"
-
-#c compiler priority
-AC_PROG_CC([gcc icc cc])
-#c++ compiler priority
-AC_PROG_CXX([g++ icpc c++])
-#define ranlib
-AC_PROG_RANLIB()
-# restore flags
-CFLAGS="$CFLAGS_OLD"
-CPPFLAGS="$CPPFLAGS_OLD"
-
-AC_ARG_WITH([config],
- AS_HELP_STRING([--with-config=type],
- [Choose config type. Possible options are:
- --with-config=release,
- --with-config=size_optimized_release.
- Default is 'release' if no option is specified.]),
- [],
- [with_config=release]
-)
-
-AC_SUBST([CONFIG], ["release"])
-AS_IF([test "x$with_config" != "xrelease"], [
- [CONFIG=size_optimized_release]
-])
-
-# default install path is current directory
-AC_PREFIX_DEFAULT([`pwd`/_install])
-AC_CONFIG_FILES([Makefile])
-AC_OUTPUT
-
diff --git a/doc/html/1_81_2file__parser_8h.html b/doc/html/1_81_2file__parser_8h.html
index 6b012c3..c0bdf3e 100644
--- a/doc/html/1_81_2file__parser_8h.html
+++ b/doc/html/1_81_2file__parser_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -64,7 +64,7 @@ $(document).ready(function(){initNavTree('1_81_2file__parser_8h.html','');});
</div><!--header-->
<div class="contents">
-<p>Epid 1.1 issuer material parsing utilities.
+<p>Intel(R) EPID 1.1 issuer material parsing utilities.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
<code>#include &quot;<a class="el" href="1_81_2types_8h.html">epid/common/1.1/types.h</a>&quot;</code><br />
@@ -87,7 +87,7 @@ Functions</h2></td></tr>
<tr class="separator:gae28a844eb68828480b2a76fcb7d252a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Epid 1.1 issuer material parsing utilities. </p>
+<div class="textblock"><p>Intel(R) EPID 1.1 issuer material parsing utilities. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/1_81_2types_8h.html b/doc/html/1_81_2types_8h.html
index 6e51db7..eaad6be 100644
--- a/doc/html/1_81_2types_8h.html
+++ b/doc/html/1_81_2types_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/Basenames.html b/doc/html/Basenames.html
index 6a7c031..2759709 100644
--- a/doc/html/Basenames.html
+++ b/doc/html/Basenames.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -66,10 +66,16 @@ $(document).ready(function(){initNavTree('Basenames.html','');});
</p>
<h1><a class="anchor" id="random_base"></a>
Random Base Signatures</h1>
+<div class="image">
+<img src="random_base.png" alt="random_base.png"/>
+</div>
<p>By default, members sign using a random basename that is not shared with the verifier. This signing method is also referred to as signing using random base. Signing using random base provides the strongest privacy properties for the signer. If a member signs using random base, the signature generated by the member is anonymous.</p>
<p>When the signer and verifier agree to use random base, the basename is chosen at random for each signature. Two signatures using a random base cannot be linked to the same signer.</p>
<h1><a class="anchor" id="name_based"></a>
Name Based Signatures</h1>
+<div class="image">
+<img src="base_name.png" alt="base_name.png"/>
+</div>
<p>A name based signature is a type of signature that gives the verifier the ability to link Intel&reg; EPID signatures from the same member, reducing the member's privacy. When using name based signatures, the signer and verifier agree on an explicit basename.</p>
<p>The verifier can ask the member to sign a message with a basename that the verifier chooses. If the member agrees to use a name based signature, then all the signatures created by the member using the same basename are linkable by the verifier, reducing the member's privacy.</p>
<p>Reasons why a verifier might require members to use a basename when signing include the following:</p>
diff --git a/doc/html/BuildToolsInstallation.html b/doc/html/BuildToolsInstallation.html
index e65f91c..8c8a243 100644
--- a/doc/html/BuildToolsInstallation.html
+++ b/doc/html/BuildToolsInstallation.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/BuildingSdk.html b/doc/html/BuildingSdk.html
index eed8ffa..75f2557 100644
--- a/doc/html/BuildingSdk.html
+++ b/doc/html/BuildingSdk.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -95,7 +95,7 @@ Building SDK with SCons</h1>
<p>To build based on the default SConstruct file in the root directory of the SDK, invoke scons with no arguments. </p><pre class="fragment">cd &lt;path/to/sdk-root&gt;
scons
</pre><p>By default, this performs a release build of the SDK with unit tests for the current platform and runs unit tests.</p>
-<p>To skip unit test execution when doing cross platfrom build use: </p><pre class="fragment">scons build:: utest::
+<p>To skip unit test execution when doing cross platform build use: </p><pre class="fragment">scons build:: utest::
</pre><p>Built components appear in the <code>_install</code> directory of the SDK root.</p>
<p>Potentially useful command line options:</p>
<table class="doxtable">
@@ -133,6 +133,8 @@ scons
<td><code>run_utest::</code> </td><td>Run unit tests (builds tests if needed) </td></tr>
<tr>
<td><code>-c</code> </td><td>Clean the build </td></tr>
+<tr>
+<td><code>-j N</code> or <code>--jobs=N</code> </td><td>Allow N jobs at once </td></tr>
</table>
<h1><a class="anchor" id="BuildingSdk_Building_Makefile"></a>
Alternate Makefile/Autoconf Based Build Approach</h1>
@@ -149,6 +151,7 @@ make install
</ul>
<p><code>make check</code> is optional. It builds and runs the unit tests.</p>
<p>Alternatively, you can use <code>make build</code> as a shortcut to replace <code>make all</code>, <code>make check</code>, and <code>make install</code>.</p>
+<p>To run N jobs at once use the <code>-j N</code> or <code>--jobs=N</code> option with the <code>make</code> command, e.g. <code>make all -j 4</code> will allow make to create 4 jobs at once.</p>
<p>To clean the build, run <code>make clean</code>.</p>
<p>To remove the install directory, run <code>make uninstall</code>.</p>
<p>To configure cross compilation use <code>--host</code> option. For example, <code>./configure --host=arm-linux-gnueabi</code> configures cross compilation build targeting ARM architecture. Cross compiled tests will not run on the build machine so <code>make check</code> should be replaced to <code>make utest</code>. A typical build sequence for cross compilation is as follows: </p><pre class="fragment">./configure --host=&lt;target system&gt;
diff --git a/doc/html/ChangeLog.html b/doc/html/ChangeLog.html
index 73c3f3a..6ea802d 100644
--- a/doc/html/ChangeLog.html
+++ b/doc/html/ChangeLog.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,47 @@ $(document).ready(function(){initNavTree('ChangeLog.html','');});
<div class="title">What's New </div> </div>
</div><!--header-->
<div class="contents">
-<div class="textblock"><h2>[4.0.0] - 2017-04-25</h2>
+<div class="textblock"><h2>[5.0.0] - 2017-09-15</h2>
+<h3>Added</h3>
+<ul>
+<li>The member implementation now has the option to support signing using a TPM, using the ECDAA capabilities of TPM 2.0.</li>
+</ul>
+<h3>Changed</h3>
+<ul>
+<li>Member API updated to unify HW and SW use cases.<ul>
+<li>Added<ul>
+<li><code>ProvisionKey</code></li>
+<li><code>ProvisionCompressed</code></li>
+<li><code>ProvisionCredential</code></li>
+<li><code>Startup</code></li>
+</ul>
+</li>
+<li>Parameters changed<ul>
+<li><code>MemberCreate</code></li>
+<li><code>RequestJoin</code></li>
+</ul>
+</li>
+<li>Removed or made private<ul>
+<li><code>WritePrecomp</code></li>
+<li><code>SignBasic</code></li>
+<li><code>NrProve</code></li>
+<li><code>AssemblePrivKey</code></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><code>EpidRequestJoin</code> was renamed to <code>EpidCreateJoinRequest</code> to make it clear that it is not directly communicating with the issuer.</li>
+</ul>
+<h3>Fixed</h3>
+<ul>
+<li><code>EpidCreateJoinRequest</code> creates valid join requests. This fixes a regression in <code>EpidRequestJoin</code> introduced in 4.0.0.</li>
+</ul>
+<h3>Known Issues</h3>
+<ul>
+<li>Only the SHA-256 hash algorithm is supported when using the SDK with the IBM TPM simulator due to a defect in version 532 of the simulator.</li>
+<li>Basenames are limited to 124 bytes in TPM mode.</li>
+</ul>
+<h2>[4.0.0] - 2017-04-25</h2>
<h3>Added</h3>
<ul>
<li>The member implementation now provides an internal interface that gives guidance on partitioning member operations between highly sensitive ones that use f value of the private key, and less sensitive operations that can be performed in a host environment.</li>
diff --git a/doc/html/EpidOverview.html b/doc/html/EpidOverview.html
index 64a02c8..cc62682 100644
--- a/doc/html/EpidOverview.html
+++ b/doc/html/EpidOverview.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -67,13 +67,13 @@ $(document).ready(function(){initNavTree('EpidOverview.html','');});
<li class="level2"><a href="#EpidOverview_Verifiers">Verifiers</a></li>
</ul>
</li>
+<li class="level1"><a href="#EpidOverview_Entity_interaction">Member and Verifier Interaction</a></li>
<li class="level1"><a href="#EpidOverview_Groups">Groups</a></li>
<li class="level1"><a href="#EpidOverview_Keys">Keys</a><ul><li class="level2"><a href="#EpidOverview_Group_public_key">Group Public Key</a></li>
<li class="level2"><a href="#EpidOverview_Issuing_private_key">Issuing Private Key</a></li>
<li class="level2"><a href="#EpidOverview_Member_private_key">Member Private Key</a></li>
</ul>
</li>
-<li class="level1"><a href="#EpidOverview_Entity_interaction">Member and Verifier Interaction</a></li>
</ul>
</div>
<div class="textblock"><p>Intel&reg; EPID is a cryptographic protocol which enables the remote authentication of a trusted platform whilst preserving the user's privacy.</p>
@@ -90,14 +90,49 @@ Issuers</h2>
<p>The issuer manages groups by doing the following:</p>
<ul>
<li>Creates groups by generating one issuing private key and one group certificate for each group. The group certificate contains the group public key.</li>
+</ul>
+<div class="image">
+<img src="epid_diagram_group_public_key_and_issuing_private_key.png" alt="epid_diagram_group_public_key_and_issuing_private_key.png"/>
+</div>
+<p><br />
+</p>
+<ul>
<li>Creates group members by generating unique Intel&reg; EPID member private keys through bulk provisioning. Member private keys are created from the issuing private key for the group.</li>
-<li>Manages requests from prospective members to join existing groups by using the join protocol.</li>
-<li>Creates and maintains signature revocation lists and member private key revocation lists. These lists of members no longer in good standing allow members to be dropped from a group.</li>
+<li>Manages requests from prospective members to join existing groups.</li>
+</ul>
+<div class="image">
+<img src="epid_diagram_generating_member_private_keys.png" alt="epid_diagram_generating_member_private_keys.png"/>
+</div>
+<div class="image">
+<img src="epid_diagram_provisioning.png" alt="epid_diagram_provisioning.png"/>
+</div>
+<p><br />
+</p>
+<ul>
<li>Creates and maintains group revocation lists.</li>
-<li>Makes group public keys and revocation lists available to verifiers.</li>
</ul>
<div class="image">
-<img src="epid_diagram_issuer_functionality.png" alt="epid_diagram_issuer_functionality.png"/>
+<img src="epid_diagram_generating_member_private_keys.png" alt="epid_diagram_generating_member_private_keys.png"/>
+</div>
+<div class="image">
+<img src="epid_diagram_provisioning.png" alt="epid_diagram_provisioning.png"/>
+</div>
+<p><br />
+</p>
+<ul>
+<li>Creates and maintains group revocation lists.</li>
+<li>Creates and maintains signature revocation lists and member private key revocation lists. These lists of members no longer in good standing allow members to be dropped from a group.</li>
+</ul>
+<div class="image">
+<img src="epid_diagram_maintaining_revocation_lists.png" alt="epid_diagram_maintaining_revocation_lists.png"/>
+</div>
+<p><br />
+</p>
+<ul>
+<li>Makes group public keys and revocation lists available to verifiers. Makes signature revocation list available to members.</li>
+</ul>
+<div class="image">
+<img src="epid_diagram_issuer_makes_revocation_lists_available.png" alt="epid_diagram_issuer_makes_revocation_lists_available.png"/>
</div>
<h2><a class="anchor" id="EpidOverview_Members"></a>
Members</h2>
@@ -107,9 +142,6 @@ Members</h2>
<li>Each group member has a unique Intel&reg; EPID private key, which corresponds to the group.</li>
<li>The member uses its member private key to sign a message to prove group membership to the verifier without revealing the identity of the member.</li>
</ul>
-<div class="image">
-<img src="epid_diagram_member_functionality.png" alt="epid_diagram_member_functionality.png"/>
-</div>
<h2><a class="anchor" id="EpidOverview_Verifiers"></a>
Verifiers</h2>
<p>The verifier checks an Intel(R) EPID signature to establish whether it was signed by an entity or device that is a member in good standing.</p>
@@ -121,8 +153,13 @@ Verifiers</h2>
<li>Negotiate details of signature protocol with members.</li>
<li>Manage a private list of revoked members, also called the verifier blacklist.</li>
</ul>
+<h1><a class="anchor" id="EpidOverview_Entity_interaction"></a>
+Member and Verifier Interaction</h1>
+<p>Each Intel&reg; EPID member uses its Intel&reg; EPID private key to digitally sign a message. The resulting signature is called an Intel&reg; EPID signature.</p>
+<p>The Intel&reg; EPID verifier uses the group public key to verify the correctness of an Intel&reg; EPID signature, i.e., to verify that the signature was indeed created by a member with a valid Intel&reg; EPID private key.</p>
+<p>However, the Intel&reg; EPID signature does not convey any information about which unique private key was used to create the signature.</p>
<div class="image">
-<img src="epid_diagram_verifier_functionality.png" alt="epid_diagram_verifier_functionality.png"/>
+<img src="epid_diagram_signing_and_verification.png" alt="epid_diagram_signing_and_verification.png"/>
</div>
<h1><a class="anchor" id="EpidOverview_Groups"></a>
Groups</h1>
@@ -152,16 +189,8 @@ Issuing Private Key</h2>
<h2><a class="anchor" id="EpidOverview_Member_private_key"></a>
Member Private Key</h2>
<p>The member private key is the key used by the member to digitally sign a message when attempting to prove to the verifier that the member belongs to the group and is in good standing.</p>
-<p>Unique member private keys are generated by the issuer for each member of a given group. The same group public key corresponds to each member private key in the group.</p>
-<h1><a class="anchor" id="EpidOverview_Entity_interaction"></a>
-Member and Verifier Interaction</h1>
-<p>Each Intel&reg; EPID member uses its Intel&reg; EPID private key to digitally sign a message. The resulting signature is called an Intel&reg; EPID signature.</p>
-<p>The Intel&reg; EPID verifier uses the group public key to verify the correctness of an Intel&reg; EPID signature, i.e., to verify that the signature was indeed created by a member with a valid Intel&reg; EPID private key.</p>
-<p>However, the Intel&reg; EPID signature does not convey any information about which unique private key was used to create the signature.</p>
-<div class="image">
-<img src="epid_diagram_basic_interaction.png" alt="epid_diagram_basic_interaction.png"/>
-</div>
- </div></div><!-- contents -->
+<p>Unique member private keys are generated by the issuer for each member of a given group. The same group public key corresponds to each member private key in the group. </p>
+</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
diff --git a/doc/html/Glossary.html b/doc/html/Glossary.html
index 6f43609..85fb9c6 100644
--- a/doc/html/Glossary.html
+++ b/doc/html/Glossary.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -121,12 +121,12 @@ Intel® EPID signature</h1>
<p>An Intel&reg; EPID signature is a type of digital signature that preserves anonymity of the signer, while still proving the signer is a member of a trusted group.</p>
<h1><a class="anchor" id="Glossary_Issuer"></a>
Issuer</h1>
-<p>The issuer is the entity in the Intel&reg; EPID scheme that is responsible for managing group membership. Issuer APIs are not included in the SDK. An example of an issuer is the Intel Key Generation Facility. For sample issuer material, refer to <a class="el" href="IssuerMaterial.html">Sample Issuer Material</a>. For tools that can help you if you choose to use iKGF as your issuer, refer to <a class="el" href="ChoosingiKGF.html">If You Choose iKGF as Your Issuer</a>.</p>
+<p>The issuer is the entity in the Intel&reg; EPID scheme that is responsible for managing group membership. Issuer APIs are not included in the SDK. An example of an issuer is the Intel Key Generation Facility. For sample issuer material, refer to <a class="el" href="Provisioning.html">Preparing a Device</a>. For tools that can help you if you choose to use iKGF as your issuer, refer to <a class="el" href="IssuerMaterial.html">Test Data</a>.</p>
<p>The issuer manages groups by doing the following:</p>
<ul>
<li>Creates groups by generating one issuing private key and one group certificate for each group. The group certificate contains the group public key.</li>
<li>Creates group members by generating unique Intel&reg; EPID member private keys through bulk provisioning. Member private keys are created from the issuing private key for the group.</li>
-<li>Manages requests from prospective members to join existing groups by using the join protocol.</li>
+<li>Manages requests from prospective members to join existing groups.</li>
<li>Creates and maintains signature based revocation lists and private key based revocation lists. These lists of members no longer in good standing allow members to be dropped from a group.</li>
<li>Creates and maintains group revocation lists.</li>
<li>Makes group public keys and revocation lists available to verifiers.</li>
diff --git a/doc/html/HowValidated.html b/doc/html/HowValidated.html
index 0349ed4..35ced23 100644
--- a/doc/html/HowValidated.html
+++ b/doc/html/HowValidated.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/ImplementationNotes.html b/doc/html/ImplementationNotes.html
index cee7f88..bfe4a21 100644
--- a/doc/html/ImplementationNotes.html
+++ b/doc/html/ImplementationNotes.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/IssuerMaterial.html b/doc/html/IssuerMaterial.html
index 8cc6a8f..5d3dd4c 100644
--- a/doc/html/IssuerMaterial.html
+++ b/doc/html/IssuerMaterial.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Sample Issuer Material</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: Test Data</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -58,36 +58,13 @@ $(document).ready(function(){initNavTree('IssuerMaterial.html','');});
<div id="doc-content">
<div class="header">
<div class="headertitle">
-<div class="title">Sample Issuer Material </div> </div>
+<div class="title">Test Data </div> </div>
</div><!--header-->
<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#IssuerMaterial_Groups">Sample Groups</a><ul><li class="level2"><a href="#IssuerMaterial_Groups_groupa">Sample Group A</a></li>
-<li class="level2"><a href="#IssuerMaterial_Groups_groupb">Sample Group B</a></li>
-</ul>
-</li>
-<li class="level1"><a href="#IssuerMaterial_GroupRls">Group Based Revocation Lists</a></li>
-<li class="level1"><a href="#IssuerMaterial_CmpGroups">Compressed Sample Groups</a><ul><li class="level2"><a href="#IssuerMaterial_CmpGroups_groupa">Compressed Sample Group A</a></li>
-<li class="level2"><a href="#IssuerMaterial_CmpGroups_groupb">Compressed Sample Group B</a></li>
-</ul>
-</li>
-<li class="level1"><a href="#IssuerMaterial_CmpGroupRls">Compressed Group Based Revocation Lists</a></li>
-</ul>
-</div>
-<div class="textblock"><p>The Intel&reg; EPID SDK does not include issuer APIs. That means you cannot generate the following items for validation:</p>
-<ul>
-<li>Group public key, which corresponds to the issuing private key kept by the issuer</li>
-<li>Member private keys</li>
-<li>Signature based revocation list (SigRL)</li>
-<li>Private key based revocation list (PrivRL)</li>
-<li>Group based revocation list (GroupRL)</li>
-</ul>
-<p>For validation purposes, you can use pre-generated sample data. This sample issuer material includes sample groups and revocation lists.</p>
-<p>Sample compressed key material is not included in the package.</p>
+<div class="textblock"><p>The SDK includes sample material in <code>example/data</code> that is intended to be provisioned in members and verifiers so that they can operate without material from a real issuer, such as iKGF.</p>
<h1><a class="anchor" id="IssuerMaterial_Groups"></a>
Sample Groups</h1>
-<h2><a class="anchor" id="IssuerMaterial_Groups_groupa"></a>
-Sample Group A</h2>
+<h2>Sample Group A</h2>
<p>Group A (<code>groupa</code>) contains eight group members and sample revocation lists:</p>
<p><br />
</p>
@@ -133,8 +110,7 @@ Sample Group A</h2>
</table>
<p><br />
</p>
-<h2><a class="anchor" id="IssuerMaterial_Groups_groupb"></a>
-Sample Group B</h2>
+<h2>Sample Group B</h2>
<p>Group B (<code>groupb</code>) contains four group members and sample revocation lists:</p>
<p><br />
</p>
@@ -167,24 +143,23 @@ Sample Group B</h2>
<td>Empty signature based revocation list </td><td><code>groupb/sigrl_empty.bin</code> </td><td>None </td></tr>
</table>
<h1><a class="anchor" id="IssuerMaterial_GroupRls"></a>
-Group Based Revocation Lists</h1>
-<p>If an entire group is no longer valid, the issuer can revoke it using the group based revocation list. Two sample group based revocation lists are provided with the SDK.</p>
+Group Revocation Lists</h1>
+<p>If an entire group is no longer valid, the issuer can revoke it using the group revocation list. Two sample group revocation lists are provided with the SDK.</p>
<p><br />
</p>
<h3>Sample GrpRLs</h3>
<table class="doxtable">
<tr>
-<th>Group Based Revocation List </th><th>Description </th></tr>
+<th>Group Revocation List </th><th>Description </th></tr>
<tr>
<td><code>grprl_empty.bin</code> </td><td>No entries </td></tr>
<tr>
<td><code>grprl.bin</code> </td><td>One entry in which <code>groupb</code> is revoked </td></tr>
</table>
-<h1><a class="anchor" id="IssuerMaterial_CmpGroups"></a>
+<h1><a class="anchor" id="CompressedSamples"></a>
Compressed Sample Groups</h1>
-<p>Intel&reg; EPID SDK supports use of compressed member private keys. The groups described here use compressed compressed member private keys but structuarlly corospond to groups described above.</p>
-<h2><a class="anchor" id="IssuerMaterial_CmpGroups_groupa"></a>
-Compressed Sample Group A</h2>
+<p>Intel&reg; EPID SDK supports use of compressed member private keys. The groups described here use compressed member private keys but structurally correspond to groups described above.</p>
+<h2>Compressed Sample Group A</h2>
<p>Group A (<code>groupa</code>) contains eight group members and sample revocation lists:</p>
<p><br />
</p>
@@ -230,8 +205,7 @@ Compressed Sample Group A</h2>
</table>
<p><br />
</p>
-<h2><a class="anchor" id="IssuerMaterial_CmpGroups_groupb"></a>
-Compressed Sample Group B</h2>
+<h2>Compressed Sample Group B</h2>
<p>Group B (<code>groupb</code>) contains four group members and sample revocation lists:</p>
<p><br />
</p>
@@ -264,14 +238,14 @@ Compressed Sample Group B</h2>
<td>Empty signature based revocation list </td><td><code>groupb/sigrl_empty.bin</code> </td><td>None </td></tr>
</table>
<h1><a class="anchor" id="IssuerMaterial_CmpGroupRls"></a>
-Compressed Group Based Revocation Lists</h1>
-<p>If an entire group is no longer valid, the issuer can revoke it using the group based revocation list. Two sample group based revocation lists are provided with the SDK.</p>
+Compressed Group Revocation Lists</h1>
+<p>If an entire group is no longer valid, the issuer can revoke it using the group revocation list. Two sample group revocation lists are provided with the SDK.</p>
<p><br />
</p>
<h3>Sample GrpRLs</h3>
<table class="doxtable">
<tr>
-<th>Group Based Revocation List </th><th>Description </th></tr>
+<th>Group Revocation List </th><th>Description </th></tr>
<tr>
<td><code>grprl_empty.bin</code> </td><td>No entries </td></tr>
<tr>
diff --git a/doc/html/LegalInformation.html b/doc/html/LegalInformation.html
index 3ee8118..f36d152 100644
--- a/doc/html/LegalInformation.html
+++ b/doc/html/LegalInformation.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/Provisioning.html b/doc/html/Provisioning.html
new file mode 100644
index 0000000..fc2ab11
--- /dev/null
+++ b/doc/html/Provisioning.html
@@ -0,0 +1,138 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: Preparing a Device</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('Provisioning.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">Preparing a Device </div> </div>
+</div><!--header-->
+<div class="contents">
+<div class="toc"><h3>Table of Contents</h3>
+<ul><li class="level1"><a href="#Provisioning_BulkProvisioning">Bulk Provisioning</a></li>
+<li class="level1"><a href="#Provisioning_JoinProvisioning">Dynamic Provisioning</a></li>
+<li class="level1"><a href="#SampleIssuerMaterial">Issuer Material</a><ul><li class="level2"><a href="#Provisioning_ValidatingVerifiers">Issuer Material for Verifiers</a></li>
+<li class="level2"><a href="#Provisioning_ValidatingMembers">Issuer Material for Members</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="textblock"><p>In order to be an Intel&reg; EPID device, members need to be provisioned with a member private key and group public key. Members can get member private keys through bulk or dynamic provisioning.</p>
+<p>For Intel&reg; EPID verifiers to function, they need access to a group public key and revocation lists.</p>
+<p>All Intel&reg; EPID keys and revocation lists are referred to collectively as issuer material.</p>
+<p>This section describes how to:</p>
+<ul>
+<li>Provision member private keys through bulk provisioning</li>
+<li>Provision member private keys through dynamic provisioning</li>
+<li>Provision members and verifiers with sample issuer material</li>
+</ul>
+<p>For information on obtaining real issuer material from iKGF (Intel Key Generation Facility), see <a class="el" href="UsingiKGF.html">Managing Groups with iKGF</a>. For more general information on how the issuer provides material for members and verifiers, see <a class="el" href="EpidOverview.html">Introduction to the Intel&reg; EPID Scheme</a>.</p>
+<h1><a class="anchor" id="Provisioning_BulkProvisioning"></a>
+Bulk Provisioning</h1>
+<p><b>Bulk provisioning</b> is typically done during manufacturing.</p>
+<p>In bulk provisioning, the issuer provides complete member private keys to the device manufacturer.</p>
+<p>In bulk provisioning, the manufacturer needs to do the following:</p>
+<ul>
+<li>Request member private keys from the issuer in bulk. These are complete member private keys, including the membership credential and the secret f component.</li>
+<li>Fuse the member private keys into each device.</li>
+</ul>
+<h1><a class="anchor" id="Provisioning_JoinProvisioning"></a>
+Dynamic Provisioning</h1>
+<p><b>Dynamic provisioning</b> was designed to allow a device to join a group post-manufacturing. While key generation is the key part of bulk provisioning, the key part of dynamic provisioning is the join protocol.</p>
+<p>Dynamic provisioning relies on a two-way exchange of intermediate values to protect the secrecy of the final member private key. In dynamic provisioning, the issuer provides the membership credential component of each member private key, while the secret <code>f</code> value comes from the device and is never known to the issuer.</p>
+<div class="image">
+<img src="member_private_key.png" alt="member_private_key.png"/>
+</div>
+<p>In dynamic provisioning, the manufacturer needs to do the following:</p>
+<ol type="1">
+<li><b>Generate the <code>f</code> value</b> of the member private key.</li>
+<li><b>Generate the join request</b> using the <code>f</code> value and a nonce obtained from the issuer.</li>
+<li>Send the join request to the issuer. The issuer will respond to the join request by returning the membership credential.</li>
+<li><b>Provision the membership credential</b> to the member device.</li>
+</ol>
+<h1><a class="anchor" id="SampleIssuerMaterial"></a>
+Issuer Material</h1>
+<p>Members and verifiers need issuer material to operate. The SDK includes sample material in <code>example/data</code> so that members and verifiers can operate without real issuer material. The following types of sample issuer material are included:</p>
+<ul>
+<li>Group public key, which corresponds to the issuing private key kept by the issuer</li>
+<li>Member private keys</li>
+<li>Signature based revocation list (SigRL)</li>
+<li>Private key based revocation list (PrivRL)</li>
+<li>Group revocation list (GroupRL)</li>
+</ul>
+<p>For detailed information on what sample issuer material is included in the SDK, refer to <a class="el" href="IssuerMaterial.html">Test Data</a>.</p>
+<p>For information on how to work with real issuer material, refer to <a class="el" href="UsingiKGF.html">Managing Groups with iKGF</a>.</p>
+<h2><a class="anchor" id="Provisioning_ValidatingVerifiers"></a>
+Issuer Material for Verifiers</h2>
+<p>To test a verifier, you can provide the verifier a sample group public key and sample revocation lists from <code>example/data</code>, and make sure that verification succeeds or fails based on the revoked or non-revoked status of the member.</p>
+<h2><a class="anchor" id="Provisioning_ValidatingMembers"></a>
+Issuer Material for Members</h2>
+<p>To test a member, you can provision the member with a sample group public key, sample member private key, and sample <code>SigRL</code> from <code>example/data</code>.</p>
+<p>You can provision the member with revoked material to make sure the verification process fails. For example, when you sign and verify using the member <code>groupa/privrevokedmember0</code>, and use the sample private key revocation list on which <code>privrevokedmember0</code> is revoked, verification should fail.</p>
+<p>Similarly, when you generate a signature using the member <code>groupa/sigrevokedmember0</code>, using sample SigRL <code>groupa/sigrl.bin</code>, verification should fail. </p>
+</div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/Revocation.html b/doc/html/Revocation.html
index 0cea37f..46ede3b 100644
--- a/doc/html/Revocation.html
+++ b/doc/html/Revocation.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/SdkOverview.html b/doc/html/SdkOverview.html
index 8bac140..a0184fe 100644
--- a/doc/html/SdkOverview.html
+++ b/doc/html/SdkOverview.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -63,7 +63,12 @@ $(document).ready(function(){initNavTree('SdkOverview.html','');});
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#SdkOverview_Components">SDK Components</a></li>
-<li class="level1"><a href="#SdkOverview_Files">Filesystem Layout</a><ul><li class="level2"><a href="#SdkOverview_Files_SourceLayout">Source Layout</a></li>
+<li class="level1"><a href="#SdkOverview_Core">SDK Core</a></li>
+<li class="level1"><a href="#SdkOverview_Samples">Samples</a></li>
+<li class="level1"><a href="#SdkOverview_Tools">Tools</a></li>
+<li class="level1"><a href="#SdkOverview_BuildingAndValidation">Building and Validation</a></li>
+<li class="level1"><a href="#SdkOverview_Compatibility">Intel&reg; EPID 1.1 Compatibility</a></li>
+<li class="level1"><a href="#SdkOverview_Files">Folder Layout</a><ul><li class="level2"><a href="#SdkOverview_Files_SourceLayout">Source Layout</a></li>
<li class="level2"><a href="#SdkOverview_Files_InstallLayout">Install Layout</a></li>
</ul>
</li>
@@ -77,6 +82,10 @@ SDK Components</h1>
</div>
<p><br />
The Intel&reg; EPID SDK is divided into the following components:</p>
+<p><br />
+</p>
+<h1><a class="anchor" id="SdkOverview_Core"></a>
+SDK Core</h1>
<p>Components in the SDK Core implement the features of Intel&reg; EPID.</p>
<table class="doxtable">
<tr>
@@ -92,7 +101,12 @@ SDK Components</h1>
<tr>
<td>IPP </td><td>A C-only non-optimized subset of Intel&reg; IPP </td></tr>
</table>
-<p><a class="el" href="Examples.html">Examples</a> show how to use the SDK APIs in working code.</p>
+<p><br />
+</p>
+<h1><a class="anchor" id="SdkOverview_Samples"></a>
+Samples</h1>
+<p>The SDK includes <a class="el" href="IssuerMaterial.html">Test Data</a> in <code>example/data</code> that is intended to be provisioned in members and verifiers so that they can operate without real issuer material. (For information on how to work with real issuer material, refer to <a class="el" href="UsingiKGF.html">Managing Groups with iKGF</a>.)</p>
+<p>The SDK also includes signing and verification <a class="el" href="Examples.html">Examples</a> that show how to use the SDK APIs in working code.</p>
<table class="doxtable">
<tr>
<th>Component </th><th>Description </th></tr>
@@ -105,7 +119,11 @@ SDK Components</h1>
<tr>
<td>Sample Issuer Material </td><td>Sample keys and revocation lists </td></tr>
</table>
-<p>Tools to interact with Intel&reg; EPID related services such those offered by the <a class="el" href="ChoosingiKGF.html">Intel&reg; Key Generation Facility</a>.</p>
+<p><br />
+</p>
+<h1><a class="anchor" id="SdkOverview_Tools"></a>
+Tools</h1>
+<p>The SDK provides tools to interact with Intel&reg; EPID related services such those offered by the <a class="el" href="IssuerMaterial.html">Intel&reg; Key Generation Facility</a>.</p>
<table class="doxtable">
<tr>
<th>Component </th><th>Description </th></tr>
@@ -120,6 +138,10 @@ SDK Components</h1>
<tr>
<td>revokesig </td><td>A tool to create a revocation request from a signature </td></tr>
</table>
+<p><br />
+</p>
+<h1><a class="anchor" id="SdkOverview_BuildingAndValidation"></a>
+Building and Validation</h1>
<p>The SDK comes with a number of other components that support building and validating the code.</p>
<table class="doxtable">
<tr>
@@ -132,12 +154,15 @@ SDK Components</h1>
<td>dropt </td><td>Library for parsing command line </td></tr>
</table>
<p>Math primitives are implemented in the <em>math</em> sub-component of <em>common</em>. The reference math primitive implementation is based on a non-optimized Vanilla C subset of the Intel&reg; Performance Primitives. <em>Math</em> is designed so that you can replace its implementation to call custom hardware IP blocks or optimized libraries.</p>
-<h2>Intel&reg; EPID 1.1 Compatibility</h2>
+<p><br />
+</p>
+<h1><a class="anchor" id="SdkOverview_Compatibility"></a>
+Intel® EPID 1.1 Compatibility</h1>
<p>In addition to the default Intel&reg; EPID 2.0 APIs, the <em>verifier</em> component also includes APIs that allow verification of Intel&reg; EPID 1.1 signatures.</p>
<p>Billions of existing devices, including most Intel platforms manufactured since 2008, create signatures that need Intel&reg; EPID 1.1 verification.</p>
-<p>For details on verifying Intel&reg; EPID 1.1 signatures see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> in the API Reference.</p>
+<p>For details on verifying Intel&reg; EPID 1.1 signatures see <a href="group___epid11_verifier_module.html#details"><b>Intel&reg; EPID 1.1 support</b></a> in the API Reference.</p>
<h1><a class="anchor" id="SdkOverview_Files"></a>
-Filesystem Layout</h1>
+Folder Layout</h1>
<p>The Intel&reg; EPID SDK has two filesystem layouts: the Source Layout and the Install Layout.</p>
<p>The Source Layout is what you find when you download the SDK and extract it to disk. This layout contains all of the files that you need to build the libraries, samples, tests, and data generated by the SDK.</p>
<p>The Install Layout is the layout of files under the <code>_install</code> folder after you build the SDK.</p>
@@ -148,7 +173,9 @@ Source Layout</h2>
|__ NOTICE.txt Legal notices
|__ README.md Readme
|__ CHANGELOG.md Change log
-|__ SConstruct Main build configuration
+|__ SConstruct Parts based build configuration
+|__ configure Make based build configuration
+|__ Makefile.in Make based build configuration
|
|__ doc/
| |__ html/ HTML format documentation
@@ -190,6 +217,7 @@ Install Layout</h2>
| |__ &lt;platform&gt; Target specific static libraries for the SDK
|
|__example/ Sample applications and data
+ |__compressed_example/ Compressed Member Key Binary data for sample applications
|__test/ Unit test executables (if unit tests built)
|__tools/ Tools</pre> </div></div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/SignVerifyTutorial.html b/doc/html/SignVerifyTutorial.html
index 1afa84e..1d2e6cb 100644
--- a/doc/html/SignVerifyTutorial.html
+++ b/doc/html/SignVerifyTutorial.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -84,7 +84,7 @@ $(document).ready(function(){initNavTree('SignVerifyTutorial.html','');});
</ul>
</div>
<div class="textblock"><p>The Intel&reg; EPID SDK provides example tools to show you how to use the Intel&reg; EPID SDK APIs. These examples are called <code>signmsg</code> and <code>verifysig</code>.</p>
-<p>These examples use the pre-generated data described in <a class="el" href="IssuerMaterial.html">Sample Issuer Material</a>. After you build the SDK, the data is in the <code>_install/epid-sdk/example/data</code> directory. If you don't have genuine issuer material, you can use this data for validation purposes.</p>
+<p>These examples use the pre-generated data described in <a class="el" href="IssuerMaterial.html">Test Data</a>. After you build the SDK, the data is in the <code>_install/epid-sdk/example/data</code> directory. If you don't have genuine issuer material, you can use this data for validation purposes.</p>
<p>You can follow along with the commands used in this tutorial if you first build these examples using the instructions in <a class="el" href="BuildingSdk.html">Building from Source</a>. The tutorial assumes <code>_install/epid-sdk/example</code> is the current directory.</p>
<p>All command lines in this tutorial use posix command line conventions; for other systems, adjust accordingly.</p>
<p>For detailed walkthroughs of the code used in <code>signmsg</code> and <code>verifysig</code>, refer to <a class="el" href="Examples.html">Walkthroughs of Examples Showing API Usage</a>.</p>
@@ -138,9 +138,6 @@ Options:
--mprecmpi=FILE
load pre-computed member data from FILE
- --mprecmpo=FILE
- write pre-computed member data to FILE
-
--capubkey=FILE
load IoT Issuing CA public key from FILE (default: cacert.bin)
@@ -162,7 +159,7 @@ What Do You Need to Verify a Signature?</h2>
<p>To verify a signature, you need the following items:</p>
<ul>
<li><b>Signature:</b> You need the signature that you want to verify.</li>
-<li><b>CA certificate:</b> You need the CA certificate to verify the authenticity of the issuer material before you use it. Depending on how your issuer protects its data, you may not need a CA certificate. For more information on issuer material, refer to <a class="el" href="ChoosingiKGF.html">If You Choose iKGF as Your Issuer</a> and <a class="el" href="IssuerMaterial.html">Sample Issuer Material</a>.</li>
+<li><b>CA certificate:</b> You need the CA certificate to verify the authenticity of the issuer material before you use it. Depending on how your issuer protects its data, you may not need a CA certificate. For more information on issuer material, refer to <a class="el" href="Provisioning.html">Preparing a Device</a> and <a class="el" href="IssuerMaterial.html">Test Data</a>.</li>
<li><b>Group certificate:</b> The group certificate comes from the issuer and contains the group public key. You need the group public key to determine if the signature came from a member of this group. The group public key corresponds to the member private key used to generate the signature.</li>
<li><b>Message:</b> In order for verification to succeed, you need to specify the message that was signed.</li>
<li><b>Hash algorithm:</b> In order for verification to succeed, you need to specify the hash algorithm that was used to sign the message. If you don't specify a hash algorithm, a default hash algorithm is used.</li>
diff --git a/doc/html/TpmConsiderations.html b/doc/html/TpmConsiderations.html
new file mode 100644
index 0000000..7bef89c
--- /dev/null
+++ b/doc/html/TpmConsiderations.html
@@ -0,0 +1,222 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: Considerations for TPM</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('TpmConsiderations.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">Considerations for TPM </div> </div>
+</div><!--header-->
+<div class="contents">
+<div class="toc"><h3>Table of Contents</h3>
+<ul><li class="level1"><a href="#TPM_compatibility">Compatibility</a></li>
+<li class="level1"><a href="#TpmConsiderations_Manufacturers">Considerations for TPM Manufacturers</a><ul><li class="level2"><a href="#TPM_provisioning">Provisioning TPM with Intel&reg; EPID Key Material</a></li>
+<li class="level2"><a href="#TpmConsiderations_Mapping">Mapping TPM Commands to Intel&reg; EPID</a></li>
+</ul>
+</li>
+<li class="level1"><a href="#TpmConsiderations_Applications">Considerations for TPM Applications</a></li>
+<li class="level1"><a href="#TpmConsiderations_Architecture">SDK Member Architecture</a></li>
+<li class="level1"><a href="#TpmConsiderations_Building">Building the SDK to Take Advantage of TPM</a><ul><li class="level2"><a href="#TpmConsiderations_Prereqs">Prerequisites to Build the SDK in TPM Mode</a></li>
+<li class="level2"><a href="#TpmConsiderations_BuildingTpmMode">Building the SDK in TPM Mode</a></li>
+<li class="level2"><a href="#TpmConsiderations_Signing">Intel&reg; EPID Signing and Verification</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="textblock"><p>Intel&reg; EPID is compatible with TPM (Trusted Platform Modules) and is designed to take advantage of the security features of TPM. This section describes integrating a TPM device and Intel&reg; EPID functionality.</p>
+<p>Intel&reg; EPID is a technology for securely and anonymously identifying a device, and TPM is a technology for protecting secrets on a device. Therefore it is desirable to protect the most secret part of the member private key on an Intel&reg; EPID TPM device.</p>
+<h1><a class="anchor" id="TPM_compatibility"></a>
+Compatibility</h1>
+<p>The SDK is compatible with the Trusted Computing Group's TPM 2.0 spec. The most recent version of the TPM 2.0 specification (Level 00, Revision 01.38) includes the use of a nonce, which is incompatible with the current version of the Intel&reg; EPID scheme. Therefore, this implementation of Intel&reg; EPID APIs is compatible with an earlier version, which is the TPM 2.0 specification Level 00, Revision 1.16.</p>
+<h1><a class="anchor" id="TpmConsiderations_Manufacturers"></a>
+Considerations for TPM Manufacturers</h1>
+<p>This section explains what manufacturers have to do with the SDK in order to have their TPMs recognized to a service provider:</p>
+<ul>
+<li>Provisioning TPM devices with crypto secrets</li>
+<li>Adapting SDK code to specific TSS functionality</li>
+</ul>
+<p>This SDK was tested on the IBM TPM and TSS (Trusted Computing Group Software Stack). Device manufacturers should replace specific items with their own TPM functionality.</p>
+<h2><a class="anchor" id="TPM_provisioning"></a>
+Provisioning TPM with Intel® EPID Key Material</h2>
+<p>For TPM use with Intel&reg; EPID, members and verifiers need to be provisioned with crypto material to enable security function.</p>
+<p>In order to ensure that the <code>f</code> value only exists in the volatile memory of the TPM, TPM manufacturers need to provision the TPM with an EPS (Endorsement Primary Seed), from which the <code>f</code> value of the member private key is derived.</p>
+<p>Typically, bulk provisioning is more efficient than dynamic provisioning in a manufacturing environment. However, bulk provisioning is not viable for TPM devices for the following reasons:</p>
+<ul>
+<li>In bulk provisioning, the issuer provides <code>f</code> as part of each member private key, but it is intentionally difficult to derive EPS from <code>f</code>.</li>
+<li>The issuer cannot provide EPS to manufacturers because the translation from EPS to <code>f</code> is dependent upon an implementation specific, deterministic random number generator.</li>
+</ul>
+<p>Therefore, in order to provision the TPM with EPS, Intel supports a variation on typical <a class="el" href="Provisioning.html#Provisioning_JoinProvisioning">dynamic provisioning</a> in which manufacturers provide their own EPS.</p>
+<p>In this variation on dynamic provisioning, which we call <b>bulk-join</b>, some steps are performed in bulk and credentials for many devices can be generated at the same time. This process allows TPM devices to be provisioned during manufacturing.</p>
+<p>For bulk-dynamic provisioning, TPM device manufacturers need to do the following:</p>
+<ol type="1">
+<li><b>Generate a set of EPS</b>, because EPS are the seeds from which the <code>f</code> values of the member private keys are generated.</li>
+<li><b>Derive a set of <code>f</code> values</b> from the EPS values.</li>
+<li><b>Request a set of nonces from the issuer</b> which will be used to generate join requests.</li>
+<li><b>Generate a set of join requests</b> using the <code>f</code> values and nonces and send them to the issuer. The issuer will respond to the bulk join requests by sending membership credentials to the manufacturer in bulk.</li>
+<li><b>Provision the membership credentials in silicon,</b> mapping each membership credential to the corresponding EPS value.</li>
+</ol>
+<p>The following graphic shows how the issuer, manufacturer, TPM, and member interact during the time of key generation, device manufacturing, and signing:</p>
+<div class="image">
+<img src="uml_sequence.png" alt="uml_sequence.png"/>
+</div>
+<h2><a class="anchor" id="TpmConsiderations_Mapping"></a>
+Mapping TPM Commands to Intel® EPID</h2>
+<p>APIs</p>
+<p>The <code>tpm2</code> module in the <code>member</code> section of the API reference contains internal functions that map to TPM commands. This code is provided as sample code for manufacturers who will use it to write their own implementation of Intel&reg; EPID APIs for TPM.</p>
+<table class="doxtable">
+<tr>
+<th>Intel&reg; EPID Function </th><th>Corresponding TPM 2.0 Command </th></tr>
+<tr>
+<td>Tpm2Commit </td><td>TPM2_Commit </td></tr>
+<tr>
+<td>Tpm2CreateContext </td><td>N/A </td></tr>
+<tr>
+<td>Tpm2DeleteContext </td><td>N/A </td></tr>
+<tr>
+<td>Tpm2GetRandom </td><td>TPM2_GetRandom </td></tr>
+<tr>
+<td>Tpm2LoadExternal </td><td>TPM2_LoadExternal </td></tr>
+<tr>
+<td>Tpm2NvDefineSpace </td><td>TPM2_NV_DefineSpace </td></tr>
+<tr>
+<td>Tpm2NvUndefineSpace </td><td>TPM2_NV_UndefineSpace </td></tr>
+<tr>
+<td>Tpm2NvWrite </td><td>TPM2_NV_Write </td></tr>
+<tr>
+<td>Tpm2NvRead </td><td>TPM2_NV_Read </td></tr>
+<tr>
+<td>Tpm2Sign </td><td>TPM2_Sign </td></tr>
+</table>
+<h1><a class="anchor" id="TpmConsiderations_Applications"></a>
+Considerations for TPM Applications</h1>
+<p>Unlike non-TPM device manufacturers, TPM manufacturers cannot use EpidProvisionKey. TPMs are designed to protect secret values from access even by the programs that use them. Dynamic provisioning is specifically designed to allow this use case.</p>
+<p>To get a TPM device running, TPM applications can use the following steps to join a group using a TPM protected secret:</p>
+<ol type="1">
+<li>Use <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a> to create a new member context. <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a> takes the parameter <a class="el" href="struct_member_params.html" title="Software only specific member parameters. ">MemberParams</a>. You will pass NULL to this struct instead of the <code>f</code> value, which indicates that <code>f</code> needs to be derived from the EPS within the TPM.</li>
+<li>Use <a class="el" href="group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3" title="Creates a request to join a group. ">EpidCreateJoinRequest</a> to generate join requests using the <code>f</code> derived from EPS within the TPM. Then send the join request to the issuer to request a membership credential.</li>
+<li>After receiving the membership credential (A, x), use EpidProvisionCredential to provision it into the non-volatile memory of the TPM device.</li>
+</ol>
+<p>After the TPM device is provisioned with EpidProvisionCredential, the simplest way to get the device running is:</p>
+<ol type="1">
+<li><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a>,</li>
+<li>EpidMemberStartup, and</li>
+<li><a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f" title="Writes an Intel(R) EPID signature. ">EpidSign</a>.</li>
+</ol>
+<h1><a class="anchor" id="TpmConsiderations_Architecture"></a>
+SDK Member Architecture</h1>
+<p>In the SDK, the Tpm2 module exposes commands that can be mapped to real TSS commands.</p>
+<div class="image">
+<img src="member_host.png" alt="member_host.png"/>
+</div>
+<p>The <b>Member Host</b> (<code>member/src</code>) implements Intel&reg; EPID signing in terms of TPM2 commands.</p>
+<p>The <b>TPM module</b> (<code>member/tpm2</code>) implements TPM2 commands.</p>
+<p>There are two implementations of TPM functionality:</p>
+<ul>
+<li><b>BM TSS dispatcher implementation</b> (<code>member/tpm2/ibm_tss</code>), which calls the IBM TSS, which calls the IBM TPM simulator (in this implementation). It is invoked when building in TPM mode.</li>
+<li><b>TPM SDK software implementation</b> (<code>member/tpm2/src</code>) implements sufficient TPM functionality for Intel&reg; EPID. It is invoked when building in non-TPM mode.</li>
+</ul>
+<h1><a class="anchor" id="TpmConsiderations_Building"></a>
+Building the SDK to Take Advantage of TPM</h1>
+<p>This section describes:</p>
+<ul>
+<li>Prerequisites to building the SDK to take advantage of TPM</li>
+<li>Building the SDK in TPM mode</li>
+<li>Running signing and verification operations with TPM</li>
+</ul>
+<h2><a class="anchor" id="TpmConsiderations_Prereqs"></a>
+Prerequisites to Build the SDK in TPM Mode</h2>
+<ol type="1">
+<li>Download <a href="https://sourceforge.net/projects/ibmtpm20tss/files/?source=navbar">IBM TSS</a> version <a href="https://sourceforge.net/projects/ibmtpm20tss/files/ibmtss996.tar.gz/download">966</a>. (The SDK was tested on version 966. Newer versions may also work, but we do not guarantee it.)</li>
+<li>Download <a href="https://sourceforge.net/projects/ibmswtpm2/files/?source=navbar">IBM TPM</a> version <a href="https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm532.tar/download">532</a>. (The SDK was tested on version 532 and does not work on newer versions.)</li>
+<li>Build the IBM TSS in accordance with the build steps from the package. Copy <code>tss.lib</code> and <code>tss.dll</code> from <code>ibmtss\tpmutils\Release</code> to <code>ibmtss\utils</code>.</li>
+</ol>
+<h2><a class="anchor" id="TpmConsiderations_BuildingTpmMode"></a>
+Building the SDK in TPM Mode</h2>
+<p>Set the TSSROOT environment variable to the <code>..\ibmtss\utils\</code> folder. Make sure this folder contains the <code>\tss2</code> folder, <code>tss.lib</code> and <code>tss.dll</code>. Example of the command for Windows: </p><pre class="fragment">&gt; set TSSROOT=C:\ibmtss\utils\
+</pre><p>To build the SDK in TPM mode, go to the SDK folder and build the SDK with the following command: </p><pre class="fragment">&gt; scons --target=x86 --use-tss
+</pre><p>Because the IBM TSS only supports x86 targets, you must build in x86.</p>
+<h2><a class="anchor" id="TpmConsiderations_Signing"></a>
+Intel® EPID Signing and Verification</h2>
+<p>with a TPM</p>
+<ol type="1">
+<li>Build the IBM TSS (see above).</li>
+<li>Build the IBM TPM (see above).</li>
+<li>Build the Intel&reg; EPID SDK with <code>--target=86 --use-tss</code> (see above).</li>
+<li>Copy <code>tss.dll</code> from <code>_install/epid-sdk/test</code> to <code>_install/epid-sdk/example</code>.</li>
+<li>Go to the <code>ibmtpm</code> folder and run the <code>tpm_server</code> executable. Note: if you built the TPM server with the MS Visual Studio debug mode, go to the <code>..\ibmtpm\tpmvstudio\tpm_server\Debug\</code> folder.</li>
+<li>You need to run both the TPM server and the <code>powerup</code> and <code>startup</code> executables on IBM TSS. Go to <code>..\ibmtss\tpmutils\Debug\</code> or <code>..\ibmtss\tpmutils\Release\</code> and run <code>powerup</code> and <code>startup</code> executables.</li>
+</ol>
+<p>Then you can run:</p>
+<pre class="fragment">&gt; signmsg --hashalg=SHA-256 --msg="test"
+</pre><dl class="section note"><dt>Note</dt><dd>In TPM mode samples have to be used with <code>--hashalg=SHA-256</code>.</dd></dl>
+<p>If signing succeeds, nothing is returned.</p>
+<p>Then run:</p>
+<pre class="fragment">&gt; verifysig --hashalg=SHA-256 --msg="test"
+-signature verified successfully
+</pre><dl class="section note"><dt>Note</dt><dd>The samples use <code>LoadExternal</code> to load keys into the TPM. In a real TPM use case, <code>CreatePrimary</code> will be used, and the SDK implementation provides functions for this use case. </dd></dl>
+</div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/UserManual_GeneratingAnIntelEpidSignature.html b/doc/html/UserManual_GeneratingAnIntelEpidSignature.html
index 7ea42f4..b08fac3 100644
--- a/doc/html/UserManual_GeneratingAnIntelEpidSignature.html
+++ b/doc/html/UserManual_GeneratingAnIntelEpidSignature.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -76,8 +76,8 @@ Signmsg Walkthrough</h1>
<p><br />
</p>
<p>First, we include headers so we have access to needed declarations.</p>
-<p><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><span class="preprocessor">#include &quot;src/signmsg.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;src/prng.h&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="member_2api_8h.html">epid/member/api.h</a>&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="file__parser_8h.html">epid/common/file_parser.h</a>&quot;</span></div></div><!-- fragment --></p>
-<p>The <code>prng.h</code> header provides access to a pseudo-random number generator needed for signing, while the utility headers are used by <code>signmsg</code> for logging and buffer management. The <code><a class="el" href="member_2api_8h.html" title="Intel(R) EPID SDK member API. ">epid/member/api.h</a></code> header provides access to the core member APIs. The <code><a class="el" href="file__parser_8h.html" title="Epid issuer material parsing utilities. ">epid/common/file_parser.h</a></code> header provides an API for parsing buffers formatted according to the various IoT Intel&reg; EPID binary file formats.</p>
+<p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;src/signmsg.h&quot;</span></div><div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="file__parser_8h.html">epid/common/file_parser.h</a>&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="member_2api_8h.html">epid/member/api.h</a>&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;src/prng.h&quot;</span></div></div><!-- fragment --></p>
+<p>The <code>prng.h</code> header provides access to a pseudo-random number generator needed for signing, while the utility headers are used by <code>signmsg</code> for logging and buffer management. The <code><a class="el" href="member_2api_8h.html" title="Intel(R) EPID SDK member API. ">epid/member/api.h</a></code> header provides access to the core member APIs. The <code><a class="el" href="file__parser_8h.html" title="Intel(R) EPID issuer material parsing utilities. ">epid/common/file_parser.h</a></code> header provides an API for parsing buffers formatted according to the various IoT Intel&reg; EPID binary file formats. The <code><a class="el" href="software__member_8h.html" title="Member creation parameters for software only implementation. ">epid/member/software_member.h</a></code> provides an implementation specific definition of <a class="el" href="struct_member_params.html" title="Software only specific member parameters. ">MemberParams</a>. The specific definition of <a class="el" href="struct_member_params.html" title="Software only specific member parameters. ">MemberParams</a> may differ dramatically between implementations.</p>
<p><br />
</p>
<p>We define a stub function responsible for checking that the CA certificate is authorized by the root CA.</p>
@@ -85,29 +85,30 @@ Signmsg Walkthrough</h1>
<p><br />
</p>
<p>The core signing functionality is contained in <code>SignMsg</code>.</p>
-<p><div class="fragment"><div class="line"><a class="code" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> SignMsg(<span class="keywordtype">void</span> <span class="keyword">const</span>* msg, <span class="keywordtype">size_t</span> msg_len, <span class="keywordtype">void</span> <span class="keyword">const</span>* basename,</div><div class="line"> <span class="keywordtype">size_t</span> basename_len, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* signed_sig_rl,</div><div class="line"> <span class="keywordtype">size_t</span> signed_sig_rl_size,</div><div class="line"> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* signed_pubkey,</div><div class="line"> <span class="keywordtype">size_t</span> signed_pubkey_size, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* priv_key_ptr,</div><div class="line"> <span class="keywordtype">size_t</span> privkey_size, <a class="code" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg,</div><div class="line"> <a class="code" href="struct_member_precomp.html">MemberPrecomp</a>* member_precomp, <span class="keywordtype">bool</span> member_precomp_is_input,</div><div class="line"> <a class="code" href="struct_epid_signature.html">EpidSignature</a>** sig, <span class="keywordtype">size_t</span>* sig_len,</div><div class="line"> <a class="code" href="struct_epid_ca_certificate.html">EpidCaCertificate</a> <span class="keyword">const</span>* cacert) {</div></div><!-- fragment --></p>
+<p><div class="fragment"><div class="line"><a class="code" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> SignMsg(<span class="keywordtype">void</span> <span class="keyword">const</span>* msg, <span class="keywordtype">size_t</span> msg_len, <span class="keywordtype">void</span> <span class="keyword">const</span>* basename,</div><div class="line"> <span class="keywordtype">size_t</span> basename_len, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* signed_sig_rl,</div><div class="line"> <span class="keywordtype">size_t</span> signed_sig_rl_size,</div><div class="line"> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* signed_pubkey,</div><div class="line"> <span class="keywordtype">size_t</span> signed_pubkey_size, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <span class="keyword">const</span>* priv_key_ptr,</div><div class="line"> <span class="keywordtype">size_t</span> privkey_size, <a class="code" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg,</div><div class="line"> <a class="code" href="struct_member_precomp.html">MemberPrecomp</a>* member_precomp, <a class="code" href="struct_epid_signature.html">EpidSignature</a>** sig,</div><div class="line"> <span class="keywordtype">size_t</span>* sig_len, <a class="code" href="struct_epid_ca_certificate.html">EpidCaCertificate</a> <span class="keyword">const</span>* cacert) {</div></div><!-- fragment --></p>
<p>The <code>SignMsg</code> parameters are either received by the member, or they are part of the member's configuration. The exceptions are the <code>sig</code> and <code>sig_len</code> parameters, which are used to output the signature.</p>
<p>The verifier might send the message to the member or there may be another mechanism to choose the message, but the way the message is communicated is outside the scope of the Intel&reg; EPID scheme.</p>
-<p>We use the parameters <code>member_precomp</code> and <code>member_precomp_is_input</code> to pass in a pre-computation blob if provided. We can use the pre-computation blob to increase performance when verifying signatures repeatedly with the same group public key.</p>
+<p>We use the parameters <code>member_precomp</code> to pass in a pre-computation blob if provided. We can use the pre-computation blob to increase performance when verifying signatures repeatedly with the same group public key.</p>
<p>The member knows the group public key and the member private key.</p>
<p>The member and the verifier agree on the message, basename, hash algorithm, and SigRL that the member uses for signing.</p>
<p><br />
</p>
<p>Next we do basic variable setup and argument checking.</p>
-<p><div class="fragment"><div class="line"> <a class="code" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aa08f0d2e394b37694117a6a32bc71e6e">kEpidErr</a>;</div><div class="line"> <span class="keywordtype">void</span>* prng = NULL;</div><div class="line"> <a class="code" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a>* member = NULL;</div><div class="line"> <a class="code" href="struct_sig_rl.html">SigRl</a>* sig_rl = NULL;</div><div class="line"></div><div class="line"> <span class="keywordflow">do</span> {</div><div class="line"> <a class="code" href="struct_group_pub_key.html">GroupPubKey</a> pub_key = {0};</div><div class="line"> <a class="code" href="struct_priv_key.html">PrivKey</a> priv_key = {0};</div><div class="line"> <span class="keywordtype">size_t</span> sig_rl_size = 0;</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span> (!sig) {</div><div class="line"> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf">kEpidBadArgErr</a>;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
+<p><div class="fragment"><div class="line"> <a class="code" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aa08f0d2e394b37694117a6a32bc71e6e">kEpidErr</a>;</div><div class="line"> <span class="keywordtype">void</span>* prng = NULL;</div><div class="line"> <a class="code" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a>* member = NULL;</div><div class="line"> <a class="code" href="struct_sig_rl.html">SigRl</a>* sig_rl = NULL;</div><div class="line"></div><div class="line"> <span class="keywordflow">do</span> {</div><div class="line"> <a class="code" href="struct_group_pub_key.html">GroupPubKey</a> pub_key = {0};</div><div class="line"> <a class="code" href="struct_priv_key.html">PrivKey</a> priv_key = {0};</div><div class="line"> <a class="code" href="struct_membership_credential.html">MembershipCredential</a> member_credential = {0};</div><div class="line"> <span class="keywordtype">size_t</span> sig_rl_size = 0;</div><div class="line"> <a class="code" href="struct_member_params.html">MemberParams</a> params = {0};</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span> (!sig) {</div><div class="line"> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf">kEpidBadArgErr</a>;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
<p>We create pointers to resources to be allocated and use the <code>do {} while(0)</code> idiom so that we can reliably free resources on return from <code>SignMsg</code>.</p>
<p>We create variables on the stack to hold the group public key and member private key.</p>
<p>Finally we check to make sure that <code>sig</code> is a vaild pointer.</p>
<p><br />
</p>
-<p>Next, we authenticate and extract the group public key using <a class="el" href="group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb" title="Extracts group public key from buffer in issuer binary format. ">EpidParseGroupPubKeyFile</a>.</p>
+<p>Next, if group public key is passed we authenticate and extract the group public key using <a class="el" href="group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb" title="Extracts group public key from buffer in issuer binary format. ">EpidParseGroupPubKeyFile</a>.</p>
<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb">EpidParseGroupPubKeyFile</a>(signed_pubkey, signed_pubkey_size, cacert,</div><div class="line"> &amp;pub_key);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
<p><a class="el" href="group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb" title="Extracts group public key from buffer in issuer binary format. ">EpidParseGroupPubKeyFile</a> takes a buffer containing a group public key in issuer binary format and validates that the public key is signed by the private key that corresponds to the provided CA certificate, extracting the key in the process.</p>
<p><br />
</p>
-<p>Next, we fill the member private key.</p>
-<p><div class="fragment"><div class="line"> <span class="keywordflow">if</span> (privkey_size == <span class="keyword">sizeof</span>(<a class="code" href="struct_priv_key.html">PrivKey</a>)) {</div><div class="line"> priv_key = *(<a class="code" href="struct_priv_key.html">PrivKey</a>*)priv_key_ptr;</div><div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (privkey_size == <span class="keyword">sizeof</span>(<a class="code" href="struct_compressed_priv_key.html">CompressedPrivKey</a>)) {</div><div class="line"> sts = <a class="code" href="group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef">EpidDecompressPrivKey</a>(&amp;pub_key, (<a class="code" href="struct_compressed_priv_key.html">CompressedPrivKey</a>*)priv_key_ptr,</div><div class="line"> &amp;priv_key);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div><div class="line"> } <span class="keywordflow">else</span> {</div><div class="line"> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aa08f0d2e394b37694117a6a32bc71e6e">kEpidErr</a>;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> } <span class="comment">// if (privkey_size == sizeof(PrivKey))</span></div></div><!-- fragment --></p>
+<p>Next, if member private key is passed we fill the member private key.</p>
+<p><div class="fragment"><div class="line"> <span class="keywordflow">if</span> (privkey_size == <span class="keyword">sizeof</span>(<a class="code" href="struct_priv_key.html">PrivKey</a>)) {</div><div class="line"> priv_key = *(<a class="code" href="struct_priv_key.html">PrivKey</a>*)priv_key_ptr;</div><div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (privkey_size == <span class="keyword">sizeof</span>(<a class="code" href="struct_compressed_priv_key.html">CompressedPrivKey</a>)) {</div><div class="line"> sts = <a class="code" href="group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef">EpidDecompressPrivKey</a>(&amp;pub_key, (<a class="code" href="struct_compressed_priv_key.html">CompressedPrivKey</a>*)priv_key_ptr,</div><div class="line"> &amp;priv_key);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div><div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (privkey_size == <span class="keyword">sizeof</span>(<a class="code" href="struct_membership_credential.html">MembershipCredential</a>)) {</div><div class="line"> member_credential = *(<a class="code" href="struct_membership_credential.html">MembershipCredential</a>*)priv_key_ptr;</div><div class="line"> } <span class="keywordflow">else</span> {</div><div class="line"> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aa08f0d2e394b37694117a6a32bc71e6e">kEpidErr</a>;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> } <span class="comment">// if (privkey_size == sizeof(PrivKey))</span></div></div><!-- fragment --></p>
<p>If the member private key is compressed, then we decompress it using <a class="el" href="group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef" title="Decompresses compressed member private key. ">EpidDecompressPrivKey</a> before it can be passed to the member APIs. To determine if the member private key is compressed, we check if it is the known size of a compressed key.</p>
+<p>If the member private key contains just public part, then we fill it as membership credential. To check if the member private key is complete or contains only the membership credential, we check if it is the known size of the member private key without the secret <code>f</code> value.</p>
<p>If the key size is not the size of a known format, we return an error.</p>
<p><br />
</p>
@@ -116,14 +117,23 @@ Signmsg Walkthrough</h1>
<dl class="section warning"><dt>Warning</dt><dd>This pseudo-random number generator is included only for demonstration, and should not be used in production code as a source of secure random data. For security, <code>prng</code> should be a cryptographically secure random number generator.</dd></dl>
<p><br />
</p>
-<p>Now that the inputs have been prepared, we create a member context using <a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a>.</p>
-<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb">EpidMemberCreate</a>(&amp;pub_key, &amp;priv_key,</div><div class="line"> member_precomp_is_input ? member_precomp : NULL,</div><div class="line"> PrngGen, prng, &amp;member);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
+<p>Now that the inputs have been prepared, we create a member context using <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a>.</p>
+<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7">EpidMemberCreate</a>(&amp;params, &amp;member);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
+<p>Then we set the hash algorithm to be used by the member using <a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf" title="Sets the hash algorithm to be used by a member. ">EpidMemberSetHashAlg</a>.</p>
+<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">EpidMemberSetHashAlg</a>(member, hash_alg);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
+<p>After the hash algorithm is set, future calls to <code>EpidSign</code> will use the same algorithm.</p>
+<p><br />
+</p>
<p>If a pre-computation blob is provided to the top level application, we use it. Otherwise, we pass in <code>NULL</code>.</p>
<p><br />
</p>
-<p>Next, we serialize pre-computed member data using <a class="el" href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721" title="Serializes the pre-computed member settings. ">EpidMemberWritePrecomp</a>.</p>
-<p><div class="fragment"><div class="line"> <span class="keywordflow">if</span> (!member_precomp_is_input &amp;&amp; member_precomp) {</div><div class="line"> <span class="comment">// return member pre-computation blob if requested</span></div><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721">EpidMemberWritePrecomp</a>(member, member_precomp);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
-<p>The serialized member pre-computation blob can be used to greatly increase performance of <a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a> in future sessions if the same member private key is used.</p>
+<p>Next we provision either key or membership credential based on passed member private key.</p>
+<p><div class="fragment"><div class="line"> <span class="keywordflow">if</span> (privkey_size == <span class="keyword">sizeof</span>(<a class="code" href="struct_priv_key.html">PrivKey</a>) ||</div><div class="line"> privkey_size == <span class="keyword">sizeof</span>(<a class="code" href="struct_compressed_priv_key.html">CompressedPrivKey</a>)) {</div><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302">EpidProvisionKey</a>(member, &amp;pub_key, &amp;priv_key, member_precomp);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div><div class="line"> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (privkey_size == <span class="keyword">sizeof</span>(<a class="code" href="struct_membership_credential.html">MembershipCredential</a>)) {</div><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140">EpidProvisionCredential</a>(member, &amp;pub_key, &amp;member_credential,</div><div class="line"> member_precomp);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div><div class="line"> } <span class="comment">// if (privkey_size == sizeof(PrivKey))</span></div></div><!-- fragment --></p>
+<p>If neither is passed, we provision nothing.</p>
+<p><br />
+</p>
+<p>Now we load provisioned membership credential and initialize context.</p>
+<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6">EpidMemberStartup</a>(member);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
<p><br />
</p>
<p>Next, if a basename is specified, we register it with <a class="el" href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d" title="Registers a basename with a member. ">EpidRegisterBaseName</a> so that the member can use it.</p>
@@ -146,11 +156,6 @@ Signmsg Walkthrough</h1>
<p>After we extracted the signature based revocation list we should assign it to the member context using <a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4" title="Sets the signature based revocation list to be used by a member. ">EpidMemberSetSigRl</a>.</p>
<p><br />
</p>
-<p>Then we set the hash algorithm to be used by the member using <a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf" title="Sets the hash algorithm to be used by a member. ">EpidMemberSetHashAlg</a>.</p>
-<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">EpidMemberSetHashAlg</a>(member, hash_alg);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
-<p>After the hash algorithm is set, future calls to <code>EpidSign</code> will use the same algorithm.</p>
-<p><br />
-</p>
<p>Next, we sign the message, generating an Intel&reg; EPID signature.</p>
<p><div class="fragment"><div class="line"> *sig_len = <a class="code" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000">EpidGetSigSize</a>(sig_rl);</div><div class="line"></div><div class="line"> *sig = calloc(1, *sig_len);</div><div class="line"> <span class="keywordflow">if</span> (!*sig) {</div><div class="line"> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a11a4d2f1c37064eb663de08dc57bcda8">kEpidMemAllocErr</a>;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="comment">// sign message</span></div><div class="line"> sts =</div><div class="line"> <a class="code" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">EpidSign</a>(member, msg, msg_len, basename, basename_len, *sig, *sig_len);</div><div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != sts) {</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div></div><!-- fragment --></p>
<p>To create a signature, first we find out the required size of the signature using <a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000" title="Computes the size in bytes required for an Intel(R) EPID signature. ">EpidGetSigSize</a>. Then we allocate a buffer for the signature and fill the buffer using <a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f" title="Writes an Intel(R) EPID signature. ">EpidSign</a>.</p>
diff --git a/doc/html/UserManual_VerifyingAnIntelEpidSignature.html b/doc/html/UserManual_VerifyingAnIntelEpidSignature.html
index da840a4..3e5de9b 100644
--- a/doc/html/UserManual_VerifyingAnIntelEpidSignature.html
+++ b/doc/html/UserManual_VerifyingAnIntelEpidSignature.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -62,7 +62,7 @@ $(document).ready(function(){initNavTree('UserManual_VerifyingAnIntelEpidSignatu
</div><!--header-->
<div class="contents">
<div class="textblock"><p>This walkthrough of the <code>verifysig</code> example shows you how to use SDK APIs to verify an Intel&reg; EPID 2.0 signature. <code>verifysig</code> is built during the <a class="el" href="BuildingSdk.html">SDK build</a>.</p>
-<p>To verify an Intel&reg; EPID 1.1 signature see the example code in <code>verifysig11.c</code>. For information on Intel&reg; EPID 1.1 speciifc APIs see <a href="group___epid11_verifier_module.html"><b>EPID 1.1 support</b></a>.</p>
+<p>To verify an Intel&reg; EPID 1.1 signature see the example code in <code>verifysig11.c</code>. For information on Intel&reg; EPID 1.1 specific APIs see <a href="group___epid11_verifier_module.html"><b>Intel&reg; EPID 1.1 support</b></a>.</p>
<p><br />
</p>
<h1><a class="anchor" id="verifysigWalktrhu_overview"></a>
@@ -79,8 +79,8 @@ Summary</h1>
<h1><a class="anchor" id="verifysigWalkthrough_main"></a>
Verifysig Walkthrough</h1>
<p>First, we include headers so we have access to needed declarations.</p>
-<p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;src/verifysig.h&quot;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="verifier_2api_8h.html">epid/verifier/api.h</a>&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="file__parser_8h.html">epid/common/file_parser.h</a>&quot;</span></div></div><!-- fragment --></p>
-<p>The utility headers are used by <code>verifysig</code> for logging and buffer management. The <code><a class="el" href="verifier_2api_8h.html" title="Intel(R) EPID SDK verifier API. ">epid/verifier/api.h</a></code> header provides access to the core verifier APIs, and the <code><a class="el" href="file__parser_8h.html" title="Epid issuer material parsing utilities. ">epid/common/file_parser.h</a></code> header provides an API for parsing buffers formatted according to the various IoT Intel&reg; EPID binary file formats.</p>
+<p><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;src/verifysig.h&quot;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="file__parser_8h.html">epid/common/file_parser.h</a>&quot;</span></div></div><!-- fragment --></p>
+<p>The utility headers are used by <code>verifysig</code> for logging and buffer management. The <code><a class="el" href="verifier_2api_8h.html" title="Intel(R) EPID SDK verifier API. ">epid/verifier/api.h</a></code> header provides access to the core verifier APIs, and the <code><a class="el" href="file__parser_8h.html" title="Intel(R) EPID issuer material parsing utilities. ">epid/common/file_parser.h</a></code> header provides an API for parsing buffers formatted according to the various IoT Intel&reg; EPID binary file formats.</p>
<p><br />
</p>
<p>In <code>main.c</code>, we define a stub function, IsCaCertAuthorizedByRootCa, which is responsible for checking that the CA certificate is authorized by the root CA. Before calling <code>verify</code>, we call this function, IsCaCertAuthorizedByRootCa. In an actual implementation, you need to provide an implementation to validate the issuing CA certificate with the CA root certificate before using it in parse functions.</p>
diff --git a/doc/html/ChoosingiKGF.html b/doc/html/UsingiKGF.html
index f1598d1..bfd6f26 100644
--- a/doc/html/ChoosingiKGF.html
+++ b/doc/html/UsingiKGF.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: If You Choose iKGF as Your Issuer</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: Managing Groups with iKGF</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,16 +53,17 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('ChoosingiKGF.html','');});
+$(document).ready(function(){initNavTree('UsingiKGF.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
-<div class="title">If You Choose iKGF as Your Issuer </div> </div>
+<div class="title">Managing Groups with iKGF </div> </div>
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#RevocationTools">Tools for Creating Revocation Requests</a><ul><li class="level2"><a href="#RevocationTools_revokegrp">Requesting Group Revocation</a></li>
+<ul><li class="level1"><a href="#ContactingiKGF">Contacting iKGF</a></li>
+<li class="level1"><a href="#RevocationTools">Tools for Creating Revocation Requests</a><ul><li class="level2"><a href="#RevocationTools_revokegrp">Requesting Group Revocation</a></li>
<li class="level2"><a href="#RevocationTools_revokekey">Requesting Private Key Revocation</a></li>
<li class="level2"><a href="#RevocationTools_revokesig">Requesting Signature Revocation</a></li>
</ul>
@@ -73,20 +74,24 @@ $(document).ready(function(){initNavTree('ChoosingiKGF.html','');});
</li>
</ul>
</div>
-<div class="textblock"><p>To use the Intel&reg; EPID APIs, you need to use the following items that are created by the issuer:</p>
+<div class="textblock"><p>The issuer handles group membership and revocation. To provision devices with Intel&reg; EPID keys, you need to process data provided by the issuer. Also, in order to revoke a member, you have to generate a revocation request and send it to the issuer.</p>
+<p>This section assumes you are using iKGF as your issuer, and describes how to do the following:</p>
<ul>
-<li>Group public key, which corresponds to the issuing private key kept by the issuer</li>
-<li>Member private keys</li>
-<li>Signature based revocation list (SigRL)</li>
-<li>Private key based revocation list (PrivRL)</li>
-<li>Group based revocation list (GroupRL)</li>
+<li>Create group revocation request for iKGF</li>
+<li>Create member private key revocation request for iKGF</li>
+<li>Create signature revocation request for iKGF</li>
+<li>Extract group public keys from iKGF files</li>
+<li>Extract member private keys from iKGF files</li>
</ul>
+<p>After you send revocation requests with the issuer, the issuer updates the revocation lists as needed.</p>
+<p>The Intel&reg; EPID SDK provides tools designed to make it easier to generate revocation requests and extract keys from iKGF files.</p>
+<h1><a class="anchor" id="ContactingiKGF"></a>
+Contacting iKGF</h1>
<p>If you want to use the Intel Key Generation Facility (iKGF) as the issuer, contact <a href="#" onclick="location.href='mai'+'lto:'+'inf'+'o@'+'dig'+'it'+'al-'+'cp'+'.co'+'m'; return false;">info@<span style="display: none;">.nosp@m.</span>digi<span style="display: none;">.nosp@m.</span>tal-c<span style="display: none;">.nosp@m.</span>p.co<span style="display: none;">.nosp@m.</span>m</a> to get started.</p>
-<p>If you choose to use iKGF as the issuer, you can take advantage of tools included in the SDK that are designed to make it easier for you to interact with iKGF by creating requests to update revocation lists and by extracting member private keys and group public keys from iKGF files.</p>
<h1><a class="anchor" id="RevocationTools"></a>
Tools for Creating Revocation Requests</h1>
-<p>The Intel&reg; EPID SDK includes tools to help you request additions to revocation lists managed by iKGF if you are using iKGF as the issuer.</p>
-<p>These tools are designed to create a revocation request in the format required by iKGF. In order to update a revocation list, the requests generated by these tools must be submitted to the issuer.</p>
+<p>The Intel&reg; EPID SDK includes tools to help you request that iKGF add a revoked group, member private key, or signature to a revocation list.</p>
+<p>These tools are designed to create a revocation request in the specific format required by iKGF. After one of these tools generates a revocation request, the request must be submitted to the issuer in order for the revocation to take effect.</p>
<p>To access the tools, go to <code>_install/epid-sdk/tools</code> in the SDK directory.</p>
<p>You need to build the SDK before you can use these tools. For more information, refer to <a class="el" href="BuildingSdk.html">Building from Source</a>.</p>
<p>The following tools are available:</p>
@@ -100,6 +105,8 @@ Tools for Creating Revocation Requests</h1>
<tr>
<td><code>revokesig</code> </td><td>Create signature revocation request </td></tr>
</table>
+<p><br />
+</p>
<h2><a class="anchor" id="RevocationTools_revokegrp"></a>
Requesting Group Revocation</h2>
<p>The <code>revokegrp</code> tool adds a group to the revocation request file. </p><pre class="fragment">Usage: revokegrp [OPTION]...
@@ -123,7 +130,9 @@ Options:
-v, --verbose
print status messages to stdout
-</pre><h2><a class="anchor" id="RevocationTools_revokekey"></a>
+</pre><p><br />
+</p>
+<h2><a class="anchor" id="RevocationTools_revokekey"></a>
Requesting Private Key Revocation</h2>
<p>The <code>revokekey</code> tool adds a member private key to the revocation request file. </p><pre class="fragment">Usage: revokekey [OPTION]
Revoke Intel(R) EPID private key
@@ -148,7 +157,9 @@ The following options are only needed for compressed keys:
--capubkey=FILE
load IoT Issuing CA public key from FILE
-</pre><h2><a class="anchor" id="RevocationTools_revokesig"></a>
+</pre><p><br />
+</p>
+<h2><a class="anchor" id="RevocationTools_revokesig"></a>
Requesting Signature Revocation</h2>
<p>The <code>revokesig</code> tool creates a request to add a signature to the revocation request file.</p>
<p><code>revokesig</code> only accepts valid signatures for addition to the revocation request. </p><pre class="fragment">Usage: revokesig [OPTION]...
@@ -180,7 +191,7 @@ Options:
print status messages to stdout
</pre><h1><a class="anchor" id="ExtractionTools"></a>
Tools for Extracting Keys from iKGF Files</h1>
-<p>The Intel&reg; EPID SDK includes tools to help you extract individual keys from files provided by the Intel Key Generation Facility (iKGF) if you are using iKGF as the issuer.</p>
+<p>The Intel&reg; EPID SDK includes tools to help you extract individual keys from files provided by the Intel Key Generation Facility (iKGF).</p>
<p>To access the tools, go to <code>_install/epid-sdk/tools</code> in the SDK directory.</p>
<p>You need to build the SDK before you can use these tools. For more information, refer to <a class="el" href="BuildingSdk.html">Building from Source</a>.</p>
<p>The following tools are available:</p>
@@ -192,6 +203,8 @@ Tools for Extracting Keys from iKGF Files</h1>
<tr>
<td><code>extractkeys</code> </td><td>Extracts member private keys </td></tr>
</table>
+<p><br />
+</p>
<h2><a class="anchor" id="ExtractionTools_extractgrps"></a>
Extracting Group Public Keys</h2>
<p>The <code>extractgrps</code> tool extracts group public keys from the input file to the current directory. </p><pre class="fragment">Usage: extractgrps [OPTION]... [FILE] [NUM]
@@ -203,7 +216,9 @@ Options:
-v, --verbose
print status messages to stdout
-</pre><h2><a class="anchor" id="ExtractionTools_extractkeys"></a>
+</pre><p><br />
+</p>
+<h2><a class="anchor" id="ExtractionTools_extractkeys"></a>
Extracting Member Private Keys</h2>
<p>The <code>extractkeys</code> tool extracts member private keys from the input file to the current directory. </p><pre class="fragment">Usage: extractkeys [OPTION]... [FILE] [NUM]
Extract the first NUM private keys from FILE to current directory.
diff --git a/doc/html/annotated.html b/doc/html/annotated.html
index e4f28a2..f9507cf 100644
--- a/doc/html/annotated.html
+++ b/doc/html/annotated.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -98,10 +98,10 @@ $(document).ready(function(){initNavTree('annotated.html','');});
<tr id="row_32_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_gt_elem_str.html" target="_self">GtElemStr</a></td><td class="desc">Serialized GT element </td></tr>
<tr id="row_33_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_i_priv_key.html" target="_self">IPrivKey</a></td><td class="desc">Intel(R) EPID 2.0 issuing private key </td></tr>
<tr id="row_34_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_join_request.html" target="_self">JoinRequest</a></td><td class="desc">Join request </td></tr>
-<tr id="row_35_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_member_precomp.html" target="_self">MemberPrecomp</a></td><td class="desc">Pre-computed member settings </td></tr>
-<tr id="row_36_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_membership_credential.html" target="_self">MembershipCredential</a></td><td class="desc">Membership credential </td></tr>
-<tr id="row_37_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_nr_proof.html" target="_self">NrProof</a></td><td class="desc">Non-revoked Proof </td></tr>
-<tr id="row_38_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_nr_prove_commit_output.html" target="_self">NrProveCommitOutput</a></td><td class="desc">Result of NrProve Commit </td></tr>
+<tr id="row_35_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_member_params.html" target="_self">MemberParams</a></td><td class="desc">Software only specific member parameters </td></tr>
+<tr id="row_36_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_member_precomp.html" target="_self">MemberPrecomp</a></td><td class="desc">Pre-computed member settings </td></tr>
+<tr id="row_37_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_membership_credential.html" target="_self">MembershipCredential</a></td><td class="desc">Membership credential </td></tr>
+<tr id="row_38_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_nr_proof.html" target="_self">NrProof</a></td><td class="desc">Non-revoked Proof </td></tr>
<tr id="row_39_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str128.html" target="_self">OctStr128</a></td><td class="desc">128 bit octet string </td></tr>
<tr id="row_40_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str16.html" target="_self">OctStr16</a></td><td class="desc">16 bit octet string </td></tr>
<tr id="row_41_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str256.html" target="_self">OctStr256</a></td><td class="desc">256 bit octet string </td></tr>
@@ -115,9 +115,9 @@ $(document).ready(function(){initNavTree('annotated.html','');});
<tr id="row_49_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_priv_key.html" target="_self">PrivKey</a></td><td class="desc">Intel(R) EPID 2.0 private key </td></tr>
<tr id="row_50_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_priv_rl.html" target="_self">PrivRl</a></td><td class="desc">Private-key based revocation list </td></tr>
<tr id="row_51_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sha256_digest.html" target="_self">Sha256Digest</a></td><td class="desc">SHA256 digest </td></tr>
-<tr id="row_52_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sign_commit_output.html" target="_self">SignCommitOutput</a></td><td class="desc">Result of Sign Commit </td></tr>
-<tr id="row_53_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sig_rl.html" target="_self">SigRl</a></td><td class="desc">Signature based revocation list </td></tr>
-<tr id="row_54_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sig_rl_entry.html" target="_self">SigRlEntry</a></td><td class="desc">Entry in SigRL (B,K) </td></tr>
+<tr id="row_52_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sig_rl.html" target="_self">SigRl</a></td><td class="desc">Signature based revocation list </td></tr>
+<tr id="row_53_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sig_rl_entry.html" target="_self">SigRlEntry</a></td><td class="desc">Entry in SigRL (B,K) </td></tr>
+<tr id="row_54_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_tpm2_ctx.html" target="_self">Tpm2Ctx</a></td><td class="desc">TPM TSS context definition </td></tr>
<tr id="row_55_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_verifier_precomp.html" target="_self">VerifierPrecomp</a></td><td class="desc">Pre-computed verifier settings </td></tr>
<tr id="row_56_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_verifier_rl.html" target="_self">VerifierRl</a></td><td class="desc"></td></tr>
</table>
diff --git a/doc/html/base_name.png b/doc/html/base_name.png
new file mode 100644
index 0000000..5b28a61
--- /dev/null
+++ b/doc/html/base_name.png
Binary files differ
diff --git a/doc/html/basenames_8dox.html b/doc/html/basenames_8dox.html
index 2ecf9e7..6532fad 100644
--- a/doc/html/basenames_8dox.html
+++ b/doc/html/basenames_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/bignum_8h.html b/doc/html/bignum_8h.html
index f3099d4..e85fbd8 100644
--- a/doc/html/bignum_8h.html
+++ b/doc/html/bignum_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -69,8 +69,8 @@ $(document).ready(function(){initNavTree('bignum_8h.html','');});
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
<code>#include &lt;stdint.h&gt;</code><br />
-<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
diff --git a/doc/html/bitsupplier_8h.html b/doc/html/bitsupplier_8h.html
index 0e21810..dfe0bf3 100644
--- a/doc/html/bitsupplier_8h.html
+++ b/doc/html/bitsupplier_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/build__tools__installation_8dox.html b/doc/html/build__tools__installation_8dox.html
index 804dde0..fa2b11e 100644
--- a/doc/html/build__tools__installation_8dox.html
+++ b/doc/html/build__tools__installation_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/building__sdk_8dox.html b/doc/html/building__sdk_8dox.html
index 6f39e23..659ba68 100644
--- a/doc/html/building__sdk_8dox.html
+++ b/doc/html/building__sdk_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/classes.html b/doc/html/classes.html
index e7786a3..35696eb 100644
--- a/doc/html/classes.html
+++ b/doc/html/classes.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,42 +61,43 @@ $(document).ready(function(){initNavTree('classes.html','');});
<div class="title">Data Structure Index</div> </div>
</div><!--header-->
<div class="contents">
-<div class="qindex"><a class="qindex" href="#letter_B">B</a>&#160;|&#160;<a class="qindex" href="#letter_C">C</a>&#160;|&#160;<a class="qindex" href="#letter_E">E</a>&#160;|&#160;<a class="qindex" href="#letter_F">F</a>&#160;|&#160;<a class="qindex" href="#letter_G">G</a>&#160;|&#160;<a class="qindex" href="#letter_I">I</a>&#160;|&#160;<a class="qindex" href="#letter_J">J</a>&#160;|&#160;<a class="qindex" href="#letter_M">M</a>&#160;|&#160;<a class="qindex" href="#letter_N">N</a>&#160;|&#160;<a class="qindex" href="#letter_O">O</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a>&#160;|&#160;<a class="qindex" href="#letter_S">S</a>&#160;|&#160;<a class="qindex" href="#letter_V">V</a></div>
+<div class="qindex"><a class="qindex" href="#letter_B">B</a>&#160;|&#160;<a class="qindex" href="#letter_C">C</a>&#160;|&#160;<a class="qindex" href="#letter_E">E</a>&#160;|&#160;<a class="qindex" href="#letter_F">F</a>&#160;|&#160;<a class="qindex" href="#letter_G">G</a>&#160;|&#160;<a class="qindex" href="#letter_I">I</a>&#160;|&#160;<a class="qindex" href="#letter_J">J</a>&#160;|&#160;<a class="qindex" href="#letter_M">M</a>&#160;|&#160;<a class="qindex" href="#letter_N">N</a>&#160;|&#160;<a class="qindex" href="#letter_O">O</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a>&#160;|&#160;<a class="qindex" href="#letter_S">S</a>&#160;|&#160;<a class="qindex" href="#letter_T">T</a>&#160;|&#160;<a class="qindex" href="#letter_V">V</a></div>
<table class="classindex">
<tr><td rowspan="2" valign="bottom"><a name="letter_B"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;B&#160;&#160;</div></td></tr></table>
-</td><td valign="top"><a class="el" href="struct_epid11_nr_proof.html">Epid11NrProof</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq6_elem_str.html">Fq6ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_membership_credential.html">MembershipCredential</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;P&#160;&#160;</div></td></tr></table>
-</td></tr>
-<tr><td valign="top"><a class="el" href="struct_epid11_params.html">Epid11Params</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq_elem_str.html">FqElemStr</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_N"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;N&#160;&#160;</div></td></tr></table>
+</td><td valign="top"><a class="el" href="struct_epid11_nr_proof.html">Epid11NrProof</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq6_elem_str.html">Fq6ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_member_precomp.html">MemberPrecomp</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;P&#160;&#160;</div></td></tr></table>
</td></tr>
+<tr><td valign="top"><a class="el" href="struct_epid11_params.html">Epid11Params</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq_elem_str.html">FqElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_membership_credential.html">MembershipCredential</a>&#160;&#160;&#160;</td></tr>
<tr><td valign="top"><a class="el" href="struct_basic_signature.html">BasicSignature</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_epid11_priv_rl.html">Epid11PrivRl</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_G"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;G&#160;&#160;</div></td></tr></table>
+</td><td rowspan="2" valign="bottom"><a name="letter_N"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;N&#160;&#160;</div></td></tr></table>
</td><td valign="top"><a class="el" href="struct_priv_key.html">PrivKey</a>&#160;&#160;&#160;</td></tr>
-<tr><td valign="top"><a class="el" href="struct_big_num_str.html">BigNumStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_epid11_signature.html">Epid11Signature</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_nr_proof.html">NrProof</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_priv_rl.html">PrivRl</a>&#160;&#160;&#160;</td></tr>
+<tr><td valign="top"><a class="el" href="struct_big_num_str.html">BigNumStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_epid11_signature.html">Epid11Signature</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_priv_rl.html">PrivRl</a>&#160;&#160;&#160;</td></tr>
<tr><td rowspan="2" valign="bottom"><a name="letter_C"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;C&#160;&#160;</div></td></tr></table>
-</td><td valign="top"><a class="el" href="struct_epid11_sig_rl.html">Epid11SigRl</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_nr_prove_commit_output.html">NrProveCommitOutput</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_S"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;S&#160;&#160;</div></td></tr></table>
+</td><td valign="top"><a class="el" href="struct_epid11_sig_rl.html">Epid11SigRl</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_nr_proof.html">NrProof</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_S"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;S&#160;&#160;</div></td></tr></table>
</td></tr>
<tr><td valign="top"><a class="el" href="struct_epid11_sig_rl_entry.html">Epid11SigRlEntry</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_g2_elem_str.html">G2ElemStr</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_O"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;O&#160;&#160;</div></td></tr></table>
</td></tr>
<tr><td valign="top"><a class="el" href="struct_compressed_priv_key.html">CompressedPrivKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_epid11_verifier_precomp.html">Epid11VerifierPrecomp</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_group_pub_key.html">GroupPubKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_sha256_digest.html">Sha256Digest</a>&#160;&#160;&#160;</td></tr>
<tr><td rowspan="2" valign="bottom"><a name="letter_E"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;E&#160;&#160;</div></td></tr></table>
-</td><td valign="top"><a class="el" href="struct_epid2_params.html">Epid2Params</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_group_rl.html">GroupRl</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str128.html">OctStr128</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_sign_commit_output.html">SignCommitOutput</a>&#160;&#160;&#160;</td></tr>
-<tr><td valign="top"><a class="el" href="struct_epid_ca_certificate.html">EpidCaCertificate</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_gt_elem_str.html">GtElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str16.html">OctStr16</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_sig_rl.html">SigRl</a>&#160;&#160;&#160;</td></tr>
+</td><td valign="top"><a class="el" href="struct_epid2_params.html">Epid2Params</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_group_rl.html">GroupRl</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str128.html">OctStr128</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_sig_rl.html">SigRl</a>&#160;&#160;&#160;</td></tr>
+<tr><td valign="top"><a class="el" href="struct_epid_ca_certificate.html">EpidCaCertificate</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_gt_elem_str.html">GtElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str16.html">OctStr16</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_sig_rl_entry.html">SigRlEntry</a>&#160;&#160;&#160;</td></tr>
<tr><td valign="top"><a class="el" href="struct_ecdsa_private_key.html">EcdsaPrivateKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_epid_file_header.html">EpidFileHeader</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_I"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;I&#160;&#160;</div></td></tr></table>
-</td><td valign="top"><a class="el" href="struct_oct_str256.html">OctStr256</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_sig_rl_entry.html">SigRlEntry</a>&#160;&#160;&#160;</td></tr>
-<tr><td valign="top"><a class="el" href="struct_ecdsa_public_key.html">EcdsaPublicKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_epid_signature.html">EpidSignature</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str32.html">OctStr32</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_V"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;V&#160;&#160;</div></td></tr></table>
+</td><td valign="top"><a class="el" href="struct_oct_str256.html">OctStr256</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_T"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;T&#160;&#160;</div></td></tr></table>
</td></tr>
+<tr><td valign="top"><a class="el" href="struct_ecdsa_public_key.html">EcdsaPublicKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_epid_signature.html">EpidSignature</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str32.html">OctStr32</a>&#160;&#160;&#160;</td></tr>
<tr><td valign="top"><a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_F"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;F&#160;&#160;</div></td></tr></table>
-</td><td valign="top"><a class="el" href="struct_i_priv_key.html">IPrivKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str512.html">OctStr512</a>&#160;&#160;&#160;</td></tr>
+</td><td valign="top"><a class="el" href="struct_i_priv_key.html">IPrivKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str512.html">OctStr512</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a>&#160;&#160;&#160;</td></tr>
<tr><td valign="top"><a class="el" href="struct_epid11_basic_signature.html">Epid11BasicSignature</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_J"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;J&#160;&#160;</div></td></tr></table>
-</td><td valign="top"><a class="el" href="struct_oct_str600.html">OctStr600</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_verifier_precomp.html">VerifierPrecomp</a>&#160;&#160;&#160;</td></tr>
-<tr><td valign="top"><a class="el" href="struct_epid11_g2_elem_str.html">Epid11G2ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str64.html">OctStr64</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_verifier_rl.html">VerifierRl</a>&#160;&#160;&#160;</td></tr>
-<tr><td valign="top"><a class="el" href="struct_epid11_group_pub_key.html">Epid11GroupPubKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq12_elem_str.html">Fq12ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_join_request.html">JoinRequest</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str768.html">OctStr768</a>&#160;&#160;&#160;</td><td></td></tr>
+</td><td valign="top"><a class="el" href="struct_oct_str600.html">OctStr600</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_V"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;V&#160;&#160;</div></td></tr></table>
+</td></tr>
+<tr><td valign="top"><a class="el" href="struct_epid11_g2_elem_str.html">Epid11G2ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str64.html">OctStr64</a>&#160;&#160;&#160;</td></tr>
+<tr><td valign="top"><a class="el" href="struct_epid11_group_pub_key.html">Epid11GroupPubKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq12_elem_str.html">Fq12ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_join_request.html">JoinRequest</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str768.html">OctStr768</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_verifier_precomp.html">VerifierPrecomp</a>&#160;&#160;&#160;</td></tr>
<tr><td valign="top"><a class="el" href="struct_epid11_group_rl.html">Epid11GroupRl</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq2_elem_str.html">Fq2ElemStr</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_M"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;M&#160;&#160;</div></td></tr></table>
-</td><td valign="top"><a class="el" href="struct_oct_str8.html">OctStr8</a>&#160;&#160;&#160;</td><td></td></tr>
+</td><td valign="top"><a class="el" href="struct_oct_str8.html">OctStr8</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_verifier_rl.html">VerifierRl</a>&#160;&#160;&#160;</td></tr>
<tr><td valign="top"><a class="el" href="struct_epid11_gt_elem_str.html">Epid11GtElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq3_elem_str.html">Fq3ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str80.html">OctStr80</a>&#160;&#160;&#160;</td><td></td></tr>
-<tr><td></td><td></td><td valign="top"><a class="el" href="struct_member_precomp.html">MemberPrecomp</a>&#160;&#160;&#160;</td><td></td><td></td></tr>
+<tr><td></td><td></td><td valign="top"><a class="el" href="struct_member_params.html">MemberParams</a>&#160;&#160;&#160;</td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
</table>
-<div class="qindex"><a class="qindex" href="#letter_B">B</a>&#160;|&#160;<a class="qindex" href="#letter_C">C</a>&#160;|&#160;<a class="qindex" href="#letter_E">E</a>&#160;|&#160;<a class="qindex" href="#letter_F">F</a>&#160;|&#160;<a class="qindex" href="#letter_G">G</a>&#160;|&#160;<a class="qindex" href="#letter_I">I</a>&#160;|&#160;<a class="qindex" href="#letter_J">J</a>&#160;|&#160;<a class="qindex" href="#letter_M">M</a>&#160;|&#160;<a class="qindex" href="#letter_N">N</a>&#160;|&#160;<a class="qindex" href="#letter_O">O</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a>&#160;|&#160;<a class="qindex" href="#letter_S">S</a>&#160;|&#160;<a class="qindex" href="#letter_V">V</a></div>
+<div class="qindex"><a class="qindex" href="#letter_B">B</a>&#160;|&#160;<a class="qindex" href="#letter_C">C</a>&#160;|&#160;<a class="qindex" href="#letter_E">E</a>&#160;|&#160;<a class="qindex" href="#letter_F">F</a>&#160;|&#160;<a class="qindex" href="#letter_G">G</a>&#160;|&#160;<a class="qindex" href="#letter_I">I</a>&#160;|&#160;<a class="qindex" href="#letter_J">J</a>&#160;|&#160;<a class="qindex" href="#letter_M">M</a>&#160;|&#160;<a class="qindex" href="#letter_N">N</a>&#160;|&#160;<a class="qindex" href="#letter_O">O</a>&#160;|&#160;<a class="qindex" href="#letter_P">P</a>&#160;|&#160;<a class="qindex" href="#letter_S">S</a>&#160;|&#160;<a class="qindex" href="#letter_T">T</a>&#160;|&#160;<a class="qindex" href="#letter_V">V</a></div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/commit_8c.html b/doc/html/commit_8c.html
new file mode 100644
index 0000000..ea3720e
--- /dev/null
+++ b/doc/html/commit_8c.html
@@ -0,0 +1,135 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/commit.c File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('commit_8c.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#define-members">Macros</a> &#124;
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">commit.c File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Tpm2Commit implementation.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="commit_8h.html">epid/member/tpm2/commit.h</a>&quot;</code><br />
+<code>#include &lt;tss2/TPM_Types.h&gt;</code><br />
+<code>#include &lt;tss2/tss.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="ecgroup_8h.html">epid/common/math/ecgroup.h</a>&quot;</code><br />
+<code>#include &quot;epid/common/src/epid2params.h&quot;</code><br />
+<code>#include &quot;epid/common/src/memory.h&quot;</code><br />
+<code>#include &quot;<a class="el" href="conversion_8h.html">epid/member/tpm2/ibm_tss/conversion.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="printtss_8h.html">epid/member/tpm2/ibm_tss/printtss.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="state_8h.html">epid/member/tpm2/ibm_tss/state.h</a>&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:a5638f861b82f1746ea1af0b384ef8ff1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commit_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">BREAK_ON_EPID_ERROR</a>(ret)</td></tr>
+<tr class="memdesc:a5638f861b82f1746ea1af0b384ef8ff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle Intel(R) EPID Error with Break. <a href="#a5638f861b82f1746ea1af0b384ef8ff1">More...</a><br /></td></tr>
+<tr class="separator:a5638f861b82f1746ea1af0b384ef8ff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aa6b8f3261ae9e2e1043380c192f7b5f0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa6b8f3261ae9e2e1043380c192f7b5f0"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commit_8c.html#aa6b8f3261ae9e2e1043380c192f7b5f0">BIT7</a>&#160;&#160;&#160;0x080</td></tr>
+<tr class="memdesc:aa6b8f3261ae9e2e1043380c192f7b5f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit 7 binary mask. <br /></td></tr>
+<tr class="separator:aa6b8f3261ae9e2e1043380c192f7b5f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a5c80fc0389d18e76cf9f43cfe13b63c7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5c80fc0389d18e76cf9f43cfe13b63c7"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commit_8c.html#a5c80fc0389d18e76cf9f43cfe13b63c7">BITS0500</a>&#160;&#160;&#160;0x3f</td></tr>
+<tr class="memdesc:a5c80fc0389d18e76cf9f43cfe13b63c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Binary 00011111. <br /></td></tr>
+<tr class="separator:a5c80fc0389d18e76cf9f43cfe13b63c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga750e38b6d6cea1b05f605e476df065d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">Tpm2Commit</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *p1, void const *s2, size_t s2_len, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const *y2, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *k, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *l, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *e, uint16_t *counter)</td></tr>
+<tr class="memdesc:ga750e38b6d6cea1b05f605e476df065d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_Commit TPM operation. <a href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">More...</a><br /></td></tr>
+<tr class="separator:ga750e38b6d6cea1b05f605e476df065d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>Tpm2Commit implementation. </p>
+</div><h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="a5638f861b82f1746ea1af0b384ef8ff1"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define BREAK_ON_EPID_ERROR</td>
+ <td>(</td>
+ <td class="paramtype">&#160;</td>
+ <td class="paramname">ret</td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != (ret)) { \</div><div class="line"> break; \</div><div class="line"> }</div><div class="ttc" id="group___error_codes_html_ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9"><div class="ttname"><a href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a></div><div class="ttdoc">no error </div><div class="ttdef"><b>Definition:</b> errors.h:41</div></div>
+</div><!-- fragment -->
+<p>Handle Intel(R) EPID Error with Break. </p>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="commit_8c.html">commit.c</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/presig_8h.html b/doc/html/commit_8h.html
index 3ee4f22..50f1bbc 100644
--- a/doc/html/presig_8h.html
+++ b/doc/html/commit_8h.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm/presig.h File Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/commit.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,40 +53,38 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('presig_8h.html','');});
+$(document).ready(function(){initNavTree('commit_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">presig.h File Reference</div> </div>
+<div class="title">commit.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
-<p>Sensitive pre-computed signature APIs.
+<p>SDK TPM Commit API.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
-<tr class="memitem:ga2335ec4eb78b542cf87df9b0cd15358c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga2335ec4eb78b542cf87df9b0cd15358c">TpmAddPreSigs</a> (TpmCtx *ctx, size_t number_presigs)</td></tr>
-<tr class="memdesc:ga2335ec4eb78b542cf87df9b0cd15358c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extends the TPM's pool of pre-computed signatures. <a href="group___tpm_module.html#ga2335ec4eb78b542cf87df9b0cd15358c">More...</a><br /></td></tr>
-<tr class="separator:ga2335ec4eb78b542cf87df9b0cd15358c"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaa53a6bd52e22808bac21596a964bdece"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gaa53a6bd52e22808bac21596a964bdece">TpmGetNumPreSigs</a> (TpmCtx const *ctx)</td></tr>
-<tr class="memdesc:gaa53a6bd52e22808bac21596a964bdece"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the number of pre-computed signatures in the TPM's pool. <a href="group___tpm_module.html#gaa53a6bd52e22808bac21596a964bdece">More...</a><br /></td></tr>
-<tr class="separator:gaa53a6bd52e22808bac21596a964bdece"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga750e38b6d6cea1b05f605e476df065d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">Tpm2Commit</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *p1, void const *s2, size_t s2_len, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const *y2, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *k, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *l, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *e, uint16_t *counter)</td></tr>
+<tr class="memdesc:ga750e38b6d6cea1b05f605e476df065d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_Commit TPM operation. <a href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">More...</a><br /></td></tr>
+<tr class="separator:ga750e38b6d6cea1b05f605e476df065d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Sensitive pre-computed signature APIs. </p>
+<div class="textblock"><p>SDK TPM Commit API. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li><li class="navelem"><a class="el" href="presig_8h.html">presig.h</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="commit_8h.html">commit.h</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/context_8c.html b/doc/html/context_8c.html
new file mode 100644
index 0000000..aa3313a
--- /dev/null
+++ b/doc/html/context_8c.html
@@ -0,0 +1,174 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/context.c File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('context_8c.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#define-members">Macros</a> &#124;
+<a href="#func-members">Functions</a> &#124;
+<a href="#var-members">Variables</a> </div>
+ <div class="headertitle">
+<div class="title">context.c File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM context implementation.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="context_8h.html">epid/member/tpm2/context.h</a>&quot;</code><br />
+<code>#include &lt;tss2/TPM_Types.h&gt;</code><br />
+<code>#include &lt;tss2/tss.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
+<code>#include &quot;epid/common/src/epid2params.h&quot;</code><br />
+<code>#include &quot;epid/common/src/memory.h&quot;</code><br />
+<code>#include &quot;<a class="el" href="getrandom_8h.html">epid/member/tpm2/getrandom.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="printtss_8h.html">epid/member/tpm2/ibm_tss/printtss.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="state_8h.html">epid/member/tpm2/ibm_tss/state.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="tpm__member_8h.html">epid/member/tpm_member.h</a>&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:a5638f861b82f1746ea1af0b384ef8ff1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="context_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">BREAK_ON_EPID_ERROR</a>(ret)</td></tr>
+<tr class="memdesc:a5638f861b82f1746ea1af0b384ef8ff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle Intel(R) EPID Error with Break. <a href="#a5638f861b82f1746ea1af0b384ef8ff1">More...</a><br /></td></tr>
+<tr class="separator:a5638f861b82f1746ea1af0b384ef8ff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:a7f547c0068dc63f0a6b76ad15b1b9675"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="context_8c.html#a7f547c0068dc63f0a6b76ad15b1b9675">Tpm2FlushKey</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx)</td></tr>
+<tr class="memdesc:a7f547c0068dc63f0a6b76ad15b1b9675"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes key from TPM. <a href="#a7f547c0068dc63f0a6b76ad15b1b9675">More...</a><br /></td></tr>
+<tr class="separator:a7f547c0068dc63f0a6b76ad15b1b9675"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">Tpm2CreateContext</a> (<a class="el" href="struct_member_params.html">MemberParams</a> const *params, Epid2Params_ const *epid2_params, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> *rnd_func, void **rnd_param, const <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> **f, <a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new Tpm context. <a href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">More...</a><br /></td></tr>
+<tr class="separator:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga38f47cba4c26320db06aa50a77590ef4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">Tpm2DeleteContext</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga38f47cba4c26320db06aa50a77590ef4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an existing Tpm context. <a href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">More...</a><br /></td></tr>
+<tr class="separator:ga38f47cba4c26320db06aa50a77590ef4"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga11cc131debbca60c0de7e53d48330b69"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">Tpm2SetHashAlg</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
+<tr class="memdesc:ga11cc131debbca60c0de7e53d48330b69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the hash algorithm to be used by a TPM2. <a href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">More...</a><br /></td></tr>
+<tr class="separator:ga11cc131debbca60c0de7e53d48330b69"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">Tpm2ResetContext</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset an existing Tpm context. <a href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">More...</a><br /></td></tr>
+<tr class="separator:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
+Variables</h2></td></tr>
+<tr class="memitem:a8e9ae8d68d53b7549da3823bc65a336e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e9ae8d68d53b7549da3823bc65a336e"></a>
+<a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="context_8c.html#a8e9ae8d68d53b7549da3823bc65a336e">is_context_already_created</a> = <a class="el" href="stdtypes_8h.html#a65e9886d74aaee76545e83dd09011727">false</a></td></tr>
+<tr class="memdesc:a8e9ae8d68d53b7549da3823bc65a336e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Flag that indicates that context was already created. <br /></td></tr>
+<tr class="separator:a8e9ae8d68d53b7549da3823bc65a336e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM context implementation. </p>
+</div><h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="a5638f861b82f1746ea1af0b384ef8ff1"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define BREAK_ON_EPID_ERROR</td>
+ <td>(</td>
+ <td class="paramtype">&#160;</td>
+ <td class="paramname">ret</td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != (ret)) { \</div><div class="line"> break; \</div><div class="line"> }</div><div class="ttc" id="group___error_codes_html_ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9"><div class="ttname"><a href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a></div><div class="ttdoc">no error </div><div class="ttdef"><b>Definition:</b> errors.h:41</div></div>
+</div><!-- fragment -->
+<p>Handle Intel(R) EPID Error with Break. </p>
+
+</div>
+</div>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a7f547c0068dc63f0a6b76ad15b1b9675"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Tpm2FlushKey </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Deletes key from TPM. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="context_8c.html">context.c</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/context_8h.html b/doc/html/context_8h.html
index 2b34549..178a3cd 100644
--- a/doc/html/context_8h.html
+++ b/doc/html/context_8h.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm/context.h File Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/context.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -64,35 +64,36 @@ $(document).ready(function(){initNavTree('context_8h.html','');});
</div><!--header-->
<div class="contents">
-<p>Sensitive member context APIs.
+<p>SDK TPM API.
<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="bitsupplier_8h.html">epid/common/bitsupplier.h</a>&quot;</code><br />
+<div class="textblock"><code>#include &quot;<a class="el" href="bitsupplier_8h.html">epid/common/bitsupplier.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
-<tr class="memitem:ga901cad19eb14a6a6a02e85f9d710d287"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287">TpmCreate</a> (<a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param, Epid2Params_ const *epid2_params, TpmCtx **ctx)</td></tr>
-<tr class="memdesc:ga901cad19eb14a6a6a02e85f9d710d287"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new Tpm context. <a href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287">More...</a><br /></td></tr>
-<tr class="separator:ga901cad19eb14a6a6a02e85f9d710d287"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga95bc18225c1d87803be7965978e37449"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga95bc18225c1d87803be7965978e37449">TpmDelete</a> (TpmCtx **ctx)</td></tr>
-<tr class="memdesc:ga95bc18225c1d87803be7965978e37449"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an existing Tpm context. <a href="group___tpm_module.html#ga95bc18225c1d87803be7965978e37449">More...</a><br /></td></tr>
-<tr class="separator:ga95bc18225c1d87803be7965978e37449"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga42b80d485cff39fe9ec14a0b5a81426d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d">TpmProvision</a> (TpmCtx *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f_str)</td></tr>
-<tr class="memdesc:ga42b80d485cff39fe9ec14a0b5a81426d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions Tpm with sensitive parameters. <a href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d">More...</a><br /></td></tr>
-<tr class="separator:ga42b80d485cff39fe9ec14a0b5a81426d"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga688441f78f68aa53c41fcae4d31c6f50"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50">TpmProvisionCompressed</a> (TpmCtx *ctx, <a class="el" href="struct_oct_str256.html">OctStr256</a> const *seed)</td></tr>
-<tr class="memdesc:ga688441f78f68aa53c41fcae4d31c6f50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions Tpm with compressed key seed. <a href="group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50">More...</a><br /></td></tr>
-<tr class="separator:ga688441f78f68aa53c41fcae4d31c6f50"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">Tpm2CreateContext</a> (<a class="el" href="struct_member_params.html">MemberParams</a> const *params, Epid2Params_ const *epid2_params, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> *rnd_func, void **rnd_param, const <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> **f, <a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new Tpm context. <a href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">More...</a><br /></td></tr>
+<tr class="separator:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga38f47cba4c26320db06aa50a77590ef4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">Tpm2DeleteContext</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga38f47cba4c26320db06aa50a77590ef4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an existing Tpm context. <a href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">More...</a><br /></td></tr>
+<tr class="separator:ga38f47cba4c26320db06aa50a77590ef4"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga11cc131debbca60c0de7e53d48330b69"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">Tpm2SetHashAlg</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
+<tr class="memdesc:ga11cc131debbca60c0de7e53d48330b69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the hash algorithm to be used by a TPM2. <a href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">More...</a><br /></td></tr>
+<tr class="separator:ga11cc131debbca60c0de7e53d48330b69"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">Tpm2ResetContext</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset an existing Tpm context. <a href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">More...</a><br /></td></tr>
+<tr class="separator:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Sensitive member context APIs. </p>
+<div class="textblock"><p>SDK TPM API. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li><li class="navelem"><a class="el" href="context_8h.html">context.h</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="context_8h.html">context.h</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/conversion_8c.html b/doc/html/conversion_8c.html
new file mode 100644
index 0000000..888bfff
--- /dev/null
+++ b/doc/html/conversion_8c.html
@@ -0,0 +1,309 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/conversion.c File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('conversion_8c.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">conversion.c File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM-SDK data conversion implementation.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="conversion_8h.html">epid/member/tpm2/ibm_tss/conversion.h</a>&quot;</code><br />
+<code>#include &lt;string.h&gt;</code><br />
+<code>#include &lt;tss2/TPM_Types.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="ecgroup_8h.html">epid/common/math/ecgroup.h</a>&quot;</code><br />
+<code>#include &quot;epid/common/src/memory.h&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ad08628a6bf33154c1029a32e8b83325f"><td class="memItemLeft" align="right" valign="top">TPMI_ALG_HASH&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html#ad08628a6bf33154c1029a32e8b83325f">EpidtoTpm2HashAlg</a> (<a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
+<tr class="memdesc:ad08628a6bf33154c1029a32e8b83325f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps HashAlg to TPM type. <a href="#ad08628a6bf33154c1029a32e8b83325f">More...</a><br /></td></tr>
+<tr class="separator:ad08628a6bf33154c1029a32e8b83325f"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html#a51507a6be8d7dfa167c9e6fb70e5ee57">Tpm2toEpidHashAlg</a> (TPMI_ALG_HASH tpm_hash_alg)</td></tr>
+<tr class="memdesc:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps TPMI_ALG_HASH to HashAlg. <a href="#a51507a6be8d7dfa167c9e6fb70e5ee57">More...</a><br /></td></tr>
+<tr class="separator:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a8243faa9ef46d90b936c7dace421e10e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html#a8243faa9ef46d90b936c7dace421e10e">ReadTpm2FfElement</a> (<a class="el" href="struct_oct_str256.html">OctStr256</a> const *str, TPM2B_ECC_PARAMETER *tpm_data)</td></tr>
+<tr class="memdesc:a8243faa9ef46d90b936c7dace421e10e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts serialized FfElement into TPM type. <a href="#a8243faa9ef46d90b936c7dace421e10e">More...</a><br /></td></tr>
+<tr class="separator:a8243faa9ef46d90b936c7dace421e10e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9f6a2b44857c038a2f90c12959640dea"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html#a9f6a2b44857c038a2f90c12959640dea">WriteTpm2FfElement</a> (TPM2B_ECC_PARAMETER const *tpm_data, <a class="el" href="struct_oct_str256.html">OctStr256</a> *str)</td></tr>
+<tr class="memdesc:a9f6a2b44857c038a2f90c12959640dea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts TPM finite field element types into serialized FfElement. <a href="#a9f6a2b44857c038a2f90c12959640dea">More...</a><br /></td></tr>
+<tr class="separator:a9f6a2b44857c038a2f90c12959640dea"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:acff82e14f6287ec2d4676a3f8cd38a57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html#acff82e14f6287ec2d4676a3f8cd38a57">ReadTpm2EcPoint</a> (<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *p_str, TPM2B_ECC_POINT *tpm_point)</td></tr>
+<tr class="memdesc:acff82e14f6287ec2d4676a3f8cd38a57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts ECPoint string to TMP ECPoint structure. <a href="#acff82e14f6287ec2d4676a3f8cd38a57">More...</a><br /></td></tr>
+<tr class="separator:acff82e14f6287ec2d4676a3f8cd38a57"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a15e859e04c4b9c32a0970565846bdba3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html#a15e859e04c4b9c32a0970565846bdba3">WriteTpm2EcPoint</a> (TPM2B_ECC_POINT const *tpm_point, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *p_str)</td></tr>
+<tr class="memdesc:a15e859e04c4b9c32a0970565846bdba3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serializes TMP ECPoint to ECPoint string. <a href="#a15e859e04c4b9c32a0970565846bdba3">More...</a><br /></td></tr>
+<tr class="separator:a15e859e04c4b9c32a0970565846bdba3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM-SDK data conversion implementation. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ad08628a6bf33154c1029a32e8b83325f"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">TPMI_ALG_HASH EpidtoTpm2HashAlg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td>
+ <td class="paramname"><em>hash_alg</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Maps HashAlg to TPM type. </p>
+<p>Maps Intel(R) EPID SDK HashAlg into TPMI_ALG_HASH.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>Code of the hash algorithm </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>TPMI_ALG_HASH </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="acff82e14f6287ec2d4676a3f8cd38a57"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> ReadTpm2EcPoint </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
+ <td class="paramname"><em>p_str</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">TPM2B_ECC_POINT *&#160;</td>
+ <td class="paramname"><em>tpm_point</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Converts ECPoint string to TMP ECPoint structure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">p_str</td><td>The serialized EcPoint to convert. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">tpm_point</td><td>The TPM EC point representation.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a8243faa9ef46d90b936c7dace421e10e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> ReadTpm2FfElement </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> const *&#160;</td>
+ <td class="paramname"><em>str</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">TPM2B_ECC_PARAMETER *&#160;</td>
+ <td class="paramname"><em>tpm_data</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Converts serialized FfElement into TPM type. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>Serialized Intel(R) EPID SDK FfElement </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">tpm_data</td><td>tpm type data. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a51507a6be8d7dfa167c9e6fb70e5ee57"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> Tpm2toEpidHashAlg </td>
+ <td>(</td>
+ <td class="paramtype">TPMI_ALG_HASH&#160;</td>
+ <td class="paramname"><em>tpm_hash_alg</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Maps TPMI_ALG_HASH to HashAlg. </p>
+<p>Maps TPM hash code TPMI_ALG_HASH into HashAlg.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">tpm_hash_alg</td><td>Code of the hash algorithm in TPM</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>HashAlg </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a15e859e04c4b9c32a0970565846bdba3"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> WriteTpm2EcPoint </td>
+ <td>(</td>
+ <td class="paramtype">TPM2B_ECC_POINT const *&#160;</td>
+ <td class="paramname"><em>tpm_point</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
+ <td class="paramname"><em>p_str</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Serializes TMP ECPoint to ECPoint string. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">tpm_point</td><td>The TPM EC point to convert. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">p_str</td><td>The target string.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a9f6a2b44857c038a2f90c12959640dea"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> WriteTpm2FfElement </td>
+ <td>(</td>
+ <td class="paramtype">TPM2B_ECC_PARAMETER const *&#160;</td>
+ <td class="paramname"><em>tpm_data</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> *&#160;</td>
+ <td class="paramname"><em>str</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Converts TPM finite field element types into serialized FfElement. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">tpm_data</td><td>The TPM finite field data, typically TPM2B_DIGEST or TPM2B_ECC_PARAMETER. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>The target buffer.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="conversion_8c.html">conversion.c</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/conversion_8h.html b/doc/html/conversion_8h.html
new file mode 100644
index 0000000..8b4b160
--- /dev/null
+++ b/doc/html/conversion_8h.html
@@ -0,0 +1,326 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/conversion.h File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('conversion_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#define-members">Macros</a> &#124;
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">conversion.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM-SDK data conversion interface.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;tss2/TPM_Types.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:ae9c66465b8109d648704268fee8cf66b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae9c66465b8109d648704268fee8cf66b"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#ae9c66465b8109d648704268fee8cf66b">TPM_ALG_SHA256</a>&#160;&#160;&#160;(TPM_ALG_ID)(0x000B)</td></tr>
+<tr class="memdesc:ae9c66465b8109d648704268fee8cf66b"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM code of SHA 256 algorithm. <br /></td></tr>
+<tr class="separator:ae9c66465b8109d648704268fee8cf66b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a85ee45736d112c61495faad4fea3dbbc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a85ee45736d112c61495faad4fea3dbbc"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a85ee45736d112c61495faad4fea3dbbc">TPM_ALG_SHA384</a>&#160;&#160;&#160;(TPM_ALG_ID)(0x000C)</td></tr>
+<tr class="memdesc:a85ee45736d112c61495faad4fea3dbbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM code of SHA 384 algorithm. <br /></td></tr>
+<tr class="separator:a85ee45736d112c61495faad4fea3dbbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a8aecd28504c6511c02da2e78ecaaf5bd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8aecd28504c6511c02da2e78ecaaf5bd"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a8aecd28504c6511c02da2e78ecaaf5bd">TPM_ALG_SHA512</a>&#160;&#160;&#160;(TPM_ALG_ID)(0x000D)</td></tr>
+<tr class="memdesc:a8aecd28504c6511c02da2e78ecaaf5bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM code of SHA 512 algorithm. <br /></td></tr>
+<tr class="separator:a8aecd28504c6511c02da2e78ecaaf5bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a3622ddd0080bf63059d26887b6ee90ac"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3622ddd0080bf63059d26887b6ee90ac"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a3622ddd0080bf63059d26887b6ee90ac">TPM_ALG_NULL</a>&#160;&#160;&#160;(TPM_ALG_ID)(0x0010)</td></tr>
+<tr class="memdesc:a3622ddd0080bf63059d26887b6ee90ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM code of Null algorithm. <br /></td></tr>
+<tr class="separator:a3622ddd0080bf63059d26887b6ee90ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ad08628a6bf33154c1029a32e8b83325f"><td class="memItemLeft" align="right" valign="top">TPMI_ALG_HASH&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#ad08628a6bf33154c1029a32e8b83325f">EpidtoTpm2HashAlg</a> (<a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
+<tr class="memdesc:ad08628a6bf33154c1029a32e8b83325f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps HashAlg to TPM type. <a href="#ad08628a6bf33154c1029a32e8b83325f">More...</a><br /></td></tr>
+<tr class="separator:ad08628a6bf33154c1029a32e8b83325f"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a51507a6be8d7dfa167c9e6fb70e5ee57">Tpm2toEpidHashAlg</a> (TPMI_ALG_HASH tpm_hash_alg)</td></tr>
+<tr class="memdesc:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps TPMI_ALG_HASH to HashAlg. <a href="#a51507a6be8d7dfa167c9e6fb70e5ee57">More...</a><br /></td></tr>
+<tr class="separator:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a8243faa9ef46d90b936c7dace421e10e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a8243faa9ef46d90b936c7dace421e10e">ReadTpm2FfElement</a> (<a class="el" href="struct_oct_str256.html">OctStr256</a> const *str, TPM2B_ECC_PARAMETER *tpm_data)</td></tr>
+<tr class="memdesc:a8243faa9ef46d90b936c7dace421e10e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts serialized FfElement into TPM type. <a href="#a8243faa9ef46d90b936c7dace421e10e">More...</a><br /></td></tr>
+<tr class="separator:a8243faa9ef46d90b936c7dace421e10e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9f6a2b44857c038a2f90c12959640dea"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a9f6a2b44857c038a2f90c12959640dea">WriteTpm2FfElement</a> (TPM2B_ECC_PARAMETER const *tpm_data, <a class="el" href="struct_oct_str256.html">OctStr256</a> *str)</td></tr>
+<tr class="memdesc:a9f6a2b44857c038a2f90c12959640dea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts TPM finite field element types into serialized FfElement. <a href="#a9f6a2b44857c038a2f90c12959640dea">More...</a><br /></td></tr>
+<tr class="separator:a9f6a2b44857c038a2f90c12959640dea"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:acff82e14f6287ec2d4676a3f8cd38a57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#acff82e14f6287ec2d4676a3f8cd38a57">ReadTpm2EcPoint</a> (<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *p_str, TPM2B_ECC_POINT *tpm_point)</td></tr>
+<tr class="memdesc:acff82e14f6287ec2d4676a3f8cd38a57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts ECPoint string to TMP ECPoint structure. <a href="#acff82e14f6287ec2d4676a3f8cd38a57">More...</a><br /></td></tr>
+<tr class="separator:acff82e14f6287ec2d4676a3f8cd38a57"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a15e859e04c4b9c32a0970565846bdba3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a15e859e04c4b9c32a0970565846bdba3">WriteTpm2EcPoint</a> (TPM2B_ECC_POINT const *tpm_point, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *p_str)</td></tr>
+<tr class="memdesc:a15e859e04c4b9c32a0970565846bdba3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serializes TMP ECPoint to ECPoint string. <a href="#a15e859e04c4b9c32a0970565846bdba3">More...</a><br /></td></tr>
+<tr class="separator:a15e859e04c4b9c32a0970565846bdba3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM-SDK data conversion interface. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ad08628a6bf33154c1029a32e8b83325f"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">TPMI_ALG_HASH EpidtoTpm2HashAlg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td>
+ <td class="paramname"><em>hash_alg</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Maps HashAlg to TPM type. </p>
+<p>Maps Intel(R) EPID SDK HashAlg into TPMI_ALG_HASH.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>Code of the hash algorithm </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>TPMI_ALG_HASH </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="acff82e14f6287ec2d4676a3f8cd38a57"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> ReadTpm2EcPoint </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
+ <td class="paramname"><em>p_str</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">TPM2B_ECC_POINT *&#160;</td>
+ <td class="paramname"><em>tpm_point</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Converts ECPoint string to TMP ECPoint structure. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">p_str</td><td>The serialized EcPoint to convert. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">tpm_point</td><td>The TPM EC point representation.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a8243faa9ef46d90b936c7dace421e10e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> ReadTpm2FfElement </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> const *&#160;</td>
+ <td class="paramname"><em>str</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">TPM2B_ECC_PARAMETER *&#160;</td>
+ <td class="paramname"><em>tpm_data</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Converts serialized FfElement into TPM type. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>Serialized Intel(R) EPID SDK FfElement </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">tpm_data</td><td>tpm type data. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a51507a6be8d7dfa167c9e6fb70e5ee57"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> Tpm2toEpidHashAlg </td>
+ <td>(</td>
+ <td class="paramtype">TPMI_ALG_HASH&#160;</td>
+ <td class="paramname"><em>tpm_hash_alg</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Maps TPMI_ALG_HASH to HashAlg. </p>
+<p>Maps TPM hash code TPMI_ALG_HASH into HashAlg.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">tpm_hash_alg</td><td>Code of the hash algorithm in TPM</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>HashAlg </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a15e859e04c4b9c32a0970565846bdba3"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> WriteTpm2EcPoint </td>
+ <td>(</td>
+ <td class="paramtype">TPM2B_ECC_POINT const *&#160;</td>
+ <td class="paramname"><em>tpm_point</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
+ <td class="paramname"><em>p_str</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Serializes TMP ECPoint to ECPoint string. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">tpm_point</td><td>The TPM EC point to convert. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">p_str</td><td>The target string.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a9f6a2b44857c038a2f90c12959640dea"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> WriteTpm2FfElement </td>
+ <td>(</td>
+ <td class="paramtype">TPM2B_ECC_PARAMETER const *&#160;</td>
+ <td class="paramname"><em>tpm_data</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> *&#160;</td>
+ <td class="paramname"><em>str</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Converts TPM finite field element types into serialized FfElement. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">tpm_data</td><td>The TPM finite field data, typically TPM2B_DIGEST or TPM2B_ECC_PARAMETER. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>The target buffer.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="conversion_8h.html">conversion.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/createprimary_8c.html b/doc/html/createprimary_8c.html
new file mode 100644
index 0000000..4203ca8
--- /dev/null
+++ b/doc/html/createprimary_8c.html
@@ -0,0 +1,135 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/createprimary.c File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('createprimary_8c.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">createprimary.c File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM2_CreatePrimary command implementation.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="createprimary_8h.html">epid/member/tpm2/createprimary.h</a>&quot;</code><br />
+<code>#include &quot;epid/common/src/memory.h&quot;</code><br />
+<code>#include &quot;<a class="el" href="conversion_8h.html">epid/member/tpm2/ibm_tss/conversion.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="printtss_8h.html">epid/member/tpm2/ibm_tss/printtss.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="state_8h.html">epid/member/tpm2/ibm_tss/state.h</a>&quot;</code><br />
+<code>#include &quot;tss2/TPM_Types.h&quot;</code><br />
+<code>#include &quot;tss2/tss.h&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:a01df38cbb1c7c7986dadefcc1295bb9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="createprimary_8c.html#a01df38cbb1c7c7986dadefcc1295bb9e">Tpm2CreatePrimary</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *p_str)</td></tr>
+<tr class="memdesc:a01df38cbb1c7c7986dadefcc1295bb9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates Primary key. <a href="#a01df38cbb1c7c7986dadefcc1295bb9e">More...</a><br /></td></tr>
+<tr class="separator:a01df38cbb1c7c7986dadefcc1295bb9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM2_CreatePrimary command implementation. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a01df38cbb1c7c7986dadefcc1295bb9e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2CreatePrimary </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
+ <td class="paramname"><em>p_str</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Creates Primary key. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">p_str</td><td>Primary key: g1^f </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="createprimary_8c.html">createprimary.c</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/createprimary_8h.html b/doc/html/createprimary_8h.html
new file mode 100644
index 0000000..42ff953
--- /dev/null
+++ b/doc/html/createprimary_8h.html
@@ -0,0 +1,129 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/createprimary.h File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('createprimary_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">createprimary.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM2_CreatePrimary command interface.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:a01df38cbb1c7c7986dadefcc1295bb9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="createprimary_8h.html#a01df38cbb1c7c7986dadefcc1295bb9e">Tpm2CreatePrimary</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *p_str)</td></tr>
+<tr class="memdesc:a01df38cbb1c7c7986dadefcc1295bb9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates Primary key. <a href="#a01df38cbb1c7c7986dadefcc1295bb9e">More...</a><br /></td></tr>
+<tr class="separator:a01df38cbb1c7c7986dadefcc1295bb9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM2_CreatePrimary command interface. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a01df38cbb1c7c7986dadefcc1295bb9e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2CreatePrimary </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
+ <td class="paramname"><em>p_str</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Creates Primary key. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">p_str</td><td>Primary key: g1^f </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="createprimary_8h.html">createprimary.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/dir_02c945662023679b89476bd7126bc985.html b/doc/html/dir_02c945662023679b89476bd7126bc985.html
index fa564fd..f31adf0 100644
--- a/doc/html/dir_02c945662023679b89476bd7126bc985.html
+++ b/doc/html/dir_02c945662023679b89476bd7126bc985.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_6048dbb18cb271412de4a010207fd345.html b/doc/html/dir_0d59f1b8006345e373e07b4691e0da76.html
index 7b7bb58..4e64a72 100644
--- a/doc/html/dir_6048dbb18cb271412de4a010207fd345.html
+++ b/doc/html/dir_0d59f1b8006345e373e07b4691e0da76.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm Directory Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2 Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,40 +53,40 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('dir_6048dbb18cb271412de4a010207fd345.html','');});
+$(document).ready(function(){initNavTree('dir_0d59f1b8006345e373e07b4691e0da76.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
-<div class="title">tpm Directory Reference</div> </div>
+<div class="title">tpm2 Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a>
+Directories</h2></td></tr>
+</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
-<tr class="memitem:context_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="context_8h.html">context.h</a></td></tr>
-<tr class="memdesc:context_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sensitive member context APIs. <br /></td></tr>
+<tr class="memitem:commit_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commit_8h.html">commit.h</a></td></tr>
+<tr class="memdesc:commit_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">SDK TPM Commit API. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:decompress_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="decompress_8h.html">decompress.h</a></td></tr>
-<tr class="memdesc:decompress_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM key decompression APIs. <br /></td></tr>
+<tr class="memitem:context_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="context_8h.html">context.h</a></td></tr>
+<tr class="memdesc:context_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">SDK TPM API. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:init_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="init_8h.html">init.h</a></td></tr>
-<tr class="memdesc:init_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Non-sensitive member context APIs. <br /></td></tr>
+<tr class="memitem:createprimary_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="createprimary_8h.html">createprimary.h</a></td></tr>
+<tr class="memdesc:createprimary_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM2_CreatePrimary command interface. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:join_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="join_8h.html">join.h</a></td></tr>
-<tr class="memdesc:join_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM join APIs. <br /></td></tr>
+<tr class="memitem:getrandom_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="getrandom_8h.html">getrandom.h</a></td></tr>
+<tr class="memdesc:getrandom_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">SDK TPM API. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:nrprove_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nrprove_8h.html">nrprove.h</a></td></tr>
-<tr class="memdesc:nrprove_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM NrProve APIs. <br /></td></tr>
+<tr class="memitem:load__external_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="load__external_8h.html">load_external.h</a></td></tr>
+<tr class="memdesc:load__external_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">SDK TPM API. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:presig_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="presig_8h.html">presig.h</a></td></tr>
-<tr class="memdesc:presig_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sensitive pre-computed signature APIs. <br /></td></tr>
+<tr class="memitem:nv_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nv_8h.html">nv.h</a></td></tr>
+<tr class="memdesc:nv_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">SDK TPM non volatile memory API. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:sign_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sign_8h.html">sign.h</a></td></tr>
-<tr class="memdesc:sign_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM signing APIs. <br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:validatekey_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="validatekey_8h.html">validatekey.h</a></td></tr>
-<tr class="memdesc:validatekey_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Non-sensitive member context APIs. <br /></td></tr>
+<tr class="memdesc:sign_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">SDK TPM Sign API. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
@@ -95,7 +95,7 @@ Files</h2></td></tr>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/dir_12b90d9c027aaf878a834df729679a56.html b/doc/html/dir_12b90d9c027aaf878a834df729679a56.html
index 7a4c933..a25a280 100644
--- a/doc/html/dir_12b90d9c027aaf878a834df729679a56.html
+++ b/doc/html/dir_12b90d9c027aaf878a834df729679a56.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_512d3e62841a8535b716ec4cf8b9e950.html b/doc/html/dir_512d3e62841a8535b716ec4cf8b9e950.html
index 5e26711..b40409f 100644
--- a/doc/html/dir_512d3e62841a8535b716ec4cf8b9e950.html
+++ b/doc/html/dir_512d3e62841a8535b716ec4cf8b9e950.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -74,6 +74,12 @@ Files</h2></td></tr>
<tr class="memitem:member_2api_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="member_2api_8h.html">api.h</a></td></tr>
<tr class="memdesc:member_2api_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID SDK member API. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:software__member_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="software__member_8h.html">software_member.h</a></td></tr>
+<tr class="memdesc:software__member_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Member creation parameters for software only implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:tpm__member_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tpm__member_8h.html">tpm_member.h</a></td></tr>
+<tr class="memdesc:tpm__member_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Member creation parameters for TPM implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Member functionality. </p>
diff --git a/doc/html/dir_a32be19bc88f3d7aac6b7249da379f26.html b/doc/html/dir_a32be19bc88f3d7aac6b7249da379f26.html
index d5579b0..e8d531a 100644
--- a/doc/html/dir_a32be19bc88f3d7aac6b7249da379f26.html
+++ b/doc/html/dir_a32be19bc88f3d7aac6b7249da379f26.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -65,7 +65,7 @@ $(document).ready(function(){initNavTree('dir_a32be19bc88f3d7aac6b7249da379f26.h
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:1_81_2file__parser_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="1_81_2file__parser_8h.html">file_parser.h</a></td></tr>
-<tr class="memdesc:1_81_2file__parser_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Epid 1.1 issuer material parsing utilities. <br /></td></tr>
+<tr class="memdesc:1_81_2file__parser_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 issuer material parsing utilities. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:1_81_2types_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="1_81_2types_8h.html">types.h</a></td></tr>
<tr class="memdesc:1_81_2types_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">SDK data types for Intel(R) EPID 1.1. <br /></td></tr>
diff --git a/doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html b/doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html
new file mode 100644
index 0000000..ad2ce28
--- /dev/null
+++ b/doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html
@@ -0,0 +1,117 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss Directory Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('dir_b7525369f2fbc378c6814b573b9a2bc3.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">ibm_tss Directory Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
+Files</h2></td></tr>
+<tr class="memitem:commit_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="commit_8c.html">commit.c</a></td></tr>
+<tr class="memdesc:commit_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tpm2Commit implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:context_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="context_8c.html">context.c</a></td></tr>
+<tr class="memdesc:context_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM context implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:conversion_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html">conversion.c</a></td></tr>
+<tr class="memdesc:conversion_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM-SDK data conversion implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:conversion_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html">conversion.h</a></td></tr>
+<tr class="memdesc:conversion_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM-SDK data conversion interface. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:createprimary_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="createprimary_8c.html">createprimary.c</a></td></tr>
+<tr class="memdesc:createprimary_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM2_CreatePrimary command implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:getrandom_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="getrandom_8c.html">getrandom.c</a></td></tr>
+<tr class="memdesc:getrandom_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM2_GetRandom command implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:load__external_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="load__external_8c.html">load_external.c</a></td></tr>
+<tr class="memdesc:load__external_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM2_LoadExternal command implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:nv_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="nv_8c.html">nv.c</a></td></tr>
+<tr class="memdesc:nv_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">TSS NV API implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:printtss_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printtss_8c.html">printtss.c</a></td></tr>
+<tr class="memdesc:printtss_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM context implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:printtss_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printtss_8h.html">printtss.h</a></td></tr>
+<tr class="memdesc:printtss_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM log error prints. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:sign_8c"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sign_8c.html">sign.c</a></td></tr>
+<tr class="memdesc:sign_8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tpm2Sign implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:state_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="state_8h.html">state.h</a></td></tr>
+<tr class="memdesc:state_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM internal state. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/dir_ef364879bae02db2684040178ed9b186.html b/doc/html/dir_ef364879bae02db2684040178ed9b186.html
index 037ebae..86e2dfc 100644
--- a/doc/html/dir_ef364879bae02db2684040178ed9b186.html
+++ b/doc/html/dir_ef364879bae02db2684040178ed9b186.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_f169ebf8da29290a918fa4b3f7151050.html b/doc/html/dir_f169ebf8da29290a918fa4b3f7151050.html
index 5c36c0c..75d4c5c 100644
--- a/doc/html/dir_f169ebf8da29290a918fa4b3f7151050.html
+++ b/doc/html/dir_f169ebf8da29290a918fa4b3f7151050.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_f6bef457d5f671b6e774bfccc16651f6.html b/doc/html/dir_f6bef457d5f671b6e774bfccc16651f6.html
index 4ab2133..b36f7fb 100644
--- a/doc/html/dir_f6bef457d5f671b6e774bfccc16651f6.html
+++ b/doc/html/dir_f6bef457d5f671b6e774bfccc16651f6.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -81,7 +81,7 @@ Files</h2></td></tr>
<tr class="memdesc:errors_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Error reporting. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:file__parser_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="file__parser_8h.html">file_parser.h</a></td></tr>
-<tr class="memdesc:file__parser_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Epid issuer material parsing utilities. <br /></td></tr>
+<tr class="memdesc:file__parser_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID issuer material parsing utilities. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:stdtypes_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="stdtypes_8h.html">stdtypes.h</a></td></tr>
<tr class="memdesc:stdtypes_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">C99 standard data types. <br /></td></tr>
diff --git a/doc/html/ecdsa_8h.html b/doc/html/ecdsa_8h.html
index 33ced6d..b5a47cd 100644
--- a/doc/html/ecdsa_8h.html
+++ b/doc/html/ecdsa_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -67,9 +67,9 @@ $(document).ready(function(){initNavTree('ecdsa_8h.html','');});
<p>Ecdsa interface.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="bitsupplier_8h.html">epid/common/bitsupplier.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="bitsupplier_8h.html">epid/common/bitsupplier.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
diff --git a/doc/html/ecgroup_8h.html b/doc/html/ecgroup_8h.html
index 21003e0..4647db2 100644
--- a/doc/html/ecgroup_8h.html
+++ b/doc/html/ecgroup_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -67,10 +67,10 @@ $(document).ready(function(){initNavTree('ecgroup_8h.html','');});
<p>Elliptic curve group interface.
<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="bignum_8h.html">epid/common/math/bignum.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
@@ -131,9 +131,9 @@ Functions</h2></td></tr>
<tr class="memitem:gaad96a1498b85d28f71514b8f7b154d82"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ec_group_primitives.html#gaad96a1498b85d28f71514b8f7b154d82">Epid11EcHash</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> *g, <a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> msg, size_t msg_len, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *r)</td></tr>
<tr class="memdesc:gaad96a1498b85d28f71514b8f7b154d82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes an arbitrary message to an Intel(R) EPID 1.1 element in an elliptic curve group. <a href="group___ec_group_primitives.html#gaad96a1498b85d28f71514b8f7b154d82">More...</a><br /></td></tr>
<tr class="separator:gaad96a1498b85d28f71514b8f7b154d82"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gab647ccc031063807ff3860f51d0f6919"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ec_group_primitives.html#gab647ccc031063807ff3860f51d0f6919">EcHash</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> *g, <a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> msg, size_t msg_len, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *r)</td></tr>
-<tr class="memdesc:gab647ccc031063807ff3860f51d0f6919"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes an arbitrary message to an element in an elliptic curve group. <a href="group___ec_group_primitives.html#gab647ccc031063807ff3860f51d0f6919">More...</a><br /></td></tr>
-<tr class="separator:gab647ccc031063807ff3860f51d0f6919"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac3067cc899e65e647390bb3bd1cabe4c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ec_group_primitives.html#gac3067cc899e65e647390bb3bd1cabe4c">EcHash</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> *g, <a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> msg, size_t msg_len, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *r, uint32_t *iterations)</td></tr>
+<tr class="memdesc:gac3067cc899e65e647390bb3bd1cabe4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes an arbitrary message to an element in an elliptic curve group. <a href="group___ec_group_primitives.html#gac3067cc899e65e647390bb3bd1cabe4c">More...</a><br /></td></tr>
+<tr class="separator:gac3067cc899e65e647390bb3bd1cabe4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a6114a48214a327d4ec04fd25e5940e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ec_group_primitives.html#ga8a6114a48214a327d4ec04fd25e5940e">EcMakePoint</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> *g, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const *x, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *r)</td></tr>
<tr class="memdesc:ga8a6114a48214a327d4ec04fd25e5940e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets an EcPoint variable to a point on a curve. <a href="group___ec_group_primitives.html#ga8a6114a48214a327d4ec04fd25e5940e">More...</a><br /></td></tr>
<tr class="separator:ga8a6114a48214a327d4ec04fd25e5940e"><td class="memSeparator" colspan="2">&#160;</td></tr>
diff --git a/doc/html/epid__overview_8dox.html b/doc/html/epid__overview_8dox.html
index ee5b8d1..0d6c128 100644
--- a/doc/html/epid__overview_8dox.html
+++ b/doc/html/epid__overview_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/epid_diagram_basic_interaction.png b/doc/html/epid_diagram_basic_interaction.png
deleted file mode 100644
index 2c0f236..0000000
--- a/doc/html/epid_diagram_basic_interaction.png
+++ /dev/null
Binary files differ
diff --git a/doc/html/epid_diagram_generating_member_private_keys.png b/doc/html/epid_diagram_generating_member_private_keys.png
new file mode 100644
index 0000000..6b92763
--- /dev/null
+++ b/doc/html/epid_diagram_generating_member_private_keys.png
Binary files differ
diff --git a/doc/html/epid_diagram_group_public_key_and_issuing_private_key.png b/doc/html/epid_diagram_group_public_key_and_issuing_private_key.png
new file mode 100644
index 0000000..a6b7ca1
--- /dev/null
+++ b/doc/html/epid_diagram_group_public_key_and_issuing_private_key.png
Binary files differ
diff --git a/doc/html/epid_diagram_issuer_functionality.png b/doc/html/epid_diagram_issuer_functionality.png
deleted file mode 100644
index 7614b56..0000000
--- a/doc/html/epid_diagram_issuer_functionality.png
+++ /dev/null
Binary files differ
diff --git a/doc/html/epid_diagram_issuer_makes_revocation_lists_available.png b/doc/html/epid_diagram_issuer_makes_revocation_lists_available.png
new file mode 100644
index 0000000..cd77e59
--- /dev/null
+++ b/doc/html/epid_diagram_issuer_makes_revocation_lists_available.png
Binary files differ
diff --git a/doc/html/epid_diagram_maintaining_revocation_lists.png b/doc/html/epid_diagram_maintaining_revocation_lists.png
new file mode 100644
index 0000000..79ddddc
--- /dev/null
+++ b/doc/html/epid_diagram_maintaining_revocation_lists.png
Binary files differ
diff --git a/doc/html/epid_diagram_member_functionality.png b/doc/html/epid_diagram_member_functionality.png
deleted file mode 100644
index 3b0a41a..0000000
--- a/doc/html/epid_diagram_member_functionality.png
+++ /dev/null
Binary files differ
diff --git a/doc/html/epid_diagram_provisioning.png b/doc/html/epid_diagram_provisioning.png
new file mode 100644
index 0000000..40fafd1
--- /dev/null
+++ b/doc/html/epid_diagram_provisioning.png
Binary files differ
diff --git a/doc/html/epid_diagram_signing_and_verification.png b/doc/html/epid_diagram_signing_and_verification.png
new file mode 100644
index 0000000..7eeedbb
--- /dev/null
+++ b/doc/html/epid_diagram_signing_and_verification.png
Binary files differ
diff --git a/doc/html/epid_diagram_verifier_functionality.png b/doc/html/epid_diagram_verifier_functionality.png
deleted file mode 100644
index c065129..0000000
--- a/doc/html/epid_diagram_verifier_functionality.png
+++ /dev/null
Binary files differ
diff --git a/doc/html/epidstyle.css b/doc/html/epidstyle.css
index 0ad7ff8..4b51e3f 100644
--- a/doc/html/epidstyle.css
+++ b/doc/html/epidstyle.css
@@ -322,4 +322,4 @@ SPAN.Color4 {
#projectlink {
color:inherit;
text-decoration:none;
-} \ No newline at end of file
+}
diff --git a/doc/html/errors_8h.html b/doc/html/errors_8h.html
index cec6edb..ffcf85b 100644
--- a/doc/html/errors_8h.html
+++ b/doc/html/errors_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/examples.html b/doc/html/examples.html
index 241bb40..b114cb9 100644
--- a/doc/html/examples.html
+++ b/doc/html/examples.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/examples_8dox.html b/doc/html/examples_8dox.html
index 34cfc3d..671ec28 100644
--- a/doc/html/examples_8dox.html
+++ b/doc/html/examples_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/file__parser_8h.html b/doc/html/file__parser_8h.html
index 0165205..0387fae 100644
--- a/doc/html/file__parser_8h.html
+++ b/doc/html/file__parser_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -67,11 +67,11 @@ $(document).ready(function(){initNavTree('file__parser_8h.html','');});
</div><!--header-->
<div class="contents">
-<p>Epid issuer material parsing utilities.
+<p>Intel(R) EPID issuer material parsing utilities.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
-<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
@@ -137,7 +137,7 @@ const <a class="el" href="struct_oct_str16.html">OctStr16</a>&#160;</td><td clas
<tr class="separator:ga3770c39a0546c79447c9d4159d794c33"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Epid issuer material parsing utilities. </p>
+<div class="textblock"><p>Intel(R) EPID issuer material parsing utilities. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/files.html b/doc/html/files.html
index 28117fc..82c4335 100644
--- a/doc/html/files.html
+++ b/doc/html/files.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -62,11 +62,11 @@ $(document).ready(function(){initNavTree('files.html','');});
</div><!--header-->
<div class="contents">
<div class="textblock">Here is a list of all documented files with brief descriptions:</div><div class="directory">
-<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span><span onclick="javascript:toggleLevel(4);">4</span>]</div><table class="directory">
+<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span><span onclick="javascript:toggleLevel(4);">4</span><span onclick="javascript:toggleLevel(5);">5</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span id="img_0_" class="iconfopen" onclick="toggleFolder('0_')">&#160;</span><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html" target="_self">epid</a></td><td class="desc">Core Intel&reg; EPID functionality </td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_0_" class="arrow" onclick="toggleFolder('0_0_')">&#9660;</span><span id="img_0_0_" class="iconfopen" onclick="toggleFolder('0_0_')">&#160;</span><a class="el" href="dir_f6bef457d5f671b6e774bfccc16651f6.html" target="_self">common</a></td><td class="desc">Common code shared between core sub-components </td></tr>
<tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_0_" class="arrow" onclick="toggleFolder('0_0_0_')">&#9660;</span><span id="img_0_0_0_" class="iconfopen" onclick="toggleFolder('0_0_0_')">&#160;</span><a class="el" href="dir_a32be19bc88f3d7aac6b7249da379f26.html" target="_self">1.1</a></td><td class="desc"></td></tr>
-<tr id="row_0_0_0_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="1_81_2file__parser_8h.html" target="_self">file_parser.h</a></td><td class="desc">Epid 1.1 issuer material parsing utilities </td></tr>
+<tr id="row_0_0_0_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="1_81_2file__parser_8h.html" target="_self">file_parser.h</a></td><td class="desc">Intel(R) EPID 1.1 issuer material parsing utilities </td></tr>
<tr id="row_0_0_0_1_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="1_81_2types_8h.html" target="_self">types.h</a></td><td class="desc">SDK data types for Intel(R) EPID 1.1 </td></tr>
<tr id="row_0_0_1_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_1_" class="arrow" onclick="toggleFolder('0_0_1_')">&#9660;</span><span id="img_0_0_1_" class="iconfopen" onclick="toggleFolder('0_0_1_')">&#160;</span><a class="el" href="dir_f169ebf8da29290a918fa4b3f7151050.html" target="_self">math</a></td><td class="desc">Math primitives </td></tr>
<tr id="row_0_0_1_0_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="bignum_8h.html" target="_self">bignum.h</a></td><td class="desc">Big number interface </td></tr>
@@ -79,20 +79,34 @@ $(document).ready(function(){initNavTree('files.html','');});
<tr id="row_0_0_1_7_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="tatepairing_8h.html" target="_self">tatepairing.h</a></td><td class="desc">Intel(R) EPID 1.1 Pairing interface </td></tr>
<tr id="row_0_0_2_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="bitsupplier_8h.html" target="_self">bitsupplier.h</a></td><td class="desc">Random data supplier interface </td></tr>
<tr id="row_0_0_3_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="errors_8h.html" target="_self">errors.h</a></td><td class="desc">Error reporting </td></tr>
-<tr id="row_0_0_4_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="file__parser_8h.html" target="_self">file_parser.h</a></td><td class="desc">Epid issuer material parsing utilities </td></tr>
+<tr id="row_0_0_4_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="file__parser_8h.html" target="_self">file_parser.h</a></td><td class="desc">Intel(R) EPID issuer material parsing utilities </td></tr>
<tr id="row_0_0_5_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="stdtypes_8h.html" target="_self">stdtypes.h</a></td><td class="desc">C99 standard data types </td></tr>
<tr id="row_0_0_6_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="types_8h.html" target="_self">types.h</a></td><td class="desc">SDK data types </td></tr>
<tr id="row_0_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_1_" class="arrow" onclick="toggleFolder('0_1_')">&#9660;</span><span id="img_0_1_" class="iconfopen" onclick="toggleFolder('0_1_')">&#160;</span><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html" target="_self">member</a></td><td class="desc">Member functionality </td></tr>
-<tr id="row_0_1_0_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_1_0_" class="arrow" onclick="toggleFolder('0_1_0_')">&#9660;</span><span id="img_0_1_0_" class="iconfopen" onclick="toggleFolder('0_1_0_')">&#160;</span><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html" target="_self">tpm</a></td><td class="desc"></td></tr>
-<tr id="row_0_1_0_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="context_8h.html" target="_self">context.h</a></td><td class="desc">Sensitive member context APIs </td></tr>
-<tr id="row_0_1_0_1_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="decompress_8h.html" target="_self">decompress.h</a></td><td class="desc">TPM key decompression APIs </td></tr>
-<tr id="row_0_1_0_2_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="init_8h.html" target="_self">init.h</a></td><td class="desc">Non-sensitive member context APIs </td></tr>
-<tr id="row_0_1_0_3_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="join_8h.html" target="_self">join.h</a></td><td class="desc">TPM join APIs </td></tr>
-<tr id="row_0_1_0_4_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="nrprove_8h.html" target="_self">nrprove.h</a></td><td class="desc">TPM NrProve APIs </td></tr>
-<tr id="row_0_1_0_5_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="presig_8h.html" target="_self">presig.h</a></td><td class="desc">Sensitive pre-computed signature APIs </td></tr>
-<tr id="row_0_1_0_6_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="sign_8h.html" target="_self">sign.h</a></td><td class="desc">TPM signing APIs </td></tr>
-<tr id="row_0_1_0_7_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="validatekey_8h.html" target="_self">validatekey.h</a></td><td class="desc">Non-sensitive member context APIs </td></tr>
+<tr id="row_0_1_0_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_1_0_" class="arrow" onclick="toggleFolder('0_1_0_')">&#9660;</span><span id="img_0_1_0_" class="iconfopen" onclick="toggleFolder('0_1_0_')">&#160;</span><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html" target="_self">tpm2</a></td><td class="desc"></td></tr>
+<tr id="row_0_1_0_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span id="arr_0_1_0_0_" class="arrow" onclick="toggleFolder('0_1_0_0_')">&#9660;</span><span id="img_0_1_0_0_" class="iconfopen" onclick="toggleFolder('0_1_0_0_')">&#160;</span><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html" target="_self">ibm_tss</a></td><td class="desc"></td></tr>
+<tr id="row_0_1_0_0_0_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="commit_8c.html" target="_self">commit.c</a></td><td class="desc">Tpm2Commit implementation </td></tr>
+<tr id="row_0_1_0_0_1_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="context_8c.html" target="_self">context.c</a></td><td class="desc">TPM context implementation </td></tr>
+<tr id="row_0_1_0_0_2_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="conversion_8c.html" target="_self">conversion.c</a></td><td class="desc">TPM-SDK data conversion implementation </td></tr>
+<tr id="row_0_1_0_0_3_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="conversion_8h.html" target="_self">conversion.h</a></td><td class="desc">TPM-SDK data conversion interface </td></tr>
+<tr id="row_0_1_0_0_4_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="createprimary_8c.html" target="_self">createprimary.c</a></td><td class="desc">TPM2_CreatePrimary command implementation </td></tr>
+<tr id="row_0_1_0_0_5_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="getrandom_8c.html" target="_self">getrandom.c</a></td><td class="desc">TPM2_GetRandom command implementation </td></tr>
+<tr id="row_0_1_0_0_6_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="load__external_8c.html" target="_self">load_external.c</a></td><td class="desc">TPM2_LoadExternal command implementation </td></tr>
+<tr id="row_0_1_0_0_7_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="nv_8c.html" target="_self">nv.c</a></td><td class="desc">TSS NV API implementation </td></tr>
+<tr id="row_0_1_0_0_8_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="printtss_8c.html" target="_self">printtss.c</a></td><td class="desc">TPM context implementation </td></tr>
+<tr id="row_0_1_0_0_9_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="printtss_8h.html" target="_self">printtss.h</a></td><td class="desc">TPM log error prints </td></tr>
+<tr id="row_0_1_0_0_10_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="sign_8c.html" target="_self">sign.c</a></td><td class="desc">Tpm2Sign implementation </td></tr>
+<tr id="row_0_1_0_0_11_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="state_8h.html" target="_self">state.h</a></td><td class="desc">TPM internal state </td></tr>
+<tr id="row_0_1_0_1_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="commit_8h.html" target="_self">commit.h</a></td><td class="desc">SDK TPM Commit API </td></tr>
+<tr id="row_0_1_0_2_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="context_8h.html" target="_self">context.h</a></td><td class="desc">SDK TPM API </td></tr>
+<tr id="row_0_1_0_3_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="createprimary_8h.html" target="_self">createprimary.h</a></td><td class="desc">TPM2_CreatePrimary command interface </td></tr>
+<tr id="row_0_1_0_4_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="getrandom_8h.html" target="_self">getrandom.h</a></td><td class="desc">SDK TPM API </td></tr>
+<tr id="row_0_1_0_5_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="load__external_8h.html" target="_self">load_external.h</a></td><td class="desc">SDK TPM API </td></tr>
+<tr id="row_0_1_0_6_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="nv_8h.html" target="_self">nv.h</a></td><td class="desc">SDK TPM non volatile memory API </td></tr>
+<tr id="row_0_1_0_7_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="sign_8h.html" target="_self">sign.h</a></td><td class="desc">SDK TPM Sign API </td></tr>
<tr id="row_0_1_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="member_2api_8h.html" target="_self">api.h</a></td><td class="desc">Intel(R) EPID SDK member API </td></tr>
+<tr id="row_0_1_2_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="software__member_8h.html" target="_self">software_member.h</a></td><td class="desc">Member creation parameters for software only implementation </td></tr>
+<tr id="row_0_1_3_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="tpm__member_8h.html" target="_self">tpm_member.h</a></td><td class="desc">Member creation parameters for TPM implementation </td></tr>
<tr id="row_0_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_2_" class="arrow" onclick="toggleFolder('0_2_')">&#9660;</span><span id="img_0_2_" class="iconfopen" onclick="toggleFolder('0_2_')">&#160;</span><a class="el" href="dir_02c945662023679b89476bd7126bc985.html" target="_self">verifier</a></td><td class="desc">Verifier functionality </td></tr>
<tr id="row_0_2_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_2_0_" class="arrow" onclick="toggleFolder('0_2_0_')">&#9660;</span><span id="img_0_2_0_" class="iconfopen" onclick="toggleFolder('0_2_0_')">&#160;</span><a class="el" href="dir_ef364879bae02db2684040178ed9b186.html" target="_self">1.1</a></td><td class="desc"></td></tr>
<tr id="row_0_2_0_0_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="verifier_21_81_2api_8h.html" target="_self">api.h</a></td><td class="desc">Intel(R) EPID SDK verifier Intel(R) EPID 1.1 API </td></tr>
diff --git a/doc/html/finitefield_8h.html b/doc/html/finitefield_8h.html
index d89d041..65a85c6 100644
--- a/doc/html/finitefield_8h.html
+++ b/doc/html/finitefield_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -67,10 +67,10 @@ $(document).ready(function(){initNavTree('finitefield_8h.html','');});
<p>Finite field interface.
<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="bitsupplier_8h.html">epid/common/bitsupplier.h</a>&quot;</code><br />
+<div class="textblock"><code>#include &quot;<a class="el" href="bitsupplier_8h.html">epid/common/bitsupplier.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="bignum_8h.html">epid/common/math/bignum.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
diff --git a/doc/html/functions.html b/doc/html/functions.html
index 248ebab..342d76d 100644
--- a/doc/html/functions.html
+++ b/doc/html/functions.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -92,12 +92,7 @@ $(document).ready(function(){initNavTree('functions.html','');});
, <a class="el" href="struct_epid11_sig_rl_entry.html#abe47cfbd00684941f93a211417bedf0c">Epid11SigRlEntry</a>
, <a class="el" href="struct_epid2_params.html#a2f868edb49be49f645101ef5ebbbc551">Epid2Params</a>
, <a class="el" href="struct_epid_ca_certificate.html#a280e0b0238cf45834c21849ab8a7e124">EpidCaCertificate</a>
-</li>
-<li>B
-: <a class="el" href="struct_sign_commit_output.html#ae2ebcc07395e60187d9ccca373665dba">SignCommitOutput</a>
-</li>
-<li>b
-: <a class="el" href="struct_sig_rl_entry.html#ac6a47ff0d1b8ea1512e0ff14983ac5ce">SigRlEntry</a>
+, <a class="el" href="struct_sig_rl_entry.html#ac6a47ff0d1b8ea1512e0ff14983ac5ce">SigRlEntry</a>
</li>
<li>B
: <a class="el" href="struct_verifier_rl.html#a5d9a9265fffa96fd5f9260543eb08c68">VerifierRl</a>
@@ -172,6 +167,9 @@ $(document).ready(function(){initNavTree('functions.html','');});
<li>eg12
: <a class="el" href="struct_verifier_precomp.html#ab061d6cc07d1467eeb5bf25f3ea7e306">VerifierPrecomp</a>
</li>
+<li>epid2_params
+: <a class="el" href="struct_tpm2_ctx.html#ac9cb082159a9ca169b6666779985a705">Tpm2Ctx</a>
+</li>
<li>epid_version
: <a class="el" href="struct_epid_file_header.html#a35d43c51c1739940381e4898ca87b824">EpidFileHeader</a>
</li>
@@ -186,7 +184,8 @@ $(document).ready(function(){initNavTree('functions.html','');});
: <a class="el" href="struct_join_request.html#a005651506fd4511e8a3537f6c3634532">JoinRequest</a>
</li>
<li>f
-: <a class="el" href="struct_priv_key.html#ad7ee0392a583edd2e287cf8c1f9066ba">PrivKey</a>
+: <a class="el" href="struct_member_params.html#ad6782a38fd79477bccf2313c676ea4fc">MemberParams</a>
+, <a class="el" href="struct_priv_key.html#ad7ee0392a583edd2e287cf8c1f9066ba">PrivKey</a>
, <a class="el" href="struct_priv_rl.html#a60d73f9ef5fc81f117b3abadf8c18466">PrivRl</a>
</li>
<li>file_type
@@ -245,6 +244,9 @@ $(document).ready(function(){initNavTree('functions.html','');});
<li>h_tick
: <a class="el" href="struct_epid11_params.html#a0fe238db4ebc0225899dc2dac97d11c0">Epid11Params</a>
</li>
+<li>hash_alg
+: <a class="el" href="struct_tpm2_ctx.html#a48940c01483e2e6ba4bd1475fba16fdd">Tpm2Ctx</a>
+</li>
<li>header
: <a class="el" href="struct_epid_ca_certificate.html#ac03cf7257c52ad14e3dd3201b930dd50">EpidCaCertificate</a>
</li>
@@ -258,16 +260,14 @@ $(document).ready(function(){initNavTree('functions.html','');});
</li>
<li>k
: <a class="el" href="struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a">Epid11SigRlEntry</a>
-</li>
-<li>K
-: <a class="el" href="struct_sign_commit_output.html#a496bdc4d14fb73b1e85dfff3bc9fd3ba">SignCommitOutput</a>
-</li>
-<li>k
-: <a class="el" href="struct_sig_rl_entry.html#a0dfeb058614e81878bfbf86ae3edac3c">SigRlEntry</a>
+, <a class="el" href="struct_sig_rl_entry.html#a0dfeb058614e81878bfbf86ae3edac3c">SigRlEntry</a>
</li>
<li>K
: <a class="el" href="struct_verifier_rl.html#ac7d3dceab4772096bbbeb3fa735d18a9">VerifierRl</a>
</li>
+<li>key_handle
+: <a class="el" href="struct_tpm2_ctx.html#ad71eba97fbd7d36ac1dd51ffc67791ce">Tpm2Ctx</a>
+</li>
</ul>
@@ -340,18 +340,16 @@ $(document).ready(function(){initNavTree('functions.html','');});
<li>r
: <a class="el" href="struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2">EpidCaCertificate</a>
</li>
-<li>R1
-: <a class="el" href="struct_nr_prove_commit_output.html#af9c605d560f83ccd69e35d8b9cfe51b3">NrProveCommitOutput</a>
-, <a class="el" href="struct_sign_commit_output.html#ad01513f153f51f7ce211cf323a224499">SignCommitOutput</a>
-</li>
-<li>R2
-: <a class="el" href="struct_nr_prove_commit_output.html#aab0f11e55d3b8d838e472242e27a1a43">NrProveCommitOutput</a>
-, <a class="el" href="struct_sign_commit_output.html#a0f35f1d619ea972acbdf9d45af630de0">SignCommitOutput</a>
-</li>
<li>rl_ver
: <a class="el" href="struct_epid11_signature.html#a43cb3ed13c862ff05a9292623ad57c5e">Epid11Signature</a>
, <a class="el" href="struct_epid_signature.html#a4155f3f4f1223fc4ae50c94f5305def1">EpidSignature</a>
</li>
+<li>rnd_func
+: <a class="el" href="struct_member_params.html#ad844c7a2be20bac70b118e7c08530c0b">MemberParams</a>
+</li>
+<li>rnd_param
+: <a class="el" href="struct_member_params.html#a7510f05e63328fa13cf2a3a3bd6acd95">MemberParams</a>
+</li>
</ul>
@@ -419,8 +417,6 @@ $(document).ready(function(){initNavTree('functions.html','');});
</li>
<li>T
: <a class="el" href="struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3">NrProof</a>
-, <a class="el" href="struct_nr_prove_commit_output.html#a00234dfa2443d49f5a294c58fdacb064">NrProveCommitOutput</a>
-, <a class="el" href="struct_sign_commit_output.html#a9ce3b28916094f5fa108d5f5c86631b0">SignCommitOutput</a>
</li>
<li>T1
: <a class="el" href="struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b">Epid11BasicSignature</a>
@@ -428,6 +424,9 @@ $(document).ready(function(){initNavTree('functions.html','');});
<li>T2
: <a class="el" href="struct_epid11_basic_signature.html#a267cf4e17d10584736b0c38f3668d822">Epid11BasicSignature</a>
</li>
+<li>tss
+: <a class="el" href="struct_tpm2_ctx.html#add1c4c767abfee8bf87068ac03c52db1">Tpm2Ctx</a>
+</li>
</ul>
diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html
index 071a59c..7005ce0 100644
--- a/doc/html/functions_vars.html
+++ b/doc/html/functions_vars.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -92,12 +92,7 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
, <a class="el" href="struct_epid11_sig_rl_entry.html#abe47cfbd00684941f93a211417bedf0c">Epid11SigRlEntry</a>
, <a class="el" href="struct_epid2_params.html#a2f868edb49be49f645101ef5ebbbc551">Epid2Params</a>
, <a class="el" href="struct_epid_ca_certificate.html#a280e0b0238cf45834c21849ab8a7e124">EpidCaCertificate</a>
-</li>
-<li>B
-: <a class="el" href="struct_sign_commit_output.html#ae2ebcc07395e60187d9ccca373665dba">SignCommitOutput</a>
-</li>
-<li>b
-: <a class="el" href="struct_sig_rl_entry.html#ac6a47ff0d1b8ea1512e0ff14983ac5ce">SigRlEntry</a>
+, <a class="el" href="struct_sig_rl_entry.html#ac6a47ff0d1b8ea1512e0ff14983ac5ce">SigRlEntry</a>
</li>
<li>B
: <a class="el" href="struct_verifier_rl.html#a5d9a9265fffa96fd5f9260543eb08c68">VerifierRl</a>
@@ -172,6 +167,9 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
<li>eg12
: <a class="el" href="struct_verifier_precomp.html#ab061d6cc07d1467eeb5bf25f3ea7e306">VerifierPrecomp</a>
</li>
+<li>epid2_params
+: <a class="el" href="struct_tpm2_ctx.html#ac9cb082159a9ca169b6666779985a705">Tpm2Ctx</a>
+</li>
<li>epid_version
: <a class="el" href="struct_epid_file_header.html#a35d43c51c1739940381e4898ca87b824">EpidFileHeader</a>
</li>
@@ -186,7 +184,8 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
: <a class="el" href="struct_join_request.html#a005651506fd4511e8a3537f6c3634532">JoinRequest</a>
</li>
<li>f
-: <a class="el" href="struct_priv_key.html#ad7ee0392a583edd2e287cf8c1f9066ba">PrivKey</a>
+: <a class="el" href="struct_member_params.html#ad6782a38fd79477bccf2313c676ea4fc">MemberParams</a>
+, <a class="el" href="struct_priv_key.html#ad7ee0392a583edd2e287cf8c1f9066ba">PrivKey</a>
, <a class="el" href="struct_priv_rl.html#a60d73f9ef5fc81f117b3abadf8c18466">PrivRl</a>
</li>
<li>file_type
@@ -245,6 +244,9 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
<li>h_tick
: <a class="el" href="struct_epid11_params.html#a0fe238db4ebc0225899dc2dac97d11c0">Epid11Params</a>
</li>
+<li>hash_alg
+: <a class="el" href="struct_tpm2_ctx.html#a48940c01483e2e6ba4bd1475fba16fdd">Tpm2Ctx</a>
+</li>
<li>header
: <a class="el" href="struct_epid_ca_certificate.html#ac03cf7257c52ad14e3dd3201b930dd50">EpidCaCertificate</a>
</li>
@@ -258,16 +260,14 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
</li>
<li>k
: <a class="el" href="struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a">Epid11SigRlEntry</a>
-</li>
-<li>K
-: <a class="el" href="struct_sign_commit_output.html#a496bdc4d14fb73b1e85dfff3bc9fd3ba">SignCommitOutput</a>
-</li>
-<li>k
-: <a class="el" href="struct_sig_rl_entry.html#a0dfeb058614e81878bfbf86ae3edac3c">SigRlEntry</a>
+, <a class="el" href="struct_sig_rl_entry.html#a0dfeb058614e81878bfbf86ae3edac3c">SigRlEntry</a>
</li>
<li>K
: <a class="el" href="struct_verifier_rl.html#ac7d3dceab4772096bbbeb3fa735d18a9">VerifierRl</a>
</li>
+<li>key_handle
+: <a class="el" href="struct_tpm2_ctx.html#ad71eba97fbd7d36ac1dd51ffc67791ce">Tpm2Ctx</a>
+</li>
</ul>
@@ -340,18 +340,16 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
<li>r
: <a class="el" href="struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2">EpidCaCertificate</a>
</li>
-<li>R1
-: <a class="el" href="struct_nr_prove_commit_output.html#af9c605d560f83ccd69e35d8b9cfe51b3">NrProveCommitOutput</a>
-, <a class="el" href="struct_sign_commit_output.html#ad01513f153f51f7ce211cf323a224499">SignCommitOutput</a>
-</li>
-<li>R2
-: <a class="el" href="struct_nr_prove_commit_output.html#aab0f11e55d3b8d838e472242e27a1a43">NrProveCommitOutput</a>
-, <a class="el" href="struct_sign_commit_output.html#a0f35f1d619ea972acbdf9d45af630de0">SignCommitOutput</a>
-</li>
<li>rl_ver
: <a class="el" href="struct_epid11_signature.html#a43cb3ed13c862ff05a9292623ad57c5e">Epid11Signature</a>
, <a class="el" href="struct_epid_signature.html#a4155f3f4f1223fc4ae50c94f5305def1">EpidSignature</a>
</li>
+<li>rnd_func
+: <a class="el" href="struct_member_params.html#ad844c7a2be20bac70b118e7c08530c0b">MemberParams</a>
+</li>
+<li>rnd_param
+: <a class="el" href="struct_member_params.html#a7510f05e63328fa13cf2a3a3bd6acd95">MemberParams</a>
+</li>
</ul>
@@ -419,8 +417,6 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
</li>
<li>T
: <a class="el" href="struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3">NrProof</a>
-, <a class="el" href="struct_nr_prove_commit_output.html#a00234dfa2443d49f5a294c58fdacb064">NrProveCommitOutput</a>
-, <a class="el" href="struct_sign_commit_output.html#a9ce3b28916094f5fa108d5f5c86631b0">SignCommitOutput</a>
</li>
<li>T1
: <a class="el" href="struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b">Epid11BasicSignature</a>
@@ -428,6 +424,9 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
<li>T2
: <a class="el" href="struct_epid11_basic_signature.html#a267cf4e17d10584736b0c38f3668d822">Epid11BasicSignature</a>
</li>
+<li>tss
+: <a class="el" href="struct_tpm2_ctx.html#add1c4c767abfee8bf87068ac03c52db1">Tpm2Ctx</a>
+</li>
</ul>
diff --git a/doc/html/join_8h.html b/doc/html/getrandom_8c.html
index 0281f2d..cb9a5ef 100644
--- a/doc/html/join_8h.html
+++ b/doc/html/getrandom_8c.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm/join.h File Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/getrandom.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,39 +53,42 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('join_8h.html','');});
+$(document).ready(function(){initNavTree('getrandom_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">join.h File Reference</div> </div>
+<div class="title">getrandom.c File Reference</div> </div>
</div><!--header-->
<div class="contents">
-<p>TPM join APIs.
+<p>TPM2_GetRandom command implementation.
<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<div class="textblock"><code>#include &lt;limits.h&gt;</code><br />
+<code>#include &quot;epid/common/src/memory.h&quot;</code><br />
+<code>#include &quot;<a class="el" href="getrandom_8h.html">epid/member/tpm2/getrandom.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="printtss_8h.html">epid/member/tpm2/ibm_tss/printtss.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="state_8h.html">epid/member/tpm2/ibm_tss/state.h</a>&quot;</code><br />
+<code>#include &quot;tss2/TPM_Types.h&quot;</code><br />
+<code>#include &quot;tss2/tss.h&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
-<tr class="memitem:gae69218c9cba6a19d3ae1199c59772efc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc">TpmJoinCommit</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *F_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *R_str)</td></tr>
-<tr class="memdesc:gae69218c9cba6a19d3ae1199c59772efc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the first part of the join operation. <a href="group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc">More...</a><br /></td></tr>
-<tr class="separator:gae69218c9cba6a19d3ae1199c59772efc"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gab80c411f070858fbe019d93f5ac6a6ec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec">TpmJoin</a> (TpmCtx *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *c_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *s_str)</td></tr>
-<tr class="memdesc:gab80c411f070858fbe019d93f5ac6a6ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the last part of the join operation. <a href="group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec">More...</a><br /></td></tr>
-<tr class="separator:gab80c411f070858fbe019d93f5ac6a6ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">Tpm2GetRandom</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, int const num_bits, void *random_data)</td></tr>
+<tr class="memdesc:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get random data. <a href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">More...</a><br /></td></tr>
+<tr class="separator:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>TPM join APIs. </p>
+<div class="textblock"><p>TPM2_GetRandom command implementation. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li><li class="navelem"><a class="el" href="join_8h.html">join.h</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="getrandom_8c.html">getrandom.c</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/decompress_8h.html b/doc/html/getrandom_8h.html
index 9f5c1ca..780b90b 100644
--- a/doc/html/decompress_8h.html
+++ b/doc/html/getrandom_8h.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm/decompress.h File Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/getrandom.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,36 +53,36 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('decompress_8h.html','');});
+$(document).ready(function(){initNavTree('getrandom_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">decompress.h File Reference</div> </div>
+<div class="title">getrandom.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
-<p>TPM key decompression APIs.
+<p>SDK TPM API.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
-<tr class="memitem:gaeb9bfaa9288263af9feccd0d0543c9bc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc">TpmDecompressKey</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *h1_str, <a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *w_str, <a class="el" href="struct_fq_elem_str.html">FqElemStr</a> const *Ax_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *A_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *x_str)</td></tr>
-<tr class="memdesc:gaeb9bfaa9288263af9feccd0d0543c9bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompresses provisioned key. <a href="group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc">More...</a><br /></td></tr>
-<tr class="separator:gaeb9bfaa9288263af9feccd0d0543c9bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">Tpm2GetRandom</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, int const num_bits, void *random_data)</td></tr>
+<tr class="memdesc:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get random data. <a href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">More...</a><br /></td></tr>
+<tr class="separator:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>TPM key decompression APIs. </p>
+<div class="textblock"><p>SDK TPM API. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li><li class="navelem"><a class="el" href="decompress_8h.html">decompress.h</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="getrandom_8h.html">getrandom.h</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/globals.html b/doc/html/globals.html
index c24a588..c3c10a1 100644
--- a/doc/html/globals.html
+++ b/doc/html/globals.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_b.html b/doc/html/globals_b.html
index 14e995f..e6bf056 100644
--- a/doc/html/globals_b.html
+++ b/doc/html/globals_b.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -87,12 +87,26 @@ $(document).ready(function(){initNavTree('globals_b.html','');});
<li>BigNumSub()
: <a class="el" href="group___big_num_primitives.html#gacbec9669ab0fe768e2be74dcaca397ea">bignum.h</a>
</li>
+<li>BIT7
+: <a class="el" href="commit_8c.html#aa6b8f3261ae9e2e1043380c192f7b5f0">commit.c</a>
+, <a class="el" href="sign_8c.html#aa6b8f3261ae9e2e1043380c192f7b5f0">sign.c</a>
+</li>
+<li>BITS0500
+: <a class="el" href="commit_8c.html#a5c80fc0389d18e76cf9f43cfe13b63c7">commit.c</a>
+, <a class="el" href="sign_8c.html#a5c80fc0389d18e76cf9f43cfe13b63c7">sign.c</a>
+</li>
<li>BitSupplier
: <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">bitsupplier.h</a>
</li>
<li>bool
: <a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">stdtypes.h</a>
</li>
+<li>BREAK_ON_EPID_ERROR
+: <a class="el" href="load__external_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">load_external.c</a>
+, <a class="el" href="context_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">context.c</a>
+, <a class="el" href="sign_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">sign.c</a>
+, <a class="el" href="commit_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">commit.c</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/globals_c.html b/doc/html/globals_c.html
index a8ecc88..6823c50 100644
--- a/doc/html/globals_c.html
+++ b/doc/html/globals_c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_d.html b/doc/html/globals_d.html
index 820f0cc..a95b29f 100644
--- a/doc/html/globals_d.html
+++ b/doc/html/globals_d.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_defs.html b/doc/html/globals_defs.html
index 61272c2..4f38aa8 100644
--- a/doc/html/globals_defs.html
+++ b/doc/html/globals_defs.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,9 +61,35 @@ $(document).ready(function(){initNavTree('globals_defs.html','');});
<li>_Bool
: <a class="el" href="stdtypes_8h.html#aeaff0db5524987a2f50d71ac0162ceb2">stdtypes.h</a>
</li>
+<li>BIT7
+: <a class="el" href="commit_8c.html#aa6b8f3261ae9e2e1043380c192f7b5f0">commit.c</a>
+, <a class="el" href="sign_8c.html#aa6b8f3261ae9e2e1043380c192f7b5f0">sign.c</a>
+</li>
+<li>BITS0500
+: <a class="el" href="commit_8c.html#a5c80fc0389d18e76cf9f43cfe13b63c7">commit.c</a>
+, <a class="el" href="sign_8c.html#a5c80fc0389d18e76cf9f43cfe13b63c7">sign.c</a>
+</li>
+<li>BREAK_ON_EPID_ERROR
+: <a class="el" href="commit_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">commit.c</a>
+, <a class="el" href="sign_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">sign.c</a>
+, <a class="el" href="context_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">context.c</a>
+, <a class="el" href="load__external_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">load_external.c</a>
+</li>
<li>false
: <a class="el" href="stdtypes_8h.html#a65e9886d74aaee76545e83dd09011727">stdtypes.h</a>
</li>
+<li>TPM_ALG_NULL
+: <a class="el" href="conversion_8h.html#a3622ddd0080bf63059d26887b6ee90ac">conversion.h</a>
+</li>
+<li>TPM_ALG_SHA256
+: <a class="el" href="conversion_8h.html#ae9c66465b8109d648704268fee8cf66b">conversion.h</a>
+</li>
+<li>TPM_ALG_SHA384
+: <a class="el" href="conversion_8h.html#a85ee45736d112c61495faad4fea3dbbc">conversion.h</a>
+</li>
+<li>TPM_ALG_SHA512
+: <a class="el" href="conversion_8h.html#a8aecd28504c6511c02da2e78ecaaf5bd">conversion.h</a>
+</li>
<li>true
: <a class="el" href="stdtypes_8h.html#a41f9c5fb8b08eb5dc3edce4dcb37fee7">stdtypes.h</a>
</li>
diff --git a/doc/html/globals_e.html b/doc/html/globals_e.html
index 25ed4b1..f877740 100644
--- a/doc/html/globals_e.html
+++ b/doc/html/globals_e.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -76,7 +76,7 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
: <a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">ecgroup.h</a>
</li>
<li>EcHash()
-: <a class="el" href="group___ec_group_primitives.html#gab647ccc031063807ff3860f51d0f6919">ecgroup.h</a>
+: <a class="el" href="group___ec_group_primitives.html#gac3067cc899e65e647390bb3bd1cabe4c">ecgroup.h</a>
</li>
<li>EcInGroup()
: <a class="el" href="group___ec_group_primitives.html#ga48ec5ae951c9f49d8d7d983234eea921">ecgroup.h</a>
@@ -186,15 +186,15 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
<li>EpidAreSigsLinked()
: <a class="el" href="group___epid_verifier_module.html#gae44bd8acbc1e7205aeedff0c7e2632a8">api.h</a>
</li>
-<li>EpidAssemblePrivKey()
-: <a class="el" href="group___epid_member_module.html#ga4ccaa8337931523c77567f5b846ef188">api.h</a>
-</li>
<li>EpidBlacklistSig()
: <a class="el" href="group___epid_verifier_module.html#ga8eaeb9f4a34e9e37ccdf342919f38c69">api.h</a>
</li>
<li>EpidCheckPrivRlEntry()
: <a class="el" href="group___epid_verifier_module.html#gaeb05e6faea6f09c0665b13adc6e7ddea">api.h</a>
</li>
+<li>EpidCreateJoinRequest()
+: <a class="el" href="group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3">api.h</a>
+</li>
<li>EpidDecompressPrivKey()
: <a class="el" href="group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef">api.h</a>
</li>
@@ -211,7 +211,7 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
: <a class="el" href="group___epid_verifier_module.html#ga2a75c7d5775e852a7b6e24178dd4054f">api.h</a>
</li>
<li>EpidMemberCreate()
-: <a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb">api.h</a>
+: <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7">api.h</a>
</li>
<li>EpidMemberDelete()
: <a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">api.h</a>
@@ -222,11 +222,8 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
<li>EpidMemberSetSigRl()
: <a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">api.h</a>
</li>
-<li>EpidMemberWritePrecomp()
-: <a class="el" href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721">api.h</a>
-</li>
-<li>EpidNrProve()
-: <a class="el" href="group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc">api.h</a>
+<li>EpidMemberStartup()
+: <a class="el" href="group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6">api.h</a>
</li>
<li>EpidNrVerify()
: <a class="el" href="group___epid_verifier_module.html#gac6e2fab59e3af8a33a74a5b201642700">api.h</a>
@@ -246,24 +243,31 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
<li>EpidParseSigRlFile()
: <a class="el" href="group___file_parser.html#ga237ef5a43076aa6fc6eb18829a93da3f">file_parser.h</a>
</li>
+<li>EpidProvisionCompressed()
+: <a class="el" href="group___epid_member_module.html#ga76cddb8e20afc43de2c30d5e4addb2ea">api.h</a>
+</li>
+<li>EpidProvisionCredential()
+: <a class="el" href="group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140">api.h</a>
+</li>
+<li>EpidProvisionKey()
+: <a class="el" href="group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302">api.h</a>
+</li>
<li>EpidRegisterBaseName()
: <a class="el" href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d">api.h</a>
</li>
-<li>EpidRequestJoin()
-: <a class="el" href="group___epid_member_module.html#ga13dd0d72be9babf8194d472d7712a361">api.h</a>
-</li>
<li>EpidSign()
: <a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">api.h</a>
</li>
-<li>EpidSignBasic()
-: <a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa">api.h</a>
-</li>
<li>EpidStatus
: <a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">errors.h</a>
</li>
<li>EpidStatusToString()
: <a class="el" href="group___error_codes.html#ga59e8680ce52509302fd58a987e45004d">errors.h</a>
</li>
+<li>EpidtoTpm2HashAlg()
+: <a class="el" href="conversion_8h.html#ad08628a6bf33154c1029a32e8b83325f">conversion.h</a>
+, <a class="el" href="conversion_8c.html#ad08628a6bf33154c1029a32e8b83325f">conversion.c</a>
+</li>
<li>EpidVerifierCreate()
: <a class="el" href="group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70">api.h</a>
</li>
diff --git a/doc/html/globals_enum.html b/doc/html/globals_enum.html
index 64619c7..6771fec 100644
--- a/doc/html/globals_enum.html
+++ b/doc/html/globals_enum.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_eval.html b/doc/html/globals_eval.html
index d838e67..0923fa4 100644
--- a/doc/html/globals_eval.html
+++ b/doc/html/globals_eval.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_f.html b/doc/html/globals_f.html
index 74ccfe8..01cb71b 100644
--- a/doc/html/globals_f.html
+++ b/doc/html/globals_f.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_func.html b/doc/html/globals_func.html
index 1236d09..33a6d04 100644
--- a/doc/html/globals_func.html
+++ b/doc/html/globals_func.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -126,7 +126,7 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
: <a class="el" href="group___ec_group_primitives.html#ga3f96c43d14d24de0f7a5e214aef64196">ecgroup.h</a>
</li>
<li>EcHash()
-: <a class="el" href="group___ec_group_primitives.html#gab647ccc031063807ff3860f51d0f6919">ecgroup.h</a>
+: <a class="el" href="group___ec_group_primitives.html#gac3067cc899e65e647390bb3bd1cabe4c">ecgroup.h</a>
</li>
<li>EcInGroup()
: <a class="el" href="group___ec_group_primitives.html#ga48ec5ae951c9f49d8d7d983234eea921">ecgroup.h</a>
@@ -218,15 +218,15 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
<li>EpidAreSigsLinked()
: <a class="el" href="group___epid_verifier_module.html#gae44bd8acbc1e7205aeedff0c7e2632a8">api.h</a>
</li>
-<li>EpidAssemblePrivKey()
-: <a class="el" href="group___epid_member_module.html#ga4ccaa8337931523c77567f5b846ef188">api.h</a>
-</li>
<li>EpidBlacklistSig()
: <a class="el" href="group___epid_verifier_module.html#ga8eaeb9f4a34e9e37ccdf342919f38c69">api.h</a>
</li>
<li>EpidCheckPrivRlEntry()
: <a class="el" href="group___epid_verifier_module.html#gaeb05e6faea6f09c0665b13adc6e7ddea">api.h</a>
</li>
+<li>EpidCreateJoinRequest()
+: <a class="el" href="group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3">api.h</a>
+</li>
<li>EpidDecompressPrivKey()
: <a class="el" href="group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef">api.h</a>
</li>
@@ -240,7 +240,7 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
: <a class="el" href="group___epid_verifier_module.html#ga2a75c7d5775e852a7b6e24178dd4054f">api.h</a>
</li>
<li>EpidMemberCreate()
-: <a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb">api.h</a>
+: <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7">api.h</a>
</li>
<li>EpidMemberDelete()
: <a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">api.h</a>
@@ -251,11 +251,8 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
<li>EpidMemberSetSigRl()
: <a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">api.h</a>
</li>
-<li>EpidMemberWritePrecomp()
-: <a class="el" href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721">api.h</a>
-</li>
-<li>EpidNrProve()
-: <a class="el" href="group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc">api.h</a>
+<li>EpidMemberStartup()
+: <a class="el" href="group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6">api.h</a>
</li>
<li>EpidNrVerify()
: <a class="el" href="group___epid_verifier_module.html#gac6e2fab59e3af8a33a74a5b201642700">api.h</a>
@@ -275,21 +272,28 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
<li>EpidParseSigRlFile()
: <a class="el" href="group___file_parser.html#ga237ef5a43076aa6fc6eb18829a93da3f">file_parser.h</a>
</li>
+<li>EpidProvisionCompressed()
+: <a class="el" href="group___epid_member_module.html#ga76cddb8e20afc43de2c30d5e4addb2ea">api.h</a>
+</li>
+<li>EpidProvisionCredential()
+: <a class="el" href="group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140">api.h</a>
+</li>
+<li>EpidProvisionKey()
+: <a class="el" href="group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302">api.h</a>
+</li>
<li>EpidRegisterBaseName()
: <a class="el" href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d">api.h</a>
</li>
-<li>EpidRequestJoin()
-: <a class="el" href="group___epid_member_module.html#ga13dd0d72be9babf8194d472d7712a361">api.h</a>
-</li>
<li>EpidSign()
: <a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">api.h</a>
</li>
-<li>EpidSignBasic()
-: <a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa">api.h</a>
-</li>
<li>EpidStatusToString()
: <a class="el" href="group___error_codes.html#ga59e8680ce52509302fd58a987e45004d">errors.h</a>
</li>
+<li>EpidtoTpm2HashAlg()
+: <a class="el" href="conversion_8h.html#ad08628a6bf33154c1029a32e8b83325f">conversion.h</a>
+, <a class="el" href="conversion_8c.html#ad08628a6bf33154c1029a32e8b83325f">conversion.c</a>
+</li>
<li>EpidVerifierCreate()
: <a class="el" href="group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70">api.h</a>
</li>
@@ -417,6 +421,10 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
<li>Pairing()
: <a class="el" href="group___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d">pairing.h</a>
</li>
+<li>print_tpm2_response_code()
+: <a class="el" href="printtss_8c.html#ac02d185169caec44119e82d97228a68a">printtss.c</a>
+, <a class="el" href="printtss_8h.html#ac02d185169caec44119e82d97228a68a">printtss.h</a>
+</li>
<li>PrintBigNum()
: <a class="el" href="group___epid_print.html#ga45a933b44fc1dfe926e3af89c198070a">printutils.h</a>
</li>
@@ -466,6 +474,14 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
<li>ReadFfElement()
: <a class="el" href="group___finite_field_primitives.html#ga8a143a5a815a62f4947be2de1653c50f">finitefield.h</a>
</li>
+<li>ReadTpm2EcPoint()
+: <a class="el" href="conversion_8h.html#acff82e14f6287ec2d4676a3f8cd38a57">conversion.h</a>
+, <a class="el" href="conversion_8c.html#acff82e14f6287ec2d4676a3f8cd38a57">conversion.c</a>
+</li>
+<li>ReadTpm2FfElement()
+: <a class="el" href="conversion_8c.html#a8243faa9ef46d90b936c7dace421e10e">conversion.c</a>
+, <a class="el" href="conversion_8h.html#a8243faa9ef46d90b936c7dace421e10e">conversion.h</a>
+</li>
</ul>
@@ -477,50 +493,68 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
-<li>TpmAddPreSigs()
-: <a class="el" href="group___tpm_module.html#ga2335ec4eb78b542cf87df9b0cd15358c">presig.h</a>
+<li>Tpm2Commit()
+: <a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">commit.h</a>
+, <a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">commit.c</a>
</li>
-<li>TpmCreate()
-: <a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287">context.h</a>
+<li>Tpm2CreateContext()
+: <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">context.c</a>
+, <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">context.h</a>
</li>
-<li>TpmDecompressKey()
-: <a class="el" href="group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc">decompress.h</a>
+<li>Tpm2CreatePrimary()
+: <a class="el" href="createprimary_8h.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.h</a>
+, <a class="el" href="createprimary_8c.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.c</a>
</li>
-<li>TpmDelete()
-: <a class="el" href="group___tpm_module.html#ga95bc18225c1d87803be7965978e37449">context.h</a>
+<li>Tpm2DeleteContext()
+: <a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">context.c</a>
+, <a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">context.h</a>
</li>
-<li>TpmGetNumPreSigs()
-: <a class="el" href="group___tpm_module.html#gaa53a6bd52e22808bac21596a964bdece">presig.h</a>
+<li>Tpm2FlushKey()
+: <a class="el" href="context_8c.html#a7f547c0068dc63f0a6b76ad15b1b9675">context.c</a>
</li>
-<li>TpmInit()
-: <a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615">init.h</a>
+<li>Tpm2GetRandom()
+: <a class="el" href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">getrandom.h</a>
+, <a class="el" href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">getrandom.c</a>
</li>
-<li>TpmIsKeyValid()
-: <a class="el" href="group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f">validatekey.h</a>
+<li>Tpm2LoadExternal()
+: <a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">load_external.c</a>
+, <a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">load_external.h</a>
</li>
-<li>TpmJoin()
-: <a class="el" href="group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec">join.h</a>
+<li>Tpm2NvDefineSpace()
+: <a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">nv.c</a>
+, <a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">nv.h</a>
</li>
-<li>TpmJoinCommit()
-: <a class="el" href="group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc">join.h</a>
+<li>Tpm2NvRead()
+: <a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">nv.c</a>
+, <a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">nv.h</a>
</li>
-<li>TpmNrProve()
-: <a class="el" href="group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2">nrprove.h</a>
+<li>Tpm2NvUndefineSpace()
+: <a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">nv.c</a>
+, <a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">nv.h</a>
</li>
-<li>TpmNrProveCommit()
-: <a class="el" href="group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0">nrprove.h</a>
+<li>Tpm2NvWrite()
+: <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">nv.c</a>
+, <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">nv.h</a>
</li>
-<li>TpmProvision()
-: <a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d">context.h</a>
+<li>Tpm2ReleaseCounter()
+: <a class="el" href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">sign.c</a>
+, <a class="el" href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">sign.h</a>
</li>
-<li>TpmProvisionCompressed()
-: <a class="el" href="group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50">context.h</a>
+<li>Tpm2ResetContext()
+: <a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">context.c</a>
+, <a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">context.h</a>
</li>
-<li>TpmSign()
-: <a class="el" href="group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f">sign.h</a>
+<li>Tpm2SetHashAlg()
+: <a class="el" href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">context.h</a>
+, <a class="el" href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">context.c</a>
</li>
-<li>TpmSignCommit()
-: <a class="el" href="group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd">sign.h</a>
+<li>Tpm2Sign()
+: <a class="el" href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">sign.c</a>
+, <a class="el" href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">sign.h</a>
+</li>
+<li>Tpm2toEpidHashAlg()
+: <a class="el" href="conversion_8c.html#a51507a6be8d7dfa167c9e6fb70e5ee57">conversion.c</a>
+, <a class="el" href="conversion_8h.html#a51507a6be8d7dfa167c9e6fb70e5ee57">conversion.h</a>
</li>
</ul>
@@ -535,6 +569,14 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
<li>WriteFfElement()
: <a class="el" href="group___finite_field_primitives.html#gaa3c1f7515dd823ddad8764091ebc665f">finitefield.h</a>
</li>
+<li>WriteTpm2EcPoint()
+: <a class="el" href="conversion_8h.html#a15e859e04c4b9c32a0970565846bdba3">conversion.h</a>
+, <a class="el" href="conversion_8c.html#a15e859e04c4b9c32a0970565846bdba3">conversion.c</a>
+</li>
+<li>WriteTpm2FfElement()
+: <a class="el" href="conversion_8c.html#a9f6a2b44857c038a2f90c12959640dea">conversion.c</a>
+, <a class="el" href="conversion_8h.html#a9f6a2b44857c038a2f90c12959640dea">conversion.h</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/globals_g.html b/doc/html/globals_g.html
index acabe7c..975621a 100644
--- a/doc/html/globals_g.html
+++ b/doc/html/globals_g.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_h.html b/doc/html/globals_h.html
index 5e4ebc2..2eea091 100644
--- a/doc/html/globals_h.html
+++ b/doc/html/globals_h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_i.html b/doc/html/globals_i.html
index 9168758..ea9c427 100644
--- a/doc/html/globals_i.html
+++ b/doc/html/globals_i.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -63,6 +63,9 @@ $(document).ready(function(){initNavTree('globals_i.html','');});
<li>InitFfElementFromBn()
: <a class="el" href="group___finite_field_primitives.html#ga90b2c192708973b54b7a3e82b34536ed">finitefield.h</a>
</li>
+<li>is_context_already_created
+: <a class="el" href="context_8c.html#a8e9ae8d68d53b7549da3823bc65a336e">context.c</a>
+</li>
<li>IssuerNonce
: <a class="el" href="group___epid_types.html#ga55eb2193045bde31af3f551565126042">types.h</a>
</li>
diff --git a/doc/html/globals_k.html b/doc/html/globals_k.html
index 56eef29..f2d0274 100644
--- a/doc/html/globals_k.html
+++ b/doc/html/globals_k.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_m.html b/doc/html/globals_m.html
index 1176e0e..124ce6f 100644
--- a/doc/html/globals_m.html
+++ b/doc/html/globals_m.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('globals_m.html','');});
<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
<li>MemberCtx
-: <a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">api.h</a>
+: <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">api.h</a>
</li>
</ul>
</div><!-- contents -->
diff --git a/doc/html/globals_n.html b/doc/html/globals_n.html
index 2985516..e4a55e0 100644
--- a/doc/html/globals_n.html
+++ b/doc/html/globals_n.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_o.html b/doc/html/globals_o.html
index bbb1e5b..08301f5 100644
--- a/doc/html/globals_o.html
+++ b/doc/html/globals_o.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_p.html b/doc/html/globals_p.html
index 454ff90..b3942ca 100644
--- a/doc/html/globals_p.html
+++ b/doc/html/globals_p.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -66,6 +66,10 @@ $(document).ready(function(){initNavTree('globals_p.html','');});
<li>PairingState
: <a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">pairing.h</a>
</li>
+<li>print_tpm2_response_code()
+: <a class="el" href="printtss_8h.html#ac02d185169caec44119e82d97228a68a">printtss.h</a>
+, <a class="el" href="printtss_8c.html#ac02d185169caec44119e82d97228a68a">printtss.c</a>
+</li>
<li>PrintBigNum()
: <a class="el" href="group___epid_print.html#ga45a933b44fc1dfe926e3af89c198070a">printutils.h</a>
</li>
diff --git a/doc/html/globals_r.html b/doc/html/globals_r.html
index 9cdf1b8..e208810 100644
--- a/doc/html/globals_r.html
+++ b/doc/html/globals_r.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -69,6 +69,14 @@ $(document).ready(function(){initNavTree('globals_r.html','');});
<li>ReadFfElement()
: <a class="el" href="group___finite_field_primitives.html#ga8a143a5a815a62f4947be2de1653c50f">finitefield.h</a>
</li>
+<li>ReadTpm2EcPoint()
+: <a class="el" href="conversion_8c.html#acff82e14f6287ec2d4676a3f8cd38a57">conversion.c</a>
+, <a class="el" href="conversion_8h.html#acff82e14f6287ec2d4676a3f8cd38a57">conversion.h</a>
+</li>
+<li>ReadTpm2FfElement()
+: <a class="el" href="conversion_8c.html#a8243faa9ef46d90b936c7dace421e10e">conversion.c</a>
+, <a class="el" href="conversion_8h.html#a8243faa9ef46d90b936c7dace421e10e">conversion.h</a>
+</li>
<li>ReKeySeed
: <a class="el" href="group___epid_types.html#ga54bd22670f2e348593db7ab631131d10">types.h</a>
</li>
diff --git a/doc/html/globals_s.html b/doc/html/globals_s.html
index df4e600..4935fc1 100644
--- a/doc/html/globals_s.html
+++ b/doc/html/globals_s.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_t.html b/doc/html/globals_t.html
index 777151a..5c6e9b1 100644
--- a/doc/html/globals_t.html
+++ b/doc/html/globals_t.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,50 +60,80 @@ $(document).ready(function(){initNavTree('globals_t.html','');});
<div class="textblock">Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:</div>
<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
-<li>TpmAddPreSigs()
-: <a class="el" href="group___tpm_module.html#ga2335ec4eb78b542cf87df9b0cd15358c">presig.h</a>
+<li>Tpm2Commit()
+: <a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">commit.h</a>
+, <a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">commit.c</a>
</li>
-<li>TpmCreate()
-: <a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287">context.h</a>
+<li>Tpm2CreateContext()
+: <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">context.c</a>
+, <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">context.h</a>
</li>
-<li>TpmDecompressKey()
-: <a class="el" href="group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc">decompress.h</a>
+<li>Tpm2CreatePrimary()
+: <a class="el" href="createprimary_8h.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.h</a>
+, <a class="el" href="createprimary_8c.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.c</a>
</li>
-<li>TpmDelete()
-: <a class="el" href="group___tpm_module.html#ga95bc18225c1d87803be7965978e37449">context.h</a>
+<li>Tpm2DeleteContext()
+: <a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">context.c</a>
+, <a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">context.h</a>
</li>
-<li>TpmGetNumPreSigs()
-: <a class="el" href="group___tpm_module.html#gaa53a6bd52e22808bac21596a964bdece">presig.h</a>
+<li>Tpm2FlushKey()
+: <a class="el" href="context_8c.html#a7f547c0068dc63f0a6b76ad15b1b9675">context.c</a>
</li>
-<li>TpmInit()
-: <a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615">init.h</a>
+<li>Tpm2GetRandom()
+: <a class="el" href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">getrandom.h</a>
+, <a class="el" href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">getrandom.c</a>
</li>
-<li>TpmIsKeyValid()
-: <a class="el" href="group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f">validatekey.h</a>
+<li>Tpm2LoadExternal()
+: <a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">load_external.c</a>
+, <a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">load_external.h</a>
</li>
-<li>TpmJoin()
-: <a class="el" href="group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec">join.h</a>
+<li>Tpm2NvDefineSpace()
+: <a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">nv.c</a>
+, <a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">nv.h</a>
</li>
-<li>TpmJoinCommit()
-: <a class="el" href="group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc">join.h</a>
+<li>Tpm2NvRead()
+: <a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">nv.c</a>
+, <a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">nv.h</a>
</li>
-<li>TpmNrProve()
-: <a class="el" href="group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2">nrprove.h</a>
+<li>Tpm2NvUndefineSpace()
+: <a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">nv.c</a>
+, <a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">nv.h</a>
</li>
-<li>TpmNrProveCommit()
-: <a class="el" href="group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0">nrprove.h</a>
+<li>Tpm2NvWrite()
+: <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">nv.c</a>
+, <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">nv.h</a>
</li>
-<li>TpmProvision()
-: <a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d">context.h</a>
+<li>Tpm2ReleaseCounter()
+: <a class="el" href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">sign.c</a>
+, <a class="el" href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">sign.h</a>
</li>
-<li>TpmProvisionCompressed()
-: <a class="el" href="group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50">context.h</a>
+<li>Tpm2ResetContext()
+: <a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">context.h</a>
+, <a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">context.c</a>
</li>
-<li>TpmSign()
-: <a class="el" href="group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f">sign.h</a>
+<li>Tpm2SetHashAlg()
+: <a class="el" href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">context.c</a>
+, <a class="el" href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">context.h</a>
</li>
-<li>TpmSignCommit()
-: <a class="el" href="group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd">sign.h</a>
+<li>Tpm2Sign()
+: <a class="el" href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">sign.h</a>
+, <a class="el" href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">sign.c</a>
+</li>
+<li>Tpm2toEpidHashAlg()
+: <a class="el" href="conversion_8h.html#a51507a6be8d7dfa167c9e6fb70e5ee57">conversion.h</a>
+, <a class="el" href="conversion_8c.html#a51507a6be8d7dfa167c9e6fb70e5ee57">conversion.c</a>
+</li>
+<li>TPM_ALG_NULL
+: <a class="el" href="conversion_8h.html#a3622ddd0080bf63059d26887b6ee90ac">conversion.h</a>
+</li>
+<li>TPM_ALG_SHA256
+: <a class="el" href="conversion_8h.html#ae9c66465b8109d648704268fee8cf66b">conversion.h</a>
+</li>
+<li>TPM_ALG_SHA384
+: <a class="el" href="conversion_8h.html#a85ee45736d112c61495faad4fea3dbbc">conversion.h</a>
+</li>
+<li>TPM_ALG_SHA512
+: <a class="el" href="conversion_8h.html#a8aecd28504c6511c02da2e78ecaaf5bd">conversion.h</a>
</li>
<li>true
: <a class="el" href="stdtypes_8h.html#a41f9c5fb8b08eb5dc3edce4dcb37fee7">stdtypes.h</a>
diff --git a/doc/html/globals_type.html b/doc/html/globals_type.html
index 7abeba3..4acfc92 100644
--- a/doc/html/globals_type.html
+++ b/doc/html/globals_type.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -104,7 +104,7 @@ $(document).ready(function(){initNavTree('globals_type.html','');});
: <a class="el" href="group___epid_types.html#ga55eb2193045bde31af3f551565126042">types.h</a>
</li>
<li>MemberCtx
-: <a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">api.h</a>
+: <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">api.h</a>
</li>
<li>OctStr
: <a class="el" href="group___epid_types.html#ga3315fb24f4c5783b6d6eb107933390b0">types.h</a>
diff --git a/doc/html/globals_v.html b/doc/html/globals_v.html
index 0b44c14..03b7653 100644
--- a/doc/html/globals_v.html
+++ b/doc/html/globals_v.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_vars.html b/doc/html/globals_vars.html
index e6fcc1d..83631f1 100644
--- a/doc/html/globals_vars.html
+++ b/doc/html/globals_vars.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -58,6 +58,9 @@ $(document).ready(function(){initNavTree('globals_vars.html','');});
<div id="doc-content">
<div class="contents">
&#160;<ul>
+<li>is_context_already_created
+: <a class="el" href="context_8c.html#a8e9ae8d68d53b7549da3823bc65a336e">context.c</a>
+</li>
<li>kEpidFileTypeCode
: <a class="el" href="group___file_parser.html#ga3770c39a0546c79447c9d4159d794c33">file_parser.h</a>
</li>
diff --git a/doc/html/globals_w.html b/doc/html/globals_w.html
index 009cdb6..d5d4ca4 100644
--- a/doc/html/globals_w.html
+++ b/doc/html/globals_w.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -69,6 +69,14 @@ $(document).ready(function(){initNavTree('globals_w.html','');});
<li>WriteFfElement()
: <a class="el" href="group___finite_field_primitives.html#gaa3c1f7515dd823ddad8764091ebc665f">finitefield.h</a>
</li>
+<li>WriteTpm2EcPoint()
+: <a class="el" href="conversion_8h.html#a15e859e04c4b9c32a0970565846bdba3">conversion.h</a>
+, <a class="el" href="conversion_8c.html#a15e859e04c4b9c32a0970565846bdba3">conversion.c</a>
+</li>
+<li>WriteTpm2FfElement()
+: <a class="el" href="conversion_8c.html#a9f6a2b44857c038a2f90c12959640dea">conversion.c</a>
+, <a class="el" href="conversion_8h.html#a9f6a2b44857c038a2f90c12959640dea">conversion.h</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/glossary_8dox.html b/doc/html/glossary_8dox.html
index 8f3c01d..92138cf 100644
--- a/doc/html/glossary_8dox.html
+++ b/doc/html/glossary_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___big_num_primitives.html b/doc/html/group___big_num_primitives.html
index 5a88775..cd1d238 100644
--- a/doc/html/group___big_num_primitives.html
+++ b/doc/html/group___big_num_primitives.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('group___big_num_primitives.html','');}
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">bignum<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
+<div class="title">bignum<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/group___ec_group_primitives.html b/doc/html/group___ec_group_primitives.html
index 5501a99..be0febe 100644
--- a/doc/html/group___ec_group_primitives.html
+++ b/doc/html/group___ec_group_primitives.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('group___ec_group_primitives.html','');
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">ecgroup<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
+<div class="title">ecgroup<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -126,9 +126,9 @@ Functions</h2></td></tr>
<tr class="memitem:gaad96a1498b85d28f71514b8f7b154d82"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ec_group_primitives.html#gaad96a1498b85d28f71514b8f7b154d82">Epid11EcHash</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> *g, <a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> msg, size_t msg_len, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *r)</td></tr>
<tr class="memdesc:gaad96a1498b85d28f71514b8f7b154d82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes an arbitrary message to an Intel(R) EPID 1.1 element in an elliptic curve group. <a href="#gaad96a1498b85d28f71514b8f7b154d82">More...</a><br /></td></tr>
<tr class="separator:gaad96a1498b85d28f71514b8f7b154d82"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gab647ccc031063807ff3860f51d0f6919"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ec_group_primitives.html#gab647ccc031063807ff3860f51d0f6919">EcHash</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> *g, <a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> msg, size_t msg_len, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *r)</td></tr>
-<tr class="memdesc:gab647ccc031063807ff3860f51d0f6919"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes an arbitrary message to an element in an elliptic curve group. <a href="#gab647ccc031063807ff3860f51d0f6919">More...</a><br /></td></tr>
-<tr class="separator:gab647ccc031063807ff3860f51d0f6919"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac3067cc899e65e647390bb3bd1cabe4c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ec_group_primitives.html#gac3067cc899e65e647390bb3bd1cabe4c">EcHash</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> *g, <a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> msg, size_t msg_len, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *r, uint32_t *iterations)</td></tr>
+<tr class="memdesc:gac3067cc899e65e647390bb3bd1cabe4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes an arbitrary message to an element in an elliptic curve group. <a href="#gac3067cc899e65e647390bb3bd1cabe4c">More...</a><br /></td></tr>
+<tr class="separator:gac3067cc899e65e647390bb3bd1cabe4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a6114a48214a327d4ec04fd25e5940e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ec_group_primitives.html#ga8a6114a48214a327d4ec04fd25e5940e">EcMakePoint</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> *g, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const *x, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *r)</td></tr>
<tr class="memdesc:ga8a6114a48214a327d4ec04fd25e5940e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets an EcPoint variable to a point on a curve. <a href="#ga8a6114a48214a327d4ec04fd25e5940e">More...</a><br /></td></tr>
<tr class="separator:ga8a6114a48214a327d4ec04fd25e5940e"><td class="memSeparator" colspan="2">&#160;</td></tr>
@@ -306,7 +306,7 @@ Functions</h2></td></tr>
</div>
</div>
-<a class="anchor" id="gab647ccc031063807ff3860f51d0f6919"></a>
+<a class="anchor" id="gac3067cc899e65e647390bb3bd1cabe4c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
@@ -338,7 +338,13 @@ Functions</h2></td></tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *&#160;</td>
- <td class="paramname"><em>r</em>&#160;</td>
+ <td class="paramname"><em>r</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t *&#160;</td>
+ <td class="paramname"><em>iterations</em>&#160;</td>
</tr>
<tr>
<td></td>
@@ -355,7 +361,8 @@ Functions</h2></td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>The message. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">msg_len</td><td>The size of msg in bytes. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>The hash algorithm. </td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>The hashed value.</td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>The hashed value. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">iterations</td><td>The number of hash iterations needed to find a valid hash. Can be NULL.</td></tr>
</table>
</dd>
</dl>
diff --git a/doc/html/group___ec_group_primitives.js b/doc/html/group___ec_group_primitives.js
index c57ea10..48bf3ad 100644
--- a/doc/html/group___ec_group_primitives.js
+++ b/doc/html/group___ec_group_primitives.js
@@ -6,7 +6,7 @@ var group___ec_group_primitives =
[ "DeleteEcPoint", "group___ec_group_primitives.html#ga8cb086d792bffb79b3ca07e6ca4ce0e7", null ],
[ "EcExp", "group___ec_group_primitives.html#ga01bf8d6fa60a2e445490966b3a06c270", null ],
[ "EcGetRandom", "group___ec_group_primitives.html#ga3f96c43d14d24de0f7a5e214aef64196", null ],
- [ "EcHash", "group___ec_group_primitives.html#gab647ccc031063807ff3860f51d0f6919", null ],
+ [ "EcHash", "group___ec_group_primitives.html#gac3067cc899e65e647390bb3bd1cabe4c", null ],
[ "EcInGroup", "group___ec_group_primitives.html#ga48ec5ae951c9f49d8d7d983234eea921", null ],
[ "EcInverse", "group___ec_group_primitives.html#ga0b6d7a3398251e9352fb29ef4abef466", null ],
[ "EcIsEqual", "group___ec_group_primitives.html#gad3b3c63c48fa24e8dea07837b05bc061", null ],
diff --git a/doc/html/group___ecdsa_primitives.html b/doc/html/group___ecdsa_primitives.html
index 41626d2..7c5b725 100644
--- a/doc/html/group___ecdsa_primitives.html
+++ b/doc/html/group___ecdsa_primitives.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('group___ecdsa_primitives.html','');});
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">ecdsa<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
+<div class="title">ecdsa<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/group___epid11_file_parser_module.html b/doc/html/group___epid11_file_parser_module.html
index 9db82aa..8606656 100644
--- a/doc/html/group___epid11_file_parser_module.html
+++ b/doc/html/group___epid11_file_parser_module.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: EPID 1.1 support</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: Intel(R) EPID 1.1 support</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('group___epid11_file_parser_module.html
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">EPID 1.1 support<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___file_parser.html">fileparser</a></div></div> </div>
+<div class="title">Intel(R) EPID 1.1 support<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___file_parser.html">fileparser</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -85,7 +85,7 @@ Functions</h2></td></tr>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Parser for 1.1 issuer material. </p>
<p>Defines the APIs needed to parse Intel(R) EPID 1.1 issuer material.</p>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga1f92d1cb6bd7d9815711fde515b40a4c"></a>
<div class="memitem">
@@ -142,7 +142,7 @@ Functions</h2></td></tr>
</table>
</dd>
</dl>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -209,7 +209,7 @@ Functions</h2></td></tr>
</table>
</dd>
</dl>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -276,7 +276,7 @@ Functions</h2></td></tr>
</table>
</dd>
</dl>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -343,7 +343,7 @@ Functions</h2></td></tr>
</table>
</dd>
</dl>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
diff --git a/doc/html/group___epid11_pairing_primitives.html b/doc/html/group___epid11_pairing_primitives.html
index 2cbe069..b90eee8 100644
--- a/doc/html/group___epid11_pairing_primitives.html
+++ b/doc/html/group___epid11_pairing_primitives.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: EPID 1.1 specific pairing</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: Intel(R) EPID 1.1 specific pairing</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,11 +61,11 @@ $(document).ready(function(){initNavTree('group___epid11_pairing_primitives.html
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">EPID 1.1 specific pairing<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a> &raquo; <a class="el" href="group___pairing_primitives.html">pairing</a></div></div> </div>
+<div class="title">Intel(R) EPID 1.1 specific pairing<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a> &raquo; <a class="el" href="group___pairing_primitives.html">pairing</a></div></div> </div>
</div><!--header-->
<div class="contents">
-<p>EPID 1.1 pairing operations.
+<p>Intel(R) EPID 1.1 pairing operations.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
@@ -88,10 +88,10 @@ Functions</h2></td></tr>
<tr class="separator:gaa4076dfe25e8e61ac6753333a322c059"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<p>EPID 1.1 pairing operations. </p>
+<p>Intel(R) EPID 1.1 pairing operations. </p>
<p>Provides APIs for defining and using a pairing relationship between two Elliptic curve groups.</p>
<p>These pairing operations are intended to support Intel(R) EPID 1.1 verification.</p>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaa3457d6f85889bc714910252fd21c758"></a>
<div class="memitem">
@@ -118,7 +118,7 @@ Functions</h2></td></tr>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid11_pairing_primitives.html#ga0ee658e26e9f933ba2ffbf2504dfae7e" title="Constructs a new Tate pairing state. ">NewEpid11PairingState</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -170,7 +170,7 @@ Functions</h2></td></tr>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -227,7 +227,7 @@ Functions</h2></td></tr>
<dl class="section attention"><dt>Attention</dt><dd>It is the responsibility of the caller to ensure that ga, gb, and ff exist for the entire lifetime of the new Epid11PairingState.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid11_pairing_primitives.html#gaa3457d6f85889bc714910252fd21c758" title="Frees a previously allocated by Epid11PairingState. ">DeleteEpid11PairingState</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
diff --git a/doc/html/group___epid11_types.html b/doc/html/group___epid11_types.html
index 7438064..a020d8b 100644
--- a/doc/html/group___epid11_types.html
+++ b/doc/html/group___epid11_types.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: EPID 1.1 specific types</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: Intel(R) EPID 1.1 specific types</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('group___epid11_types.html','');});
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> </div>
<div class="headertitle">
-<div class="title">EPID 1.1 specific types<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">Intel(R) EPID 1.1 specific types<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -134,7 +134,7 @@ typedef <a class="el" href="struct_oct_str32.html">OctStr32</a>&#160;</td><td cl
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Intel(R) EPID 1.1 specific data types. </p>
<p>Defines serialized data types used by the SDK. These data types are only used by components that need to do Intel(R) EPID 1.1 verification.</p>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/group___epid11_verifier_module.html b/doc/html/group___epid11_verifier_module.html
index 29c5acb..d1d8006 100644
--- a/doc/html/group___epid11_verifier_module.html
+++ b/doc/html/group___epid11_verifier_module.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: EPID 1.1 support</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: Intel(R) EPID 1.1 support</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -62,7 +62,7 @@ $(document).ready(function(){initNavTree('group___epid11_verifier_module.html','
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">EPID 1.1 support<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_verifier_module.html">verifier</a></div></div> </div>
+<div class="title">Intel(R) EPID 1.1 support<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_verifier_module.html">verifier</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -175,7 +175,7 @@ Functions</h2></td></tr>
<dl class="section note"><dt>Note</dt><dd>The input signatures should be verified using <a class="el" href="group___epid11_verifier_module.html#ga7b5d19277da043c2b79721975d7bd070" title="Verifies an Intel(R) EPID 1.1 member signature without revocation checks. ">Epid11VerifyBasicSig()</a> before invocation. Behavior is undefined if either of the signatures cannot be verified.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid11_verifier_module.html#ga7b5d19277da043c2b79721975d7bd070" title="Verifies an Intel(R) EPID 1.1 member signature without revocation checks. ">Epid11VerifyBasicSig</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -232,7 +232,7 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
<dd>
<a class="el" href="group___epid11_verifier_module.html#ga7b5d19277da043c2b79721975d7bd070" title="Verifies an Intel(R) EPID 1.1 member signature without revocation checks. ">Epid11VerifyBasicSig</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -310,7 +310,7 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
<dd>
<a class="el" href="group___epid11_verifier_module.html#ga0b79c79d09e3551158e1c38c7c335929" title="Verifies an Intel(R) EPID 1.1 signature has not been revoked in the private key based revocation list...">Epid11CheckPrivRlEntry</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -362,7 +362,7 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
<dd>
<a class="el" href="group___epid11_verifier_module.html#ga241520cb925e5be89893a2037451cf1c" title="Serializes the pre-computed Intel(R) EPID 1.1 verifier settings. ">Epid11VerifierWritePrecomp</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -391,7 +391,7 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8" title="Creates a new Intel(R) EPID 1.1 verifier context. ">Epid11VerifierCreate</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -489,7 +489,7 @@ It is the responsibility of the caller to free the memory pointed to by grp_rl a
<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the group based revocation list pointed to by the verifier is undefined.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8" title="Creates a new Intel(R) EPID 1.1 verifier context. ">Epid11VerifierCreate</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -541,7 +541,7 @@ It is the responsibility of the caller to free the memory pointed to by priv_rl
<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the private key based revocation list pointed to by the verifier is undefined.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8" title="Creates a new Intel(R) EPID 1.1 verifier context. ">Epid11VerifierCreate</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -595,7 +595,7 @@ It is the responsibility of the caller to free the memory pointed to by sig_rl a
<dd>
SdkOverview_11Verifier </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -633,7 +633,7 @@ SdkOverview_11Verifier </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the content of precomp is undefined.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -704,7 +704,7 @@ SdkOverview_11Verifier </dd>
<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> or one of the values listed above the verify should de considered to have failed.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8" title="Creates a new Intel(R) EPID 1.1 verifier context. ">Epid11VerifierCreate</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
@@ -761,7 +761,7 @@ SdkOverview_11Verifier </dd>
If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the verify should be considered to have failed.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8" title="Creates a new Intel(R) EPID 1.1 verifier context. ">Epid11VerifierCreate</a> </dd>
<dd>
-<a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div>
</div>
diff --git a/doc/html/group___epid_common.html b/doc/html/group___epid_common.html
index 702e601..ce239c0 100644
--- a/doc/html/group___epid_common.html
+++ b/doc/html/group___epid_common.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('group___epid_common.html','');});
<a href="#groups">Modules</a> &#124;
<a href="#typedef-members">Typedefs</a> </div>
<div class="headertitle">
-<div class="title">common<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a></div></div> </div>
+<div class="title">common<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -108,7 +108,7 @@ Typedefs</h2></td></tr>
<p>Generates random data. </p>
<p>The SDK provides the <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c" title="Generates random data. ">BitSupplier</a> as a function prototype so that you will know the requirements for your own implementation of a random number generator.</p>
-<p>You need to pass a pointer to your implementation of the random number generator into methods that require it, such as <a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a>.</p>
+<p>You need to pass a pointer to your implementation of the random number generator into methods that require it.</p>
<p>For an example of how a BitSupplier is created, see the <code>signmsg</code> example.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
@@ -118,8 +118,7 @@ Typedefs</h2></td></tr>
</table>
</dd>
</dl>
-<dl class="section return"><dt>Returns</dt><dd>zero on success and non-zero value on error.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a> </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd>zero on success and non-zero value on error. </dd></dl>
</div>
</div>
diff --git a/doc/html/group___epid_math.html b/doc/html/group___epid_math.html
index b5a5158..510aff0 100644
--- a/doc/html/group___epid_math.html
+++ b/doc/html/group___epid_math.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('group___epid_math.html','');});
<div class="summary">
<a href="#groups">Modules</a> </div>
<div class="headertitle">
-<div class="title">math<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
+<div class="title">math<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/group___epid_member_module.html b/doc/html/group___epid_member_module.html
index 771ded4..7730741 100644
--- a/doc/html/group___epid_member_module.html
+++ b/doc/html/group___epid_member_module.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -59,10 +59,10 @@ $(document).ready(function(){initNavTree('group___epid_member_module.html','');}
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> &#124;
-<a href="#typedef-members">Typedefs</a> &#124;
+<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">member<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a></div></div> </div>
+<div class="title">member<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -71,68 +71,67 @@ $(document).ready(function(){initNavTree('group___epid_member_module.html','');}
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
-<tr class="memitem:group___tpm_module"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html">tpm</a></td></tr>
-<tr class="memdesc:group___tpm_module"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal interface that models sensitive member functionality. <br /></td></tr>
+<tr class="memitem:group___tpm2_module"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html">tpm2</a></td></tr>
+<tr class="memdesc:group___tpm2_module"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal interface that models TPM 2.0 interfaces. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
-Typedefs</h2></td></tr>
-<tr class="memitem:gadfb10d5dfdadb0694792c7b06718e817"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gadfb10d5dfdadb0694792c7b06718e817"></a>
-typedef struct <a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a></td></tr>
-<tr class="memdesc:gadfb10d5dfdadb0694792c7b06718e817"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal context of member. <br /></td></tr>
-<tr class="separator:gadfb10d5dfdadb0694792c7b06718e817"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_member_params.html">MemberParams</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Software only specific member parameters. <a href="struct_member_params.html#details">More...</a><br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
-<tr class="memitem:ga561c4d544a78ee1bf59c3f4f919aa7bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb">EpidMemberCreate</a> (<a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_priv_key.html">PrivKey</a> const *priv_key, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param, <a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **ctx)</td></tr>
-<tr class="memdesc:ga561c4d544a78ee1bf59c3f4f919aa7bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new member context. <a href="#ga561c4d544a78ee1bf59c3f4f919aa7bb">More...</a><br /></td></tr>
-<tr class="separator:ga561c4d544a78ee1bf59c3f4f919aa7bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga3824589c683c5e0e59d483462fce65d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">EpidMemberDelete</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **ctx)</td></tr>
+<tr class="memitem:gae7a7b01bc0a84c44c9d14e6c311c1ba7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7">EpidMemberCreate</a> (<a class="el" href="struct_member_params.html">MemberParams</a> const *params, <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **ctx)</td></tr>
+<tr class="memdesc:gae7a7b01bc0a84c44c9d14e6c311c1ba7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new member context. <a href="#gae7a7b01bc0a84c44c9d14e6c311c1ba7">More...</a><br /></td></tr>
+<tr class="separator:gae7a7b01bc0a84c44c9d14e6c311c1ba7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac10008d8c9ba7bc5e5be899ed03c61c3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3">EpidCreateJoinRequest</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="group___epid_types.html#ga55eb2193045bde31af3f551565126042">IssuerNonce</a> const *ni, <a class="el" href="struct_join_request.html">JoinRequest</a> *join_request)</td></tr>
+<tr class="memdesc:gac10008d8c9ba7bc5e5be899ed03c61c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a request to join a group. <a href="#gac10008d8c9ba7bc5e5be899ed03c61c3">More...</a><br /></td></tr>
+<tr class="separator:gac10008d8c9ba7bc5e5be899ed03c61c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga788ebc9d1ba6153c637b762484ca1140"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140">EpidProvisionCredential</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_membership_credential.html">MembershipCredential</a> const *credential, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp_str)</td></tr>
+<tr class="memdesc:ga788ebc9d1ba6153c637b762484ca1140"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions a member context from a membership credential. <a href="#ga788ebc9d1ba6153c637b762484ca1140">More...</a><br /></td></tr>
+<tr class="separator:ga788ebc9d1ba6153c637b762484ca1140"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga76cddb8e20afc43de2c30d5e4addb2ea"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga76cddb8e20afc43de2c30d5e4addb2ea">EpidProvisionCompressed</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_compressed_priv_key.html">CompressedPrivKey</a> const *compressed_privkey, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp_str)</td></tr>
+<tr class="memdesc:ga76cddb8e20afc43de2c30d5e4addb2ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions a member context from a compressed private key. <a href="#ga76cddb8e20afc43de2c30d5e4addb2ea">More...</a><br /></td></tr>
+<tr class="separator:ga76cddb8e20afc43de2c30d5e4addb2ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga07094399c1e040b95ae3e58a74e7c302"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302">EpidProvisionKey</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_priv_key.html">PrivKey</a> const *priv_key, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp_str)</td></tr>
+<tr class="memdesc:ga07094399c1e040b95ae3e58a74e7c302"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions a member context from a private key. <a href="#ga07094399c1e040b95ae3e58a74e7c302">More...</a><br /></td></tr>
+<tr class="separator:ga07094399c1e040b95ae3e58a74e7c302"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gaa2c85b1f0ea17a11ac5d297b21aa30f6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6">EpidMemberStartup</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx)</td></tr>
+<tr class="memdesc:gaa2c85b1f0ea17a11ac5d297b21aa30f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change member from setup state to normal operation. <a href="#gaa2c85b1f0ea17a11ac5d297b21aa30f6">More...</a><br /></td></tr>
+<tr class="separator:gaa2c85b1f0ea17a11ac5d297b21aa30f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga3824589c683c5e0e59d483462fce65d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">EpidMemberDelete</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **ctx)</td></tr>
<tr class="memdesc:ga3824589c683c5e0e59d483462fce65d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an existing member context. <a href="#ga3824589c683c5e0e59d483462fce65d6">More...</a><br /></td></tr>
<tr class="separator:ga3824589c683c5e0e59d483462fce65d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga5c35798d62cf81c4ca62b22c38809721"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721">EpidMemberWritePrecomp</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> *precomp)</td></tr>
-<tr class="memdesc:ga5c35798d62cf81c4ca62b22c38809721"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serializes the pre-computed member settings. <a href="#ga5c35798d62cf81c4ca62b22c38809721">More...</a><br /></td></tr>
-<tr class="separator:ga5c35798d62cf81c4ca62b22c38809721"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga9998eb454838ff5d232ff22ecbab31bf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">EpidMemberSetHashAlg</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
+<tr class="memitem:ga9998eb454838ff5d232ff22ecbab31bf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">EpidMemberSetHashAlg</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
<tr class="memdesc:ga9998eb454838ff5d232ff22ecbab31bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the hash algorithm to be used by a member. <a href="#ga9998eb454838ff5d232ff22ecbab31bf">More...</a><br /></td></tr>
<tr class="separator:ga9998eb454838ff5d232ff22ecbab31bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaaae6f21f58c22fce58076f10d68159f4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">EpidMemberSetSigRl</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_sig_rl.html">SigRl</a> const *sig_rl, size_t sig_rl_size)</td></tr>
+<tr class="memitem:gaaae6f21f58c22fce58076f10d68159f4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">EpidMemberSetSigRl</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_sig_rl.html">SigRl</a> const *sig_rl, size_t sig_rl_size)</td></tr>
<tr class="memdesc:gaaae6f21f58c22fce58076f10d68159f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the signature based revocation list to be used by a member. <a href="#gaaae6f21f58c22fce58076f10d68159f4">More...</a><br /></td></tr>
<tr class="separator:gaaae6f21f58c22fce58076f10d68159f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga76e535722467af7c16809b5b521e0000"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000">EpidGetSigSize</a> (<a class="el" href="struct_sig_rl.html">SigRl</a> const *sig_rl)</td></tr>
<tr class="memdesc:ga76e535722467af7c16809b5b521e0000"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the size in bytes required for an Intel(R) EPID signature. <a href="#ga76e535722467af7c16809b5b521e0000">More...</a><br /></td></tr>
<tr class="separator:ga76e535722467af7c16809b5b521e0000"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga74d1409a816cb52633564b793072da5f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">EpidSign</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, void const *msg, size_t msg_len, void const *basename, size_t basename_len, <a class="el" href="struct_epid_signature.html">EpidSignature</a> *sig, size_t sig_len)</td></tr>
+<tr class="memitem:ga74d1409a816cb52633564b793072da5f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">EpidSign</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, void const *msg, size_t msg_len, void const *basename, size_t basename_len, <a class="el" href="struct_epid_signature.html">EpidSignature</a> *sig, size_t sig_len)</td></tr>
<tr class="memdesc:ga74d1409a816cb52633564b793072da5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes an Intel(R) EPID signature. <a href="#ga74d1409a816cb52633564b793072da5f">More...</a><br /></td></tr>
<tr class="separator:ga74d1409a816cb52633564b793072da5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gad92d3c3266ae1833ffb1dba9ad76035d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d">EpidRegisterBaseName</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, void const *basename, size_t basename_len)</td></tr>
+<tr class="memitem:gad92d3c3266ae1833ffb1dba9ad76035d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d">EpidRegisterBaseName</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, void const *basename, size_t basename_len)</td></tr>
<tr class="memdesc:gad92d3c3266ae1833ffb1dba9ad76035d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a basename with a member. <a href="#gad92d3c3266ae1833ffb1dba9ad76035d">More...</a><br /></td></tr>
<tr class="separator:gad92d3c3266ae1833ffb1dba9ad76035d"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gacb0547ec085a9ed324d323416bce4a78"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78">EpidAddPreSigs</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, size_t number_presigs)</td></tr>
+<tr class="memitem:gacb0547ec085a9ed324d323416bce4a78"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78">EpidAddPreSigs</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, size_t number_presigs)</td></tr>
<tr class="memdesc:gacb0547ec085a9ed324d323416bce4a78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extends the member's pool of pre-computed signatures. <a href="#gacb0547ec085a9ed324d323416bce4a78">More...</a><br /></td></tr>
<tr class="separator:gacb0547ec085a9ed324d323416bce4a78"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gad78ca056dfea2565bbacd5734d9dc075"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075">EpidGetNumPreSigs</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx)</td></tr>
+<tr class="memitem:gad78ca056dfea2565bbacd5734d9dc075"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075">EpidGetNumPreSigs</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx)</td></tr>
<tr class="memdesc:gad78ca056dfea2565bbacd5734d9dc075"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the number of pre-computed signatures in the member's pool. <a href="#gad78ca056dfea2565bbacd5734d9dc075">More...</a><br /></td></tr>
<tr class="separator:gad78ca056dfea2565bbacd5734d9dc075"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga13dd0d72be9babf8194d472d7712a361"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga13dd0d72be9babf8194d472d7712a361">EpidRequestJoin</a> (<a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="group___epid_types.html#ga55eb2193045bde31af3f551565126042">IssuerNonce</a> const *ni, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg, <a class="el" href="struct_join_request.html">JoinRequest</a> *join_request)</td></tr>
-<tr class="memdesc:ga13dd0d72be9babf8194d472d7712a361"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a request to join a group. <a href="#ga13dd0d72be9babf8194d472d7712a361">More...</a><br /></td></tr>
-<tr class="separator:ga13dd0d72be9babf8194d472d7712a361"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gae04a250d5981fcf9bd6f9f57e0468faa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa">EpidSignBasic</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, void const *msg, size_t msg_len, void const *basename, size_t basename_len, <a class="el" href="struct_basic_signature.html">BasicSignature</a> *sig)</td></tr>
-<tr class="memdesc:gae04a250d5981fcf9bd6f9f57e0468faa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a basic signature for use in constrained environment. <a href="#gae04a250d5981fcf9bd6f9f57e0468faa">More...</a><br /></td></tr>
-<tr class="separator:gae04a250d5981fcf9bd6f9f57e0468faa"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gac8e2c6c1fead8030785a40427905a2cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc">EpidNrProve</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, void const *msg, size_t msg_len, <a class="el" href="struct_basic_signature.html">BasicSignature</a> const *sig, <a class="el" href="struct_sig_rl_entry.html">SigRlEntry</a> const *sigrl_entry, <a class="el" href="struct_nr_proof.html">NrProof</a> *proof)</td></tr>
-<tr class="memdesc:gac8e2c6c1fead8030785a40427905a2cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates a non-revoked proof for a single signature based revocation list entry. <a href="#gac8e2c6c1fead8030785a40427905a2cc">More...</a><br /></td></tr>
-<tr class="separator:gac8e2c6c1fead8030785a40427905a2cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga4ccaa8337931523c77567f5b846ef188"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga4ccaa8337931523c77567f5b846ef188">EpidAssemblePrivKey</a> (<a class="el" href="struct_membership_credential.html">MembershipCredential</a> const *credential, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_priv_key.html">PrivKey</a> *priv_key)</td></tr>
-<tr class="memdesc:ga4ccaa8337931523c77567f5b846ef188"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assembles member private key from membership credential and f value. <a href="#ga4ccaa8337931523c77567f5b846ef188">More...</a><br /></td></tr>
-<tr class="separator:ga4ccaa8337931523c77567f5b846ef188"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8cd05388f017486f14da2ee48d067ef"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef">EpidDecompressPrivKey</a> (<a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_compressed_priv_key.html">CompressedPrivKey</a> const *compressed_privkey, <a class="el" href="struct_priv_key.html">PrivKey</a> *priv_key)</td></tr>
<tr class="memdesc:gaf8cd05388f017486f14da2ee48d067ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompresses compressed member private key. <a href="#gaf8cd05388f017486f14da2ee48d067ef">More...</a><br /></td></tr>
<tr class="separator:gaf8cd05388f017486f14da2ee48d067ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Member functionality. </p>
-<p>Defines the APIs needed by Intel(R) EPID members. Each member context (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817" title="Internal context of member. ">MemberCtx</a>) represents membership in a single group.</p>
+<p>Defines the APIs needed by Intel(R) EPID members. Each member context (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817" title="Internal context of member. ">MemberCtx</a>) represents membership in a single group.</p>
<p>To use this module, include the header <a class="el" href="member_2api_8h.html" title="Intel(R) EPID SDK member API. ">epid/member/api.h</a>. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gacb0547ec085a9ed324d323416bce4a78"></a>
@@ -142,7 +141,7 @@ Functions</h2></td></tr>
<tr>
<td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidAddPreSigs </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
@@ -169,37 +168,37 @@ Functions</h2></td></tr>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a> </dd></dl>
</div>
</div>
-<a class="anchor" id="ga4ccaa8337931523c77567f5b846ef188"></a>
+<a class="anchor" id="gac10008d8c9ba7bc5e5be899ed03c61c3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidAssemblePrivKey </td>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidCreateJoinRequest </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="struct_membership_credential.html">MembershipCredential</a> const *&#160;</td>
- <td class="paramname"><em>credential</em>, </td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
- <td class="paramname"><em>f</em>, </td>
+ <td class="paramtype"><a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *&#160;</td>
+ <td class="paramname"><em>pub_key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *&#160;</td>
- <td class="paramname"><em>pub_key</em>, </td>
+ <td class="paramtype"><a class="el" href="group___epid_types.html#ga55eb2193045bde31af3f551565126042">IssuerNonce</a> const *&#160;</td>
+ <td class="paramname"><em>ni</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="struct_priv_key.html">PrivKey</a> *&#160;</td>
- <td class="paramname"><em>priv_key</em>&#160;</td>
+ <td class="paramtype"><a class="el" href="struct_join_request.html">JoinRequest</a> *&#160;</td>
+ <td class="paramname"><em>join_request</em>&#160;</td>
</tr>
<tr>
<td></td>
@@ -209,20 +208,18 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
-<p>Assembles member private key from membership credential and f value. </p>
-<p>Combines membership credential obtained from the issuer in response to a successful join request with the f value chosen by the member to create a complete member private key.</p>
-<p>The assembled private key is sanity checked to confirm it is a possible key in the group. If it is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf" title="incorrect arg to function ">kEpidBadArgErr</a> is returned.</p>
+<p>Creates a request to join a group. </p>
+<p>The created request is part of the interaction with an issuer needed to join a group. This interaction with the issuer is outside the scope of this API.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">credential</td><td>Membership credential received. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">f</td><td>The f value used to generate the join request associated with the membership credential. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">pub_key</td><td>The public key of the group. </td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">priv_key</td><td>The private key.</td></tr>
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">pub_key</td><td>The group certificate of group to join. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">ni</td><td>The nonce chosen by issuer as part of join protocol. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">join_request</td><td>The join request.</td></tr>
</table>
</dd>
</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga13dd0d72be9babf8194d472d7712a361" title="Creates a request to join a group. ">EpidRequestJoin</a> </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
</div>
</div>
@@ -279,7 +276,7 @@ Functions</h2></td></tr>
<tr>
<td class="memname">size_t EpidGetNumPreSigs </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *&#160;</td>
<td class="paramname"><em>ctx</em></td><td>)</td>
<td></td>
</tr>
@@ -294,7 +291,7 @@ Functions</h2></td></tr>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of remaining pre-computed signatures. Returns 0 if ctx is NULL.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a> </dd></dl>
</div>
</div>
@@ -326,44 +323,20 @@ Functions</h2></td></tr>
</div>
</div>
-<a class="anchor" id="ga561c4d544a78ee1bf59c3f4f919aa7bb"></a>
+<a class="anchor" id="gae7a7b01bc0a84c44c9d14e6c311c1ba7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidMemberCreate </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *&#160;</td>
- <td class="paramname"><em>pub_key</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_priv_key.html">PrivKey</a> const *&#160;</td>
- <td class="paramname"><em>priv_key</em>, </td>
+ <td class="paramtype"><a class="el" href="struct_member_params.html">MemberParams</a> const *&#160;</td>
+ <td class="paramname"><em>params</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *&#160;</td>
- <td class="paramname"><em>precomp</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a>&#160;</td>
- <td class="paramname"><em>rnd_func</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">void *&#160;</td>
- <td class="paramname"><em>rnd_param</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **&#160;</td>
<td class="paramname"><em>ctx</em>&#160;</td>
</tr>
<tr>
@@ -375,31 +348,14 @@ Functions</h2></td></tr>
</div><div class="memdoc">
<p>Creates a new member context. </p>
-<p>Must be called to create the member context that is used by other "Member" APIs.</p>
-<p>Allocates memory for the context, then initializes it.</p>
-<p><a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6" title="Deletes an existing member context. ">EpidMemberDelete()</a> must be called to safely release the member context.</p>
-<p>You need to use a cryptographically secure random number generator to create a member context using <a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a>. The <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c" title="Generates random data. ">BitSupplier</a> is provided as a function prototype for your own implementation of the random number generator.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">pub_key</td><td>The group certificate. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">priv_key</td><td>The member private key. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">precomp</td><td>Optional pre-computed data. If NULL the value is computed internally and is readable using <a class="el" href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721" title="Serializes the pre-computed member settings. ">EpidMemberWritePrecomp()</a>. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">rnd_func</td><td>Random number generator. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">rnd_param</td><td>Pass through user data that will be passed to the user_data parameter of the random number generator. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">params</td><td>Implementation specific configuration parameters. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">ctx</td><td>Newly constructed member context.</td></tr>
</table>
</dd>
</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section warning"><dt>Warning</dt><dd>For security rnd_func should be a cryptographically secure random number generator.</dd></dl>
-<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the content of ctx is undefined.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6" title="Deletes an existing member context. ">EpidMemberDelete</a> </dd>
-<dd>
-<a class="el" href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721" title="Serializes the pre-computed member settings. ">EpidMemberWritePrecomp</a> </dd>
-<dd>
-<a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c" title="Generates random data. ">BitSupplier</a></dd></dl>
-<p><b>Example</b> </p>
-<p><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> </p>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
</div>
</div>
@@ -410,7 +366,7 @@ Functions</h2></td></tr>
<tr>
<td class="memname">void EpidMemberDelete </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **&#160;</td>
<td class="paramname"><em>ctx</em></td><td>)</td>
<td></td>
</tr>
@@ -418,7 +374,7 @@ Functions</h2></td></tr>
</div><div class="memdoc">
<p>Deletes an existing member context. </p>
-<p>Must be called to safely release a member context created using <a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate()</a>.</p>
+<p>Must be called to safely release a member context created using <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a>.</p>
<p>De-initializes the context, frees memory used by the context, and sets the context pointer to NULL.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
@@ -426,7 +382,7 @@ Functions</h2></td></tr>
</table>
</dd>
</dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a></dd></dl>
<p><b>Example</b> </p>
<p><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> </p>
@@ -439,7 +395,7 @@ Functions</h2></td></tr>
<tr>
<td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidMemberSetHashAlg </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
@@ -466,7 +422,7 @@ Functions</h2></td></tr>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a>, the hash algorithm used by the member is undefined.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a> </dd>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a> </dd>
<dd>
<a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890" title="Recognized hash algorithms. ">HashAlg</a></dd></dl>
<p><b>Example</b> </p>
@@ -481,7 +437,7 @@ Functions</h2></td></tr>
<tr>
<td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidMemberSetSigRl </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
@@ -519,90 +475,64 @@ It is the responsibility of the caller to free the memory pointed to by sig_rl a
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the signature based revocation list pointed to by the member is not changed.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a></dd></dl>
<p><b>Example</b> </p>
<p><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> </p>
</div>
</div>
-<a class="anchor" id="ga5c35798d62cf81c4ca62b22c38809721"></a>
+<a class="anchor" id="gaa2c85b1f0ea17a11ac5d297b21aa30f6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidMemberWritePrecomp </td>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidMemberStartup </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_member_precomp.html">MemberPrecomp</a> *&#160;</td>
- <td class="paramname"><em>precomp</em>&#160;</td>
- </tr>
- <tr>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em></td><td>)</td>
<td></td>
- <td>)</td>
- <td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
-<p>Serializes the pre-computed member settings. </p>
+<p>Change member from setup state to normal operation. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">precomp</td><td>The Serialized pre-computed member settings.</td></tr>
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The member context.</td></tr>
</table>
</dd>
</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a>, the content of precomp is undefined.</dd></dl>
-<p><b>Example</b> </p>
-<p><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> </p>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
</div>
</div>
-<a class="anchor" id="gac8e2c6c1fead8030785a40427905a2cc"></a>
+<a class="anchor" id="ga76cddb8e20afc43de2c30d5e4addb2ea"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidNrProve </td>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidProvisionCompressed </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype">void const *&#160;</td>
- <td class="paramname"><em>msg</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">size_t&#160;</td>
- <td class="paramname"><em>msg_len</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_basic_signature.html">BasicSignature</a> const *&#160;</td>
- <td class="paramname"><em>sig</em>, </td>
+ <td class="paramtype"><a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *&#160;</td>
+ <td class="paramname"><em>pub_key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="struct_sig_rl_entry.html">SigRlEntry</a> const *&#160;</td>
- <td class="paramname"><em>sigrl_entry</em>, </td>
+ <td class="paramtype"><a class="el" href="struct_compressed_priv_key.html">CompressedPrivKey</a> const *&#160;</td>
+ <td class="paramname"><em>compressed_privkey</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="struct_nr_proof.html">NrProof</a> *&#160;</td>
- <td class="paramname"><em>proof</em>&#160;</td>
+ <td class="paramtype"><a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *&#160;</td>
+ <td class="paramname"><em>precomp_str</em>&#160;</td>
</tr>
<tr>
<td></td>
@@ -612,50 +542,47 @@ It is the responsibility of the caller to free the memory pointed to by sig_rl a
</table>
</div><div class="memdoc">
-<p>Calculates a non-revoked proof for a single signature based revocation list entry. </p>
-<p>Used in constrained environments where, due to limited memory, it may not be possible to process through a large and potentially unbounded revocation list.</p>
+<p>Provisions a member context from a compressed private key. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>The message. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">msg_len</td><td>The length of message in bytes. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">sig</td><td>The basic signature. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">sigrl_entry</td><td>The signature based revocation list entry. </td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">proof</td><td>The generated non-revoked proof.</td></tr>
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">pub_key</td><td>The group certificate of group to provision. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">compressed_privkey</td><td>private key. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">precomp_str</td><td>Precomputed state (implementation specific optional)</td></tr>
</table>
</dd>
</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section note"><dt>Note</dt><dd>This function should be used in conjunction with <a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa" title="Creates a basic signature for use in constrained environment. ">EpidSignBasic()</a>.</dd>
-<dd>
-If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a>, the content of proof is undefined.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a> </dd>
-<dd>
-<a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa" title="Creates a basic signature for use in constrained environment. ">EpidSignBasic</a> </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
</div>
</div>
-<a class="anchor" id="gad92d3c3266ae1833ffb1dba9ad76035d"></a>
+<a class="anchor" id="ga788ebc9d1ba6153c637b762484ca1140"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidRegisterBaseName </td>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidProvisionCredential </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype">void const *&#160;</td>
- <td class="paramname"><em>basename</em>, </td>
+ <td class="paramtype"><a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *&#160;</td>
+ <td class="paramname"><em>pub_key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype">size_t&#160;</td>
- <td class="paramname"><em>basename_len</em>&#160;</td>
+ <td class="paramtype"><a class="el" href="struct_membership_credential.html">MembershipCredential</a> const *&#160;</td>
+ <td class="paramname"><em>credential</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *&#160;</td>
+ <td class="paramname"><em>precomp_str</em>&#160;</td>
</tr>
<tr>
<td></td>
@@ -665,75 +592,47 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
</table>
</div><div class="memdoc">
-<p>Registers a basename with a member. </p>
-<p>To prevent loss of privacy, the member keeps a list of basenames (corresponding to authorized verifiers). The member signs a message with a basename only if the basename is in the member's basename list.</p>
-<dl class="section warning"><dt>Warning</dt><dd>The use of a name-based signature creates a platform unique pseudonymous identifier. Because it reduces the member's privacy, the user should be notified when it is used and should have control over its use.</dd></dl>
+<p>Provisions a member context from a membership credential. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">basename</td><td>The basename. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">basename_len</td><td>Length of the basename.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="retval"><dt>Return values</dt><dd>
- <table class="retval">
- <tr><td class="paramname"><a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a3706f895a660260033b5b91890516c0f" title="argument would add duplicate entry ">kEpidDuplicateErr</a></td><td>The basename was already registered.</td></tr>
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">pub_key</td><td>The group certificate of group to provision. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">credential</td><td>membership credential. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">precomp_str</td><td>Precomputed state (implementation specific optional)</td></tr>
</table>
</dd>
</dl>
-<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> or <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a3706f895a660260033b5b91890516c0f" title="argument would add duplicate entry ">kEpidDuplicateErr</a> it is undefined if the basename is registered.</dd></dl>
-<p><b>Example</b> </p>
-<p><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> </p>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
</div>
</div>
-<a class="anchor" id="ga13dd0d72be9babf8194d472d7712a361"></a>
+<a class="anchor" id="ga07094399c1e040b95ae3e58a74e7c302"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidRequestJoin </td>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidProvisionKey </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *&#160;</td>
- <td class="paramname"><em>pub_key</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="group___epid_types.html#ga55eb2193045bde31af3f551565126042">IssuerNonce</a> const *&#160;</td>
- <td class="paramname"><em>ni</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
- <td class="paramname"><em>f</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a>&#160;</td>
- <td class="paramname"><em>rnd_func</em>, </td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype">void *&#160;</td>
- <td class="paramname"><em>rnd_param</em>, </td>
+ <td class="paramtype"><a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *&#160;</td>
+ <td class="paramname"><em>pub_key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td>
- <td class="paramname"><em>hash_alg</em>, </td>
+ <td class="paramtype"><a class="el" href="struct_priv_key.html">PrivKey</a> const *&#160;</td>
+ <td class="paramname"><em>priv_key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="struct_join_request.html">JoinRequest</a> *&#160;</td>
- <td class="paramname"><em>join_request</em>&#160;</td>
+ <td class="paramtype"><a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *&#160;</td>
+ <td class="paramname"><em>precomp_str</em>&#160;</td>
</tr>
<tr>
<td></td>
@@ -743,74 +642,41 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
</table>
</div><div class="memdoc">
-<p>Creates a request to join a group. </p>
-<p>The created request is part of the interaction with an issuer needed to join a group. This interaction with the issuer is outside the scope of this API.</p>
+<p>Provisions a member context from a private key. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">pub_key</td><td>The group certificate of group to join. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">ni</td><td>The nonce chosen by issuer as part of join protocol. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">f</td><td>A randomly selected integer in [1, p-1]. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">rnd_func</td><td>Random number generator. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">rnd_param</td><td>Pass through context data for rnd_func. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>The hash algorithm to be used. </td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">join_request</td><td>The join request.</td></tr>
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">pub_key</td><td>The group certificate of group to provision. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">priv_key</td><td>private key. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">precomp_str</td><td>Precomputed state (implementation specific optional)</td></tr>
</table>
</dd>
</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section warning"><dt>Warning</dt><dd>For security rnd_func should be a cryptographically secure random number generator.</dd></dl>
-<dl class="section note"><dt>Note</dt><dd>The default hash algorithm in Member is SHA-512. This is the recommended option if you do not override the hash algorithm elsewhere.</dd>
-<dd>
-If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a>, the content of join_request is undefined.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890" title="Recognized hash algorithms. ">HashAlg</a> </dd></dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
</div>
</div>
-<a class="anchor" id="ga74d1409a816cb52633564b793072da5f"></a>
+<a class="anchor" id="gad92d3c3266ae1833ffb1dba9ad76035d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidSign </td>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidRegisterBaseName </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void const *&#160;</td>
- <td class="paramname"><em>msg</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">size_t&#160;</td>
- <td class="paramname"><em>msg_len</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">void const *&#160;</td>
<td class="paramname"><em>basename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
- <td class="paramname"><em>basename_len</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_epid_signature.html">EpidSignature</a> *&#160;</td>
- <td class="paramname"><em>sig</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">size_t&#160;</td>
- <td class="paramname"><em>sig_len</em>&#160;</td>
+ <td class="paramname"><em>basename_len</em>&#160;</td>
</tr>
<tr>
<td></td>
@@ -820,41 +686,38 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
</table>
</div><div class="memdoc">
-<p>Writes an Intel(R) EPID signature. </p>
+<p>Registers a basename with a member. </p>
+<p>To prevent loss of privacy, the member keeps a list of basenames (corresponding to authorized verifiers). The member signs a message with a basename only if the basename is in the member's basename list.</p>
+<dl class="section warning"><dt>Warning</dt><dd>The use of a name-based signature creates a platform unique pseudonymous identifier. Because it reduces the member's privacy, the user should be notified when it is used and should have control over its use.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>The message to sign. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">msg_len</td><td>The length in bytes of message. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">basename</td><td>Optional basename. If basename is NULL a random basename is used. Signatures generated using random basenames are anonymous. Signatures generated using the same basename are linkable by the verifier. If a basename is provided, it must already be registered, or <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf" title="incorrect arg to function ">kEpidBadArgErr</a> is returned. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">basename_len</td><td>The size of basename in bytes. Must be 0 if basename is NULL. </td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">sig</td><td>The generated signature </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">sig_len</td><td>The size of signature in bytes. Must be equal to value returned by <a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000" title="Computes the size in bytes required for an Intel(R) EPID signature. ">EpidGetSigSize()</a>.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">basename</td><td>The basename. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">basename_len</td><td>Length of the basename.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the content of sig is undefined.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a> </dd>
-<dd>
-<a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf" title="Sets the hash algorithm to be used by a member. ">EpidMemberSetHashAlg</a> </dd>
-<dd>
-<a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4" title="Sets the signature based revocation list to be used by a member. ">EpidMemberSetSigRl</a> </dd>
-<dd>
-<a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000" title="Computes the size in bytes required for an Intel(R) EPID signature. ">EpidGetSigSize</a></dd></dl>
+<dl class="retval"><dt>Return values</dt><dd>
+ <table class="retval">
+ <tr><td class="paramname"><a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a3706f895a660260033b5b91890516c0f" title="argument would add duplicate entry ">kEpidDuplicateErr</a></td><td>The basename was already registered.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> or <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a3706f895a660260033b5b91890516c0f" title="argument would add duplicate entry ">kEpidDuplicateErr</a> it is undefined if the basename is registered.</dd></dl>
<p><b>Example</b> </p>
<p><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> </p>
</div>
</div>
-<a class="anchor" id="gae04a250d5981fcf9bd6f9f57e0468faa"></a>
+<a class="anchor" id="ga74d1409a816cb52633564b793072da5f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidSignBasic </td>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EpidSign </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *&#160;</td>
+ <td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
</tr>
<tr>
@@ -884,8 +747,14 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="struct_basic_signature.html">BasicSignature</a> *&#160;</td>
- <td class="paramname"><em>sig</em>&#160;</td>
+ <td class="paramtype"><a class="el" href="struct_epid_signature.html">EpidSignature</a> *&#160;</td>
+ <td class="paramname"><em>sig</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>sig_len</em>&#160;</td>
</tr>
<tr>
<td></td>
@@ -895,26 +764,30 @@ If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c
</table>
</div><div class="memdoc">
-<p>Creates a basic signature for use in constrained environment. </p>
-<p>Used in constrained environments where, due to limited memory, it may not be possible to process through a large and potentially unbounded revocation list.</p>
+<p>Writes an Intel(R) EPID signature. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The member context. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>The message. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">msg_len</td><td>The length of message in bytes. </td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">basename</td><td>Optional basename. If basename is NULL a random basename is used. Signatures generated using random basenames are anonymous. Signatures generated using the same basename are linkable by the verifier. If a basename is provided it must already be registered or <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf" title="incorrect arg to function ">kEpidBadArgErr</a> is returned. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>The message to sign. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">msg_len</td><td>The length in bytes of message. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">basename</td><td>Optional basename. If basename is NULL a random basename is used. Signatures generated using random basenames are anonymous. Signatures generated using the same basename are linkable by the verifier. If a basename is provided, it must already be registered, or <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf" title="incorrect arg to function ">kEpidBadArgErr</a> is returned. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">basename_len</td><td>The size of basename in bytes. Must be 0 if basename is NULL. </td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">sig</td><td>The generated basic signature</td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">sig</td><td>The generated signature </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">sig_len</td><td>The size of signature in bytes. Must be equal to value returned by <a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000" title="Computes the size in bytes required for an Intel(R) EPID signature. ">EpidGetSigSize()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section note"><dt>Note</dt><dd>This function should be used in conjunction with <a class="el" href="group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc" title="Calculates a non-revoked proof for a single signature based revocation list entry. ">EpidNrProve()</a></dd>
+<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the content of sig is undefined.</dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a> </dd>
+<dd>
+<a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf" title="Sets the hash algorithm to be used by a member. ">EpidMemberSetHashAlg</a> </dd>
<dd>
-If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the content of sig, is undefined.</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb" title="Creates a new member context. ">EpidMemberCreate</a> </dd>
+<a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4" title="Sets the signature based revocation list to be used by a member. ">EpidMemberSetSigRl</a> </dd>
<dd>
-<a class="el" href="group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc" title="Calculates a non-revoked proof for a single signature based revocation list entry. ">EpidNrProve</a> </dd></dl>
+<a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000" title="Computes the size in bytes required for an Intel(R) EPID signature. ">EpidGetSigSize</a></dd></dl>
+<p><b>Example</b> </p>
+<p><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> </p>
</div>
</div>
diff --git a/doc/html/group___epid_member_module.js b/doc/html/group___epid_member_module.js
index 373485f..f904ae6 100644
--- a/doc/html/group___epid_member_module.js
+++ b/doc/html/group___epid_member_module.js
@@ -1,20 +1,24 @@
var group___epid_member_module =
[
- [ "tpm", "group___tpm_module.html", "group___tpm_module" ],
- [ "MemberCtx", "group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817", null ],
+ [ "tpm2", "group___tpm2_module.html", "group___tpm2_module" ],
+ [ "MemberParams", "struct_member_params.html", [
+ [ "f", "struct_member_params.html#ad6782a38fd79477bccf2313c676ea4fc", null ],
+ [ "rnd_func", "struct_member_params.html#ad844c7a2be20bac70b118e7c08530c0b", null ],
+ [ "rnd_param", "struct_member_params.html#a7510f05e63328fa13cf2a3a3bd6acd95", null ]
+ ] ],
[ "EpidAddPreSigs", "group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78", null ],
- [ "EpidAssemblePrivKey", "group___epid_member_module.html#ga4ccaa8337931523c77567f5b846ef188", null ],
+ [ "EpidCreateJoinRequest", "group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3", null ],
[ "EpidDecompressPrivKey", "group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef", null ],
[ "EpidGetNumPreSigs", "group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075", null ],
[ "EpidGetSigSize", "group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000", null ],
- [ "EpidMemberCreate", "group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb", null ],
+ [ "EpidMemberCreate", "group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7", null ],
[ "EpidMemberDelete", "group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6", null ],
[ "EpidMemberSetHashAlg", "group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf", null ],
[ "EpidMemberSetSigRl", "group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4", null ],
- [ "EpidMemberWritePrecomp", "group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721", null ],
- [ "EpidNrProve", "group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc", null ],
+ [ "EpidMemberStartup", "group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6", null ],
+ [ "EpidProvisionCompressed", "group___epid_member_module.html#ga76cddb8e20afc43de2c30d5e4addb2ea", null ],
+ [ "EpidProvisionCredential", "group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140", null ],
+ [ "EpidProvisionKey", "group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302", null ],
[ "EpidRegisterBaseName", "group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d", null ],
- [ "EpidRequestJoin", "group___epid_member_module.html#ga13dd0d72be9babf8194d472d7712a361", null ],
- [ "EpidSign", "group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f", null ],
- [ "EpidSignBasic", "group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa", null ]
+ [ "EpidSign", "group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f", null ]
]; \ No newline at end of file
diff --git a/doc/html/group___epid_module.html b/doc/html/group___epid_module.html
index 01d5c8e..636cb9f 100644
--- a/doc/html/group___epid_module.html
+++ b/doc/html/group___epid_module.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid&nbsp;</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('group___epid_module.html','');});
<div class="summary">
<a href="#groups">Modules</a> </div>
<div class="headertitle">
-<div class="title">epid</div> </div>
+<div class="title">epid&#160;</div> </div>
</div><!--header-->
<div class="contents">
@@ -81,7 +81,7 @@ Modules</h2></td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Core Intel&reg; EPID functionality. </p>
-<p>Contains core functionality used to provide or implement APIs in the Intel(R) EPID SDK. </p>
+<p>Contains core functionality used to provide or implement APIs in the Intel&reg; EPID SDK. </p>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/group___epid_print.html b/doc/html/group___epid_print.html
index 7f78db2..bc3039c 100644
--- a/doc/html/group___epid_print.html
+++ b/doc/html/group___epid_print.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('group___epid_print.html','');});
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">print_utils<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
+<div class="title">print_utils<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/group___epid_types.html b/doc/html/group___epid_types.html
index 9d5e80f..c925672 100644
--- a/doc/html/group___epid_types.html
+++ b/doc/html/group___epid_types.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -63,7 +63,7 @@ $(document).ready(function(){initNavTree('group___epid_types.html','');});
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> </div>
<div class="headertitle">
-<div class="title">types<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
+<div class="title">types<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -72,7 +72,7 @@ $(document).ready(function(){initNavTree('group___epid_types.html','');});
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
-<tr class="memitem:group___epid11_types"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></td></tr>
+<tr class="memitem:group___epid11_types"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></td></tr>
<tr class="memdesc:group___epid11_types"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 specific data types. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
diff --git a/doc/html/group___epid_types.js b/doc/html/group___epid_types.js
index 3cd8a41..865892d 100644
--- a/doc/html/group___epid_types.js
+++ b/doc/html/group___epid_types.js
@@ -1,6 +1,6 @@
var group___epid_types =
[
- [ "EPID 1.1 specific types", "group___epid11_types.html", "group___epid11_types" ],
+ [ "Intel(R) EPID 1.1 specific types", "group___epid11_types.html", "group___epid11_types" ],
[ "OctStr8", "struct_oct_str8.html", [
[ "data", "struct_oct_str8.html#a5e6c56fda48c88b419e621b464b03bef", null ]
] ],
diff --git a/doc/html/group___epid_verifier_module.html b/doc/html/group___epid_verifier_module.html
index 88ff90b..44ae137 100644
--- a/doc/html/group___epid_verifier_module.html
+++ b/doc/html/group___epid_verifier_module.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -63,7 +63,7 @@ $(document).ready(function(){initNavTree('group___epid_verifier_module.html','')
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">verifier<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a></div></div> </div>
+<div class="title">verifier<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -72,7 +72,7 @@ $(document).ready(function(){initNavTree('group___epid_verifier_module.html','')
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
-<tr class="memitem:group___epid11_verifier_module"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_verifier_module.html">EPID 1.1 support</a></td></tr>
+<tr class="memitem:group___epid11_verifier_module"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_verifier_module.html">Intel(R) EPID 1.1 support</a></td></tr>
<tr class="memdesc:group___epid11_verifier_module"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 Verifier functionality. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
@@ -192,7 +192,7 @@ Functions</h2></td></tr>
<dl class="section note"><dt>Note</dt><dd>The input signatures should be verified using <a class="el" href="group___epid_verifier_module.html#gac3b1f1a2bdba8eeeebbf1e0c8c00862e" title="Verifies a member signature without revocation checks. ">EpidVerifyBasicSig()</a> before invocation. Behavior is undefined if either of the signatures cannot be verified.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_verifier_module.html#gac3b1f1a2bdba8eeeebbf1e0c8c00862e" title="Verifies a member signature without revocation checks. ">EpidVerifyBasicSig</a> </dd>
<dd>
-<a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa" title="Creates a basic signature for use in constrained environment. ">EpidSignBasic</a> </dd>
+EpidSignBasic </dd>
<dd>
<a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f" title="Writes an Intel(R) EPID signature. ">EpidSign</a> </dd></dl>
@@ -906,7 +906,7 @@ It is the responsibility of the caller to free the memory pointed to by sig_rl a
<dl class="section note"><dt>Note</dt><dd>If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> or one of the values listed above the verify should be considered to have failed.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70" title="Creates a new verifier context. ">EpidVerifierCreate</a> </dd>
<dd>
-<a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa" title="Creates a basic signature for use in constrained environment. ">EpidSignBasic</a> </dd>
+EpidSignBasic </dd>
<dd>
<a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f" title="Writes an Intel(R) EPID signature. ">EpidSign</a></dd></dl>
<p><b>Example</b> </p>
@@ -967,7 +967,7 @@ It is the responsibility of the caller to free the memory pointed to by sig_rl a
If the result is not <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9" title="no error ">kEpidNoErr</a> the verify should be considered to have failed.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70" title="Creates a new verifier context. ">EpidVerifierCreate</a> </dd>
<dd>
-<a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa" title="Creates a basic signature for use in constrained environment. ">EpidSignBasic</a> </dd>
+EpidSignBasic </dd>
<dd>
<a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f" title="Writes an Intel(R) EPID signature. ">EpidSign</a> </dd></dl>
diff --git a/doc/html/group___epid_verifier_module.js b/doc/html/group___epid_verifier_module.js
index b93f822..9b10202 100644
--- a/doc/html/group___epid_verifier_module.js
+++ b/doc/html/group___epid_verifier_module.js
@@ -1,6 +1,6 @@
var group___epid_verifier_module =
[
- [ "EPID 1.1 support", "group___epid11_verifier_module.html", "group___epid11_verifier_module" ],
+ [ "Intel(R) EPID 1.1 support", "group___epid11_verifier_module.html", "group___epid11_verifier_module" ],
[ "VerifierPrecomp", "struct_verifier_precomp.html", [
[ "e12", "struct_verifier_precomp.html#ad1106376f12772942af0331eb74de6e5", null ],
[ "e22", "struct_verifier_precomp.html#af8fd90f3a5a2be932a97dcd86099d5b2", null ],
diff --git a/doc/html/group___error_codes.html b/doc/html/group___error_codes.html
index cdf7ec2..c93f72d 100644
--- a/doc/html/group___error_codes.html
+++ b/doc/html/group___error_codes.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('group___error_codes.html','');});
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">errors<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
+<div class="title">errors<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/group___file_parser.html b/doc/html/group___file_parser.html
index e69716c..4cf1003 100644
--- a/doc/html/group___file_parser.html
+++ b/doc/html/group___file_parser.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -64,7 +64,7 @@ $(document).ready(function(){initNavTree('group___file_parser.html','');});
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
-<div class="title">fileparser<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
+<div class="title">fileparser<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -73,7 +73,7 @@ $(document).ready(function(){initNavTree('group___file_parser.html','');});
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
-<tr class="memitem:group___epid11_file_parser_module"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_file_parser_module.html">EPID 1.1 support</a></td></tr>
+<tr class="memitem:group___epid11_file_parser_module"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_file_parser_module.html">Intel(R) EPID 1.1 support</a></td></tr>
<tr class="memdesc:group___epid11_file_parser_module"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parser for 1.1 issuer material. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
@@ -143,7 +143,7 @@ const <a class="el" href="struct_oct_str16.html">OctStr16</a>&#160;</td><td clas
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Parser for issuer material. </p>
<p>Provides an API for parsing buffers formatted according to the various IoT Intel(R) EPID binary file formats.</p>
-<p>To use this module, include the header <a class="el" href="file__parser_8h.html" title="Epid issuer material parsing utilities. ">epid/common/file_parser.h</a>. </p>
+<p>To use this module, include the header <a class="el" href="file__parser_8h.html" title="Intel(R) EPID issuer material parsing utilities. ">epid/common/file_parser.h</a>. </p>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga9a33be7edc6b4c7a867fb07bd2bddecb"></a>
<div class="memitem">
@@ -207,7 +207,7 @@ const <a class="el" href="struct_oct_str16.html">OctStr16</a>&#160;</td><td clas
<p>Intel(R) EPID version 2.x. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga1562efc7c1891875d6b2b9180d65de9da8bbd27765997dd10f1c0378dbecef01d"></a>kNumEpidVersions&#160;</td><td class="fielddoc">
-<p>Maximum number of EPID versions. </p>
+<p>Maximum number of versions. </p>
</td></tr>
</table>
@@ -255,8 +255,8 @@ const <a class="el" href="struct_oct_str16.html">OctStr16</a>&#160;</td><td clas
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to buffer containing Intel(R) EPID Binary Output File to parse.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>The size of buf in bytes.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">epid_version</td><td>The extracted EPID version or kNumEpidVersions if EPID version is unknown. Pass NULL to not extract.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">file_type</td><td>The extracted EPID file type or kNumFileTypes if file type is unknown. Pass NULL to not extract.</td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">epid_version</td><td>The extracted Intel(R) EPID version or kNumEpidVersions if Intel(R) EPID version is unknown. Pass NULL to not extract.</td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">file_type</td><td>The extracted Intel(R) EPID file type or kNumFileTypes if file type is unknown. Pass NULL to not extract.</td></tr>
</table>
</dd>
</dl>
diff --git a/doc/html/group___file_parser.js b/doc/html/group___file_parser.js
index 3694cba..1fe5f83 100644
--- a/doc/html/group___file_parser.js
+++ b/doc/html/group___file_parser.js
@@ -1,6 +1,6 @@
var group___file_parser =
[
- [ "EPID 1.1 support", "group___epid11_file_parser_module.html", "group___epid11_file_parser_module" ],
+ [ "Intel(R) EPID 1.1 support", "group___epid11_file_parser_module.html", "group___epid11_file_parser_module" ],
[ "EpidFileHeader", "struct_epid_file_header.html", [
[ "epid_version", "struct_epid_file_header.html#a35d43c51c1739940381e4898ca87b824", null ],
[ "file_type", "struct_epid_file_header.html#af5d48c739cc6c00c6e1ce35abf4f1473", null ]
diff --git a/doc/html/group___finite_field_primitives.html b/doc/html/group___finite_field_primitives.html
index e8ae94e..aba3702 100644
--- a/doc/html/group___finite_field_primitives.html
+++ b/doc/html/group___finite_field_primitives.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('group___finite_field_primitives.html',
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">finitefield<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
+<div class="title">finitefield<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/group___hash_primitives.html b/doc/html/group___hash_primitives.html
index 240969d..6b38f26 100644
--- a/doc/html/group___hash_primitives.html
+++ b/doc/html/group___hash_primitives.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,7 @@ $(document).ready(function(){initNavTree('group___hash_primitives.html','');});
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">hash<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
+<div class="title">hash<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/group___pairing_primitives.html b/doc/html/group___pairing_primitives.html
index bc5801f..7e5e364 100644
--- a/doc/html/group___pairing_primitives.html
+++ b/doc/html/group___pairing_primitives.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -62,7 +62,7 @@ $(document).ready(function(){initNavTree('group___pairing_primitives.html','');}
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">pairing<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
+<div class="title">pairing<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -71,8 +71,8 @@ $(document).ready(function(){initNavTree('group___pairing_primitives.html','');}
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
-<tr class="memitem:group___epid11_pairing_primitives"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_pairing_primitives.html">EPID 1.1 specific pairing</a></td></tr>
-<tr class="memdesc:group___epid11_pairing_primitives"><td class="mdescLeft">&#160;</td><td class="mdescRight">EPID 1.1 pairing operations. <br /></td></tr>
+<tr class="memitem:group___epid11_pairing_primitives"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_pairing_primitives.html">Intel(R) EPID 1.1 specific pairing</a></td></tr>
+<tr class="memdesc:group___epid11_pairing_primitives"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 pairing operations. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
diff --git a/doc/html/group___pairing_primitives.js b/doc/html/group___pairing_primitives.js
index f66ceb1..dc48d2d 100644
--- a/doc/html/group___pairing_primitives.js
+++ b/doc/html/group___pairing_primitives.js
@@ -1,6 +1,6 @@
var group___pairing_primitives =
[
- [ "EPID 1.1 specific pairing", "group___epid11_pairing_primitives.html", "group___epid11_pairing_primitives" ],
+ [ "Intel(R) EPID 1.1 specific pairing", "group___epid11_pairing_primitives.html", "group___epid11_pairing_primitives" ],
[ "PairingState", "group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607", null ],
[ "DeletePairingState", "group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d", null ],
[ "NewPairingState", "group___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc", null ],
diff --git a/doc/html/group___tpm2_module.html b/doc/html/group___tpm2_module.html
new file mode 100644
index 0000000..931b7cf
--- /dev/null
+++ b/doc/html/group___tpm2_module.html
@@ -0,0 +1,762 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: tpm2</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('group___tpm2_module.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">tpm2<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_member_module.html">member</a></div></div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Internal interface that models TPM 2.0 interfaces.
+<a href="#details">More...</a></p>
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga750e38b6d6cea1b05f605e476df065d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">Tpm2Commit</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *p1, void const *s2, size_t s2_len, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const *y2, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *k, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *l, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *e, uint16_t *counter)</td></tr>
+<tr class="memdesc:ga750e38b6d6cea1b05f605e476df065d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_Commit TPM operation. <a href="#ga750e38b6d6cea1b05f605e476df065d9">More...</a><br /></td></tr>
+<tr class="separator:ga750e38b6d6cea1b05f605e476df065d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">Tpm2CreateContext</a> (<a class="el" href="struct_member_params.html">MemberParams</a> const *params, Epid2Params_ const *epid2_params, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> *rnd_func, void **rnd_param, const <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> **f, <a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new Tpm context. <a href="#ga11a523e65eee3c7ad1ab21239329ce3e">More...</a><br /></td></tr>
+<tr class="separator:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga38f47cba4c26320db06aa50a77590ef4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">Tpm2DeleteContext</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga38f47cba4c26320db06aa50a77590ef4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an existing Tpm context. <a href="#ga38f47cba4c26320db06aa50a77590ef4">More...</a><br /></td></tr>
+<tr class="separator:ga38f47cba4c26320db06aa50a77590ef4"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga11cc131debbca60c0de7e53d48330b69"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">Tpm2SetHashAlg</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
+<tr class="memdesc:ga11cc131debbca60c0de7e53d48330b69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the hash algorithm to be used by a TPM2. <a href="#ga11cc131debbca60c0de7e53d48330b69">More...</a><br /></td></tr>
+<tr class="separator:ga11cc131debbca60c0de7e53d48330b69"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">Tpm2ResetContext</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr>
+<tr class="memdesc:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset an existing Tpm context. <a href="#ga8ee4fed3e1a4dd0c910102430fca8c81">More...</a><br /></td></tr>
+<tr class="separator:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">Tpm2GetRandom</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, int const num_bits, void *random_data)</td></tr>
+<tr class="memdesc:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get random data. <a href="#gae7f35aaf9045e4e21bc2ec56e384fcf6">More...</a><br /></td></tr>
+<tr class="separator:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac2507260f635a9c7abd9113cda6918f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">Tpm2LoadExternal</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f_str)</td></tr>
+<tr class="memdesc:gac2507260f635a9c7abd9113cda6918f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invokes TPM2_LoadExternal command. <a href="#gac2507260f635a9c7abd9113cda6918f9">More...</a><br /></td></tr>
+<tr class="separator:gac2507260f635a9c7abd9113cda6918f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gadee3a48d63f03d55ea5f02e48d169326"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">Tpm2NvDefineSpace</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size)</td></tr>
+<tr class="memdesc:gadee3a48d63f03d55ea5f02e48d169326"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_DefineSpace TPM command. <a href="#gadee3a48d63f03d55ea5f02e48d169326">More...</a><br /></td></tr>
+<tr class="separator:gadee3a48d63f03d55ea5f02e48d169326"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga38ca781a9a0126223456e677f40e1d22"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">Tpm2NvUndefineSpace</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index)</td></tr>
+<tr class="memdesc:ga38ca781a9a0126223456e677f40e1d22"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_UndefineSpace TPM command. <a href="#ga38ca781a9a0126223456e677f40e1d22">More...</a><br /></td></tr>
+<tr class="separator:ga38ca781a9a0126223456e677f40e1d22"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">Tpm2NvWrite</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size, uint16_t offset, void const *data)</td></tr>
+<tr class="memdesc:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_Write TPM command. <a href="#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">More...</a><br /></td></tr>
+<tr class="separator:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">Tpm2NvRead</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size, uint16_t offset, void *data)</td></tr>
+<tr class="memdesc:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_Read TPM command. <a href="#ga2ec34e65adaf46a14a78f24a7fd0e4dd">More...</a><br /></td></tr>
+<tr class="separator:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga035c8ffba3182ba75a38131e23bb31c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">Tpm2Sign</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, void const *digest, size_t digest_len, uint16_t counter, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *k, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *s)</td></tr>
+<tr class="memdesc:ga035c8ffba3182ba75a38131e23bb31c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_Sign TPM command. <a href="#ga035c8ffba3182ba75a38131e23bb31c7">More...</a><br /></td></tr>
+<tr class="separator:ga035c8ffba3182ba75a38131e23bb31c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac3735163276efa0da4b793ba935513bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">Tpm2ReleaseCounter</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint16_t counter)</td></tr>
+<tr class="memdesc:gac3735163276efa0da4b793ba935513bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erases random r value assosiated with counter. <a href="#gac3735163276efa0da4b793ba935513bb">More...</a><br /></td></tr>
+<tr class="separator:gac3735163276efa0da4b793ba935513bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<p>Internal interface that models TPM 2.0 interfaces. </p>
+<p>Provides an interface that represents operations that can be directly translated to operations on TPM 2.0 devices. </p>
+<h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ga750e38b6d6cea1b05f605e476df065d9"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2Commit </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *&#160;</td>
+ <td class="paramname"><em>p1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void const *&#160;</td>
+ <td class="paramname"><em>s2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>s2_len</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const *&#160;</td>
+ <td class="paramname"><em>y2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *&#160;</td>
+ <td class="paramname"><em>k</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *&#160;</td>
+ <td class="paramname"><em>l</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *&#160;</td>
+ <td class="paramname"><em>e</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint16_t *&#160;</td>
+ <td class="paramname"><em>counter</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Performs TPM2_Commit TPM operation. </p>
+<p>Generates random r and compute K, L and E points.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>A point P1 on G1 curve. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">s2</td><td>Octet array used to derive x-coordinate of a point P2. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">s2_len</td><td>Length of s2 buffer. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">y2</td><td>y coordinate of the point associated with s2. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">k</td><td>Result of G1.exp(P2, private key f). </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">l</td><td>Result of G1.exp(P2, random r). </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">e</td><td>Result of G1.exp(P1, random r). </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">counter</td><td>A value associated with the random r. Should be initialized with zero.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga11a523e65eee3c7ad1ab21239329ce3e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2CreateContext </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_member_params.html">MemberParams</a> const *&#160;</td>
+ <td class="paramname"><em>params</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">Epid2Params_ const *&#160;</td>
+ <td class="paramname"><em>epid2_params</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> *&#160;</td>
+ <td class="paramname"><em>rnd_func</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void **&#160;</td>
+ <td class="paramname"><em>rnd_param</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> **&#160;</td>
+ <td class="paramname"><em>f</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **&#160;</td>
+ <td class="paramname"><em>ctx</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Creates a new Tpm context. </p>
+<p>Must be called to create the TPM context that is used by other TPM APIs.</p>
+<p>You need to use a cryptographically secure random number generator to create a TPM context. The <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c" title="Generates random data. ">BitSupplier</a> is provided as a function prototype for your own implementation of the random number generator.</p>
+<p><a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4" title="Deletes an existing Tpm context. ">Tpm2DeleteContext</a> must be called to safely release the TPM context.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">params</td><td>member parameters to initialize rnd_func, rnd_param, ff_elem, ctx.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">epid2_params</td><td>The field and group parameters.</td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">rnd_func</td><td>random function if exists in MemberParms</td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">rnd_param</td><td>random parameters if exists in MemberParms</td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">f</td><td>seed f if exists in <a class="el" href="struct_member_params.html" title="Software only specific member parameters. ">MemberParams</a></td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">ctx</td><td>Newly constructed TPM context.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4" title="Deletes an existing Tpm context. ">Tpm2DeleteContext</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga38f47cba4c26320db06aa50a77590ef4"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Tpm2DeleteContext </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **&#160;</td>
+ <td class="paramname"><em>ctx</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Deletes an existing Tpm context. </p>
+<p>Must be called to safely release a TPM context created using <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a>.</p>
+<p>De-initializes the context, frees memory used by the context, and sets the context pointer to NULL.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context. Can be NULL.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="gae7f35aaf9045e4e21bc2ec56e384fcf6"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2GetRandom </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int const&#160;</td>
+ <td class="paramname"><em>num_bits</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void *&#160;</td>
+ <td class="paramname"><em>random_data</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Get random data. </p>
+<p>This command returns the next num_bits from the random number generator (RNG).</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">num_bits</td><td>Number of bits to return.</td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">random_data</td><td>Output random bits.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="gac2507260f635a9c7abd9113cda6918f9"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2LoadExternal </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
+ <td class="paramname"><em>f_str</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Invokes TPM2_LoadExternal command. </p>
+<p>This command is used to load an object that is not a Protected Object into the TPM. The command allows loading of a public area or both a public and sensitive area.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">f_str</td><td>The f value of the member private key.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="gadee3a48d63f03d55ea5f02e48d169326"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2NvDefineSpace </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>nv_index</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>size</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Performs TPM2_NV_DefineSpace TPM command. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>Handle of the data area. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of the data area.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd" title="Performs TPM2_NV_Read TPM command. ">Tpm2NvRead</a> </dd>
+<dd>
+<a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc" title="Performs TPM2_NV_Write TPM command. ">Tpm2NvWrite</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga2ec34e65adaf46a14a78f24a7fd0e4dd"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2NvRead </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>nv_index</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>size</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint16_t&#160;</td>
+ <td class="paramname"><em>offset</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void *&#160;</td>
+ <td class="paramname"><em>data</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Performs TPM2_NV_Read TPM command. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>NV Index to be read. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of bytes to read. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>Offset into the area. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>Data read.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc" title="Performs TPM2_NV_Write TPM command. ">Tpm2NvWrite</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga38ca781a9a0126223456e677f40e1d22"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2NvUndefineSpace </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>nv_index</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Performs TPM2_NV_UndefineSpace TPM command. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>Handle of the data area to undefine.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326" title="Performs TPM2_NV_DefineSpace TPM command. ">Tpm2NvDefineSpace</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2NvWrite </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>nv_index</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>size</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint16_t&#160;</td>
+ <td class="paramname"><em>offset</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void const *&#160;</td>
+ <td class="paramname"><em>data</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Performs TPM2_NV_Write TPM command. </p>
+<p>An area in NV memory must be defined prior writing.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>NV Index to be write. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of bytes to write. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>Offset into the area. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Data to write.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326" title="Performs TPM2_NV_DefineSpace TPM command. ">Tpm2NvDefineSpace</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="gac3735163276efa0da4b793ba935513bb"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2ReleaseCounter </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint16_t&#160;</td>
+ <td class="paramname"><em>counter</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Erases random r value assosiated with counter. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">counter</td><td>To be released value associated with the random r generated during TPM2_Commit.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section note"><dt>Note</dt><dd>This function should be used if Tpm2Sign wasn't called after Tpm2Commit which created counter.</dd></dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9" title="Performs TPM2_Commit TPM operation. ">Tpm2Commit</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga8ee4fed3e1a4dd0c910102430fca8c81"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Tpm2ResetContext </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **&#160;</td>
+ <td class="paramname"><em>ctx</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Reset an existing Tpm context. </p>
+<p>Must be called to reset a TPM context created using <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a>.</p>
+<p>Re-initializes the context, reset memory used for primary key.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context. Can be NULL.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga11cc131debbca60c0de7e53d48330b69"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2SetHashAlg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td>
+ <td class="paramname"><em>hash_alg</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the hash algorithm to be used by a TPM2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM2 context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>The hash algorithm to use.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga035c8ffba3182ba75a38131e23bb31c7"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2Sign </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *&#160;</td>
+ <td class="paramname"><em>ctx</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void const *&#160;</td>
+ <td class="paramname"><em>digest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>digest_len</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint16_t&#160;</td>
+ <td class="paramname"><em>counter</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *&#160;</td>
+ <td class="paramname"><em>k</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *&#160;</td>
+ <td class="paramname"><em>s</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Performs TPM2_Sign TPM command. </p>
+<p>Calculate a pair (k, s) an ECDAA signature.</p>
+<p>Private key f must exist in the TPM context.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">digest</td><td>Digest to be signed. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">digest_len</td><td>The size of digest in bytes. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">counter</td><td>A value associated with the random r generated during TPM2_Commit. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">k</td><td>The ECDAA signature k value. Nonce produced by the TPM during signing. </td></tr>
+ <tr><td class="paramdir">[out]</td><td class="paramname">s</td><td>The ECDAA signature s value.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd>
+<dd>
+<a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9" title="Performs TPM2_Commit TPM operation. ">Tpm2Commit</a> </dd></dl>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/group___tpm2_module.js b/doc/html/group___tpm2_module.js
new file mode 100644
index 0000000..6f085a0
--- /dev/null
+++ b/doc/html/group___tpm2_module.js
@@ -0,0 +1,16 @@
+var group___tpm2_module =
+[
+ [ "Tpm2Commit", "group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9", null ],
+ [ "Tpm2CreateContext", "group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e", null ],
+ [ "Tpm2DeleteContext", "group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4", null ],
+ [ "Tpm2GetRandom", "group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6", null ],
+ [ "Tpm2LoadExternal", "group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9", null ],
+ [ "Tpm2NvDefineSpace", "group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326", null ],
+ [ "Tpm2NvRead", "group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd", null ],
+ [ "Tpm2NvUndefineSpace", "group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22", null ],
+ [ "Tpm2NvWrite", "group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc", null ],
+ [ "Tpm2ReleaseCounter", "group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb", null ],
+ [ "Tpm2ResetContext", "group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81", null ],
+ [ "Tpm2SetHashAlg", "group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69", null ],
+ [ "Tpm2Sign", "group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7", null ]
+]; \ No newline at end of file
diff --git a/doc/html/group___tpm_module.html b/doc/html/group___tpm_module.html
deleted file mode 100644
index 41a6f92..0000000
--- a/doc/html/group___tpm_module.html
+++ /dev/null
@@ -1,929 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: tpm</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
- $(document).ready(initResizable);
- $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname"><a
- onclick="storeLink('index.html')"
- id="projectlink"
- class="index.html"
- href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
-</div>
- </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('group___tpm_module.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
- <div class="summary">
-<a href="#nested-classes">Data Structures</a> &#124;
-<a href="#func-members">Functions</a> </div>
- <div class="headertitle">
-<div class="title">tpm<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_member_module.html">member</a></div></div> </div>
-</div><!--header-->
-<div class="contents">
-
-<p>Internal interface that models sensitive member functionality.
-<a href="#details">More...</a></p>
-<table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
-Data Structures</h2></td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_nr_prove_commit_output.html">NrProveCommitOutput</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Result of NrProve Commit. <a href="struct_nr_prove_commit_output.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sign_commit_output.html">SignCommitOutput</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Result of Sign Commit. <a href="struct_sign_commit_output.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
-Functions</h2></td></tr>
-<tr class="memitem:ga901cad19eb14a6a6a02e85f9d710d287"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287">TpmCreate</a> (<a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param, Epid2Params_ const *epid2_params, TpmCtx **ctx)</td></tr>
-<tr class="memdesc:ga901cad19eb14a6a6a02e85f9d710d287"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new Tpm context. <a href="#ga901cad19eb14a6a6a02e85f9d710d287">More...</a><br /></td></tr>
-<tr class="separator:ga901cad19eb14a6a6a02e85f9d710d287"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga95bc18225c1d87803be7965978e37449"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga95bc18225c1d87803be7965978e37449">TpmDelete</a> (TpmCtx **ctx)</td></tr>
-<tr class="memdesc:ga95bc18225c1d87803be7965978e37449"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an existing Tpm context. <a href="#ga95bc18225c1d87803be7965978e37449">More...</a><br /></td></tr>
-<tr class="separator:ga95bc18225c1d87803be7965978e37449"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga42b80d485cff39fe9ec14a0b5a81426d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d">TpmProvision</a> (TpmCtx *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f_str)</td></tr>
-<tr class="memdesc:ga42b80d485cff39fe9ec14a0b5a81426d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions Tpm with sensitive parameters. <a href="#ga42b80d485cff39fe9ec14a0b5a81426d">More...</a><br /></td></tr>
-<tr class="separator:ga42b80d485cff39fe9ec14a0b5a81426d"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga688441f78f68aa53c41fcae4d31c6f50"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50">TpmProvisionCompressed</a> (TpmCtx *ctx, <a class="el" href="struct_oct_str256.html">OctStr256</a> const *seed)</td></tr>
-<tr class="memdesc:ga688441f78f68aa53c41fcae4d31c6f50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions Tpm with compressed key seed. <a href="#ga688441f78f68aa53c41fcae4d31c6f50">More...</a><br /></td></tr>
-<tr class="separator:ga688441f78f68aa53c41fcae4d31c6f50"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaeb9bfaa9288263af9feccd0d0543c9bc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc">TpmDecompressKey</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *h1_str, <a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *w_str, <a class="el" href="struct_fq_elem_str.html">FqElemStr</a> const *Ax_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *A_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *x_str)</td></tr>
-<tr class="memdesc:gaeb9bfaa9288263af9feccd0d0543c9bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompresses provisioned key. <a href="#gaeb9bfaa9288263af9feccd0d0543c9bc">More...</a><br /></td></tr>
-<tr class="separator:gaeb9bfaa9288263af9feccd0d0543c9bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga5e62323b94837b847f3e869cf2ff3615"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615">TpmInit</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *A_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *x_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *h1_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *h2_str, <a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *w_str, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp_str)</td></tr>
-<tr class="memdesc:ga5e62323b94837b847f3e869cf2ff3615"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes Tpm with non-sensitive parameters. <a href="#ga5e62323b94837b847f3e869cf2ff3615">More...</a><br /></td></tr>
-<tr class="separator:ga5e62323b94837b847f3e869cf2ff3615"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gae69218c9cba6a19d3ae1199c59772efc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc">TpmJoinCommit</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *F_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *R_str)</td></tr>
-<tr class="memdesc:gae69218c9cba6a19d3ae1199c59772efc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the first part of the join operation. <a href="#gae69218c9cba6a19d3ae1199c59772efc">More...</a><br /></td></tr>
-<tr class="separator:gae69218c9cba6a19d3ae1199c59772efc"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gab80c411f070858fbe019d93f5ac6a6ec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec">TpmJoin</a> (TpmCtx *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *c_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *s_str)</td></tr>
-<tr class="memdesc:gab80c411f070858fbe019d93f5ac6a6ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the last part of the join operation. <a href="#gab80c411f070858fbe019d93f5ac6a6ec">More...</a><br /></td></tr>
-<tr class="separator:gab80c411f070858fbe019d93f5ac6a6ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gace6002b520db41d8e781b02c6f538dc0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0">TpmNrProveCommit</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *B_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *K_str, <a class="el" href="struct_sig_rl_entry.html">SigRlEntry</a> const *sigrl_entry, <a class="el" href="struct_nr_prove_commit_output.html">NrProveCommitOutput</a> *commit_out)</td></tr>
-<tr class="memdesc:gace6002b520db41d8e781b02c6f538dc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the first part of the NrProve operation. <a href="#gace6002b520db41d8e781b02c6f538dc0">More...</a><br /></td></tr>
-<tr class="separator:gace6002b520db41d8e781b02c6f538dc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga4346d22fb9fed6a161cb1ea178b50ed2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2">TpmNrProve</a> (TpmCtx *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *c_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *smu_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *snu_str)</td></tr>
-<tr class="memdesc:ga4346d22fb9fed6a161cb1ea178b50ed2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the last part of the NrProve operation. <a href="#ga4346d22fb9fed6a161cb1ea178b50ed2">More...</a><br /></td></tr>
-<tr class="separator:ga4346d22fb9fed6a161cb1ea178b50ed2"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga2335ec4eb78b542cf87df9b0cd15358c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga2335ec4eb78b542cf87df9b0cd15358c">TpmAddPreSigs</a> (TpmCtx *ctx, size_t number_presigs)</td></tr>
-<tr class="memdesc:ga2335ec4eb78b542cf87df9b0cd15358c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extends the TPM's pool of pre-computed signatures. <a href="#ga2335ec4eb78b542cf87df9b0cd15358c">More...</a><br /></td></tr>
-<tr class="separator:ga2335ec4eb78b542cf87df9b0cd15358c"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaa53a6bd52e22808bac21596a964bdece"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gaa53a6bd52e22808bac21596a964bdece">TpmGetNumPreSigs</a> (TpmCtx const *ctx)</td></tr>
-<tr class="memdesc:gaa53a6bd52e22808bac21596a964bdece"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the number of pre-computed signatures in the TPM's pool. <a href="#gaa53a6bd52e22808bac21596a964bdece">More...</a><br /></td></tr>
-<tr class="separator:gaa53a6bd52e22808bac21596a964bdece"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaf9004ce8832c1acae497604d1deb49cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd">TpmSignCommit</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *B_in_str, <a class="el" href="struct_sign_commit_output.html">SignCommitOutput</a> *commit_out)</td></tr>
-<tr class="memdesc:gaf9004ce8832c1acae497604d1deb49cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the first part of the sign operation. <a href="#gaf9004ce8832c1acae497604d1deb49cd">More...</a><br /></td></tr>
-<tr class="separator:gaf9004ce8832c1acae497604d1deb49cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaa667fb3295e4533334bb32afcd43890f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f">TpmSign</a> (TpmCtx *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *c_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *sx_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *sf_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *sa_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *sb_str)</td></tr>
-<tr class="memdesc:gaa667fb3295e4533334bb32afcd43890f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the last part of the sign operation. <a href="#gaa667fb3295e4533334bb32afcd43890f">More...</a><br /></td></tr>
-<tr class="separator:gaa667fb3295e4533334bb32afcd43890f"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga3318f97e4d1763815dace3779ae6564f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f">TpmIsKeyValid</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *A_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *x_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *h1_str, <a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *w_str)</td></tr>
-<tr class="memdesc:ga3318f97e4d1763815dace3779ae6564f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if provided parameters result in a valid key. <a href="#ga3318f97e4d1763815dace3779ae6564f">More...</a><br /></td></tr>
-<tr class="separator:ga3318f97e4d1763815dace3779ae6564f"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<p>Internal interface that models sensitive member functionality. </p>
-<p>Provides an interface that gives guidance on partitioning member operations between highly sensitive ones that use f value of the private key and the random engine, and less sensitive operations that can be performed in a host environment.</p>
-<p>The TPM set-up operations are intended to model phases in the provisioning of a device.</p>
-<p><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> represents hardware and firmware that is intrinsic to the device and is key independent.</p>
-<p><a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> and <a class="el" href="group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50" title="Provisions Tpm with compressed key seed. ">TpmProvisionCompressed</a> represent the provisioning of the <code>f</code> portion of the secret key into the device. This is usually done by blowing of fuses or other one time programmable storage, and is not an operation that is typically done as part of normal member operation.</p>
-<p><a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615" title="Initializes Tpm with non-sensitive parameters. ">TpmInit</a> represents joining the device to a group. This may be called more than once in the event of a re-key or join event. <a class="el" href="group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f" title="Checks if provided parameters result in a valid key. ">TpmIsKeyValid</a> can be called to validate the parameters to <code>TpmInit</code>.</p>
-<p>The core member functionality of generating signatures, non-revoked proofs, and join requests is implemented using split operations. The host needs to call the commit portion of the split operation first, then it does some work on the output, and completes the operation by calling the second half of the split operation. </p>
-<h2 class="groupheader">Function Documentation</h2>
-<a class="anchor" id="ga2335ec4eb78b542cf87df9b0cd15358c"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmAddPreSigs </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">size_t&#160;</td>
- <td class="paramname"><em>number_presigs</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Extends the TPM's pool of pre-computed signatures. </p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">number_presigs</td><td>The number of pre-computed signatures to add to the pool.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#gaa53a6bd52e22808bac21596a964bdece" title="Gets the number of pre-computed signatures in the TPM&#39;s pool. ">TpmGetNumPreSigs</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="ga901cad19eb14a6a6a02e85f9d710d287"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmCreate </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a>&#160;</td>
- <td class="paramname"><em>rnd_func</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">void *&#160;</td>
- <td class="paramname"><em>rnd_param</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">Epid2Params_ const *&#160;</td>
- <td class="paramname"><em>epid2_params</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">TpmCtx **&#160;</td>
- <td class="paramname"><em>ctx</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Creates a new Tpm context. </p>
-<p>Must be called to create the TPM context that is used by other TPM APIs.</p>
-<p><a class="el" href="group___tpm_module.html#ga95bc18225c1d87803be7965978e37449" title="Deletes an existing Tpm context. ">TpmDelete</a> must be called to safely release the TPM context.</p>
-<p>You need to use a cryptographically secure random number generator to create a TPM context using <a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a>. The <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c" title="Generates random data. ">BitSupplier</a> is provided as a function prototype for your own implementation of the random number generator.</p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">rnd_func</td><td>Random number generator.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">rnd_param</td><td>Pass through user data that will be passed to the user_data parameter of the random number generator.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">epid2_params</td><td>The field and group parameters.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">ctx</td><td>Newly constructed TPM context.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga95bc18225c1d87803be7965978e37449" title="Deletes an existing Tpm context. ">TpmDelete</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="gaeb9bfaa9288263af9feccd0d0543c9bc"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmDecompressKey </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>h1_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>w_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fq_elem_str.html">FqElemStr</a> const *&#160;</td>
- <td class="paramname"><em>Ax_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
- <td class="paramname"><em>A_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
- <td class="paramname"><em>x_str</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Decompresses provisioned key. </p>
-<p>If you provision a compressed key using <a class="el" href="group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50" title="Provisions Tpm with compressed key seed. ">TpmProvisionCompressed</a>, you must call <a class="el" href="group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc" title="Decompresses provisioned key. ">TpmDecompressKey</a> before performing any other operations that use the TPM context. Once decompressed, the context will maintain the decompressed key for the lifetime of the context.</p>
-<dl class="section note"><dt>Note</dt><dd>If the compressed private key has not been provisioned, the result of the decompression is undefined.</dd></dl>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">h1_str</td><td>The h1 value of the group public key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">w_str</td><td>The w value of the group public key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">Ax_str</td><td>The Ax value of the compressed member private key.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">A_str</td><td>The A value of the member private key.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">x_str</td><td>The x value of the member private key.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50" title="Provisions Tpm with compressed key seed. ">TpmProvisionCompressed</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="ga95bc18225c1d87803be7965978e37449"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void TpmDelete </td>
- <td>(</td>
- <td class="paramtype">TpmCtx **&#160;</td>
- <td class="paramname"><em>ctx</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Deletes an existing Tpm context. </p>
-<p>Must be called to safely release a TPM context created using <a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a>.</p>
-<p>De-initializes the context, frees memory used by the context, and sets the context pointer to NULL.</p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context. Can be NULL.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="gaa53a6bd52e22808bac21596a964bdece"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">size_t TpmGetNumPreSigs </td>
- <td>(</td>
- <td class="paramtype">TpmCtx const *&#160;</td>
- <td class="paramname"><em>ctx</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Gets the number of pre-computed signatures in the TPM's pool. </p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd>Number of pre-computed signatures in TPM's pool</dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga2335ec4eb78b542cf87df9b0cd15358c" title="Extends the TPM&#39;s pool of pre-computed signatures. ">TpmAddPreSigs</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="ga5e62323b94837b847f3e869cf2ff3615"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmInit </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>A_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
- <td class="paramname"><em>x_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>h1_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>h2_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>w_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *&#160;</td>
- <td class="paramname"><em>precomp_str</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Initializes Tpm with non-sensitive parameters. </p>
-<dl class="section note"><dt>Note</dt><dd>Does not check consistency with the provisioned f value. Use <a class="el" href="group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f" title="Checks if provided parameters result in a valid key. ">TpmIsKeyValid</a> to check that the parameters will result in a valid key pair.</dd></dl>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">A_str</td><td>The A value of the member private key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">x_str</td><td>The x value of the member private key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">h1_str</td><td>The h1 value of the group public key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">h2_str</td><td>The h2 value of the group public key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">w_str</td><td>The w value of the group public key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">precomp_str</td><td>The member pre-computed data.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f" title="Checks if provided parameters result in a valid key. ">TpmIsKeyValid</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="ga3318f97e4d1763815dace3779ae6564f"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> TpmIsKeyValid </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>A_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
- <td class="paramname"><em>x_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>h1_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>w_str</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Checks if provided parameters result in a valid key. </p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">A_str</td><td>The A value of the member private key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">x_str</td><td>The x value of the member private key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">h1_str</td><td>The h1 value of the group public key.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">w_str</td><td>The w value of the group public key.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="retval"><dt>Return values</dt><dd>
- <table class="retval">
- <tr><td class="paramname">true</td><td>if the input values would result in a valid member private key</td></tr>
- <tr><td class="paramname">false</td><td>if the input values would result in an invalid member private key</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615" title="Initializes Tpm with non-sensitive parameters. ">TpmInit</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="gab80c411f070858fbe019d93f5ac6a6ec"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmJoin </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
- <td class="paramname"><em>c_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
- <td class="paramname"><em>s_str</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Performs the last part of the join operation. </p>
-<dl class="section note"><dt>Note</dt><dd><a class="el" href="group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec" title="Performs the last part of the join operation. ">TpmJoin</a> must be preceded by a call to <a class="el" href="group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc" title="Performs the first part of the join operation. ">TpmJoinCommit</a>. Two sequential calls to <a class="el" href="group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec" title="Performs the last part of the join operation. ">TpmJoin</a> will fail with <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a700953ded1af35781948e8ada6dedf43" title="operation was performed out of sequence ">kEpidOutOfSequenceError</a>.</dd></dl>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">c_str</td><td>The join commitment hash.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">s_str</td><td>The s value of the join request.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc" title="Performs the first part of the join operation. ">TpmJoinCommit</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="gae69218c9cba6a19d3ae1199c59772efc"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmJoinCommit </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
- <td class="paramname"><em>F_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
- <td class="paramname"><em>R_str</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Performs the first part of the join operation. </p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">F_str</td><td>The F value of the join commit.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">R_str</td><td>The R value of the join commit.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec" title="Performs the last part of the join operation. ">TpmJoin</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="ga4346d22fb9fed6a161cb1ea178b50ed2"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmNrProve </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
- <td class="paramname"><em>c_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
- <td class="paramname"><em>smu_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
- <td class="paramname"><em>snu_str</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Performs the last part of the NrProve operation. </p>
-<dl class="section note"><dt>Note</dt><dd><a class="el" href="group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2" title="Performs the last part of the NrProve operation. ">TpmNrProve</a> must be preceded by a call to <a class="el" href="group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0" title="Performs the first part of the NrProve operation. ">TpmNrProveCommit</a>. Two sequential calls to <a class="el" href="group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2" title="Performs the last part of the NrProve operation. ">TpmNrProve</a> will fail with <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a700953ded1af35781948e8ada6dedf43" title="operation was performed out of sequence ">kEpidOutOfSequenceError</a>.</dd></dl>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">c_str</td><td>The non-revoked proof commitment hash.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">smu_str</td><td>The smu value in the non-revoked proof.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">snu_str</td><td>The snu value in the non-revoked proof.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615" title="Initializes Tpm with non-sensitive parameters. ">TpmInit</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0" title="Performs the first part of the NrProve operation. ">TpmNrProveCommit</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="gace6002b520db41d8e781b02c6f538dc0"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmNrProveCommit </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>B_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>K_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_sig_rl_entry.html">SigRlEntry</a> const *&#160;</td>
- <td class="paramname"><em>sigrl_entry</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_nr_prove_commit_output.html">NrProveCommitOutput</a> *&#160;</td>
- <td class="paramname"><em>commit_out</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Performs the first part of the NrProve operation. </p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">B_str</td><td>The B value from the <a class="el" href="struct_basic_signature.html" title="Intel(R) EPID 2.0 basic signature. ">BasicSignature</a>.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">K_str</td><td>The K value from the <a class="el" href="struct_basic_signature.html" title="Intel(R) EPID 2.0 basic signature. ">BasicSignature</a>.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">sigrl_entry</td><td>The signature based revocation list entry corresponding to this proof.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">commit_out</td><td>The resulting commitment value.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615" title="Initializes Tpm with non-sensitive parameters. ">TpmInit</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2" title="Performs the last part of the NrProve operation. ">TpmNrProve</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="ga42b80d485cff39fe9ec14a0b5a81426d"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmProvision </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
- <td class="paramname"><em>f_str</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Provisions Tpm with sensitive parameters. </p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir"></td><td class="paramname">f_str</td><td>The f value of the member private key.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615" title="Initializes Tpm with non-sensitive parameters. ">TpmInit</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="ga688441f78f68aa53c41fcae4d31c6f50"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmProvisionCompressed </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> const *&#160;</td>
- <td class="paramname"><em>seed</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Provisions Tpm with compressed key seed. </p>
-<p>You must call <a class="el" href="group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc" title="Decompresses provisioned key. ">TpmDecompressKey</a> before performing any other operations that use the TPM context.</p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">seed</td><td>The seed value of the compressed key.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615" title="Initializes Tpm with non-sensitive parameters. ">TpmInit</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc" title="Decompresses provisioned key. ">TpmDecompressKey</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="gaa667fb3295e4533334bb32afcd43890f"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmSign </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td>
- <td class="paramname"><em>c_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
- <td class="paramname"><em>sx_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
- <td class="paramname"><em>sf_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
- <td class="paramname"><em>sa_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
- <td class="paramname"><em>sb_str</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Performs the last part of the sign operation. </p>
-<dl class="section note"><dt>Note</dt><dd><a class="el" href="group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f" title="Performs the last part of the sign operation. ">TpmSign</a> must be preceded by a call to <a class="el" href="group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd" title="Performs the first part of the sign operation. ">TpmSignCommit</a>. Two sequential calls to <a class="el" href="group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f" title="Performs the last part of the sign operation. ">TpmSign</a> will fail with <a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a700953ded1af35781948e8ada6dedf43" title="operation was performed out of sequence ">kEpidOutOfSequenceError</a>.</dd></dl>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">c_str</td><td>The sign commitment hash.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">sx_str</td><td>The <a class="el" href="struct_basic_signature.html" title="Intel(R) EPID 2.0 basic signature. ">BasicSignature</a> sx value.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">sf_str</td><td>The <a class="el" href="struct_basic_signature.html" title="Intel(R) EPID 2.0 basic signature. ">BasicSignature</a> sf value.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">sa_str</td><td>The <a class="el" href="struct_basic_signature.html" title="Intel(R) EPID 2.0 basic signature. ">BasicSignature</a> sa value.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">sb_str</td><td>The <a class="el" href="struct_basic_signature.html" title="Intel(R) EPID 2.0 basic signature. ">BasicSignature</a> sb value.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615" title="Initializes Tpm with non-sensitive parameters. ">TpmInit</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd" title="Performs the first part of the sign operation. ">TpmSignCommit</a> </dd></dl>
-
-</div>
-</div>
-<a class="anchor" id="gaf9004ce8832c1acae497604d1deb49cd"></a>
-<div class="memitem">
-<div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> TpmSignCommit </td>
- <td>(</td>
- <td class="paramtype">TpmCtx *&#160;</td>
- <td class="paramname"><em>ctx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
- <td class="paramname"><em>B_in_str</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype"><a class="el" href="struct_sign_commit_output.html">SignCommitOutput</a> *&#160;</td>
- <td class="paramname"><em>commit_out</em>&#160;</td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
-</div><div class="memdoc">
-
-<p>Performs the first part of the sign operation. </p>
-<dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context.</td></tr>
- <tr><td class="paramdir">[in]</td><td class="paramname">B_in_str</td><td>An optional serialized hash of basename. If NULL a random basename is used.</td></tr>
- <tr><td class="paramdir">[out]</td><td class="paramname">commit_out</td><td>The resulting commitment value.</td></tr>
- </table>
- </dd>
-</dl>
-<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287" title="Creates a new Tpm context. ">TpmCreate</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d" title="Provisions Tpm with sensitive parameters. ">TpmProvision</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615" title="Initializes Tpm with non-sensitive parameters. ">TpmInit</a> </dd>
-<dd>
-<a class="el" href="group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f" title="Performs the last part of the sign operation. ">TpmSign</a> </dd></dl>
-
-</div>
-</div>
-</div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="footer">
- &copy; 2016-2017 Intel Corporation
- </li>
- </ul>
-</div>
-</body>
-</html>
diff --git a/doc/html/group___tpm_module.js b/doc/html/group___tpm_module.js
deleted file mode 100644
index 3e0b437..0000000
--- a/doc/html/group___tpm_module.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var group___tpm_module =
-[
- [ "NrProveCommitOutput", "struct_nr_prove_commit_output.html", [
- [ "R1", "struct_nr_prove_commit_output.html#af9c605d560f83ccd69e35d8b9cfe51b3", null ],
- [ "R2", "struct_nr_prove_commit_output.html#aab0f11e55d3b8d838e472242e27a1a43", null ],
- [ "T", "struct_nr_prove_commit_output.html#a00234dfa2443d49f5a294c58fdacb064", null ]
- ] ],
- [ "SignCommitOutput", "struct_sign_commit_output.html", [
- [ "B", "struct_sign_commit_output.html#ae2ebcc07395e60187d9ccca373665dba", null ],
- [ "K", "struct_sign_commit_output.html#a496bdc4d14fb73b1e85dfff3bc9fd3ba", null ],
- [ "R1", "struct_sign_commit_output.html#ad01513f153f51f7ce211cf323a224499", null ],
- [ "R2", "struct_sign_commit_output.html#a0f35f1d619ea972acbdf9d45af630de0", null ],
- [ "T", "struct_sign_commit_output.html#a9ce3b28916094f5fa108d5f5c86631b0", null ]
- ] ],
- [ "TpmAddPreSigs", "group___tpm_module.html#ga2335ec4eb78b542cf87df9b0cd15358c", null ],
- [ "TpmCreate", "group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287", null ],
- [ "TpmDecompressKey", "group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc", null ],
- [ "TpmDelete", "group___tpm_module.html#ga95bc18225c1d87803be7965978e37449", null ],
- [ "TpmGetNumPreSigs", "group___tpm_module.html#gaa53a6bd52e22808bac21596a964bdece", null ],
- [ "TpmInit", "group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615", null ],
- [ "TpmIsKeyValid", "group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f", null ],
- [ "TpmJoin", "group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec", null ],
- [ "TpmJoinCommit", "group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc", null ],
- [ "TpmNrProve", "group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2", null ],
- [ "TpmNrProveCommit", "group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0", null ],
- [ "TpmProvision", "group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d", null ],
- [ "TpmProvisionCompressed", "group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50", null ],
- [ "TpmSign", "group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f", null ],
- [ "TpmSignCommit", "group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd", null ]
-]; \ No newline at end of file
diff --git a/doc/html/hash_8h.html b/doc/html/hash_8h.html
index 6166734..0b86f58 100644
--- a/doc/html/hash_8h.html
+++ b/doc/html/hash_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -67,9 +67,9 @@ $(document).ready(function(){initNavTree('hash_8h.html','');});
<p>Hash primitives.
<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
+<div class="textblock"><code>#include &lt;limits.h&gt;</code><br />
+<code>#include &lt;stddef.h&gt;</code><br />
<code>#include &lt;stdint.h&gt;</code><br />
-<code>#include &lt;limits.h&gt;</code><br />
<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
diff --git a/doc/html/how__validated_8dox.html b/doc/html/how__validated_8dox.html
index e5cf885..d7d055f 100644
--- a/doc/html/how__validated_8dox.html
+++ b/doc/html/how__validated_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/implementation__notes_8dox.html b/doc/html/implementation__notes_8dox.html
index e81f729..55f065f 100644
--- a/doc/html/implementation__notes_8dox.html
+++ b/doc/html/implementation__notes_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/index.html b/doc/html/index.html
index 5afffbe..ec75efd 100644
--- a/doc/html/index.html
+++ b/doc/html/index.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -69,7 +69,7 @@ Getting Started</h1>
<ol type="1">
<li><b>Get the Big Picture</b> The <a class="el" href="EpidOverview.html">Introduction to the Intel&reg; EPID Scheme</a> provides a non-implementation-specific overview of the interactions between the issuer, member, and verifier.</li>
<li><b>Build the SDK</b> For instructions, refer to <a class="el" href="BuildingSdk.html">Building from Source</a>. For help installing the prerequisite build tools, refer to <a class="el" href="BuildToolsInstallation.html">Guide to Installing Build Tools</a>.</li>
-<li><b>Run the SDK Samples with Test Data</b> After you build the SDK, you can follow along with the commands in the implementation specific <a class="el" href="SignVerifyTutorial.html">Signing and Verification Tutorial</a>, using the provided samples and the test data from <a class="el" href="IssuerMaterial.html">Sample Issuer Material</a>.</li>
+<li><b>Run the SDK Samples with Test Data</b> After you build the SDK, you can follow along with the commands in the implementation specific <a class="el" href="SignVerifyTutorial.html">Signing and Verification Tutorial</a>, using the provided samples and the test data from <a class="el" href="IssuerMaterial.html">Test Data</a>.</li>
<li><b>Check out the Code Examples</b> Refer to <a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> and <a class="el" href="UserManual_VerifyingAnIntelEpidSignature.html">Verifying an Intel&reg; EPID Signature</a> to see how SDK APIs are used by the code examples <code>signmsg</code> and <code>verifysig</code>.</li>
<li><b>Check out the API Reference</b> The API reference shows you how to use all APIs included in the SDK. </li>
</ol>
diff --git a/doc/html/issuer__material_8dox.html b/doc/html/issuer__material_8dox.html
index 3e5dad5..c3b55c3 100644
--- a/doc/html/issuer__material_8dox.html
+++ b/doc/html/issuer__material_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/legal__information_8dox.html b/doc/html/legal__information_8dox.html
index 53757da..6e99ee9 100644
--- a/doc/html/legal__information_8dox.html
+++ b/doc/html/legal__information_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/load__external_8c.html b/doc/html/load__external_8c.html
new file mode 100644
index 0000000..2c93b88
--- /dev/null
+++ b/doc/html/load__external_8c.html
@@ -0,0 +1,127 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/load_external.c File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('load__external_8c.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#define-members">Macros</a> &#124;
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">load_external.c File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM2_LoadExternal command implementation.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="load__external_8h.html">epid/member/tpm2/load_external.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="ecgroup_8h.html">epid/common/math/ecgroup.h</a>&quot;</code><br />
+<code>#include &quot;epid/common/src/epid2params.h&quot;</code><br />
+<code>#include &quot;epid/common/src/memory.h&quot;</code><br />
+<code>#include &quot;<a class="el" href="conversion_8h.html">epid/member/tpm2/ibm_tss/conversion.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="printtss_8h.html">epid/member/tpm2/ibm_tss/printtss.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="state_8h.html">epid/member/tpm2/ibm_tss/state.h</a>&quot;</code><br />
+<code>#include &quot;tss2/TPM_Types.h&quot;</code><br />
+<code>#include &quot;tss2/tss.h&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:a5638f861b82f1746ea1af0b384ef8ff1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="load__external_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">BREAK_ON_EPID_ERROR</a>(ret)</td></tr>
+<tr class="memdesc:a5638f861b82f1746ea1af0b384ef8ff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle Intel(R) EPID Error with Break. <a href="#a5638f861b82f1746ea1af0b384ef8ff1">More...</a><br /></td></tr>
+<tr class="separator:a5638f861b82f1746ea1af0b384ef8ff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gac2507260f635a9c7abd9113cda6918f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">Tpm2LoadExternal</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f_str)</td></tr>
+<tr class="memdesc:gac2507260f635a9c7abd9113cda6918f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invokes TPM2_LoadExternal command. <a href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">More...</a><br /></td></tr>
+<tr class="separator:gac2507260f635a9c7abd9113cda6918f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM2_LoadExternal command implementation. </p>
+</div><h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="a5638f861b82f1746ea1af0b384ef8ff1"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define BREAK_ON_EPID_ERROR</td>
+ <td>(</td>
+ <td class="paramtype">&#160;</td>
+ <td class="paramname">ret</td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != (ret)) { \</div><div class="line"> break; \</div><div class="line"> }</div><div class="ttc" id="group___error_codes_html_ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9"><div class="ttname"><a href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a></div><div class="ttdoc">no error </div><div class="ttdef"><b>Definition:</b> errors.h:41</div></div>
+</div><!-- fragment -->
+<p>Handle Intel(R) EPID Error with Break. </p>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="load__external_8c.html">load_external.c</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/init_8h.html b/doc/html/load__external_8h.html
index 9de3ced..c52acb7 100644
--- a/doc/html/init_8h.html
+++ b/doc/html/load__external_8h.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm/init.h File Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/load_external.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,36 +53,37 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('init_8h.html','');});
+$(document).ready(function(){initNavTree('load__external_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
-<div class="title">init.h File Reference</div> </div>
+<div class="title">load_external.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
-<p>Non-sensitive member context APIs.
+<p>SDK TPM API.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
-<tr class="memitem:ga5e62323b94837b847f3e869cf2ff3615"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615">TpmInit</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *A_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *x_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *h1_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *h2_str, <a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *w_str, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp_str)</td></tr>
-<tr class="memdesc:ga5e62323b94837b847f3e869cf2ff3615"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes Tpm with non-sensitive parameters. <a href="group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615">More...</a><br /></td></tr>
-<tr class="separator:ga5e62323b94837b847f3e869cf2ff3615"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac2507260f635a9c7abd9113cda6918f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">Tpm2LoadExternal</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f_str)</td></tr>
+<tr class="memdesc:gac2507260f635a9c7abd9113cda6918f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invokes TPM2_LoadExternal command. <a href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">More...</a><br /></td></tr>
+<tr class="separator:gac2507260f635a9c7abd9113cda6918f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Non-sensitive member context APIs. </p>
+<div class="textblock"><p>SDK TPM API. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li><li class="navelem"><a class="el" href="init_8h.html">init.h</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="load__external_8h.html">load_external.h</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/mainpage_8dox.html b/doc/html/mainpage_8dox.html
index b187da9..4572fd4 100644
--- a/doc/html/mainpage_8dox.html
+++ b/doc/html/mainpage_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/member_2api_8h.html b/doc/html/member_2api_8h.html
index bcce81e..eafeb00 100644
--- a/doc/html/member_2api_8h.html
+++ b/doc/html/member_2api_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -68,62 +68,61 @@ $(document).ready(function(){initNavTree('member_2api_8h.html','');});
<p>Intel(R) EPID SDK member API.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
-<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="bitsupplier_8h.html">epid/common/bitsupplier.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
-<tr class="memitem:gadfb10d5dfdadb0694792c7b06718e817"><td class="memItemLeft" align="right" valign="top">
-typedef struct <a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a></td></tr>
-<tr class="memdesc:gadfb10d5dfdadb0694792c7b06718e817"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal context of member. <br /></td></tr>
-<tr class="separator:gadfb10d5dfdadb0694792c7b06718e817"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:adfb10d5dfdadb0694792c7b06718e817"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adfb10d5dfdadb0694792c7b06718e817"></a>
+typedef struct <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a></td></tr>
+<tr class="memdesc:adfb10d5dfdadb0694792c7b06718e817"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal context of member. <br /></td></tr>
+<tr class="separator:adfb10d5dfdadb0694792c7b06718e817"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
-<tr class="memitem:ga561c4d544a78ee1bf59c3f4f919aa7bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb">EpidMemberCreate</a> (<a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_priv_key.html">PrivKey</a> const *priv_key, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param, <a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **ctx)</td></tr>
-<tr class="memdesc:ga561c4d544a78ee1bf59c3f4f919aa7bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new member context. <a href="group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb">More...</a><br /></td></tr>
-<tr class="separator:ga561c4d544a78ee1bf59c3f4f919aa7bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga3824589c683c5e0e59d483462fce65d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">EpidMemberDelete</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **ctx)</td></tr>
+<tr class="memitem:gae7a7b01bc0a84c44c9d14e6c311c1ba7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7">EpidMemberCreate</a> (<a class="el" href="struct_member_params.html">MemberParams</a> const *params, <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **ctx)</td></tr>
+<tr class="memdesc:gae7a7b01bc0a84c44c9d14e6c311c1ba7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new member context. <a href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7">More...</a><br /></td></tr>
+<tr class="separator:gae7a7b01bc0a84c44c9d14e6c311c1ba7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac10008d8c9ba7bc5e5be899ed03c61c3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3">EpidCreateJoinRequest</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="group___epid_types.html#ga55eb2193045bde31af3f551565126042">IssuerNonce</a> const *ni, <a class="el" href="struct_join_request.html">JoinRequest</a> *join_request)</td></tr>
+<tr class="memdesc:gac10008d8c9ba7bc5e5be899ed03c61c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a request to join a group. <a href="group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3">More...</a><br /></td></tr>
+<tr class="separator:gac10008d8c9ba7bc5e5be899ed03c61c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga788ebc9d1ba6153c637b762484ca1140"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140">EpidProvisionCredential</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_membership_credential.html">MembershipCredential</a> const *credential, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp_str)</td></tr>
+<tr class="memdesc:ga788ebc9d1ba6153c637b762484ca1140"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions a member context from a membership credential. <a href="group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140">More...</a><br /></td></tr>
+<tr class="separator:ga788ebc9d1ba6153c637b762484ca1140"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga76cddb8e20afc43de2c30d5e4addb2ea"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga76cddb8e20afc43de2c30d5e4addb2ea">EpidProvisionCompressed</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_compressed_priv_key.html">CompressedPrivKey</a> const *compressed_privkey, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp_str)</td></tr>
+<tr class="memdesc:ga76cddb8e20afc43de2c30d5e4addb2ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions a member context from a compressed private key. <a href="group___epid_member_module.html#ga76cddb8e20afc43de2c30d5e4addb2ea">More...</a><br /></td></tr>
+<tr class="separator:ga76cddb8e20afc43de2c30d5e4addb2ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga07094399c1e040b95ae3e58a74e7c302"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302">EpidProvisionKey</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_priv_key.html">PrivKey</a> const *priv_key, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> const *precomp_str)</td></tr>
+<tr class="memdesc:ga07094399c1e040b95ae3e58a74e7c302"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provisions a member context from a private key. <a href="group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302">More...</a><br /></td></tr>
+<tr class="separator:ga07094399c1e040b95ae3e58a74e7c302"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gaa2c85b1f0ea17a11ac5d297b21aa30f6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6">EpidMemberStartup</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx)</td></tr>
+<tr class="memdesc:gaa2c85b1f0ea17a11ac5d297b21aa30f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change member from setup state to normal operation. <a href="group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6">More...</a><br /></td></tr>
+<tr class="separator:gaa2c85b1f0ea17a11ac5d297b21aa30f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga3824589c683c5e0e59d483462fce65d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">EpidMemberDelete</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> **ctx)</td></tr>
<tr class="memdesc:ga3824589c683c5e0e59d483462fce65d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deletes an existing member context. <a href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">More...</a><br /></td></tr>
<tr class="separator:ga3824589c683c5e0e59d483462fce65d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga5c35798d62cf81c4ca62b22c38809721"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721">EpidMemberWritePrecomp</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, <a class="el" href="struct_member_precomp.html">MemberPrecomp</a> *precomp)</td></tr>
-<tr class="memdesc:ga5c35798d62cf81c4ca62b22c38809721"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serializes the pre-computed member settings. <a href="group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721">More...</a><br /></td></tr>
-<tr class="separator:ga5c35798d62cf81c4ca62b22c38809721"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga9998eb454838ff5d232ff22ecbab31bf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">EpidMemberSetHashAlg</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
+<tr class="memitem:ga9998eb454838ff5d232ff22ecbab31bf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">EpidMemberSetHashAlg</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr>
<tr class="memdesc:ga9998eb454838ff5d232ff22ecbab31bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the hash algorithm to be used by a member. <a href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">More...</a><br /></td></tr>
<tr class="separator:ga9998eb454838ff5d232ff22ecbab31bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaaae6f21f58c22fce58076f10d68159f4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">EpidMemberSetSigRl</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_sig_rl.html">SigRl</a> const *sig_rl, size_t sig_rl_size)</td></tr>
+<tr class="memitem:gaaae6f21f58c22fce58076f10d68159f4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">EpidMemberSetSigRl</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, <a class="el" href="struct_sig_rl.html">SigRl</a> const *sig_rl, size_t sig_rl_size)</td></tr>
<tr class="memdesc:gaaae6f21f58c22fce58076f10d68159f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the signature based revocation list to be used by a member. <a href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">More...</a><br /></td></tr>
<tr class="separator:gaaae6f21f58c22fce58076f10d68159f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga76e535722467af7c16809b5b521e0000"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000">EpidGetSigSize</a> (<a class="el" href="struct_sig_rl.html">SigRl</a> const *sig_rl)</td></tr>
<tr class="memdesc:ga76e535722467af7c16809b5b521e0000"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the size in bytes required for an Intel(R) EPID signature. <a href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000">More...</a><br /></td></tr>
<tr class="separator:ga76e535722467af7c16809b5b521e0000"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga74d1409a816cb52633564b793072da5f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">EpidSign</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, void const *msg, size_t msg_len, void const *basename, size_t basename_len, <a class="el" href="struct_epid_signature.html">EpidSignature</a> *sig, size_t sig_len)</td></tr>
+<tr class="memitem:ga74d1409a816cb52633564b793072da5f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">EpidSign</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, void const *msg, size_t msg_len, void const *basename, size_t basename_len, <a class="el" href="struct_epid_signature.html">EpidSignature</a> *sig, size_t sig_len)</td></tr>
<tr class="memdesc:ga74d1409a816cb52633564b793072da5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes an Intel(R) EPID signature. <a href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">More...</a><br /></td></tr>
<tr class="separator:ga74d1409a816cb52633564b793072da5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gad92d3c3266ae1833ffb1dba9ad76035d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d">EpidRegisterBaseName</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, void const *basename, size_t basename_len)</td></tr>
+<tr class="memitem:gad92d3c3266ae1833ffb1dba9ad76035d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d">EpidRegisterBaseName</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, void const *basename, size_t basename_len)</td></tr>
<tr class="memdesc:gad92d3c3266ae1833ffb1dba9ad76035d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a basename with a member. <a href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d">More...</a><br /></td></tr>
<tr class="separator:gad92d3c3266ae1833ffb1dba9ad76035d"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gacb0547ec085a9ed324d323416bce4a78"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78">EpidAddPreSigs</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, size_t number_presigs)</td></tr>
+<tr class="memitem:gacb0547ec085a9ed324d323416bce4a78"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78">EpidAddPreSigs</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx, size_t number_presigs)</td></tr>
<tr class="memdesc:gacb0547ec085a9ed324d323416bce4a78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extends the member's pool of pre-computed signatures. <a href="group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78">More...</a><br /></td></tr>
<tr class="separator:gacb0547ec085a9ed324d323416bce4a78"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gad78ca056dfea2565bbacd5734d9dc075"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075">EpidGetNumPreSigs</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx)</td></tr>
+<tr class="memitem:gad78ca056dfea2565bbacd5734d9dc075"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075">EpidGetNumPreSigs</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx)</td></tr>
<tr class="memdesc:gad78ca056dfea2565bbacd5734d9dc075"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the number of pre-computed signatures in the member's pool. <a href="group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075">More...</a><br /></td></tr>
<tr class="separator:gad78ca056dfea2565bbacd5734d9dc075"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga13dd0d72be9babf8194d472d7712a361"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga13dd0d72be9babf8194d472d7712a361">EpidRequestJoin</a> (<a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="group___epid_types.html#ga55eb2193045bde31af3f551565126042">IssuerNonce</a> const *ni, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg, <a class="el" href="struct_join_request.html">JoinRequest</a> *join_request)</td></tr>
-<tr class="memdesc:ga13dd0d72be9babf8194d472d7712a361"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a request to join a group. <a href="group___epid_member_module.html#ga13dd0d72be9babf8194d472d7712a361">More...</a><br /></td></tr>
-<tr class="separator:ga13dd0d72be9babf8194d472d7712a361"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gae04a250d5981fcf9bd6f9f57e0468faa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa">EpidSignBasic</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, void const *msg, size_t msg_len, void const *basename, size_t basename_len, <a class="el" href="struct_basic_signature.html">BasicSignature</a> *sig)</td></tr>
-<tr class="memdesc:gae04a250d5981fcf9bd6f9f57e0468faa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a basic signature for use in constrained environment. <a href="group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa">More...</a><br /></td></tr>
-<tr class="separator:gae04a250d5981fcf9bd6f9f57e0468faa"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gac8e2c6c1fead8030785a40427905a2cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc">EpidNrProve</a> (<a class="el" href="group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> const *ctx, void const *msg, size_t msg_len, <a class="el" href="struct_basic_signature.html">BasicSignature</a> const *sig, <a class="el" href="struct_sig_rl_entry.html">SigRlEntry</a> const *sigrl_entry, <a class="el" href="struct_nr_proof.html">NrProof</a> *proof)</td></tr>
-<tr class="memdesc:gac8e2c6c1fead8030785a40427905a2cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates a non-revoked proof for a single signature based revocation list entry. <a href="group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc">More...</a><br /></td></tr>
-<tr class="separator:gac8e2c6c1fead8030785a40427905a2cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga4ccaa8337931523c77567f5b846ef188"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga4ccaa8337931523c77567f5b846ef188">EpidAssemblePrivKey</a> (<a class="el" href="struct_membership_credential.html">MembershipCredential</a> const *credential, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f, <a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_priv_key.html">PrivKey</a> *priv_key)</td></tr>
-<tr class="memdesc:ga4ccaa8337931523c77567f5b846ef188"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assembles member private key from membership credential and f value. <a href="group___epid_member_module.html#ga4ccaa8337931523c77567f5b846ef188">More...</a><br /></td></tr>
-<tr class="separator:ga4ccaa8337931523c77567f5b846ef188"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8cd05388f017486f14da2ee48d067ef"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef">EpidDecompressPrivKey</a> (<a class="el" href="struct_group_pub_key.html">GroupPubKey</a> const *pub_key, <a class="el" href="struct_compressed_priv_key.html">CompressedPrivKey</a> const *compressed_privkey, <a class="el" href="struct_priv_key.html">PrivKey</a> *priv_key)</td></tr>
<tr class="memdesc:gaf8cd05388f017486f14da2ee48d067ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompresses compressed member private key. <a href="group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef">More...</a><br /></td></tr>
<tr class="separator:gaf8cd05388f017486f14da2ee48d067ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
diff --git a/doc/html/member_host.png b/doc/html/member_host.png
new file mode 100644
index 0000000..f42006d
--- /dev/null
+++ b/doc/html/member_host.png
Binary files differ
diff --git a/doc/html/member_private_key.png b/doc/html/member_private_key.png
new file mode 100644
index 0000000..0e8d3cf
--- /dev/null
+++ b/doc/html/member_private_key.png
Binary files differ
diff --git a/doc/html/modules.html b/doc/html/modules.html
index 7432849..98654ab 100644
--- a/doc/html/modules.html
+++ b/doc/html/modules.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -63,7 +63,7 @@ $(document).ready(function(){initNavTree('modules.html','');});
<div class="contents">
<div class="textblock">Here is a list of all modules:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span><span onclick="javascript:toggleLevel(4);">4</span><span onclick="javascript:toggleLevel(5);">5</span>]</div><table class="directory">
-<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><a class="el" href="group___epid_module.html" target="_self">epid</a></td><td class="desc">Core Intel&reg; EPID functionality </td></tr>
+<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><a class="el" href="group___epid_module.html" target="_self">epid&nbsp;</a></td><td class="desc">Core Intel&reg; EPID functionality </td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_0_" class="arrow" onclick="toggleFolder('0_0_')">&#9660;</span><a class="el" href="group___epid_common.html" target="_self">common</a></td><td class="desc">Common code shared between core sub-components </td></tr>
<tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_0_" class="arrow" onclick="toggleFolder('0_0_0_')">&#9660;</span><a class="el" href="group___epid_math.html" target="_self">math</a></td><td class="desc">Math Primitives and Group Operations </td></tr>
<tr id="row_0_0_0_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a class="el" href="group___big_num_primitives.html" target="_self">bignum</a></td><td class="desc">Big number operations </td></tr>
@@ -72,17 +72,17 @@ $(document).ready(function(){initNavTree('modules.html','');});
<tr id="row_0_0_0_3_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a class="el" href="group___finite_field_primitives.html" target="_self">finitefield</a></td><td class="desc">Finite field operations </td></tr>
<tr id="row_0_0_0_4_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a class="el" href="group___hash_primitives.html" target="_self">hash</a></td><td class="desc">Hash primitives </td></tr>
<tr id="row_0_0_0_5_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span id="arr_0_0_0_5_" class="arrow" onclick="toggleFolder('0_0_0_5_')">&#9660;</span><a class="el" href="group___pairing_primitives.html" target="_self">pairing</a></td><td class="desc">Pairing operations </td></tr>
-<tr id="row_0_0_0_5_0_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><a class="el" href="group___epid11_pairing_primitives.html" target="_self">EPID 1.1 specific pairing</a></td><td class="desc">EPID 1.1 pairing operations </td></tr>
+<tr id="row_0_0_0_5_0_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><a class="el" href="group___epid11_pairing_primitives.html" target="_self">Intel(R) EPID 1.1 specific pairing</a></td><td class="desc">Intel(R) EPID 1.1 pairing operations </td></tr>
<tr id="row_0_0_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a class="el" href="group___error_codes.html" target="_self">errors</a></td><td class="desc">Error reporting interface </td></tr>
<tr id="row_0_0_2_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_2_" class="arrow" onclick="toggleFolder('0_0_2_')">&#9660;</span><a class="el" href="group___file_parser.html" target="_self">fileparser</a></td><td class="desc">Parser for issuer material </td></tr>
-<tr id="row_0_0_2_0_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a class="el" href="group___epid11_file_parser_module.html" target="_self">EPID 1.1 support</a></td><td class="desc">Parser for 1.1 issuer material </td></tr>
+<tr id="row_0_0_2_0_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a class="el" href="group___epid11_file_parser_module.html" target="_self">Intel(R) EPID 1.1 support</a></td><td class="desc">Parser for 1.1 issuer material </td></tr>
<tr id="row_0_0_3_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a class="el" href="group___epid_print.html" target="_self">print_utils</a></td><td class="desc">Debug print routines </td></tr>
<tr id="row_0_0_4_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_0_4_" class="arrow" onclick="toggleFolder('0_0_4_')">&#9660;</span><a class="el" href="group___epid_types.html" target="_self">types</a></td><td class="desc">SDK data types </td></tr>
-<tr id="row_0_0_4_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a class="el" href="group___epid11_types.html" target="_self">EPID 1.1 specific types</a></td><td class="desc">Intel(R) EPID 1.1 specific data types </td></tr>
+<tr id="row_0_0_4_0_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><a class="el" href="group___epid11_types.html" target="_self">Intel(R) EPID 1.1 specific types</a></td><td class="desc">Intel(R) EPID 1.1 specific data types </td></tr>
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_1_" class="arrow" onclick="toggleFolder('0_1_')">&#9660;</span><a class="el" href="group___epid_member_module.html" target="_self">member</a></td><td class="desc">Member functionality </td></tr>
-<tr id="row_0_1_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a class="el" href="group___tpm_module.html" target="_self">tpm</a></td><td class="desc">Internal interface that models sensitive member functionality </td></tr>
+<tr id="row_0_1_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a class="el" href="group___tpm2_module.html" target="_self">tpm2</a></td><td class="desc">Internal interface that models TPM 2.0 interfaces </td></tr>
<tr id="row_0_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_2_" class="arrow" onclick="toggleFolder('0_2_')">&#9660;</span><a class="el" href="group___epid_verifier_module.html" target="_self">verifier</a></td><td class="desc">Verifier functionality </td></tr>
-<tr id="row_0_2_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a class="el" href="group___epid11_verifier_module.html" target="_self">EPID 1.1 support</a></td><td class="desc">Intel(R) EPID 1.1 Verifier functionality </td></tr>
+<tr id="row_0_2_0_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><a class="el" href="group___epid11_verifier_module.html" target="_self">Intel(R) EPID 1.1 support</a></td><td class="desc">Intel(R) EPID 1.1 Verifier functionality </td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
diff --git a/doc/html/modules.js b/doc/html/modules.js
index ed32d66..885d249 100644
--- a/doc/html/modules.js
+++ b/doc/html/modules.js
@@ -1,4 +1,4 @@
var modules =
[
- [ "epid", "group___epid_module.html", "group___epid_module" ]
+ [ "epid ", "group___epid_module.html", "group___epid_module" ]
]; \ No newline at end of file
diff --git a/doc/html/navtreedata.js b/doc/html/navtreedata.js
index 5822c41..51e30e3 100644
--- a/doc/html/navtreedata.js
+++ b/doc/html/navtreedata.js
@@ -13,17 +13,22 @@ var NAVTREE =
[ "Members", "EpidOverview.html#EpidOverview_Members", null ],
[ "Verifiers", "EpidOverview.html#EpidOverview_Verifiers", null ]
] ],
+ [ "Member and Verifier Interaction", "EpidOverview.html#EpidOverview_Entity_interaction", null ],
[ "Groups", "EpidOverview.html#EpidOverview_Groups", null ],
[ "Keys", "EpidOverview.html#EpidOverview_Keys", [
[ "Group Public Key", "EpidOverview.html#EpidOverview_Group_public_key", null ],
[ "Issuing Private Key", "EpidOverview.html#EpidOverview_Issuing_private_key", null ],
[ "Member Private Key", "EpidOverview.html#EpidOverview_Member_private_key", null ]
- ] ],
- [ "Member and Verifier Interaction", "EpidOverview.html#EpidOverview_Entity_interaction", null ]
+ ] ]
] ],
[ "What's Included in the SDK", "SdkOverview.html", [
[ "SDK Components", "SdkOverview.html#SdkOverview_Components", null ],
- [ "Filesystem Layout", "SdkOverview.html#SdkOverview_Files", [
+ [ "SDK Core", "SdkOverview.html#SdkOverview_Core", null ],
+ [ "Samples", "SdkOverview.html#SdkOverview_Samples", null ],
+ [ "Tools", "SdkOverview.html#SdkOverview_Tools", null ],
+ [ "Building and Validation", "SdkOverview.html#SdkOverview_BuildingAndValidation", null ],
+ [ "Intel® EPID 1.1 Compatibility", "SdkOverview.html#SdkOverview_Compatibility", null ],
+ [ "Folder Layout", "SdkOverview.html#SdkOverview_Files", [
[ "Source Layout", "SdkOverview.html#SdkOverview_Files_SourceLayout", null ],
[ "Install Layout", "SdkOverview.html#SdkOverview_Files_InstallLayout", null ]
] ]
@@ -58,27 +63,30 @@ var NAVTREE =
[ "Detecting Revoked Member from Signature Based Revocation List", "SignVerifyTutorial.html#SignVerifyTutorial_SigRevocation", null ]
] ]
] ],
- [ "Sample Issuer Material", "IssuerMaterial.html", [
- [ "Sample Groups", "IssuerMaterial.html#IssuerMaterial_Groups", [
- [ "Sample Group A", "IssuerMaterial.html#IssuerMaterial_Groups_groupa", null ],
- [ "Sample Group B", "IssuerMaterial.html#IssuerMaterial_Groups_groupb", null ]
- ] ],
- [ "Group Based Revocation Lists", "IssuerMaterial.html#IssuerMaterial_GroupRls", null ],
- [ "Compressed Sample Groups", "IssuerMaterial.html#IssuerMaterial_CmpGroups", [
- [ "Compressed Sample Group A", "IssuerMaterial.html#IssuerMaterial_CmpGroups_groupa", null ],
- [ "Compressed Sample Group B", "IssuerMaterial.html#IssuerMaterial_CmpGroups_groupb", null ]
- ] ],
- [ "Compressed Group Based Revocation Lists", "IssuerMaterial.html#IssuerMaterial_CmpGroupRls", null ]
+ [ "Preparing a Device", "Provisioning.html", [
+ [ "Bulk Provisioning", "Provisioning.html#Provisioning_BulkProvisioning", null ],
+ [ "Dynamic Provisioning", "Provisioning.html#Provisioning_JoinProvisioning", null ],
+ [ "Issuer Material", "Provisioning.html#SampleIssuerMaterial", [
+ [ "Issuer Material for Verifiers", "Provisioning.html#Provisioning_ValidatingVerifiers", null ],
+ [ "Issuer Material for Members", "Provisioning.html#Provisioning_ValidatingMembers", null ]
+ ] ]
] ],
- [ "If You Choose iKGF as Your Issuer", "ChoosingiKGF.html", [
- [ "Tools for Creating Revocation Requests", "ChoosingiKGF.html#RevocationTools", [
- [ "Requesting Group Revocation", "ChoosingiKGF.html#RevocationTools_revokegrp", null ],
- [ "Requesting Private Key Revocation", "ChoosingiKGF.html#RevocationTools_revokekey", null ],
- [ "Requesting Signature Revocation", "ChoosingiKGF.html#RevocationTools_revokesig", null ]
+ [ "Test Data", "IssuerMaterial.html", [
+ [ "Sample Groups", "IssuerMaterial.html#IssuerMaterial_Groups", null ],
+ [ "Group Revocation Lists", "IssuerMaterial.html#IssuerMaterial_GroupRls", null ],
+ [ "Compressed Sample Groups", "IssuerMaterial.html#CompressedSamples", null ],
+ [ "Compressed Group Revocation Lists", "IssuerMaterial.html#IssuerMaterial_CmpGroupRls", null ]
+ ] ],
+ [ "Managing Groups with iKGF", "UsingiKGF.html", [
+ [ "Contacting iKGF", "UsingiKGF.html#ContactingiKGF", null ],
+ [ "Tools for Creating Revocation Requests", "UsingiKGF.html#RevocationTools", [
+ [ "Requesting Group Revocation", "UsingiKGF.html#RevocationTools_revokegrp", null ],
+ [ "Requesting Private Key Revocation", "UsingiKGF.html#RevocationTools_revokekey", null ],
+ [ "Requesting Signature Revocation", "UsingiKGF.html#RevocationTools_revokesig", null ]
] ],
- [ "Tools for Extracting Keys from iKGF Files", "ChoosingiKGF.html#ExtractionTools", [
- [ "Extracting Group Public Keys", "ChoosingiKGF.html#ExtractionTools_extractgrps", null ],
- [ "Extracting Member Private Keys", "ChoosingiKGF.html#ExtractionTools_extractkeys", null ]
+ [ "Tools for Extracting Keys from iKGF Files", "UsingiKGF.html#ExtractionTools", [
+ [ "Extracting Group Public Keys", "UsingiKGF.html#ExtractionTools_extractgrps", null ],
+ [ "Extracting Member Private Keys", "UsingiKGF.html#ExtractionTools_extractkeys", null ]
] ]
] ],
[ "In-Depth Explanation of Revocation", "Revocation.html", [
@@ -109,6 +117,20 @@ var NAVTREE =
[ "Octstring/Buffer Types", "ImplementationNotes.html#ImplementationNotes_SerializedTypes", null ],
[ "Flexible Arrays", "ImplementationNotes.html#ImplementationNotes_FlexibleArrays", null ]
] ],
+ [ "Considerations for TPM", "TpmConsiderations.html", [
+ [ "Compatibility", "TpmConsiderations.html#TPM_compatibility", null ],
+ [ "Considerations for TPM Manufacturers", "TpmConsiderations.html#TpmConsiderations_Manufacturers", [
+ [ "Provisioning TPM with Intel® EPID Key Material", "TpmConsiderations.html#TPM_provisioning", null ],
+ [ "Mapping TPM Commands to Intel® EPID", "TpmConsiderations.html#TpmConsiderations_Mapping", null ]
+ ] ],
+ [ "Considerations for TPM Applications", "TpmConsiderations.html#TpmConsiderations_Applications", null ],
+ [ "SDK Member Architecture", "TpmConsiderations.html#TpmConsiderations_Architecture", null ],
+ [ "Building the SDK to Take Advantage of TPM", "TpmConsiderations.html#TpmConsiderations_Building", [
+ [ "Prerequisites to Build the SDK in TPM Mode", "TpmConsiderations.html#TpmConsiderations_Prereqs", null ],
+ [ "Building the SDK in TPM Mode", "TpmConsiderations.html#TpmConsiderations_BuildingTpmMode", null ],
+ [ "Intel® EPID Signing and Verification", "TpmConsiderations.html#TpmConsiderations_Signing", null ]
+ ] ]
+ ] ],
[ "Glossary", "Glossary.html", [
[ "CA public key", "Glossary.html#Issuing_CA", null ],
[ "DAA", "Glossary.html#Glossary_Daa", null ],
@@ -145,8 +167,8 @@ var NAVTREE =
var NAVTREEINDEX =
[
"Basenames.html",
-"group___epid_verifier_module.html#gaeb05e6faea6f09c0665b13adc6e7ddea",
-"struct_group_rl.html"
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890aefb89989305b5c34120b0f18ee8e2c5d",
+"struct_fq3_elem_str.html#af1be0a4d5c9c674d75bec34f95e3c731"
];
var SYNCONMSG = 'click to disable panel synchronisation';
diff --git a/doc/html/navtreeindex0.js b/doc/html/navtreeindex0.js
index 62b20a2..3f8ec0c 100644
--- a/doc/html/navtreeindex0.js
+++ b/doc/html/navtreeindex0.js
@@ -1,12 +1,12 @@
var NAVTREEINDEX0 =
{
-"Basenames.html":[11],
-"Basenames.html#name_based":[11,1],
-"Basenames.html#random_base":[11,0],
-"BuildToolsInstallation.html":[14],
-"BuildToolsInstallation.html#build_tools_windows_parts":[14,2],
-"BuildToolsInstallation.html#build_tools_windows_python":[14,0],
-"BuildToolsInstallation.html#build_tools_windows_scons":[14,1],
+"Basenames.html":[12],
+"Basenames.html#name_based":[12,1],
+"Basenames.html#random_base":[12,0],
+"BuildToolsInstallation.html":[16],
+"BuildToolsInstallation.html#build_tools_windows_parts":[16,2],
+"BuildToolsInstallation.html#build_tools_windows_python":[16,0],
+"BuildToolsInstallation.html#build_tools_windows_scons":[16,1],
"BuildingSdk.html":[6],
"BuildingSdk.html#BuildingSdk_Building_Makefile":[6,2],
"BuildingSdk.html#BuildingSdk_Building_SCons":[6,1],
@@ -16,80 +16,79 @@ var NAVTREEINDEX0 =
"BuildingSdk.html#BuildingSdk_Prerequisites":[6,0],
"BuildingSdk.html#BuildingSdk_SizeOptimizedBuild":[6,4],
"ChangeLog.html":[3],
-"ChoosingiKGF.html":[9],
-"ChoosingiKGF.html#ExtractionTools":[9,1],
-"ChoosingiKGF.html#ExtractionTools_extractgrps":[9,1,0],
-"ChoosingiKGF.html#ExtractionTools_extractkeys":[9,1,1],
-"ChoosingiKGF.html#RevocationTools":[9,0],
-"ChoosingiKGF.html#RevocationTools_revokegrp":[9,0,0],
-"ChoosingiKGF.html#RevocationTools_revokekey":[9,0,1],
-"ChoosingiKGF.html#RevocationTools_revokesig":[9,0,2],
"EpidOverview.html":[4],
-"EpidOverview.html#EpidOverview_Entity_interaction":[4,3],
-"EpidOverview.html#EpidOverview_Group_public_key":[4,2,0],
-"EpidOverview.html#EpidOverview_Groups":[4,1],
+"EpidOverview.html#EpidOverview_Entity_interaction":[4,1],
+"EpidOverview.html#EpidOverview_Group_public_key":[4,3,0],
+"EpidOverview.html#EpidOverview_Groups":[4,2],
"EpidOverview.html#EpidOverview_Issuers":[4,0,0],
-"EpidOverview.html#EpidOverview_Issuing_private_key":[4,2,1],
-"EpidOverview.html#EpidOverview_Keys":[4,2],
-"EpidOverview.html#EpidOverview_Member_private_key":[4,2,2],
+"EpidOverview.html#EpidOverview_Issuing_private_key":[4,3,1],
+"EpidOverview.html#EpidOverview_Keys":[4,3],
+"EpidOverview.html#EpidOverview_Member_private_key":[4,3,2],
"EpidOverview.html#EpidOverview_Members":[4,0,1],
"EpidOverview.html#EpidOverview_Roles":[4,0],
"EpidOverview.html#EpidOverview_Verifiers":[4,0,2],
-"Examples.html":[16],
-"Glossary.html":[13],
-"Glossary.html#Glossary_Daa":[13,1],
-"Glossary.html#Glossary_EllipticCurve":[13,2],
-"Glossary.html#Glossary_EllipticCurvePoint":[13,3],
-"Glossary.html#Glossary_Epid":[13,7],
-"Glossary.html#Glossary_EpidSignature":[13,8],
-"Glossary.html#Glossary_Group":[13,4],
-"Glossary.html#Glossary_GroupPublicKey":[13,6],
-"Glossary.html#Glossary_Group_certificate":[13,5],
-"Glossary.html#Glossary_Issuer":[13,9],
-"Glossary.html#Glossary_IssuingPrivateKey":[13,10],
-"Glossary.html#Glossary_Member":[13,11],
-"Glossary.html#Glossary_MemberPrivateKey":[13,13],
-"Glossary.html#Glossary_NameBasedSignature":[13,12],
-"Glossary.html#Glossary_NonRevokedProof":[13,14],
-"Glossary.html#Glossary_Pairing":[13,15],
-"Glossary.html#Glossary_Revocation":[13,16],
-"Glossary.html#Glossary_Verifier":[13,17],
-"Glossary.html#Issuing_CA":[13,0],
-"HowValidated.html":[15],
-"HowValidated.html#validated_supported_compilers":[15,0],
-"ImplementationNotes.html":[12],
-"ImplementationNotes.html#ImplementationNotes_FlexibleArrays":[12,4],
-"ImplementationNotes.html#ImplementationNotes_MathPrimitives":[12,2],
-"ImplementationNotes.html#ImplementationNotes_Prng":[12,0],
-"ImplementationNotes.html#ImplementationNotes_ProtectingSecrets":[12,1],
-"ImplementationNotes.html#ImplementationNotes_SerializedTypes":[12,3],
-"IssuerMaterial.html":[8],
-"IssuerMaterial.html#IssuerMaterial_CmpGroupRls":[8,3],
-"IssuerMaterial.html#IssuerMaterial_CmpGroups":[8,2],
-"IssuerMaterial.html#IssuerMaterial_CmpGroups_groupa":[8,2,0],
-"IssuerMaterial.html#IssuerMaterial_CmpGroups_groupb":[8,2,1],
-"IssuerMaterial.html#IssuerMaterial_GroupRls":[8,1],
-"IssuerMaterial.html#IssuerMaterial_Groups":[8,0],
-"IssuerMaterial.html#IssuerMaterial_Groups_groupa":[8,0,0],
-"IssuerMaterial.html#IssuerMaterial_Groups_groupb":[8,0,1],
+"Examples.html":[18],
+"Glossary.html":[15],
+"Glossary.html#Glossary_Daa":[15,1],
+"Glossary.html#Glossary_EllipticCurve":[15,2],
+"Glossary.html#Glossary_EllipticCurvePoint":[15,3],
+"Glossary.html#Glossary_Epid":[15,7],
+"Glossary.html#Glossary_EpidSignature":[15,8],
+"Glossary.html#Glossary_Group":[15,4],
+"Glossary.html#Glossary_GroupPublicKey":[15,6],
+"Glossary.html#Glossary_Group_certificate":[15,5],
+"Glossary.html#Glossary_Issuer":[15,9],
+"Glossary.html#Glossary_IssuingPrivateKey":[15,10],
+"Glossary.html#Glossary_Member":[15,11],
+"Glossary.html#Glossary_MemberPrivateKey":[15,13],
+"Glossary.html#Glossary_NameBasedSignature":[15,12],
+"Glossary.html#Glossary_NonRevokedProof":[15,14],
+"Glossary.html#Glossary_Pairing":[15,15],
+"Glossary.html#Glossary_Revocation":[15,16],
+"Glossary.html#Glossary_Verifier":[15,17],
+"Glossary.html#Issuing_CA":[15,0],
+"HowValidated.html":[17],
+"HowValidated.html#validated_supported_compilers":[17,0],
+"ImplementationNotes.html":[13],
+"ImplementationNotes.html#ImplementationNotes_FlexibleArrays":[13,4],
+"ImplementationNotes.html#ImplementationNotes_MathPrimitives":[13,2],
+"ImplementationNotes.html#ImplementationNotes_Prng":[13,0],
+"ImplementationNotes.html#ImplementationNotes_ProtectingSecrets":[13,1],
+"ImplementationNotes.html#ImplementationNotes_SerializedTypes":[13,3],
+"IssuerMaterial.html":[9],
+"IssuerMaterial.html#CompressedSamples":[9,2],
+"IssuerMaterial.html#IssuerMaterial_CmpGroupRls":[9,3],
+"IssuerMaterial.html#IssuerMaterial_GroupRls":[9,1],
+"IssuerMaterial.html#IssuerMaterial_Groups":[9,0],
"LegalInformation.html":[2],
-"Revocation.html":[10],
-"Revocation.html#group_revocation":[10,2],
-"Revocation.html#group_revocation_reasons":[10,2,0],
-"Revocation.html#private_key_revocation":[10,3],
-"Revocation.html#private_key_revocation_reasons":[10,3,0],
-"Revocation.html#revocation_hierarchy":[10,0],
-"Revocation.html#revocation_versions":[10,1],
-"Revocation.html#revoked_proofs":[10,4,0],
-"Revocation.html#signature_revocation":[10,4],
-"Revocation.html#signature_revocation_reasons":[10,4,1],
-"Revocation.html#verifier_blacklist":[10,5],
-"Revocation.html#verifier_blacklist_reasons":[10,5,0],
+"Provisioning.html":[8],
+"Provisioning.html#Provisioning_BulkProvisioning":[8,0],
+"Provisioning.html#Provisioning_JoinProvisioning":[8,1],
+"Provisioning.html#Provisioning_ValidatingMembers":[8,2,1],
+"Provisioning.html#Provisioning_ValidatingVerifiers":[8,2,0],
+"Provisioning.html#SampleIssuerMaterial":[8,2],
+"Revocation.html":[11],
+"Revocation.html#group_revocation":[11,2],
+"Revocation.html#group_revocation_reasons":[11,2,0],
+"Revocation.html#private_key_revocation":[11,3],
+"Revocation.html#private_key_revocation_reasons":[11,3,0],
+"Revocation.html#revocation_hierarchy":[11,0],
+"Revocation.html#revocation_versions":[11,1],
+"Revocation.html#revoked_proofs":[11,4,0],
+"Revocation.html#signature_revocation":[11,4],
+"Revocation.html#signature_revocation_reasons":[11,4,1],
+"Revocation.html#verifier_blacklist":[11,5],
+"Revocation.html#verifier_blacklist_reasons":[11,5,0],
"SdkOverview.html":[5],
+"SdkOverview.html#SdkOverview_BuildingAndValidation":[5,4],
+"SdkOverview.html#SdkOverview_Compatibility":[5,5],
"SdkOverview.html#SdkOverview_Components":[5,0],
-"SdkOverview.html#SdkOverview_Files":[5,1],
-"SdkOverview.html#SdkOverview_Files_InstallLayout":[5,1,1],
-"SdkOverview.html#SdkOverview_Files_SourceLayout":[5,1,0],
+"SdkOverview.html#SdkOverview_Core":[5,1],
+"SdkOverview.html#SdkOverview_Files":[5,6],
+"SdkOverview.html#SdkOverview_Files_InstallLayout":[5,6,1],
+"SdkOverview.html#SdkOverview_Files_SourceLayout":[5,6,0],
+"SdkOverview.html#SdkOverview_Samples":[5,2],
+"SdkOverview.html#SdkOverview_Tools":[5,3],
"SignVerifyTutorial.html":[7],
"SignVerifyTutorial.html#SignVerifyTutorial_GroupRevocation":[7,3,0],
"SignVerifyTutorial.html#SignVerifyTutorial_KeyRevocation":[7,3,1],
@@ -106,148 +105,149 @@ var NAVTREEINDEX0 =
"SignVerifyTutorial.html#tutorial_verifyExample":[7,1,1],
"SignVerifyTutorial.html#tutorial_verifyList":[7,1,0],
"SignVerifyTutorial.html#tutorial_verifysigOverview":[7,1],
-"UserManual_GeneratingAnIntelEpidSignature.html":[16,0],
-"UserManual_GeneratingAnIntelEpidSignature.html#signmsgWalkthru_":[16,0,1],
-"UserManual_GeneratingAnIntelEpidSignature.html#signmsgWalktrhu_overview":[16,0,0],
-"UserManual_VerifyingAnIntelEpidSignature.html":[16,1],
-"UserManual_VerifyingAnIntelEpidSignature.html#verifysigWalkthrough_main":[16,1,1],
-"UserManual_VerifyingAnIntelEpidSignature.html#verifysigWalktrhu_overview":[16,1,0],
-"group___big_num_primitives.html":[17,0,0,0,0],
-"group___big_num_primitives.html#ga03c89b8b8dd87de2c0f4b5822145d317":[17,0,0,0,0,6],
-"group___big_num_primitives.html#ga166134085464b0df2c8efcfccf8ec573":[17,0,0,0,0,2],
-"group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718":[17,0,0,0,0,0],
-"group___big_num_primitives.html#ga2d17600068b1d94000635c6644258a03":[17,0,0,0,0,9],
-"group___big_num_primitives.html#ga7dd6038987210d10bf843602fef0c929":[17,0,0,0,0,5],
-"group___big_num_primitives.html#ga904c16cc020e7196f22ac9abdc31b41f":[17,0,0,0,0,12],
-"group___big_num_primitives.html#gabe8e39d5788423f41770a71a4c911fbe":[17,0,0,0,0,11],
-"group___big_num_primitives.html#gacbec9669ab0fe768e2be74dcaca397ea":[17,0,0,0,0,8],
-"group___big_num_primitives.html#gacde6564a814617a96985b379be0dfabb":[17,0,0,0,0,4],
-"group___big_num_primitives.html#gad5f6f262bfd780fed3678bcee16f0aed":[17,0,0,0,0,10],
-"group___big_num_primitives.html#gae70fd9b3026f0ab3c7e9601d0a3186b8":[17,0,0,0,0,1],
-"group___big_num_primitives.html#gaf0366e47226563b17fcbc8e3ed766084":[17,0,0,0,0,3],
-"group___big_num_primitives.html#gafd64b66fc85dab0005f4a1bb67bdf7b4":[17,0,0,0,0,7],
-"group___ec_group_primitives.html":[17,0,0,0,2],
-"group___ec_group_primitives.html#ga01bf8d6fa60a2e445490966b3a06c270":[17,0,0,0,2,4],
-"group___ec_group_primitives.html#ga0b6d7a3398251e9352fb29ef4abef466":[17,0,0,0,2,8],
-"group___ec_group_primitives.html#ga25c9013cc76907d73765eb7a96aa8c96":[17,0,0,0,2,12],
-"group___ec_group_primitives.html#ga3f96c43d14d24de0f7a5e214aef64196":[17,0,0,0,2,5],
-"group___ec_group_primitives.html#ga40e3431d3dbe8cf7a65ada7b7811cba4":[17,0,0,0,2,16],
-"group___ec_group_primitives.html#ga48ec5ae951c9f49d8d7d983234eea921":[17,0,0,0,2,7],
-"group___ec_group_primitives.html#ga6417b0ce72ba96de00c329e322fec7fb":[17,0,0,0,2,19],
-"group___ec_group_primitives.html#ga76d24378455eb96a3257fe8045c0993a":[17,0,0,0,2,14],
-"group___ec_group_primitives.html#ga7a8bdb9782d065bc32fd102e0ae73ccb":[17,0,0,0,2,21],
-"group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa":[17,0,0,0,2,1],
-"group___ec_group_primitives.html#ga8a6114a48214a327d4ec04fd25e5940e":[17,0,0,0,2,11],
-"group___ec_group_primitives.html#ga8cb086d792bffb79b3ca07e6ca4ce0e7":[17,0,0,0,2,3],
-"group___ec_group_primitives.html#ga9cf15b34bc4ff12e58b169dd989d8210":[17,0,0,0,2,10],
-"group___ec_group_primitives.html#gaad96a1498b85d28f71514b8f7b154d82":[17,0,0,0,2,17],
-"group___ec_group_primitives.html#gab647ccc031063807ff3860f51d0f6919":[17,0,0,0,2,6],
-"group___ec_group_primitives.html#gab7af276256c27610eda85ff432b846ea":[17,0,0,0,2,2],
-"group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159":[17,0,0,0,2,0],
-"group___ec_group_primitives.html#gad3b3c63c48fa24e8dea07837b05bc061":[17,0,0,0,2,9],
-"group___ec_group_primitives.html#gad495a9f91b79984f7533c8ea4f92b3cb":[17,0,0,0,2,20],
-"group___ec_group_primitives.html#gae96c38e004ccd2211290ad6e66415ec4":[17,0,0,0,2,13],
-"group___ec_group_primitives.html#gaf3b6a548aa6f0d4f028a14feca251f57":[17,0,0,0,2,15],
-"group___ec_group_primitives.html#gaf4e23677dd378ef2e0cf55df79cbdb62":[17,0,0,0,2,18],
-"group___ecdsa_primitives.html":[17,0,0,0,1],
-"group___ecdsa_primitives.html#ga07e4ebd3423e1f6f9ae35f0608dde7c0":[17,0,0,0,1,1],
-"group___ecdsa_primitives.html#gaef0e8a31e830fe9285b43a0969e6611a":[17,0,0,0,1,0],
-"group___epid11_file_parser_module.html":[17,0,0,2,0],
-"group___epid11_file_parser_module.html#ga1f92d1cb6bd7d9815711fde515b40a4c":[17,0,0,2,0,0],
-"group___epid11_file_parser_module.html#gac3f6daaa5333627d4efe5438c1fe8868":[17,0,0,2,0,3],
-"group___epid11_file_parser_module.html#gae28a844eb68828480b2a76fcb7d252a3":[17,0,0,2,0,1],
-"group___epid11_file_parser_module.html#gae682077d315c39ed298ef198fd738546":[17,0,0,2,0,2],
-"group___epid11_pairing_primitives.html":[17,0,0,0,5,0],
-"group___epid11_pairing_primitives.html#ga0ee658e26e9f933ba2ffbf2504dfae7e":[17,0,0,0,5,0,3],
-"group___epid11_pairing_primitives.html#ga74236e8ebbfc30a7daa7fa1cf1df148b":[17,0,0,0,5,0,0],
-"group___epid11_pairing_primitives.html#gaa3457d6f85889bc714910252fd21c758":[17,0,0,0,5,0,1],
-"group___epid11_pairing_primitives.html#gaa4076dfe25e8e61ac6753333a322c059":[17,0,0,0,5,0,2],
-"group___epid11_types.html":[17,0,0,4,0],
-"group___epid11_types.html#ga7293cec8f937d6f5da42084403f978f1":[17,0,0,4,0,17],
-"group___epid11_types.html#gadff9c05d5b7751024152b40dda545545":[17,0,0,4,0,15],
-"group___epid11_types.html#gaf1f4f1d6f001895abe548cfb33611c23":[17,0,0,4,0,16],
-"group___epid11_verifier_module.html":[17,0,2,0],
-"group___epid11_verifier_module.html#ga0b79c79d09e3551158e1c38c7c335929":[17,0,2,0,3],
-"group___epid11_verifier_module.html#ga0cb6d30df527ee0d8f0a1b68d2b7c0c0":[17,0,2,0,7],
-"group___epid11_verifier_module.html#ga241520cb925e5be89893a2037451cf1c":[17,0,2,0,11],
-"group___epid11_verifier_module.html#ga3a2e320d7de6156b2ce9d73e9cdce813":[17,0,2,0,4],
-"group___epid11_verifier_module.html#ga63cae8d5abcf4d7e3af4157de18998f1":[17,0,2,0,6],
-"group___epid11_verifier_module.html#ga7b5d19277da043c2b79721975d7bd070":[17,0,2,0,13],
-"group___epid11_verifier_module.html#ga809c777908b2f9d029062d9424cb5f65":[17,0,2,0,8],
-"group___epid11_verifier_module.html#gab0b6560b226a37321f5ca5d4fb55eba7":[17,0,2,0,2],
-"group___epid11_verifier_module.html#gabe6a864a06322205ae7536ffea34c702":[17,0,2,0,1],
-"group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8":[17,0,2,0,5],
-"group___epid11_verifier_module.html#gafe5ad6bde38ad0c3e0a9960975fd5216":[17,0,2,0,12],
-"group___epid11_verifier_module.html#gaff5a014b0334be7e8583f0f99cb5e9b8":[17,0,2,0,10],
-"group___epid11_verifier_module.html#gaffbe6ac2bc7236ad65126a17ebdceb14":[17,0,2,0,9],
-"group___epid_common.html":[17,0,0],
-"group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c":[17,0,0,5],
-"group___epid_math.html":[17,0,0,0],
-"group___epid_member_module.html":[17,0,1],
-"group___epid_member_module.html#ga13dd0d72be9babf8194d472d7712a361":[17,0,1,14],
-"group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6":[17,0,1,8],
-"group___epid_member_module.html#ga4ccaa8337931523c77567f5b846ef188":[17,0,1,3],
-"group___epid_member_module.html#ga561c4d544a78ee1bf59c3f4f919aa7bb":[17,0,1,7],
-"group___epid_member_module.html#ga5c35798d62cf81c4ca62b22c38809721":[17,0,1,11],
-"group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f":[17,0,1,15],
-"group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000":[17,0,1,6],
-"group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf":[17,0,1,9],
-"group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4":[17,0,1,10],
-"group___epid_member_module.html#gac8e2c6c1fead8030785a40427905a2cc":[17,0,1,12],
-"group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78":[17,0,1,2],
-"group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075":[17,0,1,5],
-"group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d":[17,0,1,13],
-"group___epid_member_module.html#gadfb10d5dfdadb0694792c7b06718e817":[17,0,1,1],
-"group___epid_member_module.html#gae04a250d5981fcf9bd6f9f57e0468faa":[17,0,1,16],
-"group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef":[17,0,1,4],
-"group___epid_module.html":[17,0],
-"group___epid_print.html":[17,0,0,3],
-"group___epid_print.html#ga0d6377d9c1651d0101ec6b61feaa78ca":[17,0,0,3,3],
-"group___epid_print.html#ga138cd388247a58680d4701d59d6976d2":[17,0,0,3,12],
-"group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83":[17,0,0,3,0],
-"group___epid_print.html#ga3f2961ef6b4c44a6205d422d8a293476":[17,0,0,3,8],
-"group___epid_print.html#ga45a933b44fc1dfe926e3af89c198070a":[17,0,0,3,1],
-"group___epid_print.html#ga5f249c594ed12e4a9b11b7bc101da85d":[17,0,0,3,2],
-"group___epid_print.html#ga6c9fea48fa0477f4a98abb50f891a5e4":[17,0,0,3,9],
-"group___epid_print.html#ga87168a3ce5306f9839b8e8d6c9a5f84f":[17,0,0,3,10],
-"group___epid_print.html#ga883a834ab1703365bb0bca4abd3104de":[17,0,0,3,7],
-"group___epid_print.html#gaa3b1cbbfc6f78562658953113e5798cf":[17,0,0,3,4],
-"group___epid_print.html#gab76a4cf0385dc4a76bb56ee9f0e3e87a":[17,0,0,3,11],
-"group___epid_print.html#gae553c3a156a0e4968b89635ab0757580":[17,0,0,3,5],
-"group___epid_print.html#gaf185fe3df270cd8b4a2969bf3cfc5d5f":[17,0,0,3,6],
-"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83ade23610605d0ba7dd48db5060e28995a":[17,0,0,3,0,2],
-"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83ae2d5345c14f57fc992a613003c3c443d":[17,0,0,3,0,1],
-"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83aeb475b793d8d357087d7fcc74702ffae":[17,0,0,3,0,0],
-"group___epid_types.html":[17,0,0,4],
-"group___epid_types.html#ga3315fb24f4c5783b6d6eb107933390b0":[17,0,0,4,39],
-"group___epid_types.html#ga54bd22670f2e348593db7ab631131d10":[17,0,0,4,40],
-"group___epid_types.html#ga55eb2193045bde31af3f551565126042":[17,0,0,4,38],
-"group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890":[17,0,0,4,42],
-"group___epid_types.html#ga888541b8148df69c634a92c64ed51317":[17,0,0,4,41],
-"group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2":[17,0,0,4,36],
-"group___epid_types.html#gada666b48d0cbc301985405fde896f1de":[17,0,0,4,37],
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a0f4dde6e82b84f5769873f6704fcd290":[17,0,0,4,42,2],
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a4fa16d3867498f5e2f8ae5c94b0fab85":[17,0,0,4,42,5],
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a68b2137c7946583a99f0dac2286523eb":[17,0,0,4,42,0],
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a90d21c8885ab138f7cf91f253dd6ef86":[17,0,0,4,42,6],
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a9746b5049a62bca2f7b844925e6136ba":[17,0,0,4,42,4],
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890ade8e74cf7910b3a71fe902a40abf7eee":[17,0,0,4,42,7],
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890aefb89989305b5c34120b0f18ee8e2c5d":[17,0,0,4,42,1],
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890afb78d98f37fecc53dd1637d94c5c0055":[17,0,0,4,42,3],
-"group___epid_verifier_module.html":[17,0,2],
-"group___epid_verifier_module.html#ga0909703a0a4dfe080374d0d99077465a":[17,0,2,15],
-"group___epid_verifier_module.html#ga1c3810ef361da678a1f77823bd9c37a6":[17,0,2,10],
-"group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70":[17,0,2,8],
-"group___epid_verifier_module.html#ga1d41d6ef4dabbc30ec28452edd6baffb":[17,0,2,11],
-"group___epid_verifier_module.html#ga2a75c7d5775e852a7b6e24178dd4054f":[17,0,2,6],
-"group___epid_verifier_module.html#ga4c7c9820409ee06f30bb8dc75fdd5dcf":[17,0,2,14],
-"group___epid_verifier_module.html#ga6707e691f4b3916f9c684d5bbd463d12":[17,0,2,9],
-"group___epid_verifier_module.html#ga8eaeb9f4a34e9e37ccdf342919f38c69":[17,0,2,4],
-"group___epid_verifier_module.html#ga92df4d00ea4ee59d7bfd35b23da03392":[17,0,2,16],
-"group___epid_verifier_module.html#ga97b58b2382f24756b66a357f1e825c92":[17,0,2,12],
-"group___epid_verifier_module.html#gac3b1f1a2bdba8eeeebbf1e0c8c00862e":[17,0,2,18],
-"group___epid_verifier_module.html#gac6e2fab59e3af8a33a74a5b201642700":[17,0,2,7],
-"group___epid_verifier_module.html#gac857bff47e7d80363eac15285471fe81":[17,0,2,19],
-"group___epid_verifier_module.html#gae3f9c37628e18b880d8bbee3e7f55064":[17,0,2,17],
-"group___epid_verifier_module.html#gae44bd8acbc1e7205aeedff0c7e2632a8":[17,0,2,3]
+"TpmConsiderations.html":[14],
+"TpmConsiderations.html#TPM_compatibility":[14,0],
+"TpmConsiderations.html#TPM_provisioning":[14,1,0],
+"TpmConsiderations.html#TpmConsiderations_Applications":[14,2],
+"TpmConsiderations.html#TpmConsiderations_Architecture":[14,3],
+"TpmConsiderations.html#TpmConsiderations_Building":[14,4],
+"TpmConsiderations.html#TpmConsiderations_BuildingTpmMode":[14,4,1],
+"TpmConsiderations.html#TpmConsiderations_Manufacturers":[14,1],
+"TpmConsiderations.html#TpmConsiderations_Mapping":[14,1,1],
+"TpmConsiderations.html#TpmConsiderations_Prereqs":[14,4,0],
+"TpmConsiderations.html#TpmConsiderations_Signing":[14,4,2],
+"UserManual_GeneratingAnIntelEpidSignature.html":[18,0],
+"UserManual_GeneratingAnIntelEpidSignature.html#signmsgWalkthru_":[18,0,1],
+"UserManual_GeneratingAnIntelEpidSignature.html#signmsgWalktrhu_overview":[18,0,0],
+"UserManual_VerifyingAnIntelEpidSignature.html":[18,1],
+"UserManual_VerifyingAnIntelEpidSignature.html#verifysigWalkthrough_main":[18,1,1],
+"UserManual_VerifyingAnIntelEpidSignature.html#verifysigWalktrhu_overview":[18,1,0],
+"UsingiKGF.html":[10],
+"UsingiKGF.html#ContactingiKGF":[10,0],
+"UsingiKGF.html#ExtractionTools":[10,2],
+"UsingiKGF.html#ExtractionTools_extractgrps":[10,2,0],
+"UsingiKGF.html#ExtractionTools_extractkeys":[10,2,1],
+"UsingiKGF.html#RevocationTools":[10,1],
+"UsingiKGF.html#RevocationTools_revokegrp":[10,1,0],
+"UsingiKGF.html#RevocationTools_revokekey":[10,1,1],
+"UsingiKGF.html#RevocationTools_revokesig":[10,1,2],
+"group___big_num_primitives.html":[19,0,0,0,0],
+"group___big_num_primitives.html#ga03c89b8b8dd87de2c0f4b5822145d317":[19,0,0,0,0,6],
+"group___big_num_primitives.html#ga166134085464b0df2c8efcfccf8ec573":[19,0,0,0,0,2],
+"group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718":[19,0,0,0,0,0],
+"group___big_num_primitives.html#ga2d17600068b1d94000635c6644258a03":[19,0,0,0,0,9],
+"group___big_num_primitives.html#ga7dd6038987210d10bf843602fef0c929":[19,0,0,0,0,5],
+"group___big_num_primitives.html#ga904c16cc020e7196f22ac9abdc31b41f":[19,0,0,0,0,12],
+"group___big_num_primitives.html#gabe8e39d5788423f41770a71a4c911fbe":[19,0,0,0,0,11],
+"group___big_num_primitives.html#gacbec9669ab0fe768e2be74dcaca397ea":[19,0,0,0,0,8],
+"group___big_num_primitives.html#gacde6564a814617a96985b379be0dfabb":[19,0,0,0,0,4],
+"group___big_num_primitives.html#gad5f6f262bfd780fed3678bcee16f0aed":[19,0,0,0,0,10],
+"group___big_num_primitives.html#gae70fd9b3026f0ab3c7e9601d0a3186b8":[19,0,0,0,0,1],
+"group___big_num_primitives.html#gaf0366e47226563b17fcbc8e3ed766084":[19,0,0,0,0,3],
+"group___big_num_primitives.html#gafd64b66fc85dab0005f4a1bb67bdf7b4":[19,0,0,0,0,7],
+"group___ec_group_primitives.html":[19,0,0,0,2],
+"group___ec_group_primitives.html#ga01bf8d6fa60a2e445490966b3a06c270":[19,0,0,0,2,4],
+"group___ec_group_primitives.html#ga0b6d7a3398251e9352fb29ef4abef466":[19,0,0,0,2,8],
+"group___ec_group_primitives.html#ga25c9013cc76907d73765eb7a96aa8c96":[19,0,0,0,2,12],
+"group___ec_group_primitives.html#ga3f96c43d14d24de0f7a5e214aef64196":[19,0,0,0,2,5],
+"group___ec_group_primitives.html#ga40e3431d3dbe8cf7a65ada7b7811cba4":[19,0,0,0,2,16],
+"group___ec_group_primitives.html#ga48ec5ae951c9f49d8d7d983234eea921":[19,0,0,0,2,7],
+"group___ec_group_primitives.html#ga6417b0ce72ba96de00c329e322fec7fb":[19,0,0,0,2,19],
+"group___ec_group_primitives.html#ga76d24378455eb96a3257fe8045c0993a":[19,0,0,0,2,14],
+"group___ec_group_primitives.html#ga7a8bdb9782d065bc32fd102e0ae73ccb":[19,0,0,0,2,21],
+"group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa":[19,0,0,0,2,1],
+"group___ec_group_primitives.html#ga8a6114a48214a327d4ec04fd25e5940e":[19,0,0,0,2,11],
+"group___ec_group_primitives.html#ga8cb086d792bffb79b3ca07e6ca4ce0e7":[19,0,0,0,2,3],
+"group___ec_group_primitives.html#ga9cf15b34bc4ff12e58b169dd989d8210":[19,0,0,0,2,10],
+"group___ec_group_primitives.html#gaad96a1498b85d28f71514b8f7b154d82":[19,0,0,0,2,17],
+"group___ec_group_primitives.html#gab7af276256c27610eda85ff432b846ea":[19,0,0,0,2,2],
+"group___ec_group_primitives.html#gac3067cc899e65e647390bb3bd1cabe4c":[19,0,0,0,2,6],
+"group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159":[19,0,0,0,2,0],
+"group___ec_group_primitives.html#gad3b3c63c48fa24e8dea07837b05bc061":[19,0,0,0,2,9],
+"group___ec_group_primitives.html#gad495a9f91b79984f7533c8ea4f92b3cb":[19,0,0,0,2,20],
+"group___ec_group_primitives.html#gae96c38e004ccd2211290ad6e66415ec4":[19,0,0,0,2,13],
+"group___ec_group_primitives.html#gaf3b6a548aa6f0d4f028a14feca251f57":[19,0,0,0,2,15],
+"group___ec_group_primitives.html#gaf4e23677dd378ef2e0cf55df79cbdb62":[19,0,0,0,2,18],
+"group___ecdsa_primitives.html":[19,0,0,0,1],
+"group___ecdsa_primitives.html#ga07e4ebd3423e1f6f9ae35f0608dde7c0":[19,0,0,0,1,1],
+"group___ecdsa_primitives.html#gaef0e8a31e830fe9285b43a0969e6611a":[19,0,0,0,1,0],
+"group___epid11_file_parser_module.html":[19,0,0,2,0],
+"group___epid11_file_parser_module.html#ga1f92d1cb6bd7d9815711fde515b40a4c":[19,0,0,2,0,0],
+"group___epid11_file_parser_module.html#gac3f6daaa5333627d4efe5438c1fe8868":[19,0,0,2,0,3],
+"group___epid11_file_parser_module.html#gae28a844eb68828480b2a76fcb7d252a3":[19,0,0,2,0,1],
+"group___epid11_file_parser_module.html#gae682077d315c39ed298ef198fd738546":[19,0,0,2,0,2],
+"group___epid11_pairing_primitives.html":[19,0,0,0,5,0],
+"group___epid11_pairing_primitives.html#ga0ee658e26e9f933ba2ffbf2504dfae7e":[19,0,0,0,5,0,3],
+"group___epid11_pairing_primitives.html#ga74236e8ebbfc30a7daa7fa1cf1df148b":[19,0,0,0,5,0,0],
+"group___epid11_pairing_primitives.html#gaa3457d6f85889bc714910252fd21c758":[19,0,0,0,5,0,1],
+"group___epid11_pairing_primitives.html#gaa4076dfe25e8e61ac6753333a322c059":[19,0,0,0,5,0,2],
+"group___epid11_types.html":[19,0,0,4,0],
+"group___epid11_types.html#ga7293cec8f937d6f5da42084403f978f1":[19,0,0,4,0,17],
+"group___epid11_types.html#gadff9c05d5b7751024152b40dda545545":[19,0,0,4,0,15],
+"group___epid11_types.html#gaf1f4f1d6f001895abe548cfb33611c23":[19,0,0,4,0,16],
+"group___epid11_verifier_module.html":[19,0,2,0],
+"group___epid11_verifier_module.html#ga0b79c79d09e3551158e1c38c7c335929":[19,0,2,0,3],
+"group___epid11_verifier_module.html#ga0cb6d30df527ee0d8f0a1b68d2b7c0c0":[19,0,2,0,7],
+"group___epid11_verifier_module.html#ga241520cb925e5be89893a2037451cf1c":[19,0,2,0,11],
+"group___epid11_verifier_module.html#ga3a2e320d7de6156b2ce9d73e9cdce813":[19,0,2,0,4],
+"group___epid11_verifier_module.html#ga63cae8d5abcf4d7e3af4157de18998f1":[19,0,2,0,6],
+"group___epid11_verifier_module.html#ga7b5d19277da043c2b79721975d7bd070":[19,0,2,0,13],
+"group___epid11_verifier_module.html#ga809c777908b2f9d029062d9424cb5f65":[19,0,2,0,8],
+"group___epid11_verifier_module.html#gab0b6560b226a37321f5ca5d4fb55eba7":[19,0,2,0,2],
+"group___epid11_verifier_module.html#gabe6a864a06322205ae7536ffea34c702":[19,0,2,0,1],
+"group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8":[19,0,2,0,5],
+"group___epid11_verifier_module.html#gafe5ad6bde38ad0c3e0a9960975fd5216":[19,0,2,0,12],
+"group___epid11_verifier_module.html#gaff5a014b0334be7e8583f0f99cb5e9b8":[19,0,2,0,10],
+"group___epid11_verifier_module.html#gaffbe6ac2bc7236ad65126a17ebdceb14":[19,0,2,0,9],
+"group___epid_common.html":[19,0,0],
+"group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c":[19,0,0,5],
+"group___epid_math.html":[19,0,0,0],
+"group___epid_member_module.html":[19,0,1],
+"group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302":[19,0,1,14],
+"group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6":[19,0,1,8],
+"group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f":[19,0,1,16],
+"group___epid_member_module.html#ga76cddb8e20afc43de2c30d5e4addb2ea":[19,0,1,12],
+"group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000":[19,0,1,6],
+"group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140":[19,0,1,13],
+"group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf":[19,0,1,9],
+"group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6":[19,0,1,11],
+"group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4":[19,0,1,10],
+"group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3":[19,0,1,3],
+"group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78":[19,0,1,2],
+"group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075":[19,0,1,5],
+"group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d":[19,0,1,15],
+"group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7":[19,0,1,7],
+"group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef":[19,0,1,4],
+"group___epid_module.html":[19,0],
+"group___epid_print.html":[19,0,0,3],
+"group___epid_print.html#ga0d6377d9c1651d0101ec6b61feaa78ca":[19,0,0,3,3],
+"group___epid_print.html#ga138cd388247a58680d4701d59d6976d2":[19,0,0,3,12],
+"group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83":[19,0,0,3,0],
+"group___epid_print.html#ga3f2961ef6b4c44a6205d422d8a293476":[19,0,0,3,8],
+"group___epid_print.html#ga45a933b44fc1dfe926e3af89c198070a":[19,0,0,3,1],
+"group___epid_print.html#ga5f249c594ed12e4a9b11b7bc101da85d":[19,0,0,3,2],
+"group___epid_print.html#ga6c9fea48fa0477f4a98abb50f891a5e4":[19,0,0,3,9],
+"group___epid_print.html#ga87168a3ce5306f9839b8e8d6c9a5f84f":[19,0,0,3,10],
+"group___epid_print.html#ga883a834ab1703365bb0bca4abd3104de":[19,0,0,3,7],
+"group___epid_print.html#gaa3b1cbbfc6f78562658953113e5798cf":[19,0,0,3,4],
+"group___epid_print.html#gab76a4cf0385dc4a76bb56ee9f0e3e87a":[19,0,0,3,11],
+"group___epid_print.html#gae553c3a156a0e4968b89635ab0757580":[19,0,0,3,5],
+"group___epid_print.html#gaf185fe3df270cd8b4a2969bf3cfc5d5f":[19,0,0,3,6],
+"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83ade23610605d0ba7dd48db5060e28995a":[19,0,0,3,0,2],
+"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83ae2d5345c14f57fc992a613003c3c443d":[19,0,0,3,0,1],
+"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83aeb475b793d8d357087d7fcc74702ffae":[19,0,0,3,0,0],
+"group___epid_types.html":[19,0,0,4],
+"group___epid_types.html#ga3315fb24f4c5783b6d6eb107933390b0":[19,0,0,4,39],
+"group___epid_types.html#ga54bd22670f2e348593db7ab631131d10":[19,0,0,4,40],
+"group___epid_types.html#ga55eb2193045bde31af3f551565126042":[19,0,0,4,38],
+"group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890":[19,0,0,4,42],
+"group___epid_types.html#ga888541b8148df69c634a92c64ed51317":[19,0,0,4,41],
+"group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2":[19,0,0,4,36],
+"group___epid_types.html#gada666b48d0cbc301985405fde896f1de":[19,0,0,4,37],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a0f4dde6e82b84f5769873f6704fcd290":[19,0,0,4,42,2],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a4fa16d3867498f5e2f8ae5c94b0fab85":[19,0,0,4,42,5],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a68b2137c7946583a99f0dac2286523eb":[19,0,0,4,42,0],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a90d21c8885ab138f7cf91f253dd6ef86":[19,0,0,4,42,6],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a9746b5049a62bca2f7b844925e6136ba":[19,0,0,4,42,4],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890ade8e74cf7910b3a71fe902a40abf7eee":[19,0,0,4,42,7]
};
diff --git a/doc/html/navtreeindex1.js b/doc/html/navtreeindex1.js
index 89cb4da..b1bcdee 100644
--- a/doc/html/navtreeindex1.js
+++ b/doc/html/navtreeindex1.js
@@ -1,253 +1,253 @@
var NAVTREEINDEX1 =
{
-"group___epid_verifier_module.html#gaeb05e6faea6f09c0665b13adc6e7ddea":[17,0,2,5],
-"group___epid_verifier_module.html#gaf172a5f8f7f069d38c5838b723a1a85c":[17,0,2,2],
-"group___epid_verifier_module.html#gafab08180a43b58ce2e1d56c4b070bb0e":[17,0,2,13],
-"group___error_codes.html":[17,0,0,1],
-"group___error_codes.html#ga59e8680ce52509302fd58a987e45004d":[17,0,0,1,1],
-"group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360":[17,0,0,1,0],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a11a4d2f1c37064eb663de08dc57bcda8":[17,0,0,1,0,11],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a1739ecb620f4bede2e1b84e52a96cee6":[17,0,0,1,0,12],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a1dc7b7e6ff97c7ed9ff4191d76ebd6e1":[17,0,0,1,0,4],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a3706f895a660260033b5b91890516c0f":[17,0,0,1,0,17],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a43c658cbf0d156850d71ce3f8efd461c":[17,0,0,1,0,5],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a486e052baa99c6c25ae5d5cc710de298":[17,0,0,1,0,6],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a5252da1ff519a098446723e9edd30cc7":[17,0,0,1,0,8],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a61234ad9610406da6bf7977afd72a357":[17,0,0,1,0,16],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a700953ded1af35781948e8ada6dedf43":[17,0,0,1,0,20],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a83a867b4f71ee13edbfca2f1b72abbec":[17,0,0,1,0,14],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a893cd0d417b139bb376d09c93695c3f3":[17,0,0,1,0,13],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9":[17,0,0,1,0,0],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a94ae9c9b9337afd2fefd3b4f9c3160df":[17,0,0,1,0,18],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aa08f0d2e394b37694117a6a32bc71e6e":[17,0,0,1,0,7],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab2768a1a5c4374cb1ac6175c09c73129":[17,0,0,1,0,19],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab45ad60085d03c03ea30b40a0519897e":[17,0,0,1,0,1],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab7dfec784192a827a91a4b8a6054d01c":[17,0,0,1,0,10],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf":[17,0,0,1,0,9],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad4d4ff24a7ef2cd7a50b8082265e9ff4":[17,0,0,1,0,15],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aedd43fb4043bef3b515fc23f1d9a5fe5":[17,0,0,1,0,3],
-"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aeedd19b8a1cbdecf963f90b4860e02b8":[17,0,0,1,0,2],
-"group___file_parser.html":[17,0,0,2],
-"group___file_parser.html#ga1562efc7c1891875d6b2b9180d65de9d":[17,0,0,2,4],
-"group___file_parser.html#ga237ef5a43076aa6fc6eb18829a93da3f":[17,0,0,2,9],
-"group___file_parser.html#ga3770c39a0546c79447c9d4159d794c33":[17,0,0,2,10],
-"group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb":[17,0,0,2,6],
-"group___file_parser.html#ga8e38d1102eb1dd9b5af2e2f79236da55":[17,0,0,2,5],
-"group___file_parser.html#ga9a33be7edc6b4c7a867fb07bd2bddecb":[17,0,0,2,3],
-"group___file_parser.html#gaae808987ce82188dff42baa4e43cab82":[17,0,0,2,11],
-"group___file_parser.html#gad767f72dc55307b872a8b5600da3fd6f":[17,0,0,2,7],
-"group___file_parser.html#gadc033fb23e3cbda56aa7e3d412060b7e":[17,0,0,2,8],
-"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da5f270e2e8c2412bc07de293023f425cc":[17,0,0,2,4,0],
-"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da6af0ee9d9689f1d4325bdd0beb8a89e2":[17,0,0,2,4,1],
-"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da8bbd27765997dd10f1c0378dbecef01d":[17,0,0,2,4,2],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba1f8d8c4b253403a35c51e05d34a7ca1e":[17,0,0,2,3,1],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba692b4141bff8225bee6000750b0da322":[17,0,0,2,3,2],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba8aead4b6aab87a1efb2d7e8c77a9b710":[17,0,0,2,3,3],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba8e5247daee3999540e6cb24d4c2b3770":[17,0,0,2,3,4],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbab772fa1e3f221af125ffb34b86b3f24c":[17,0,0,2,3,7],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac24554caafe2db01e2daed413188cd92":[17,0,0,2,3,0],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac52e5fe24a12424316f655b9b7c62600":[17,0,0,2,3,6],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac6d742ea3dd3b17f6d763970ac84b811":[17,0,0,2,3,8],
-"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac708ba9e56eaeac0f1256457cbd45911":[17,0,0,2,3,5],
-"group___finite_field_primitives.html":[17,0,0,0,3],
-"group___finite_field_primitives.html#ga0d0c31a22bbfb665a16b2d25b0cd2634":[17,0,0,0,3,16],
-"group___finite_field_primitives.html#ga1a6e6d3c2319bb24eae8670b021e223b":[17,0,0,0,3,4],
-"group___finite_field_primitives.html#ga1bad3c6945d1d709fceb07a1dd03000e":[17,0,0,0,3,2],
-"group___finite_field_primitives.html#ga1ef46fc83f9c11263a2aa1ec906c9144":[17,0,0,0,3,13],
-"group___finite_field_primitives.html#ga20d9140e5670d679ef8183d9b5115f53":[17,0,0,0,3,10],
-"group___finite_field_primitives.html#ga26069d035d0f6ade33af2b5d5c14949a":[17,0,0,0,3,8],
-"group___finite_field_primitives.html#ga39892fe2ab431e166dbbcf57756660f6":[17,0,0,0,3,15],
-"group___finite_field_primitives.html#ga4613a75bd001a974b3e3e494c3a112a5":[17,0,0,0,3,11],
-"group___finite_field_primitives.html#ga59d20610f245ff4bc3a17b7bfe289991":[17,0,0,0,3,17],
-"group___finite_field_primitives.html#ga6622db072782fd9e53b4d59dd3dbd8e8":[17,0,0,0,3,6],
-"group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa":[17,0,0,0,3,0],
-"group___finite_field_primitives.html#ga7d99fdc5e4573668a5744e49df7ab67c":[17,0,0,0,3,20],
-"group___finite_field_primitives.html#ga83041e3be9984a4bd8f1021934bfa3a2":[17,0,0,0,3,21],
-"group___finite_field_primitives.html#ga84d21decc1c957bcf6e98e1492eb2ac3":[17,0,0,0,3,12],
-"group___finite_field_primitives.html#ga8a143a5a815a62f4947be2de1653c50f":[17,0,0,0,3,23],
-"group___finite_field_primitives.html#ga90b2c192708973b54b7a3e82b34536ed":[17,0,0,0,3,18],
-"group___finite_field_primitives.html#gaa3c1f7515dd823ddad8764091ebc665f":[17,0,0,0,3,24],
-"group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e":[17,0,0,0,3,1],
-"group___finite_field_primitives.html#gabd511d79d9cbd1899e59258f149102c5":[17,0,0,0,3,7],
-"group___finite_field_primitives.html#gacbdd2871ecf93dadaac9d2c5b16e1e5f":[17,0,0,0,3,3],
-"group___finite_field_primitives.html#gacc54f315ede2dbeb8c5990c024a0de6c":[17,0,0,0,3,19],
-"group___finite_field_primitives.html#gae69af62a03179718cac81b004549c598":[17,0,0,0,3,22],
-"group___finite_field_primitives.html#gae7a8c7503b6fc7a41bcaab4d45ca37b2":[17,0,0,0,3,14],
-"group___finite_field_primitives.html#gaed2acb8583e9c9f6b49fdb660c672625":[17,0,0,0,3,9],
-"group___finite_field_primitives.html#gaf0ddbc1bad048d67771cba119eb44a6c":[17,0,0,0,3,5],
-"group___hash_primitives.html":[17,0,0,0,4],
-"group___hash_primitives.html#ga86d62aac9efd7445acee311b41846c6c":[17,0,0,0,4,1],
-"group___pairing_primitives.html":[17,0,0,0,5],
-"group___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc":[17,0,0,0,5,3],
-"group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607":[17,0,0,0,5,1],
-"group___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d":[17,0,0,0,5,4],
-"group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d":[17,0,0,0,5,2],
-"group___tpm_module.html":[17,0,1,0],
-"group___tpm_module.html#ga2335ec4eb78b542cf87df9b0cd15358c":[17,0,1,0,2],
-"group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f":[17,0,1,0,8],
-"group___tpm_module.html#ga42b80d485cff39fe9ec14a0b5a81426d":[17,0,1,0,13],
-"group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2":[17,0,1,0,11],
-"group___tpm_module.html#ga5e62323b94837b847f3e869cf2ff3615":[17,0,1,0,7],
-"group___tpm_module.html#ga688441f78f68aa53c41fcae4d31c6f50":[17,0,1,0,14],
-"group___tpm_module.html#ga901cad19eb14a6a6a02e85f9d710d287":[17,0,1,0,3],
-"group___tpm_module.html#ga95bc18225c1d87803be7965978e37449":[17,0,1,0,5],
-"group___tpm_module.html#gaa53a6bd52e22808bac21596a964bdece":[17,0,1,0,6],
-"group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f":[17,0,1,0,15],
-"group___tpm_module.html#gab80c411f070858fbe019d93f5ac6a6ec":[17,0,1,0,9],
-"group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0":[17,0,1,0,12],
-"group___tpm_module.html#gae69218c9cba6a19d3ae1199c59772efc":[17,0,1,0,10],
-"group___tpm_module.html#gaeb9bfaa9288263af9feccd0d0543c9bc":[17,0,1,0,4],
-"group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd":[17,0,1,0,16],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890aefb89989305b5c34120b0f18ee8e2c5d":[19,0,0,4,42,1],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890afb78d98f37fecc53dd1637d94c5c0055":[19,0,0,4,42,3],
+"group___epid_verifier_module.html":[19,0,2],
+"group___epid_verifier_module.html#ga0909703a0a4dfe080374d0d99077465a":[19,0,2,15],
+"group___epid_verifier_module.html#ga1c3810ef361da678a1f77823bd9c37a6":[19,0,2,10],
+"group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70":[19,0,2,8],
+"group___epid_verifier_module.html#ga1d41d6ef4dabbc30ec28452edd6baffb":[19,0,2,11],
+"group___epid_verifier_module.html#ga2a75c7d5775e852a7b6e24178dd4054f":[19,0,2,6],
+"group___epid_verifier_module.html#ga4c7c9820409ee06f30bb8dc75fdd5dcf":[19,0,2,14],
+"group___epid_verifier_module.html#ga6707e691f4b3916f9c684d5bbd463d12":[19,0,2,9],
+"group___epid_verifier_module.html#ga8eaeb9f4a34e9e37ccdf342919f38c69":[19,0,2,4],
+"group___epid_verifier_module.html#ga92df4d00ea4ee59d7bfd35b23da03392":[19,0,2,16],
+"group___epid_verifier_module.html#ga97b58b2382f24756b66a357f1e825c92":[19,0,2,12],
+"group___epid_verifier_module.html#gac3b1f1a2bdba8eeeebbf1e0c8c00862e":[19,0,2,18],
+"group___epid_verifier_module.html#gac6e2fab59e3af8a33a74a5b201642700":[19,0,2,7],
+"group___epid_verifier_module.html#gac857bff47e7d80363eac15285471fe81":[19,0,2,19],
+"group___epid_verifier_module.html#gae3f9c37628e18b880d8bbee3e7f55064":[19,0,2,17],
+"group___epid_verifier_module.html#gae44bd8acbc1e7205aeedff0c7e2632a8":[19,0,2,3],
+"group___epid_verifier_module.html#gaeb05e6faea6f09c0665b13adc6e7ddea":[19,0,2,5],
+"group___epid_verifier_module.html#gaf172a5f8f7f069d38c5838b723a1a85c":[19,0,2,2],
+"group___epid_verifier_module.html#gafab08180a43b58ce2e1d56c4b070bb0e":[19,0,2,13],
+"group___error_codes.html":[19,0,0,1],
+"group___error_codes.html#ga59e8680ce52509302fd58a987e45004d":[19,0,0,1,1],
+"group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360":[19,0,0,1,0],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a11a4d2f1c37064eb663de08dc57bcda8":[19,0,0,1,0,11],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a1739ecb620f4bede2e1b84e52a96cee6":[19,0,0,1,0,12],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a1dc7b7e6ff97c7ed9ff4191d76ebd6e1":[19,0,0,1,0,4],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a3706f895a660260033b5b91890516c0f":[19,0,0,1,0,17],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a43c658cbf0d156850d71ce3f8efd461c":[19,0,0,1,0,5],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a486e052baa99c6c25ae5d5cc710de298":[19,0,0,1,0,6],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a5252da1ff519a098446723e9edd30cc7":[19,0,0,1,0,8],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a61234ad9610406da6bf7977afd72a357":[19,0,0,1,0,16],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a700953ded1af35781948e8ada6dedf43":[19,0,0,1,0,20],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a83a867b4f71ee13edbfca2f1b72abbec":[19,0,0,1,0,14],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a893cd0d417b139bb376d09c93695c3f3":[19,0,0,1,0,13],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9":[19,0,0,1,0,0],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a94ae9c9b9337afd2fefd3b4f9c3160df":[19,0,0,1,0,18],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aa08f0d2e394b37694117a6a32bc71e6e":[19,0,0,1,0,7],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab2768a1a5c4374cb1ac6175c09c73129":[19,0,0,1,0,19],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab45ad60085d03c03ea30b40a0519897e":[19,0,0,1,0,1],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab7dfec784192a827a91a4b8a6054d01c":[19,0,0,1,0,10],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf":[19,0,0,1,0,9],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad4d4ff24a7ef2cd7a50b8082265e9ff4":[19,0,0,1,0,15],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aedd43fb4043bef3b515fc23f1d9a5fe5":[19,0,0,1,0,3],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aeedd19b8a1cbdecf963f90b4860e02b8":[19,0,0,1,0,2],
+"group___file_parser.html":[19,0,0,2],
+"group___file_parser.html#ga1562efc7c1891875d6b2b9180d65de9d":[19,0,0,2,4],
+"group___file_parser.html#ga237ef5a43076aa6fc6eb18829a93da3f":[19,0,0,2,9],
+"group___file_parser.html#ga3770c39a0546c79447c9d4159d794c33":[19,0,0,2,10],
+"group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb":[19,0,0,2,6],
+"group___file_parser.html#ga8e38d1102eb1dd9b5af2e2f79236da55":[19,0,0,2,5],
+"group___file_parser.html#ga9a33be7edc6b4c7a867fb07bd2bddecb":[19,0,0,2,3],
+"group___file_parser.html#gaae808987ce82188dff42baa4e43cab82":[19,0,0,2,11],
+"group___file_parser.html#gad767f72dc55307b872a8b5600da3fd6f":[19,0,0,2,7],
+"group___file_parser.html#gadc033fb23e3cbda56aa7e3d412060b7e":[19,0,0,2,8],
+"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da5f270e2e8c2412bc07de293023f425cc":[19,0,0,2,4,0],
+"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da6af0ee9d9689f1d4325bdd0beb8a89e2":[19,0,0,2,4,1],
+"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da8bbd27765997dd10f1c0378dbecef01d":[19,0,0,2,4,2],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba1f8d8c4b253403a35c51e05d34a7ca1e":[19,0,0,2,3,1],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba692b4141bff8225bee6000750b0da322":[19,0,0,2,3,2],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba8aead4b6aab87a1efb2d7e8c77a9b710":[19,0,0,2,3,3],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba8e5247daee3999540e6cb24d4c2b3770":[19,0,0,2,3,4],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbab772fa1e3f221af125ffb34b86b3f24c":[19,0,0,2,3,7],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac24554caafe2db01e2daed413188cd92":[19,0,0,2,3,0],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac52e5fe24a12424316f655b9b7c62600":[19,0,0,2,3,6],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac6d742ea3dd3b17f6d763970ac84b811":[19,0,0,2,3,8],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac708ba9e56eaeac0f1256457cbd45911":[19,0,0,2,3,5],
+"group___finite_field_primitives.html":[19,0,0,0,3],
+"group___finite_field_primitives.html#ga0d0c31a22bbfb665a16b2d25b0cd2634":[19,0,0,0,3,16],
+"group___finite_field_primitives.html#ga1a6e6d3c2319bb24eae8670b021e223b":[19,0,0,0,3,4],
+"group___finite_field_primitives.html#ga1bad3c6945d1d709fceb07a1dd03000e":[19,0,0,0,3,2],
+"group___finite_field_primitives.html#ga1ef46fc83f9c11263a2aa1ec906c9144":[19,0,0,0,3,13],
+"group___finite_field_primitives.html#ga20d9140e5670d679ef8183d9b5115f53":[19,0,0,0,3,10],
+"group___finite_field_primitives.html#ga26069d035d0f6ade33af2b5d5c14949a":[19,0,0,0,3,8],
+"group___finite_field_primitives.html#ga39892fe2ab431e166dbbcf57756660f6":[19,0,0,0,3,15],
+"group___finite_field_primitives.html#ga4613a75bd001a974b3e3e494c3a112a5":[19,0,0,0,3,11],
+"group___finite_field_primitives.html#ga59d20610f245ff4bc3a17b7bfe289991":[19,0,0,0,3,17],
+"group___finite_field_primitives.html#ga6622db072782fd9e53b4d59dd3dbd8e8":[19,0,0,0,3,6],
+"group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa":[19,0,0,0,3,0],
+"group___finite_field_primitives.html#ga7d99fdc5e4573668a5744e49df7ab67c":[19,0,0,0,3,20],
+"group___finite_field_primitives.html#ga83041e3be9984a4bd8f1021934bfa3a2":[19,0,0,0,3,21],
+"group___finite_field_primitives.html#ga84d21decc1c957bcf6e98e1492eb2ac3":[19,0,0,0,3,12],
+"group___finite_field_primitives.html#ga8a143a5a815a62f4947be2de1653c50f":[19,0,0,0,3,23],
+"group___finite_field_primitives.html#ga90b2c192708973b54b7a3e82b34536ed":[19,0,0,0,3,18],
+"group___finite_field_primitives.html#gaa3c1f7515dd823ddad8764091ebc665f":[19,0,0,0,3,24],
+"group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e":[19,0,0,0,3,1],
+"group___finite_field_primitives.html#gabd511d79d9cbd1899e59258f149102c5":[19,0,0,0,3,7],
+"group___finite_field_primitives.html#gacbdd2871ecf93dadaac9d2c5b16e1e5f":[19,0,0,0,3,3],
+"group___finite_field_primitives.html#gacc54f315ede2dbeb8c5990c024a0de6c":[19,0,0,0,3,19],
+"group___finite_field_primitives.html#gae69af62a03179718cac81b004549c598":[19,0,0,0,3,22],
+"group___finite_field_primitives.html#gae7a8c7503b6fc7a41bcaab4d45ca37b2":[19,0,0,0,3,14],
+"group___finite_field_primitives.html#gaed2acb8583e9c9f6b49fdb660c672625":[19,0,0,0,3,9],
+"group___finite_field_primitives.html#gaf0ddbc1bad048d67771cba119eb44a6c":[19,0,0,0,3,5],
+"group___hash_primitives.html":[19,0,0,0,4],
+"group___hash_primitives.html#ga86d62aac9efd7445acee311b41846c6c":[19,0,0,0,4,1],
+"group___pairing_primitives.html":[19,0,0,0,5],
+"group___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc":[19,0,0,0,5,3],
+"group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607":[19,0,0,0,5,1],
+"group___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d":[19,0,0,0,5,4],
+"group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d":[19,0,0,0,5,2],
+"group___tpm2_module.html":[19,0,1,0],
+"group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7":[19,0,1,0,12],
+"group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e":[19,0,1,0,1],
+"group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69":[19,0,1,0,11],
+"group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd":[19,0,1,0,6],
+"group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22":[19,0,1,0,7],
+"group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4":[19,0,1,0,2],
+"group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9":[19,0,1,0,0],
+"group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81":[19,0,1,0,10],
+"group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc":[19,0,1,0,8],
+"group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9":[19,0,1,0,4],
+"group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb":[19,0,1,0,9],
+"group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326":[19,0,1,0,5],
+"group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6":[19,0,1,0,3],
"index.html":[1],
"index.html":[],
"index.html#mainpage_roadmap":[1,0],
-"modules.html":[17],
+"modules.html":[19],
"pages.html":[],
-"struct_basic_signature.html":[17,0,0,4,21],
-"struct_basic_signature.html#a0078cc83ecf6c7e31f96b7d44aa60e21":[17,0,0,4,21,2],
-"struct_basic_signature.html#a0e8ea6a2cd3af10e9b59d96d7d06bc69":[17,0,0,4,21,6],
-"struct_basic_signature.html#a4daa94db5068db3f10960f3dd178d603":[17,0,0,4,21,1],
-"struct_basic_signature.html#a69115a4776d15b48411dd6c3a76d0f3d":[17,0,0,4,21,3],
-"struct_basic_signature.html#a730f74d85cfb4fa4089d43c87b97a624":[17,0,0,4,21,7],
-"struct_basic_signature.html#a79d8dec8c5da176e497abf22e4c43adb":[17,0,0,4,21,5],
-"struct_basic_signature.html#a91daebc5b577688afeed2a7ee7913245":[17,0,0,4,21,4],
-"struct_basic_signature.html#ae90cb6af66b010ae39913f033c1e65ac":[17,0,0,4,21,0],
-"struct_big_num_str.html":[17,0,0,4,8],
-"struct_big_num_str.html#a442dcf33889b4f85c5b1228d2c8e6838":[17,0,0,4,8,0],
-"struct_compressed_priv_key.html":[17,0,0,4,18],
-"struct_compressed_priv_key.html#a0b0535f0567eb0e48f799d27991d0f66":[17,0,0,4,18,0],
-"struct_compressed_priv_key.html#a54b9af7699f517bbaef3d52d03e3fed8":[17,0,0,4,18,2],
-"struct_compressed_priv_key.html#ac6689899f1d9a6a8c5e4915563679840":[17,0,0,4,18,1],
-"struct_ecdsa_private_key.html":[17,0,0,4,35],
-"struct_ecdsa_private_key.html#a97efee9b4079f95d94a104f9a6d8c96d":[17,0,0,4,35,0],
-"struct_ecdsa_public_key.html":[17,0,0,4,34],
-"struct_ecdsa_public_key.html#a37c51614faf022eec491b4de8f3a13e1":[17,0,0,4,34,0],
-"struct_ecdsa_public_key.html#a4503c4613386cbc78add1dc245c99284":[17,0,0,4,34,1],
-"struct_ecdsa_signature.html":[17,0,0,4,33],
-"struct_ecdsa_signature.html#a2efd6bf37b12f35135bf325fa491b029":[17,0,0,4,33,1],
-"struct_ecdsa_signature.html#a64b623605a55a267a36df18f29142d0d":[17,0,0,4,33,0],
-"struct_epid11_basic_signature.html":[17,0,0,4,0,8],
-"struct_epid11_basic_signature.html#a1a73fc922f69e2499643dd4c53d0d42d":[17,0,0,4,0,8,5],
-"struct_epid11_basic_signature.html#a267cf4e17d10584736b0c38f3668d822":[17,0,0,4,0,8,12],
-"struct_epid11_basic_signature.html#a2718346665210b7e26521bf4a15cb3bd":[17,0,0,4,0,8,9],
-"struct_epid11_basic_signature.html#a27fd7ae99d1ada652e21e7508a467c0b":[17,0,0,4,0,8,0],
-"struct_epid11_basic_signature.html#a29a700f3bec251600e18b2292081df4b":[17,0,0,4,0,8,6],
-"struct_epid11_basic_signature.html#a5882fcbfd272774e12e50a2d77f0b139":[17,0,0,4,0,8,2],
-"struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b":[17,0,0,4,0,8,11],
-"struct_epid11_basic_signature.html#a911441845fc9b82d514133371b5ba87c":[17,0,0,4,0,8,10],
-"struct_epid11_basic_signature.html#a9cc6efcd3d7270022779bd16776168ed":[17,0,0,4,0,8,1],
-"struct_epid11_basic_signature.html#ae17b45194997a6fa13c6014a51ec711c":[17,0,0,4,0,8,8],
-"struct_epid11_basic_signature.html#aeb221cf52bc2b1a9bf6e0a9779bfd20f":[17,0,0,4,0,8,4],
-"struct_epid11_basic_signature.html#af18200712d2cf3ed3ccaee328e8a4e0f":[17,0,0,4,0,8,3],
-"struct_epid11_basic_signature.html#afe28bad6328f81e6f7af011cc96ac2e5":[17,0,0,4,0,8,7],
-"struct_epid11_g2_elem_str.html":[17,0,0,4,0,4],
-"struct_epid11_g2_elem_str.html#a9e8984e479bcbe8bd36c65e80c340032":[17,0,0,4,0,4,1],
-"struct_epid11_g2_elem_str.html#af28558484298f4f56377ededf57a4a04":[17,0,0,4,0,4,0],
-"struct_epid11_group_pub_key.html":[17,0,0,4,0,7],
-"struct_epid11_group_pub_key.html#a056c7138246e2bdcd47eaad501b756bb":[17,0,0,4,0,7,3],
-"struct_epid11_group_pub_key.html#a36f688472e2655052d485eac67d8c362":[17,0,0,4,0,7,1],
-"struct_epid11_group_pub_key.html#a964344b3c595bdd585bb9b5d9d0ea762":[17,0,0,4,0,7,0],
-"struct_epid11_group_pub_key.html#aa724e9d2f0cb6019c05547d76a13b72a":[17,0,0,4,0,7,2],
-"struct_epid11_group_rl.html":[17,0,0,4,0,14],
-"struct_epid11_group_rl.html#a35cb954f598d4006b0f047cde77010a5":[17,0,0,4,0,14,1],
-"struct_epid11_group_rl.html#a63afa9863e8dcb63ff884e6e4093c481":[17,0,0,4,0,14,2],
-"struct_epid11_group_rl.html#a97f165c59bc447e3ca3c2148a096710f":[17,0,0,4,0,14,0],
-"struct_epid11_gt_elem_str.html":[17,0,0,4,0,5],
-"struct_epid11_gt_elem_str.html#aed8dd86f1696c2f3537154fc904bf2b0":[17,0,0,4,0,5,0],
-"struct_epid11_nr_proof.html":[17,0,0,4,0,9],
-"struct_epid11_nr_proof.html#a1ad7fe6b32c09f2504ee49731c0ad145":[17,0,0,4,0,9,1],
-"struct_epid11_nr_proof.html#a2e5ee8dc25d296538dce935397a93d68":[17,0,0,4,0,9,0],
-"struct_epid11_nr_proof.html#a5ad9ba3bfac4eac37fd4a4e33ea65ddc":[17,0,0,4,0,9,3],
-"struct_epid11_nr_proof.html#aa8406e938b2f87bded9e374e93a8ee5d":[17,0,0,4,0,9,2],
-"struct_epid11_params.html":[17,0,0,4,0,6],
-"struct_epid11_params.html#a01381f84b2d747b6273e21c71c58a1b0":[17,0,0,4,0,6,0],
-"struct_epid11_params.html#a02bd6fa2ab256e3a07533e947ab0101e":[17,0,0,4,0,6,10],
-"struct_epid11_params.html#a0fe238db4ebc0225899dc2dac97d11c0":[17,0,0,4,0,6,9],
-"struct_epid11_params.html#a1c6bbc4e066449d9c329f88cb653ef7c":[17,0,0,4,0,6,6],
-"struct_epid11_params.html#a27b45ed7771a3024d1d059b4b4ff6eae":[17,0,0,4,0,6,2],
-"struct_epid11_params.html#a2aa4d8a2ebe0dfeb6d930fd7b39f9d1a":[17,0,0,4,0,6,11],
-"struct_epid11_params.html#a49462f35596d07a456a731d0690fdd83":[17,0,0,4,0,6,14],
-"struct_epid11_params.html#a77a8350b97a7afb584a46eb5b32f03bf":[17,0,0,4,0,6,12],
-"struct_epid11_params.html#a7eb9a1371d7187ae81bccfa8d5595033":[17,0,0,4,0,6,7],
-"struct_epid11_params.html#a835e70da717cd5b0c94e242a6418a287":[17,0,0,4,0,6,5],
-"struct_epid11_params.html#aacc39ebe0cc625321039ffb6be0b0e87":[17,0,0,4,0,6,4],
-"struct_epid11_params.html#aad03fd1cc3955bb8879535fa7298123f":[17,0,0,4,0,6,13],
-"struct_epid11_params.html#ade3f88ce73d7de656ec67d9fdb0719d7":[17,0,0,4,0,6,3],
-"struct_epid11_params.html#ae2d1dc635d9d7cba496c3d64fb6f9d5b":[17,0,0,4,0,6,8],
-"struct_epid11_params.html#ae8770bb921aac9214ff8c45c41dbb228":[17,0,0,4,0,6,1],
-"struct_epid11_params.html#af22cfcd6c7ec0e7e7369b79554b963bd":[17,0,0,4,0,6,15],
-"struct_epid11_priv_rl.html":[17,0,0,4,0,11],
-"struct_epid11_priv_rl.html#a2b3899f5a35bf64f860d6d91bccb03c8":[17,0,0,4,0,11,3],
-"struct_epid11_priv_rl.html#aa8945d81e30674b52a6d0900b64feb3c":[17,0,0,4,0,11,1],
-"struct_epid11_priv_rl.html#abbb75fee81aecb2dde7e2daab895ad3b":[17,0,0,4,0,11,0],
-"struct_epid11_priv_rl.html#ad95f880f40e2f40c723f5bdbd22ecfa2":[17,0,0,4,0,11,2],
-"struct_epid11_sig_rl.html":[17,0,0,4,0,13],
-"struct_epid11_sig_rl.html#a6473f8a98f76c9f82183041ea5ae17e3":[17,0,0,4,0,13,0],
-"struct_epid11_sig_rl.html#a8c654d43df132db7874f4c84c177dc12":[17,0,0,4,0,13,2],
-"struct_epid11_sig_rl.html#aa38674729293f4879ff94328dd3c59b1":[17,0,0,4,0,13,3],
-"struct_epid11_sig_rl.html#ad45b0e3e1be59649150dd34c104000ac":[17,0,0,4,0,13,1],
-"struct_epid11_sig_rl_entry.html":[17,0,0,4,0,12],
-"struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a":[17,0,0,4,0,12,1],
-"struct_epid11_sig_rl_entry.html#abe47cfbd00684941f93a211417bedf0c":[17,0,0,4,0,12,0],
-"struct_epid11_signature.html":[17,0,0,4,0,10],
-"struct_epid11_signature.html#a43cb3ed13c862ff05a9292623ad57c5e":[17,0,0,4,0,10,1],
-"struct_epid11_signature.html#a48526e73f02ad3f1544c4c71c481f153":[17,0,0,4,0,10,3],
-"struct_epid11_signature.html#abf24a8df563ba3f535486d8dad7384f4":[17,0,0,4,0,10,2],
-"struct_epid11_signature.html#ad25c277223a5210063163ea554d08ad4":[17,0,0,4,0,10,0],
-"struct_epid11_verifier_precomp.html":[17,0,2,0,0],
-"struct_epid11_verifier_precomp.html#a03138e937f4488bdbc52ed473dc313da":[17,0,2,0,0,3],
-"struct_epid11_verifier_precomp.html#a0a980adb039089263ec59a995600ee91":[17,0,2,0,0,0],
-"struct_epid11_verifier_precomp.html#a14ebadf105aff085edb9a817a2d1db89":[17,0,2,0,0,2],
-"struct_epid11_verifier_precomp.html#ad0ff2a13c2c87460296900dde72a2f30":[17,0,2,0,0,1],
-"struct_epid2_params.html":[17,0,0,4,14],
-"struct_epid2_params.html#a023603228fed2854ddae2e228938940f":[17,0,0,4,14,6],
-"struct_epid2_params.html#a200a0cba1c9e4ad512bece23f2461a5f":[17,0,0,4,14,7],
-"struct_epid2_params.html#a2f868edb49be49f645101ef5ebbbc551":[17,0,0,4,14,0],
-"struct_epid2_params.html#a4c5195b4fa9393a07a121336202531ad":[17,0,0,4,14,2],
-"struct_epid2_params.html#a609b0aac17fca34fe39bee29676a9618":[17,0,0,4,14,3],
-"struct_epid2_params.html#ac0e0dad45b10927860cd5fa4f8101f08":[17,0,0,4,14,5],
-"struct_epid2_params.html#ac2d7507c6f58c3451beacacb91b52695":[17,0,0,4,14,1],
-"struct_epid2_params.html#ae1d8f5d6036a82064e91bc137b278e74":[17,0,0,4,14,8],
-"struct_epid2_params.html#af23f07fb0e1745c0ad14aceeaa946928":[17,0,0,4,14,4],
-"struct_epid_ca_certificate.html":[17,0,0,2,2],
-"struct_epid_ca_certificate.html#a280e0b0238cf45834c21849ab8a7e124":[17,0,0,2,2,1],
-"struct_epid_ca_certificate.html#a2811c1914ffae913820f13da914c8f01":[17,0,0,2,2,0],
-"struct_epid_ca_certificate.html#a2f8f09ae02919c379c38386668b47418":[17,0,0,2,2,6],
-"struct_epid_ca_certificate.html#a3a44e8050ca2f5085652b2b4e15b779c":[17,0,0,2,2,3],
-"struct_epid_ca_certificate.html#a4f77996f90ed7da1d0503c4236b2c9d1":[17,0,0,2,2,7],
-"struct_epid_ca_certificate.html#a9d2fc21f46cf9fc96e2ea557b70e5356":[17,0,0,2,2,4],
-"struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2":[17,0,0,2,2,5],
-"struct_epid_ca_certificate.html#abd69cce8d5e3940787ee0d17f72184ab":[17,0,0,2,2,8],
-"struct_epid_ca_certificate.html#ac03cf7257c52ad14e3dd3201b930dd50":[17,0,0,2,2,2],
-"struct_epid_file_header.html":[17,0,0,2,1],
-"struct_epid_file_header.html#a35d43c51c1739940381e4898ca87b824":[17,0,0,2,1,0],
-"struct_epid_file_header.html#af5d48c739cc6c00c6e1ce35abf4f1473":[17,0,0,2,1,1],
-"struct_epid_signature.html":[17,0,0,4,23],
-"struct_epid_signature.html#a4155f3f4f1223fc4ae50c94f5305def1":[17,0,0,4,23,1],
-"struct_epid_signature.html#a62a6b0ffcd5f68dd3d2786a58fe43017":[17,0,0,4,23,0],
-"struct_epid_signature.html#a89d2e38223944310b6eeeadf6061a2dd":[17,0,0,4,23,2],
-"struct_epid_signature.html#ab0fe5f98bff737fcfbfe0b4d658e83f2":[17,0,0,4,23,3],
-"struct_fp_elem_str.html":[17,0,0,4,9],
-"struct_fp_elem_str.html#a5ddb96a5567750f2834335851c906c45":[17,0,0,4,9,0],
-"struct_fq12_elem_str.html":[17,0,0,4,32],
-"struct_fq12_elem_str.html#a0520947335aaf52de90af1dec5bdd112":[17,0,0,4,32,0],
-"struct_fq2_elem_str.html":[17,0,0,4,30],
-"struct_fq2_elem_str.html#ab1d253eb24ba30eaf516ac429daab915":[17,0,0,4,30,0],
-"struct_fq3_elem_str.html":[17,0,0,4,0,3],
-"struct_fq3_elem_str.html#af1be0a4d5c9c674d75bec34f95e3c731":[17,0,0,4,0,3,0],
-"struct_fq6_elem_str.html":[17,0,0,4,31],
-"struct_fq6_elem_str.html#a89d656e5c815b4a2382d11ef6932a7d2":[17,0,0,4,31,0],
-"struct_fq_elem_str.html":[17,0,0,4,10],
-"struct_fq_elem_str.html#aac1a876b51a8d2c6d1510e4df2fd3f14":[17,0,0,4,10,0],
-"struct_g1_elem_str.html":[17,0,0,4,11],
-"struct_g1_elem_str.html#a3b0e658d6e5697763ad9c633c11d4ec4":[17,0,0,4,11,0],
-"struct_g1_elem_str.html#a8f2455ca314e885ea180dadf84bf27c3":[17,0,0,4,11,1],
-"struct_g2_elem_str.html":[17,0,0,4,12],
-"struct_g2_elem_str.html#a145ec5b20a6f4f00b080e11c8680afc3":[17,0,0,4,12,0],
-"struct_g2_elem_str.html#a43141b2458aecceed8ee2748270f7908":[17,0,0,4,12,1],
-"struct_group_pub_key.html":[17,0,0,4,15],
-"struct_group_pub_key.html#a2a4320ec99fd1a15df412fbf2a8d49f1":[17,0,0,4,15,2],
-"struct_group_pub_key.html#a86be439104fb60b324784baf24a943f9":[17,0,0,4,15,3],
-"struct_group_pub_key.html#a8c22c758ea186f95e3bf4b2ef8451da5":[17,0,0,4,15,1],
-"struct_group_pub_key.html#ae8e77ab4d5eb3c8e566c24a64cce56ee":[17,0,0,4,15,0]
+"struct_basic_signature.html":[19,0,0,4,21],
+"struct_basic_signature.html#a0078cc83ecf6c7e31f96b7d44aa60e21":[19,0,0,4,21,2],
+"struct_basic_signature.html#a0e8ea6a2cd3af10e9b59d96d7d06bc69":[19,0,0,4,21,6],
+"struct_basic_signature.html#a4daa94db5068db3f10960f3dd178d603":[19,0,0,4,21,1],
+"struct_basic_signature.html#a69115a4776d15b48411dd6c3a76d0f3d":[19,0,0,4,21,3],
+"struct_basic_signature.html#a730f74d85cfb4fa4089d43c87b97a624":[19,0,0,4,21,7],
+"struct_basic_signature.html#a79d8dec8c5da176e497abf22e4c43adb":[19,0,0,4,21,5],
+"struct_basic_signature.html#a91daebc5b577688afeed2a7ee7913245":[19,0,0,4,21,4],
+"struct_basic_signature.html#ae90cb6af66b010ae39913f033c1e65ac":[19,0,0,4,21,0],
+"struct_big_num_str.html":[19,0,0,4,8],
+"struct_big_num_str.html#a442dcf33889b4f85c5b1228d2c8e6838":[19,0,0,4,8,0],
+"struct_compressed_priv_key.html":[19,0,0,4,18],
+"struct_compressed_priv_key.html#a0b0535f0567eb0e48f799d27991d0f66":[19,0,0,4,18,0],
+"struct_compressed_priv_key.html#a54b9af7699f517bbaef3d52d03e3fed8":[19,0,0,4,18,2],
+"struct_compressed_priv_key.html#ac6689899f1d9a6a8c5e4915563679840":[19,0,0,4,18,1],
+"struct_ecdsa_private_key.html":[19,0,0,4,35],
+"struct_ecdsa_private_key.html#a97efee9b4079f95d94a104f9a6d8c96d":[19,0,0,4,35,0],
+"struct_ecdsa_public_key.html":[19,0,0,4,34],
+"struct_ecdsa_public_key.html#a37c51614faf022eec491b4de8f3a13e1":[19,0,0,4,34,0],
+"struct_ecdsa_public_key.html#a4503c4613386cbc78add1dc245c99284":[19,0,0,4,34,1],
+"struct_ecdsa_signature.html":[19,0,0,4,33],
+"struct_ecdsa_signature.html#a2efd6bf37b12f35135bf325fa491b029":[19,0,0,4,33,1],
+"struct_ecdsa_signature.html#a64b623605a55a267a36df18f29142d0d":[19,0,0,4,33,0],
+"struct_epid11_basic_signature.html":[19,0,0,4,0,8],
+"struct_epid11_basic_signature.html#a1a73fc922f69e2499643dd4c53d0d42d":[19,0,0,4,0,8,5],
+"struct_epid11_basic_signature.html#a267cf4e17d10584736b0c38f3668d822":[19,0,0,4,0,8,12],
+"struct_epid11_basic_signature.html#a2718346665210b7e26521bf4a15cb3bd":[19,0,0,4,0,8,9],
+"struct_epid11_basic_signature.html#a27fd7ae99d1ada652e21e7508a467c0b":[19,0,0,4,0,8,0],
+"struct_epid11_basic_signature.html#a29a700f3bec251600e18b2292081df4b":[19,0,0,4,0,8,6],
+"struct_epid11_basic_signature.html#a5882fcbfd272774e12e50a2d77f0b139":[19,0,0,4,0,8,2],
+"struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b":[19,0,0,4,0,8,11],
+"struct_epid11_basic_signature.html#a911441845fc9b82d514133371b5ba87c":[19,0,0,4,0,8,10],
+"struct_epid11_basic_signature.html#a9cc6efcd3d7270022779bd16776168ed":[19,0,0,4,0,8,1],
+"struct_epid11_basic_signature.html#ae17b45194997a6fa13c6014a51ec711c":[19,0,0,4,0,8,8],
+"struct_epid11_basic_signature.html#aeb221cf52bc2b1a9bf6e0a9779bfd20f":[19,0,0,4,0,8,4],
+"struct_epid11_basic_signature.html#af18200712d2cf3ed3ccaee328e8a4e0f":[19,0,0,4,0,8,3],
+"struct_epid11_basic_signature.html#afe28bad6328f81e6f7af011cc96ac2e5":[19,0,0,4,0,8,7],
+"struct_epid11_g2_elem_str.html":[19,0,0,4,0,4],
+"struct_epid11_g2_elem_str.html#a9e8984e479bcbe8bd36c65e80c340032":[19,0,0,4,0,4,1],
+"struct_epid11_g2_elem_str.html#af28558484298f4f56377ededf57a4a04":[19,0,0,4,0,4,0],
+"struct_epid11_group_pub_key.html":[19,0,0,4,0,7],
+"struct_epid11_group_pub_key.html#a056c7138246e2bdcd47eaad501b756bb":[19,0,0,4,0,7,3],
+"struct_epid11_group_pub_key.html#a36f688472e2655052d485eac67d8c362":[19,0,0,4,0,7,1],
+"struct_epid11_group_pub_key.html#a964344b3c595bdd585bb9b5d9d0ea762":[19,0,0,4,0,7,0],
+"struct_epid11_group_pub_key.html#aa724e9d2f0cb6019c05547d76a13b72a":[19,0,0,4,0,7,2],
+"struct_epid11_group_rl.html":[19,0,0,4,0,14],
+"struct_epid11_group_rl.html#a35cb954f598d4006b0f047cde77010a5":[19,0,0,4,0,14,1],
+"struct_epid11_group_rl.html#a63afa9863e8dcb63ff884e6e4093c481":[19,0,0,4,0,14,2],
+"struct_epid11_group_rl.html#a97f165c59bc447e3ca3c2148a096710f":[19,0,0,4,0,14,0],
+"struct_epid11_gt_elem_str.html":[19,0,0,4,0,5],
+"struct_epid11_gt_elem_str.html#aed8dd86f1696c2f3537154fc904bf2b0":[19,0,0,4,0,5,0],
+"struct_epid11_nr_proof.html":[19,0,0,4,0,9],
+"struct_epid11_nr_proof.html#a1ad7fe6b32c09f2504ee49731c0ad145":[19,0,0,4,0,9,1],
+"struct_epid11_nr_proof.html#a2e5ee8dc25d296538dce935397a93d68":[19,0,0,4,0,9,0],
+"struct_epid11_nr_proof.html#a5ad9ba3bfac4eac37fd4a4e33ea65ddc":[19,0,0,4,0,9,3],
+"struct_epid11_nr_proof.html#aa8406e938b2f87bded9e374e93a8ee5d":[19,0,0,4,0,9,2],
+"struct_epid11_params.html":[19,0,0,4,0,6],
+"struct_epid11_params.html#a01381f84b2d747b6273e21c71c58a1b0":[19,0,0,4,0,6,0],
+"struct_epid11_params.html#a02bd6fa2ab256e3a07533e947ab0101e":[19,0,0,4,0,6,10],
+"struct_epid11_params.html#a0fe238db4ebc0225899dc2dac97d11c0":[19,0,0,4,0,6,9],
+"struct_epid11_params.html#a1c6bbc4e066449d9c329f88cb653ef7c":[19,0,0,4,0,6,6],
+"struct_epid11_params.html#a27b45ed7771a3024d1d059b4b4ff6eae":[19,0,0,4,0,6,2],
+"struct_epid11_params.html#a2aa4d8a2ebe0dfeb6d930fd7b39f9d1a":[19,0,0,4,0,6,11],
+"struct_epid11_params.html#a49462f35596d07a456a731d0690fdd83":[19,0,0,4,0,6,14],
+"struct_epid11_params.html#a77a8350b97a7afb584a46eb5b32f03bf":[19,0,0,4,0,6,12],
+"struct_epid11_params.html#a7eb9a1371d7187ae81bccfa8d5595033":[19,0,0,4,0,6,7],
+"struct_epid11_params.html#a835e70da717cd5b0c94e242a6418a287":[19,0,0,4,0,6,5],
+"struct_epid11_params.html#aacc39ebe0cc625321039ffb6be0b0e87":[19,0,0,4,0,6,4],
+"struct_epid11_params.html#aad03fd1cc3955bb8879535fa7298123f":[19,0,0,4,0,6,13],
+"struct_epid11_params.html#ade3f88ce73d7de656ec67d9fdb0719d7":[19,0,0,4,0,6,3],
+"struct_epid11_params.html#ae2d1dc635d9d7cba496c3d64fb6f9d5b":[19,0,0,4,0,6,8],
+"struct_epid11_params.html#ae8770bb921aac9214ff8c45c41dbb228":[19,0,0,4,0,6,1],
+"struct_epid11_params.html#af22cfcd6c7ec0e7e7369b79554b963bd":[19,0,0,4,0,6,15],
+"struct_epid11_priv_rl.html":[19,0,0,4,0,11],
+"struct_epid11_priv_rl.html#a2b3899f5a35bf64f860d6d91bccb03c8":[19,0,0,4,0,11,3],
+"struct_epid11_priv_rl.html#aa8945d81e30674b52a6d0900b64feb3c":[19,0,0,4,0,11,1],
+"struct_epid11_priv_rl.html#abbb75fee81aecb2dde7e2daab895ad3b":[19,0,0,4,0,11,0],
+"struct_epid11_priv_rl.html#ad95f880f40e2f40c723f5bdbd22ecfa2":[19,0,0,4,0,11,2],
+"struct_epid11_sig_rl.html":[19,0,0,4,0,13],
+"struct_epid11_sig_rl.html#a6473f8a98f76c9f82183041ea5ae17e3":[19,0,0,4,0,13,0],
+"struct_epid11_sig_rl.html#a8c654d43df132db7874f4c84c177dc12":[19,0,0,4,0,13,2],
+"struct_epid11_sig_rl.html#aa38674729293f4879ff94328dd3c59b1":[19,0,0,4,0,13,3],
+"struct_epid11_sig_rl.html#ad45b0e3e1be59649150dd34c104000ac":[19,0,0,4,0,13,1],
+"struct_epid11_sig_rl_entry.html":[19,0,0,4,0,12],
+"struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a":[19,0,0,4,0,12,1],
+"struct_epid11_sig_rl_entry.html#abe47cfbd00684941f93a211417bedf0c":[19,0,0,4,0,12,0],
+"struct_epid11_signature.html":[19,0,0,4,0,10],
+"struct_epid11_signature.html#a43cb3ed13c862ff05a9292623ad57c5e":[19,0,0,4,0,10,1],
+"struct_epid11_signature.html#a48526e73f02ad3f1544c4c71c481f153":[19,0,0,4,0,10,3],
+"struct_epid11_signature.html#abf24a8df563ba3f535486d8dad7384f4":[19,0,0,4,0,10,2],
+"struct_epid11_signature.html#ad25c277223a5210063163ea554d08ad4":[19,0,0,4,0,10,0],
+"struct_epid11_verifier_precomp.html":[19,0,2,0,0],
+"struct_epid11_verifier_precomp.html#a03138e937f4488bdbc52ed473dc313da":[19,0,2,0,0,3],
+"struct_epid11_verifier_precomp.html#a0a980adb039089263ec59a995600ee91":[19,0,2,0,0,0],
+"struct_epid11_verifier_precomp.html#a14ebadf105aff085edb9a817a2d1db89":[19,0,2,0,0,2],
+"struct_epid11_verifier_precomp.html#ad0ff2a13c2c87460296900dde72a2f30":[19,0,2,0,0,1],
+"struct_epid2_params.html":[19,0,0,4,14],
+"struct_epid2_params.html#a023603228fed2854ddae2e228938940f":[19,0,0,4,14,6],
+"struct_epid2_params.html#a200a0cba1c9e4ad512bece23f2461a5f":[19,0,0,4,14,7],
+"struct_epid2_params.html#a2f868edb49be49f645101ef5ebbbc551":[19,0,0,4,14,0],
+"struct_epid2_params.html#a4c5195b4fa9393a07a121336202531ad":[19,0,0,4,14,2],
+"struct_epid2_params.html#a609b0aac17fca34fe39bee29676a9618":[19,0,0,4,14,3],
+"struct_epid2_params.html#ac0e0dad45b10927860cd5fa4f8101f08":[19,0,0,4,14,5],
+"struct_epid2_params.html#ac2d7507c6f58c3451beacacb91b52695":[19,0,0,4,14,1],
+"struct_epid2_params.html#ae1d8f5d6036a82064e91bc137b278e74":[19,0,0,4,14,8],
+"struct_epid2_params.html#af23f07fb0e1745c0ad14aceeaa946928":[19,0,0,4,14,4],
+"struct_epid_ca_certificate.html":[19,0,0,2,2],
+"struct_epid_ca_certificate.html#a280e0b0238cf45834c21849ab8a7e124":[19,0,0,2,2,1],
+"struct_epid_ca_certificate.html#a2811c1914ffae913820f13da914c8f01":[19,0,0,2,2,0],
+"struct_epid_ca_certificate.html#a2f8f09ae02919c379c38386668b47418":[19,0,0,2,2,6],
+"struct_epid_ca_certificate.html#a3a44e8050ca2f5085652b2b4e15b779c":[19,0,0,2,2,3],
+"struct_epid_ca_certificate.html#a4f77996f90ed7da1d0503c4236b2c9d1":[19,0,0,2,2,7],
+"struct_epid_ca_certificate.html#a9d2fc21f46cf9fc96e2ea557b70e5356":[19,0,0,2,2,4],
+"struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2":[19,0,0,2,2,5],
+"struct_epid_ca_certificate.html#abd69cce8d5e3940787ee0d17f72184ab":[19,0,0,2,2,8],
+"struct_epid_ca_certificate.html#ac03cf7257c52ad14e3dd3201b930dd50":[19,0,0,2,2,2],
+"struct_epid_file_header.html":[19,0,0,2,1],
+"struct_epid_file_header.html#a35d43c51c1739940381e4898ca87b824":[19,0,0,2,1,0],
+"struct_epid_file_header.html#af5d48c739cc6c00c6e1ce35abf4f1473":[19,0,0,2,1,1],
+"struct_epid_signature.html":[19,0,0,4,23],
+"struct_epid_signature.html#a4155f3f4f1223fc4ae50c94f5305def1":[19,0,0,4,23,1],
+"struct_epid_signature.html#a62a6b0ffcd5f68dd3d2786a58fe43017":[19,0,0,4,23,0],
+"struct_epid_signature.html#a89d2e38223944310b6eeeadf6061a2dd":[19,0,0,4,23,2],
+"struct_epid_signature.html#ab0fe5f98bff737fcfbfe0b4d658e83f2":[19,0,0,4,23,3],
+"struct_fp_elem_str.html":[19,0,0,4,9],
+"struct_fp_elem_str.html#a5ddb96a5567750f2834335851c906c45":[19,0,0,4,9,0],
+"struct_fq12_elem_str.html":[19,0,0,4,32],
+"struct_fq12_elem_str.html#a0520947335aaf52de90af1dec5bdd112":[19,0,0,4,32,0],
+"struct_fq2_elem_str.html":[19,0,0,4,30],
+"struct_fq2_elem_str.html#ab1d253eb24ba30eaf516ac429daab915":[19,0,0,4,30,0],
+"struct_fq3_elem_str.html":[19,0,0,4,0,3]
};
diff --git a/doc/html/navtreeindex2.js b/doc/html/navtreeindex2.js
index e4b1623..9550284 100644
--- a/doc/html/navtreeindex2.js
+++ b/doc/html/navtreeindex2.js
@@ -1,93 +1,103 @@
var NAVTREEINDEX2 =
{
-"struct_group_rl.html":[17,0,0,4,27],
-"struct_group_rl.html#a51022e172ab8b945efc69f1e63170107":[17,0,0,4,27,0],
-"struct_group_rl.html#a69c41d99cdfc5b6ece7442f466f7ec3f":[17,0,0,4,27,2],
-"struct_group_rl.html#a9067f01c63cdefbc8e23c3cf67a10172":[17,0,0,4,27,1],
-"struct_gt_elem_str.html":[17,0,0,4,13],
-"struct_gt_elem_str.html#aeaeb0e9e1c6efd378a475eb9a6c42132":[17,0,0,4,13,0],
-"struct_i_priv_key.html":[17,0,0,4,16],
-"struct_i_priv_key.html#a6d484175317aef09fb959c3ca55fc70a":[17,0,0,4,16,0],
-"struct_i_priv_key.html#ad400a4237b6d50855538fd40580eb1bb":[17,0,0,4,16,1],
-"struct_join_request.html":[17,0,0,4,20],
-"struct_join_request.html#a005651506fd4511e8a3537f6c3634532":[17,0,0,4,20,1],
-"struct_join_request.html#a55e30a274e83b808db6fbab5ae6c6cb8":[17,0,0,4,20,0],
-"struct_join_request.html#a73bf8989df5f90eb3d06e7a42ad74d1d":[17,0,0,4,20,2],
-"struct_member_precomp.html":[17,0,0,4,29],
-"struct_member_precomp.html#a4e7412969bed3964f813b093b948e7b4":[17,0,0,4,29,1],
-"struct_member_precomp.html#a55e5c4b25c8f0f426969a8d745260fe5":[17,0,0,4,29,0],
-"struct_member_precomp.html#a573551f6494e372f44fd3bdf5b02aeda":[17,0,0,4,29,3],
-"struct_member_precomp.html#a879d5a7b0c30088b23f6e5c5fc62f834":[17,0,0,4,29,2],
-"struct_membership_credential.html":[17,0,0,4,19],
-"struct_membership_credential.html#a2c5c0d22999d6917fea5ad6618883bcf":[17,0,0,4,19,2],
-"struct_membership_credential.html#a6d38ac3a9c5417833b8adb9b22bc9dc8":[17,0,0,4,19,0],
-"struct_membership_credential.html#afbff64ec55888c7e2a658eabb5e16671":[17,0,0,4,19,1],
-"struct_nr_proof.html":[17,0,0,4,22],
-"struct_nr_proof.html#a0de1aa69acf3d93da34cf4a613b359a1":[17,0,0,4,22,0],
-"struct_nr_proof.html#a717ec36a6c91acd01d9b642bb20fc178":[17,0,0,4,22,1],
-"struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3":[17,0,0,4,22,3],
-"struct_nr_proof.html#ae2e9f22089793a4d44a0f7f5cdb78a0c":[17,0,0,4,22,2],
-"struct_nr_prove_commit_output.html":[17,0,1,0,0],
-"struct_nr_prove_commit_output.html#a00234dfa2443d49f5a294c58fdacb064":[17,0,1,0,0,2],
-"struct_nr_prove_commit_output.html#aab0f11e55d3b8d838e472242e27a1a43":[17,0,1,0,0,1],
-"struct_nr_prove_commit_output.html#af9c605d560f83ccd69e35d8b9cfe51b3":[17,0,1,0,0,0],
-"struct_oct_str128.html":[17,0,0,4,5],
-"struct_oct_str128.html#a7482aa9b0b580fdd50bd65419d52d4b9":[17,0,0,4,5,0],
-"struct_oct_str16.html":[17,0,0,4,2],
-"struct_oct_str16.html#a86ed6671693a3f60ec4ff7de2c1206c3":[17,0,0,4,2,0],
-"struct_oct_str256.html":[17,0,0,4,6],
-"struct_oct_str256.html#a359781bb84f5717a16094583a00ef14e":[17,0,0,4,6,0],
-"struct_oct_str32.html":[17,0,0,4,3],
-"struct_oct_str32.html#a5588a7e70f3d73f6ce58b567a9f5c5c8":[17,0,0,4,3,0],
-"struct_oct_str512.html":[17,0,0,4,7],
-"struct_oct_str512.html#abd4d1b97fe49321571da86de1aeac653":[17,0,0,4,7,0],
-"struct_oct_str600.html":[17,0,0,4,0,1],
-"struct_oct_str600.html#a06d53af92a06e1decc6062fd16c43a59":[17,0,0,4,0,1,0],
-"struct_oct_str64.html":[17,0,0,4,4],
-"struct_oct_str64.html#a0e107d78192a5ae0b48ed9e5c4eab0fc":[17,0,0,4,4,0],
-"struct_oct_str768.html":[17,0,0,4,0,2],
-"struct_oct_str768.html#ae45eea89259bd22e60a8d960063921cc":[17,0,0,4,0,2,0],
-"struct_oct_str8.html":[17,0,0,4,1],
-"struct_oct_str8.html#a5e6c56fda48c88b419e621b464b03bef":[17,0,0,4,1,0],
-"struct_oct_str80.html":[17,0,0,4,0,0],
-"struct_oct_str80.html#af80e2b81554109d9a41c5e771aceb8c9":[17,0,0,4,0,0,0],
-"struct_priv_key.html":[17,0,0,4,17],
-"struct_priv_key.html#a266c7e369b8b868ef5755e9cd3c0c849":[17,0,0,4,17,0],
-"struct_priv_key.html#aa805f9e124f05bdb733c85cb93614cbd":[17,0,0,4,17,3],
-"struct_priv_key.html#ab416dcb4366427c24b44c2a02e4ae7c8":[17,0,0,4,17,2],
-"struct_priv_key.html#ad7ee0392a583edd2e287cf8c1f9066ba":[17,0,0,4,17,1],
-"struct_priv_rl.html":[17,0,0,4,24],
-"struct_priv_rl.html#a4c6b51cec760f7e81ca8635422ac6a50":[17,0,0,4,24,3],
-"struct_priv_rl.html#a60d73f9ef5fc81f117b3abadf8c18466":[17,0,0,4,24,0],
-"struct_priv_rl.html#a6da9639ec4061689d1c30a58e0befd14":[17,0,0,4,24,2],
-"struct_priv_rl.html#af7317529b8e55476bd06b66ed8131d64":[17,0,0,4,24,1],
-"struct_sha256_digest.html":[17,0,0,0,4,0],
-"struct_sha256_digest.html#a4b6462ddd3f89e4c40220ceb6b1c7f28":[17,0,0,0,4,0,0],
-"struct_sig_rl.html":[17,0,0,4,26],
-"struct_sig_rl.html#a12757d30fcccd310716433948e0b603e":[17,0,0,4,26,1],
-"struct_sig_rl.html#a9dfb6b508db9051f4dc480a51d702af2":[17,0,0,4,26,2],
-"struct_sig_rl.html#ac23a919993d99d24a5150302f1778102":[17,0,0,4,26,0],
-"struct_sig_rl.html#ac9d4c343c539dba799e1f42eb38b351f":[17,0,0,4,26,3],
-"struct_sig_rl_entry.html":[17,0,0,4,25],
-"struct_sig_rl_entry.html#a0dfeb058614e81878bfbf86ae3edac3c":[17,0,0,4,25,1],
-"struct_sig_rl_entry.html#ac6a47ff0d1b8ea1512e0ff14983ac5ce":[17,0,0,4,25,0],
-"struct_sign_commit_output.html":[17,0,1,0,1],
-"struct_sign_commit_output.html#a0f35f1d619ea972acbdf9d45af630de0":[17,0,1,0,1,3],
-"struct_sign_commit_output.html#a496bdc4d14fb73b1e85dfff3bc9fd3ba":[17,0,1,0,1,1],
-"struct_sign_commit_output.html#a9ce3b28916094f5fa108d5f5c86631b0":[17,0,1,0,1,4],
-"struct_sign_commit_output.html#ad01513f153f51f7ce211cf323a224499":[17,0,1,0,1,2],
-"struct_sign_commit_output.html#ae2ebcc07395e60187d9ccca373665dba":[17,0,1,0,1,0],
-"struct_verifier_precomp.html":[17,0,2,1],
-"struct_verifier_precomp.html#a8caf79578e3c0baf91921460391103ca":[17,0,2,1,2],
-"struct_verifier_precomp.html#ab061d6cc07d1467eeb5bf25f3ea7e306":[17,0,2,1,3],
-"struct_verifier_precomp.html#ad1106376f12772942af0331eb74de6e5":[17,0,2,1,0],
-"struct_verifier_precomp.html#af8fd90f3a5a2be932a97dcd86099d5b2":[17,0,2,1,1],
-"struct_verifier_precomp.html#afc3e29a325c95c62bb192d5f8cdd5c1c":[17,0,2,1,4],
-"struct_verifier_rl.html":[17,0,0,4,28],
-"struct_verifier_rl.html#a1e3f84b873bccc0c882aa6432c42d2f7":[17,0,0,4,28,3],
-"struct_verifier_rl.html#a5d9a9265fffa96fd5f9260543eb08c68":[17,0,0,4,28,0],
-"struct_verifier_rl.html#ab85c4666d16145ff16443e84468d2d7d":[17,0,0,4,28,1],
-"struct_verifier_rl.html#ac7d3dceab4772096bbbeb3fa735d18a9":[17,0,0,4,28,2],
-"struct_verifier_rl.html#afa44ab69ffff5a3508366aeb2131fdaa":[17,0,0,4,28,4],
+"struct_fq3_elem_str.html#af1be0a4d5c9c674d75bec34f95e3c731":[19,0,0,4,0,3,0],
+"struct_fq6_elem_str.html":[19,0,0,4,31],
+"struct_fq6_elem_str.html#a89d656e5c815b4a2382d11ef6932a7d2":[19,0,0,4,31,0],
+"struct_fq_elem_str.html":[19,0,0,4,10],
+"struct_fq_elem_str.html#aac1a876b51a8d2c6d1510e4df2fd3f14":[19,0,0,4,10,0],
+"struct_g1_elem_str.html":[19,0,0,4,11],
+"struct_g1_elem_str.html#a3b0e658d6e5697763ad9c633c11d4ec4":[19,0,0,4,11,0],
+"struct_g1_elem_str.html#a8f2455ca314e885ea180dadf84bf27c3":[19,0,0,4,11,1],
+"struct_g2_elem_str.html":[19,0,0,4,12],
+"struct_g2_elem_str.html#a145ec5b20a6f4f00b080e11c8680afc3":[19,0,0,4,12,0],
+"struct_g2_elem_str.html#a43141b2458aecceed8ee2748270f7908":[19,0,0,4,12,1],
+"struct_group_pub_key.html":[19,0,0,4,15],
+"struct_group_pub_key.html#a2a4320ec99fd1a15df412fbf2a8d49f1":[19,0,0,4,15,2],
+"struct_group_pub_key.html#a86be439104fb60b324784baf24a943f9":[19,0,0,4,15,3],
+"struct_group_pub_key.html#a8c22c758ea186f95e3bf4b2ef8451da5":[19,0,0,4,15,1],
+"struct_group_pub_key.html#ae8e77ab4d5eb3c8e566c24a64cce56ee":[19,0,0,4,15,0],
+"struct_group_rl.html":[19,0,0,4,27],
+"struct_group_rl.html#a51022e172ab8b945efc69f1e63170107":[19,0,0,4,27,0],
+"struct_group_rl.html#a69c41d99cdfc5b6ece7442f466f7ec3f":[19,0,0,4,27,2],
+"struct_group_rl.html#a9067f01c63cdefbc8e23c3cf67a10172":[19,0,0,4,27,1],
+"struct_gt_elem_str.html":[19,0,0,4,13],
+"struct_gt_elem_str.html#aeaeb0e9e1c6efd378a475eb9a6c42132":[19,0,0,4,13,0],
+"struct_i_priv_key.html":[19,0,0,4,16],
+"struct_i_priv_key.html#a6d484175317aef09fb959c3ca55fc70a":[19,0,0,4,16,0],
+"struct_i_priv_key.html#ad400a4237b6d50855538fd40580eb1bb":[19,0,0,4,16,1],
+"struct_join_request.html":[19,0,0,4,20],
+"struct_join_request.html#a005651506fd4511e8a3537f6c3634532":[19,0,0,4,20,1],
+"struct_join_request.html#a55e30a274e83b808db6fbab5ae6c6cb8":[19,0,0,4,20,0],
+"struct_join_request.html#a73bf8989df5f90eb3d06e7a42ad74d1d":[19,0,0,4,20,2],
+"struct_member_params.html":[19,0,1,1],
+"struct_member_params.html#a7510f05e63328fa13cf2a3a3bd6acd95":[19,0,1,1,2],
+"struct_member_params.html#ad6782a38fd79477bccf2313c676ea4fc":[19,0,1,1,0],
+"struct_member_params.html#ad844c7a2be20bac70b118e7c08530c0b":[19,0,1,1,1],
+"struct_member_precomp.html":[19,0,0,4,29],
+"struct_member_precomp.html#a4e7412969bed3964f813b093b948e7b4":[19,0,0,4,29,1],
+"struct_member_precomp.html#a55e5c4b25c8f0f426969a8d745260fe5":[19,0,0,4,29,0],
+"struct_member_precomp.html#a573551f6494e372f44fd3bdf5b02aeda":[19,0,0,4,29,3],
+"struct_member_precomp.html#a879d5a7b0c30088b23f6e5c5fc62f834":[19,0,0,4,29,2],
+"struct_membership_credential.html":[19,0,0,4,19],
+"struct_membership_credential.html#a2c5c0d22999d6917fea5ad6618883bcf":[19,0,0,4,19,2],
+"struct_membership_credential.html#a6d38ac3a9c5417833b8adb9b22bc9dc8":[19,0,0,4,19,0],
+"struct_membership_credential.html#afbff64ec55888c7e2a658eabb5e16671":[19,0,0,4,19,1],
+"struct_nr_proof.html":[19,0,0,4,22],
+"struct_nr_proof.html#a0de1aa69acf3d93da34cf4a613b359a1":[19,0,0,4,22,0],
+"struct_nr_proof.html#a717ec36a6c91acd01d9b642bb20fc178":[19,0,0,4,22,1],
+"struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3":[19,0,0,4,22,3],
+"struct_nr_proof.html#ae2e9f22089793a4d44a0f7f5cdb78a0c":[19,0,0,4,22,2],
+"struct_oct_str128.html":[19,0,0,4,5],
+"struct_oct_str128.html#a7482aa9b0b580fdd50bd65419d52d4b9":[19,0,0,4,5,0],
+"struct_oct_str16.html":[19,0,0,4,2],
+"struct_oct_str16.html#a86ed6671693a3f60ec4ff7de2c1206c3":[19,0,0,4,2,0],
+"struct_oct_str256.html":[19,0,0,4,6],
+"struct_oct_str256.html#a359781bb84f5717a16094583a00ef14e":[19,0,0,4,6,0],
+"struct_oct_str32.html":[19,0,0,4,3],
+"struct_oct_str32.html#a5588a7e70f3d73f6ce58b567a9f5c5c8":[19,0,0,4,3,0],
+"struct_oct_str512.html":[19,0,0,4,7],
+"struct_oct_str512.html#abd4d1b97fe49321571da86de1aeac653":[19,0,0,4,7,0],
+"struct_oct_str600.html":[19,0,0,4,0,1],
+"struct_oct_str600.html#a06d53af92a06e1decc6062fd16c43a59":[19,0,0,4,0,1,0],
+"struct_oct_str64.html":[19,0,0,4,4],
+"struct_oct_str64.html#a0e107d78192a5ae0b48ed9e5c4eab0fc":[19,0,0,4,4,0],
+"struct_oct_str768.html":[19,0,0,4,0,2],
+"struct_oct_str768.html#ae45eea89259bd22e60a8d960063921cc":[19,0,0,4,0,2,0],
+"struct_oct_str8.html":[19,0,0,4,1],
+"struct_oct_str8.html#a5e6c56fda48c88b419e621b464b03bef":[19,0,0,4,1,0],
+"struct_oct_str80.html":[19,0,0,4,0,0],
+"struct_oct_str80.html#af80e2b81554109d9a41c5e771aceb8c9":[19,0,0,4,0,0,0],
+"struct_priv_key.html":[19,0,0,4,17],
+"struct_priv_key.html#a266c7e369b8b868ef5755e9cd3c0c849":[19,0,0,4,17,0],
+"struct_priv_key.html#aa805f9e124f05bdb733c85cb93614cbd":[19,0,0,4,17,3],
+"struct_priv_key.html#ab416dcb4366427c24b44c2a02e4ae7c8":[19,0,0,4,17,2],
+"struct_priv_key.html#ad7ee0392a583edd2e287cf8c1f9066ba":[19,0,0,4,17,1],
+"struct_priv_rl.html":[19,0,0,4,24],
+"struct_priv_rl.html#a4c6b51cec760f7e81ca8635422ac6a50":[19,0,0,4,24,3],
+"struct_priv_rl.html#a60d73f9ef5fc81f117b3abadf8c18466":[19,0,0,4,24,0],
+"struct_priv_rl.html#a6da9639ec4061689d1c30a58e0befd14":[19,0,0,4,24,2],
+"struct_priv_rl.html#af7317529b8e55476bd06b66ed8131d64":[19,0,0,4,24,1],
+"struct_sha256_digest.html":[19,0,0,0,4,0],
+"struct_sha256_digest.html#a4b6462ddd3f89e4c40220ceb6b1c7f28":[19,0,0,0,4,0,0],
+"struct_sig_rl.html":[19,0,0,4,26],
+"struct_sig_rl.html#a12757d30fcccd310716433948e0b603e":[19,0,0,4,26,1],
+"struct_sig_rl.html#a9dfb6b508db9051f4dc480a51d702af2":[19,0,0,4,26,2],
+"struct_sig_rl.html#ac23a919993d99d24a5150302f1778102":[19,0,0,4,26,0],
+"struct_sig_rl.html#ac9d4c343c539dba799e1f42eb38b351f":[19,0,0,4,26,3],
+"struct_sig_rl_entry.html":[19,0,0,4,25],
+"struct_sig_rl_entry.html#a0dfeb058614e81878bfbf86ae3edac3c":[19,0,0,4,25,1],
+"struct_sig_rl_entry.html#ac6a47ff0d1b8ea1512e0ff14983ac5ce":[19,0,0,4,25,0],
+"struct_verifier_precomp.html":[19,0,2,1],
+"struct_verifier_precomp.html#a8caf79578e3c0baf91921460391103ca":[19,0,2,1,2],
+"struct_verifier_precomp.html#ab061d6cc07d1467eeb5bf25f3ea7e306":[19,0,2,1,3],
+"struct_verifier_precomp.html#ad1106376f12772942af0331eb74de6e5":[19,0,2,1,0],
+"struct_verifier_precomp.html#af8fd90f3a5a2be932a97dcd86099d5b2":[19,0,2,1,1],
+"struct_verifier_precomp.html#afc3e29a325c95c62bb192d5f8cdd5c1c":[19,0,2,1,4],
+"struct_verifier_rl.html":[19,0,0,4,28],
+"struct_verifier_rl.html#a1e3f84b873bccc0c882aa6432c42d2f7":[19,0,0,4,28,3],
+"struct_verifier_rl.html#a5d9a9265fffa96fd5f9260543eb08c68":[19,0,0,4,28,0],
+"struct_verifier_rl.html#ab85c4666d16145ff16443e84468d2d7d":[19,0,0,4,28,1],
+"struct_verifier_rl.html#ac7d3dceab4772096bbbeb3fa735d18a9":[19,0,0,4,28,2],
+"struct_verifier_rl.html#afa44ab69ffff5a3508366aeb2131fdaa":[19,0,0,4,28,4],
"user":[0]
};
diff --git a/doc/html/nrprove_8h.html b/doc/html/nrprove_8h.html
deleted file mode 100644
index 77d1f02..0000000
--- a/doc/html/nrprove_8h.html
+++ /dev/null
@@ -1,103 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm/nrprove.h File Reference</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
- $(document).ready(initResizable);
- $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname"><a
- onclick="storeLink('index.html')"
- id="projectlink"
- class="index.html"
- href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
-</div>
- </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('nrprove_8h.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
- <div class="summary">
-<a href="#nested-classes">Data Structures</a> &#124;
-<a href="#func-members">Functions</a> </div>
- <div class="headertitle">
-<div class="title">nrprove.h File Reference</div> </div>
-</div><!--header-->
-<div class="contents">
-
-<p>TPM NrProve APIs.
-<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
-</div><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
-Data Structures</h2></td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_nr_prove_commit_output.html">NrProveCommitOutput</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Result of NrProve Commit. <a href="struct_nr_prove_commit_output.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
-Functions</h2></td></tr>
-<tr class="memitem:gace6002b520db41d8e781b02c6f538dc0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0">TpmNrProveCommit</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *B_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *K_str, <a class="el" href="struct_sig_rl_entry.html">SigRlEntry</a> const *sigrl_entry, <a class="el" href="struct_nr_prove_commit_output.html">NrProveCommitOutput</a> *commit_out)</td></tr>
-<tr class="memdesc:gace6002b520db41d8e781b02c6f538dc0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the first part of the NrProve operation. <a href="group___tpm_module.html#gace6002b520db41d8e781b02c6f538dc0">More...</a><br /></td></tr>
-<tr class="separator:gace6002b520db41d8e781b02c6f538dc0"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga4346d22fb9fed6a161cb1ea178b50ed2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2">TpmNrProve</a> (TpmCtx *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *c_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *smu_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *snu_str)</td></tr>
-<tr class="memdesc:ga4346d22fb9fed6a161cb1ea178b50ed2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the last part of the NrProve operation. <a href="group___tpm_module.html#ga4346d22fb9fed6a161cb1ea178b50ed2">More...</a><br /></td></tr>
-<tr class="separator:ga4346d22fb9fed6a161cb1ea178b50ed2"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>TPM NrProve APIs. </p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li><li class="navelem"><a class="el" href="nrprove_8h.html">nrprove.h</a></li>
- <li class="footer">
- &copy; 2016-2017 Intel Corporation
- </li>
- </ul>
-</div>
-</body>
-</html>
diff --git a/doc/html/nv_8c.html b/doc/html/nv_8c.html
new file mode 100644
index 0000000..6a4da8c
--- /dev/null
+++ b/doc/html/nv_8c.html
@@ -0,0 +1,105 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/nv.c File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('nv_8c.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">nv.c File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TSS NV API implementation.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="nv_8h.html">epid/member/tpm2/nv.h</a>&quot;</code><br />
+<code>#include &lt;tss2/tss.h&gt;</code><br />
+<code>#include &quot;epid/common/src/memory.h&quot;</code><br />
+<code>#include &quot;<a class="el" href="printtss_8h.html">epid/member/tpm2/ibm_tss/printtss.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="state_8h.html">epid/member/tpm2/ibm_tss/state.h</a>&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga38ca781a9a0126223456e677f40e1d22"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">Tpm2NvUndefineSpace</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index)</td></tr>
+<tr class="memdesc:ga38ca781a9a0126223456e677f40e1d22"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_UndefineSpace TPM command. <a href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">More...</a><br /></td></tr>
+<tr class="separator:ga38ca781a9a0126223456e677f40e1d22"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gadee3a48d63f03d55ea5f02e48d169326"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">Tpm2NvDefineSpace</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size)</td></tr>
+<tr class="memdesc:gadee3a48d63f03d55ea5f02e48d169326"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_DefineSpace TPM command. <a href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">More...</a><br /></td></tr>
+<tr class="separator:gadee3a48d63f03d55ea5f02e48d169326"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">Tpm2NvRead</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size, uint16_t offset, void *data)</td></tr>
+<tr class="memdesc:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_Read TPM command. <a href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">More...</a><br /></td></tr>
+<tr class="separator:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">Tpm2NvWrite</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size, uint16_t offset, void const *data)</td></tr>
+<tr class="memdesc:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_Write TPM command. <a href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">More...</a><br /></td></tr>
+<tr class="separator:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TSS NV API implementation. </p>
+</div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="nv_8c.html">nv.c</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/nv_8h.html b/doc/html/nv_8h.html
new file mode 100644
index 0000000..87a3155
--- /dev/null
+++ b/doc/html/nv_8h.html
@@ -0,0 +1,103 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/nv.h File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('nv_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">nv.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>SDK TPM non volatile memory API.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:gadee3a48d63f03d55ea5f02e48d169326"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">Tpm2NvDefineSpace</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size)</td></tr>
+<tr class="memdesc:gadee3a48d63f03d55ea5f02e48d169326"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_DefineSpace TPM command. <a href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">More...</a><br /></td></tr>
+<tr class="separator:gadee3a48d63f03d55ea5f02e48d169326"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga38ca781a9a0126223456e677f40e1d22"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">Tpm2NvUndefineSpace</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index)</td></tr>
+<tr class="memdesc:ga38ca781a9a0126223456e677f40e1d22"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_UndefineSpace TPM command. <a href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">More...</a><br /></td></tr>
+<tr class="separator:ga38ca781a9a0126223456e677f40e1d22"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">Tpm2NvWrite</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size, uint16_t offset, void const *data)</td></tr>
+<tr class="memdesc:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_Write TPM command. <a href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">More...</a><br /></td></tr>
+<tr class="separator:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">Tpm2NvRead</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size, uint16_t offset, void *data)</td></tr>
+<tr class="memdesc:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_NV_Read TPM command. <a href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">More...</a><br /></td></tr>
+<tr class="separator:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>SDK TPM non volatile memory API. </p>
+</div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="nv_8h.html">nv.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/organization_8dox.html b/doc/html/organization_8dox.html
index 55ae4f6..1fa462b 100644
--- a/doc/html/organization_8dox.html
+++ b/doc/html/organization_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/pageorder_8dox.html b/doc/html/pageorder_8dox.html
index 7556028..48d82d8 100644
--- a/doc/html/pageorder_8dox.html
+++ b/doc/html/pageorder_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/pages.html b/doc/html/pages.html
index 41b7cf4..3b02945 100644
--- a/doc/html/pages.html
+++ b/doc/html/pages.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -69,17 +69,19 @@ $(document).ready(function(){initNavTree('pages.html','');});
<tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="SdkOverview.html" target="_self">What&#39;s Included in the SDK</a></td><td class="desc"></td></tr>
<tr id="row_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="BuildingSdk.html" target="_self">Building from Source</a></td><td class="desc"></td></tr>
<tr id="row_5_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="SignVerifyTutorial.html" target="_self">Signing and Verification Tutorial</a></td><td class="desc"></td></tr>
-<tr id="row_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="IssuerMaterial.html" target="_self">Sample Issuer Material</a></td><td class="desc"></td></tr>
-<tr id="row_7_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="ChoosingiKGF.html" target="_self">If You Choose iKGF as Your Issuer</a></td><td class="desc"></td></tr>
-<tr id="row_8_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="Revocation.html" target="_self">In-Depth Explanation of Revocation</a></td><td class="desc"></td></tr>
-<tr id="row_9_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="Basenames.html" target="_self">In-Depth Explanation of Basenames</a></td><td class="desc"></td></tr>
-<tr id="row_10_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="ImplementationNotes.html" target="_self">Implementation Notes</a></td><td class="desc"></td></tr>
-<tr id="row_11_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="Glossary.html" target="_self">Glossary</a></td><td class="desc"></td></tr>
-<tr id="row_12_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="BuildToolsInstallation.html" target="_self">Guide to Installing Build Tools</a></td><td class="desc"></td></tr>
-<tr id="row_13_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="HowValidated.html" target="_self">Tested Libraries and Compilers</a></td><td class="desc"></td></tr>
-<tr id="row_14_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_14_" class="arrow" onclick="toggleFolder('14_')">&#9660;</span><a class="el" href="Examples.html" target="_self">Walkthroughs of Examples Showing API Usage</a></td><td class="desc"></td></tr>
-<tr id="row_14_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html" target="_self">Generating an Intel&reg; EPID Signature</a></td><td class="desc"></td></tr>
-<tr id="row_14_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a class="el" href="UserManual_VerifyingAnIntelEpidSignature.html" target="_self">Verifying an Intel&reg; EPID Signature</a></td><td class="desc"></td></tr>
+<tr id="row_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="Provisioning.html" target="_self">Preparing a Device</a></td><td class="desc"></td></tr>
+<tr id="row_7_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="IssuerMaterial.html" target="_self">Test Data</a></td><td class="desc"></td></tr>
+<tr id="row_8_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="UsingiKGF.html" target="_self">Managing Groups with iKGF</a></td><td class="desc"></td></tr>
+<tr id="row_9_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="Revocation.html" target="_self">In-Depth Explanation of Revocation</a></td><td class="desc"></td></tr>
+<tr id="row_10_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="Basenames.html" target="_self">In-Depth Explanation of Basenames</a></td><td class="desc"></td></tr>
+<tr id="row_11_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="ImplementationNotes.html" target="_self">Implementation Notes</a></td><td class="desc"></td></tr>
+<tr id="row_12_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="TpmConsiderations.html" target="_self">Considerations for TPM</a></td><td class="desc"></td></tr>
+<tr id="row_13_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="Glossary.html" target="_self">Glossary</a></td><td class="desc"></td></tr>
+<tr id="row_14_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="BuildToolsInstallation.html" target="_self">Guide to Installing Build Tools</a></td><td class="desc"></td></tr>
+<tr id="row_15_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="HowValidated.html" target="_self">Tested Libraries and Compilers</a></td><td class="desc"></td></tr>
+<tr id="row_16_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_16_" class="arrow" onclick="toggleFolder('16_')">&#9660;</span><a class="el" href="Examples.html" target="_self">Walkthroughs of Examples Showing API Usage</a></td><td class="desc"></td></tr>
+<tr id="row_16_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html" target="_self">Generating an Intel&reg; EPID Signature</a></td><td class="desc"></td></tr>
+<tr id="row_16_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a class="el" href="UserManual_VerifyingAnIntelEpidSignature.html" target="_self">Verifying an Intel&reg; EPID Signature</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
diff --git a/doc/html/pairing_8h.html b/doc/html/pairing_8h.html
index 203d1f6..4dbfd07 100644
--- a/doc/html/pairing_8h.html
+++ b/doc/html/pairing_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -68,9 +68,9 @@ $(document).ready(function(){initNavTree('pairing_8h.html','');});
<p>Pairing interface.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ecgroup_8h.html">epid/common/math/ecgroup.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
diff --git a/doc/html/printtss_8c.html b/doc/html/printtss_8c.html
new file mode 100644
index 0000000..505bbdd
--- /dev/null
+++ b/doc/html/printtss_8c.html
@@ -0,0 +1,131 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/printtss.c File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('printtss_8c.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">printtss.c File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM context implementation.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="printtss_8h.html">epid/member/tpm2/ibm_tss/printtss.h</a>&quot;</code><br />
+<code>#include &lt;tss2/TPM_Types.h&gt;</code><br />
+<code>#include &lt;tss2/tss.h&gt;</code><br />
+<code>#include &lt;tss2/tssresponsecode.h&gt;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ac02d185169caec44119e82d97228a68a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printtss_8c.html#ac02d185169caec44119e82d97228a68a">print_tpm2_response_code</a> (char const *operation, TPM_RC rc)</td></tr>
+<tr class="memdesc:ac02d185169caec44119e82d97228a68a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print TPM 2.0 response code as human readable message. <a href="#ac02d185169caec44119e82d97228a68a">More...</a><br /></td></tr>
+<tr class="separator:ac02d185169caec44119e82d97228a68a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM context implementation. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ac02d185169caec44119e82d97228a68a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void print_tpm2_response_code </td>
+ <td>(</td>
+ <td class="paramtype">char const *&#160;</td>
+ <td class="paramname"><em>operation</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">TPM_RC&#160;</td>
+ <td class="paramname"><em>rc</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Print TPM 2.0 response code as human readable message. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">operation</td><td>The operation that returned the code </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">rc</td><td>The response code </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="printtss_8c.html">printtss.c</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/printtss_8h.html b/doc/html/printtss_8h.html
new file mode 100644
index 0000000..0f5cb84
--- /dev/null
+++ b/doc/html/printtss_8h.html
@@ -0,0 +1,129 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/printtss.h File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('printtss_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">printtss.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM log error prints.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;tss2/TPM_Types.h&gt;</code><br />
+<code>#include &lt;tss2/tss.h&gt;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ac02d185169caec44119e82d97228a68a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printtss_8h.html#ac02d185169caec44119e82d97228a68a">print_tpm2_response_code</a> (char const *operation, TPM_RC rc)</td></tr>
+<tr class="memdesc:ac02d185169caec44119e82d97228a68a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print TPM 2.0 response code as human readable message. <a href="#ac02d185169caec44119e82d97228a68a">More...</a><br /></td></tr>
+<tr class="separator:ac02d185169caec44119e82d97228a68a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM log error prints. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ac02d185169caec44119e82d97228a68a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void print_tpm2_response_code </td>
+ <td>(</td>
+ <td class="paramtype">char const *&#160;</td>
+ <td class="paramname"><em>operation</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">TPM_RC&#160;</td>
+ <td class="paramname"><em>rc</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Print TPM 2.0 response code as human readable message. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">operation</td><td>The operation that returned the code </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">rc</td><td>The response code </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="printtss_8h.html">printtss.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/printutils_8h.html b/doc/html/printutils_8h.html
index f47adbf..1f231cf 100644
--- a/doc/html/printutils_8h.html
+++ b/doc/html/printutils_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -67,10 +67,10 @@ $(document).ready(function(){initNavTree('printutils_8h.html','');});
<p>Print helper interface.
<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="bignum_8h.html">epid/common/math/bignum.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
+<div class="textblock"><code>#include &quot;<a class="el" href="bignum_8h.html">epid/common/math/bignum.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ecgroup_8h.html">epid/common/math/ecgroup.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
diff --git a/doc/html/choosing__ikgf_8dox.html b/doc/html/provisioning_8dox.html
index 1bf416c..b53da80 100644
--- a/doc/html/choosing__ikgf_8dox.html
+++ b/doc/html/provisioning_8dox.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: doc/docsrc/choosing_ikgf.dox File Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: doc/docsrc/provisioning.dox File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,12 +53,12 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('choosing__ikgf_8dox.html','');});
+$(document).ready(function(){initNavTree('provisioning_8dox.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
-<div class="title">doc/docsrc/choosing_ikgf.dox File Reference</div> </div>
+<div class="title">doc/docsrc/provisioning.dox File Reference</div> </div>
</div><!--header-->
<div class="contents">
@@ -72,7 +72,7 @@ $(document).ready(function(){initNavTree('choosing__ikgf_8dox.html','');});
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="choosing__ikgf_8dox.html">choosing_ikgf.dox</a></li>
+ <li class="navelem"><a class="el" href="provisioning_8dox.html">provisioning.dox</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/random_base.png b/doc/html/random_base.png
new file mode 100644
index 0000000..de4c665
--- /dev/null
+++ b/doc/html/random_base.png
Binary files differ
diff --git a/doc/html/revocation_8dox.html b/doc/html/revocation_8dox.html
index e5868ad..55339f6 100644
--- a/doc/html/revocation_8dox.html
+++ b/doc/html/revocation_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/sdk__overview_8dox.html b/doc/html/sdk__overview_8dox.html
index ad9d09e..a3091e9 100644
--- a/doc/html/sdk__overview_8dox.html
+++ b/doc/html/sdk__overview_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/sign_8c.html b/doc/html/sign_8c.html
new file mode 100644
index 0000000..a0cd97d
--- /dev/null
+++ b/doc/html/sign_8c.html
@@ -0,0 +1,142 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/sign.c File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('sign_8c.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#define-members">Macros</a> &#124;
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">sign.c File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Tpm2Sign implementation.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="sign_8h.html">epid/member/tpm2/sign.h</a>&quot;</code><br />
+<code>#include &lt;stddef.h&gt;</code><br />
+<code>#include &lt;string.h&gt;</code><br />
+<code>#include &lt;tss2/tss.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
+<code>#include &quot;epid/common/src/epid2params.h&quot;</code><br />
+<code>#include &quot;epid/common/src/hashsize.h&quot;</code><br />
+<code>#include &quot;epid/common/src/memory.h&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="getrandom_8h.html">epid/member/tpm2/getrandom.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="conversion_8h.html">epid/member/tpm2/ibm_tss/conversion.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="printtss_8h.html">epid/member/tpm2/ibm_tss/printtss.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="state_8h.html">epid/member/tpm2/ibm_tss/state.h</a>&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:a5638f861b82f1746ea1af0b384ef8ff1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sign_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">BREAK_ON_EPID_ERROR</a>(ret)</td></tr>
+<tr class="memdesc:a5638f861b82f1746ea1af0b384ef8ff1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle Intel(R) EPID Error with Break. <a href="#a5638f861b82f1746ea1af0b384ef8ff1">More...</a><br /></td></tr>
+<tr class="separator:a5638f861b82f1746ea1af0b384ef8ff1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aa6b8f3261ae9e2e1043380c192f7b5f0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa6b8f3261ae9e2e1043380c192f7b5f0"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sign_8c.html#aa6b8f3261ae9e2e1043380c192f7b5f0">BIT7</a>&#160;&#160;&#160;0x080</td></tr>
+<tr class="memdesc:aa6b8f3261ae9e2e1043380c192f7b5f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bit 7 binary mask. <br /></td></tr>
+<tr class="separator:aa6b8f3261ae9e2e1043380c192f7b5f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a5c80fc0389d18e76cf9f43cfe13b63c7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5c80fc0389d18e76cf9f43cfe13b63c7"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sign_8c.html#a5c80fc0389d18e76cf9f43cfe13b63c7">BITS0500</a>&#160;&#160;&#160;0x3f</td></tr>
+<tr class="memdesc:a5c80fc0389d18e76cf9f43cfe13b63c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Binary 00011111. <br /></td></tr>
+<tr class="separator:a5c80fc0389d18e76cf9f43cfe13b63c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
+Functions</h2></td></tr>
+<tr class="memitem:ga035c8ffba3182ba75a38131e23bb31c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">Tpm2Sign</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, void const *digest, size_t digest_len, uint16_t counter, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *k, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *s)</td></tr>
+<tr class="memdesc:ga035c8ffba3182ba75a38131e23bb31c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_Sign TPM command. <a href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">More...</a><br /></td></tr>
+<tr class="separator:ga035c8ffba3182ba75a38131e23bb31c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac3735163276efa0da4b793ba935513bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">Tpm2ReleaseCounter</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint16_t counter)</td></tr>
+<tr class="memdesc:gac3735163276efa0da4b793ba935513bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erases random r value assosiated with counter. <a href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">More...</a><br /></td></tr>
+<tr class="separator:gac3735163276efa0da4b793ba935513bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>Tpm2Sign implementation. </p>
+</div><h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="a5638f861b82f1746ea1af0b384ef8ff1"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define BREAK_ON_EPID_ERROR</td>
+ <td>(</td>
+ <td class="paramtype">&#160;</td>
+ <td class="paramname">ret</td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a> != (ret)) { \</div><div class="line"> break; \</div><div class="line"> }</div><div class="ttc" id="group___error_codes_html_ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9"><div class="ttname"><a href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a></div><div class="ttdoc">no error </div><div class="ttdef"><b>Definition:</b> errors.h:41</div></div>
+</div><!-- fragment -->
+<p>Handle Intel(R) EPID Error with Break. </p>
+
+</div>
+</div>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="sign_8c.html">sign.c</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/sign_8h.html b/doc/html/sign_8h.html
index 1fbe55b..a49bd2b 100644
--- a/doc/html/sign_8h.html
+++ b/doc/html/sign_8h.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm/sign.h File Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/sign.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -58,42 +58,36 @@ $(document).ready(function(){initNavTree('sign_8h.html','');});
<div id="doc-content">
<div class="header">
<div class="summary">
-<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">sign.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
-<p>TPM signing APIs.
+<p>SDK TPM Sign API.
<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
+<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
</div><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
-Data Structures</h2></td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sign_commit_output.html">SignCommitOutput</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Result of Sign Commit. <a href="struct_sign_commit_output.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
-<tr class="memitem:gaf9004ce8832c1acae497604d1deb49cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd">TpmSignCommit</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *B_in_str, <a class="el" href="struct_sign_commit_output.html">SignCommitOutput</a> *commit_out)</td></tr>
-<tr class="memdesc:gaf9004ce8832c1acae497604d1deb49cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the first part of the sign operation. <a href="group___tpm_module.html#gaf9004ce8832c1acae497604d1deb49cd">More...</a><br /></td></tr>
-<tr class="separator:gaf9004ce8832c1acae497604d1deb49cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaa667fb3295e4533334bb32afcd43890f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f">TpmSign</a> (TpmCtx *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *c_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *sx_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *sf_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *sa_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *sb_str)</td></tr>
-<tr class="memdesc:gaa667fb3295e4533334bb32afcd43890f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs the last part of the sign operation. <a href="group___tpm_module.html#gaa667fb3295e4533334bb32afcd43890f">More...</a><br /></td></tr>
-<tr class="separator:gaa667fb3295e4533334bb32afcd43890f"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga035c8ffba3182ba75a38131e23bb31c7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">Tpm2Sign</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, void const *digest, size_t digest_len, uint16_t counter, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *k, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *s)</td></tr>
+<tr class="memdesc:ga035c8ffba3182ba75a38131e23bb31c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs TPM2_Sign TPM command. <a href="group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">More...</a><br /></td></tr>
+<tr class="separator:ga035c8ffba3182ba75a38131e23bb31c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:gac3735163276efa0da4b793ba935513bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">Tpm2ReleaseCounter</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint16_t counter)</td></tr>
+<tr class="memdesc:gac3735163276efa0da4b793ba935513bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Erases random r value assosiated with counter. <a href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">More...</a><br /></td></tr>
+<tr class="separator:gac3735163276efa0da4b793ba935513bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>TPM signing APIs. </p>
+<div class="textblock"><p>SDK TPM Sign API. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li><li class="navelem"><a class="el" href="sign_8h.html">sign.h</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="sign_8h.html">sign.h</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/sign__verify__tutorial_8dox.html b/doc/html/sign__verify__tutorial_8dox.html
index f072c9f..39ff405 100644
--- a/doc/html/sign__verify__tutorial_8dox.html
+++ b/doc/html/sign__verify__tutorial_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/signmsg__walkthrough_8dox.html b/doc/html/signmsg__walkthrough_8dox.html
index d22e623..ec0d952 100644
--- a/doc/html/signmsg__walkthrough_8dox.html
+++ b/doc/html/signmsg__walkthrough_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/validatekey_8h.html b/doc/html/software__member_8h.html
index fa6f37c..5b63a91 100644
--- a/doc/html/validatekey_8h.html
+++ b/doc/html/software__member_8h.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm/validatekey.h File Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/software_member.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,37 +53,37 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('validatekey_8h.html','');});
+$(document).ready(function(){initNavTree('software__member_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
-<a href="#func-members">Functions</a> </div>
+<a href="#nested-classes">Data Structures</a> </div>
<div class="headertitle">
-<div class="title">validatekey.h File Reference</div> </div>
+<div class="title">software_member.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
-<p>Non-sensitive member context APIs.
+<p>Member creation parameters for software only implementation.
<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<div class="textblock"><code>#include &quot;<a class="el" href="bitsupplier_8h.html">epid/common/bitsupplier.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
-Functions</h2></td></tr>
-<tr class="memitem:ga3318f97e4d1763815dace3779ae6564f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f">TpmIsKeyValid</a> (TpmCtx *ctx, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *A_str, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *x_str, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *h1_str, <a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *w_str)</td></tr>
-<tr class="memdesc:ga3318f97e4d1763815dace3779ae6564f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if provided parameters result in a valid key. <a href="group___tpm_module.html#ga3318f97e4d1763815dace3779ae6564f">More...</a><br /></td></tr>
-<tr class="separator:ga3318f97e4d1763815dace3779ae6564f"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_member_params.html">MemberParams</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Software only specific member parameters. <a href="struct_member_params.html#details">More...</a><br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Non-sensitive member context APIs. </p>
+<div class="textblock"><p>Member creation parameters for software only implementation. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_6048dbb18cb271412de4a010207fd345.html">tpm</a></li><li class="navelem"><a class="el" href="validatekey_8h.html">validatekey.h</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="software__member_8h.html">software_member.h</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/state_8h.html b/doc/html/state_8h.html
new file mode 100644
index 0000000..1ff63e2
--- /dev/null
+++ b/doc/html/state_8h.html
@@ -0,0 +1,93 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/state.h File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('state_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#nested-classes">Data Structures</a> </div>
+ <div class="headertitle">
+<div class="title">state.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>TPM internal state.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
+<code>#include &quot;tss2/TPM_Types.h&quot;</code><br />
+</div><table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
+Data Structures</h2></td></tr>
+<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM TSS context definition. <a href="struct_tpm2_ctx.html#details">More...</a><br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>TPM internal state. </p>
+</div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="state_8h.html">state.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/stdtypes_8h.html b/doc/html/stdtypes_8h.html
index d86aadf..e35919b 100644
--- a/doc/html/stdtypes_8h.html
+++ b/doc/html/stdtypes_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_basic_signature.html b/doc/html/struct_basic_signature.html
index 81952cd..b98d667 100644
--- a/doc/html/struct_basic_signature.html
+++ b/doc/html/struct_basic_signature.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_basic_signature.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">BasicSignature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">BasicSignature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_big_num_str.html b/doc/html/struct_big_num_str.html
index 6a4376c..83c52cc 100644
--- a/doc/html/struct_big_num_str.html
+++ b/doc/html/struct_big_num_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_big_num_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">BigNumStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">BigNumStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_compressed_priv_key.html b/doc/html/struct_compressed_priv_key.html
index 20ec67a..2ca35e2 100644
--- a/doc/html/struct_compressed_priv_key.html
+++ b/doc/html/struct_compressed_priv_key.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_compressed_priv_key.html','');}
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">CompressedPrivKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">CompressedPrivKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_ecdsa_private_key.html b/doc/html/struct_ecdsa_private_key.html
index 3e30da7..2a5e904 100644
--- a/doc/html/struct_ecdsa_private_key.html
+++ b/doc/html/struct_ecdsa_private_key.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_ecdsa_private_key.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">EcdsaPrivateKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">EcdsaPrivateKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_ecdsa_public_key.html b/doc/html/struct_ecdsa_public_key.html
index bcfc2ad..20f1284 100644
--- a/doc/html/struct_ecdsa_public_key.html
+++ b/doc/html/struct_ecdsa_public_key.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_ecdsa_public_key.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">EcdsaPublicKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">EcdsaPublicKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_ecdsa_signature.html b/doc/html/struct_ecdsa_signature.html
index 8a24625..9a3ed16 100644
--- a/doc/html/struct_ecdsa_signature.html
+++ b/doc/html/struct_ecdsa_signature.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_ecdsa_signature.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">EcdsaSignature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">EcdsaSignature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_basic_signature.html b/doc/html/struct_epid11_basic_signature.html
index 5b4d4a1..2f034e8 100644
--- a/doc/html/struct_epid11_basic_signature.html
+++ b/doc/html/struct_epid11_basic_signature.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_basic_signature.html',''
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11BasicSignature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11BasicSignature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_g2_elem_str.html b/doc/html/struct_epid11_g2_elem_str.html
index 084c81a..f5adb6f 100644
--- a/doc/html/struct_epid11_g2_elem_str.html
+++ b/doc/html/struct_epid11_g2_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_g2_elem_str.html','');})
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11G2ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11G2ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_group_pub_key.html b/doc/html/struct_epid11_group_pub_key.html
index 193d90f..287ed10 100644
--- a/doc/html/struct_epid11_group_pub_key.html
+++ b/doc/html/struct_epid11_group_pub_key.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_group_pub_key.html','');
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11GroupPubKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11GroupPubKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_group_rl.html b/doc/html/struct_epid11_group_rl.html
index 0071f0f..87ed580 100644
--- a/doc/html/struct_epid11_group_rl.html
+++ b/doc/html/struct_epid11_group_rl.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_group_rl.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11GroupRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11GroupRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_gt_elem_str.html b/doc/html/struct_epid11_gt_elem_str.html
index b55b2ef..70b40f6 100644
--- a/doc/html/struct_epid11_gt_elem_str.html
+++ b/doc/html/struct_epid11_gt_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_gt_elem_str.html','');})
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11GtElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11GtElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_nr_proof.html b/doc/html/struct_epid11_nr_proof.html
index 59b9cf8..b4c9433 100644
--- a/doc/html/struct_epid11_nr_proof.html
+++ b/doc/html/struct_epid11_nr_proof.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_nr_proof.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11NrProof Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11NrProof Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_params.html b/doc/html/struct_epid11_params.html
index bb6d47f..2e5f821 100644
--- a/doc/html/struct_epid11_params.html
+++ b/doc/html/struct_epid11_params.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_params.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11Params Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11Params Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_priv_rl.html b/doc/html/struct_epid11_priv_rl.html
index c20e2a2..c7d6f36 100644
--- a/doc/html/struct_epid11_priv_rl.html
+++ b/doc/html/struct_epid11_priv_rl.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_priv_rl.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11PrivRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11PrivRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_sig_rl.html b/doc/html/struct_epid11_sig_rl.html
index 8bd0a32..1af66b6 100644
--- a/doc/html/struct_epid11_sig_rl.html
+++ b/doc/html/struct_epid11_sig_rl.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_sig_rl.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11SigRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11SigRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_sig_rl_entry.html b/doc/html/struct_epid11_sig_rl_entry.html
index 5fb17af..58e4e1e 100644
--- a/doc/html/struct_epid11_sig_rl_entry.html
+++ b/doc/html/struct_epid11_sig_rl_entry.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_sig_rl_entry.html','');}
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11SigRlEntry Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11SigRlEntry Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_signature.html b/doc/html/struct_epid11_signature.html
index 48b26d0..eac6851 100644
--- a/doc/html/struct_epid11_signature.html
+++ b/doc/html/struct_epid11_signature.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_signature.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11Signature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Epid11Signature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid11_verifier_precomp.html b/doc/html/struct_epid11_verifier_precomp.html
index 9836628..63479f9 100644
--- a/doc/html/struct_epid11_verifier_precomp.html
+++ b/doc/html/struct_epid11_verifier_precomp.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid11_verifier_precomp.html','
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid11VerifierPrecomp Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_verifier_module.html">verifier</a> &raquo; <a class="el" href="group___epid11_verifier_module.html">EPID 1.1 support</a></div></div> </div>
+<div class="title">Epid11VerifierPrecomp Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_verifier_module.html">verifier</a> &raquo; <a class="el" href="group___epid11_verifier_module.html">Intel(R) EPID 1.1 support</a></div></div> </div>
</div><!--header-->
<div class="contents">
@@ -93,7 +93,7 @@ Data Fields</h2></td></tr>
<p>Serialized form of the information about a verifier that remains stable for a given set of keys.</p>
<p>This API supports Intel(R) EPID 1.1 verification.</p>
<dl class="section note"><dt>Note</dt><dd>e12 = 0 implies that this data is not valid </dd></dl>
-<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> </dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1 support</b></a> </dd></dl>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
<li>epid/verifier/1.1/<a class="el" href="verifier_21_81_2api_8h.html">api.h</a></li>
</ul>
diff --git a/doc/html/struct_epid2_params.html b/doc/html/struct_epid2_params.html
index d577309..d3adaf8 100644
--- a/doc/html/struct_epid2_params.html
+++ b/doc/html/struct_epid2_params.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid2_params.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Epid2Params Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">Epid2Params Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid_ca_certificate.html b/doc/html/struct_epid_ca_certificate.html
index 3255426..c5f0336 100644
--- a/doc/html/struct_epid_ca_certificate.html
+++ b/doc/html/struct_epid_ca_certificate.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid_ca_certificate.html','');}
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">EpidCaCertificate Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___file_parser.html">fileparser</a></div></div> </div>
+<div class="title">EpidCaCertificate Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___file_parser.html">fileparser</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid_file_header.html b/doc/html/struct_epid_file_header.html
index 8fb1c24..0527c9e 100644
--- a/doc/html/struct_epid_file_header.html
+++ b/doc/html/struct_epid_file_header.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid_file_header.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">EpidFileHeader Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___file_parser.html">fileparser</a></div></div> </div>
+<div class="title">EpidFileHeader Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___file_parser.html">fileparser</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_epid_signature.html b/doc/html/struct_epid_signature.html
index 246fa58..6e3e8a9 100644
--- a/doc/html/struct_epid_signature.html
+++ b/doc/html/struct_epid_signature.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_epid_signature.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">EpidSignature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">EpidSignature Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_fp_elem_str.html b/doc/html/struct_fp_elem_str.html
index c892ca1..b1f6635 100644
--- a/doc/html/struct_fp_elem_str.html
+++ b/doc/html/struct_fp_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_fp_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">FpElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">FpElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_fq12_elem_str.html b/doc/html/struct_fq12_elem_str.html
index ec99abf..f6d92ee 100644
--- a/doc/html/struct_fq12_elem_str.html
+++ b/doc/html/struct_fq12_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_fq12_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Fq12ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">Fq12ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_fq2_elem_str.html b/doc/html/struct_fq2_elem_str.html
index 0a38dfd..466305b 100644
--- a/doc/html/struct_fq2_elem_str.html
+++ b/doc/html/struct_fq2_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_fq2_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Fq2ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">Fq2ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_fq3_elem_str.html b/doc/html/struct_fq3_elem_str.html
index bd94a64..c4b743e 100644
--- a/doc/html/struct_fq3_elem_str.html
+++ b/doc/html/struct_fq3_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_fq3_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Fq3ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">Fq3ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_fq6_elem_str.html b/doc/html/struct_fq6_elem_str.html
index 038434e..a4f2fd7 100644
--- a/doc/html/struct_fq6_elem_str.html
+++ b/doc/html/struct_fq6_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_fq6_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Fq6ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">Fq6ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_fq_elem_str.html b/doc/html/struct_fq_elem_str.html
index 284921d..b410738 100644
--- a/doc/html/struct_fq_elem_str.html
+++ b/doc/html/struct_fq_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_fq_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">FqElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">FqElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_g1_elem_str.html b/doc/html/struct_g1_elem_str.html
index c7d5fd4..f770e4a 100644
--- a/doc/html/struct_g1_elem_str.html
+++ b/doc/html/struct_g1_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_g1_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">G1ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">G1ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_g2_elem_str.html b/doc/html/struct_g2_elem_str.html
index 15dcd45..b5c729a 100644
--- a/doc/html/struct_g2_elem_str.html
+++ b/doc/html/struct_g2_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_g2_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">G2ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">G2ElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_group_pub_key.html b/doc/html/struct_group_pub_key.html
index 37dcf30..8858942 100644
--- a/doc/html/struct_group_pub_key.html
+++ b/doc/html/struct_group_pub_key.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_group_pub_key.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">GroupPubKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">GroupPubKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_group_rl.html b/doc/html/struct_group_rl.html
index 2df4cc9..c3a8e77 100644
--- a/doc/html/struct_group_rl.html
+++ b/doc/html/struct_group_rl.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_group_rl.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">GroupRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">GroupRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_gt_elem_str.html b/doc/html/struct_gt_elem_str.html
index ad78f3d..b5238b3 100644
--- a/doc/html/struct_gt_elem_str.html
+++ b/doc/html/struct_gt_elem_str.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_gt_elem_str.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">GtElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">GtElemStr Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_i_priv_key.html b/doc/html/struct_i_priv_key.html
index c51a1b9..ba97e46 100644
--- a/doc/html/struct_i_priv_key.html
+++ b/doc/html/struct_i_priv_key.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_i_priv_key.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">IPrivKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">IPrivKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_join_request.html b/doc/html/struct_join_request.html
index e58a0b3..305db76 100644
--- a/doc/html/struct_join_request.html
+++ b/doc/html/struct_join_request.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_join_request.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">JoinRequest Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">JoinRequest Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_member_params.html b/doc/html/struct_member_params.html
new file mode 100644
index 0000000..b74f3ae
--- /dev/null
+++ b/doc/html/struct_member_params.html
@@ -0,0 +1,107 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: MemberParams Struct Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('struct_member_params.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#pub-attribs">Data Fields</a> </div>
+ <div class="headertitle">
+<div class="title">MemberParams Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_member_module.html">member</a></div></div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Software only specific member parameters.
+ <a href="struct_member_params.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/software_member.h&gt;</code></p>
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
+Data Fields</h2></td></tr>
+<tr class="memitem:ad844c7a2be20bac70b118e7c08530c0b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad844c7a2be20bac70b118e7c08530c0b"></a>
+<a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_member_params.html#ad844c7a2be20bac70b118e7c08530c0b">rnd_func</a></td></tr>
+<tr class="memdesc:ad844c7a2be20bac70b118e7c08530c0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Random number generator. <br /></td></tr>
+<tr class="separator:ad844c7a2be20bac70b118e7c08530c0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7510f05e63328fa13cf2a3a3bd6acd95"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7510f05e63328fa13cf2a3a3bd6acd95"></a>
+void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_member_params.html#a7510f05e63328fa13cf2a3a3bd6acd95">rnd_param</a></td></tr>
+<tr class="memdesc:a7510f05e63328fa13cf2a3a3bd6acd95"><td class="mdescLeft">&#160;</td><td class="mdescRight">User data that will be passed to the user_data parameter of the random number generator. <br /></td></tr>
+<tr class="separator:a7510f05e63328fa13cf2a3a3bd6acd95"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad6782a38fd79477bccf2313c676ea4fc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad6782a38fd79477bccf2313c676ea4fc"></a>
+<a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_member_params.html#ad6782a38fd79477bccf2313c676ea4fc">f</a></td></tr>
+<tr class="memdesc:ad6782a38fd79477bccf2313c676ea4fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Secret part of the private key. If NULL a random value will be generated using rnd_func. <br /></td></tr>
+<tr class="separator:ad6782a38fd79477bccf2313c676ea4fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
+</table>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>Software only specific member parameters. </p>
+<p>Implementation specific configuration parameters.</p>
+<p>You need to use a cryptographically secure random number generator to create a member context using <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a>. The <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c" title="Generates random data. ">BitSupplier</a> is provided as a function prototype for your own implementation of the random number generator. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/<a class="el" href="software__member_8h.html">software_member.h</a></li>
+</ul>
+</div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="struct_member_params.html">MemberParams</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_member_precomp.html b/doc/html/struct_member_precomp.html
index a09de36..8d03cff 100644
--- a/doc/html/struct_member_precomp.html
+++ b/doc/html/struct_member_precomp.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_member_precomp.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">MemberPrecomp Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">MemberPrecomp Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_membership_credential.html b/doc/html/struct_membership_credential.html
index c9c8663..6f28da1 100644
--- a/doc/html/struct_membership_credential.html
+++ b/doc/html/struct_membership_credential.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_membership_credential.html','')
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">MembershipCredential Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">MembershipCredential Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_nr_proof.html b/doc/html/struct_nr_proof.html
index 1f39677..6195801 100644
--- a/doc/html/struct_nr_proof.html
+++ b/doc/html/struct_nr_proof.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_nr_proof.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">NrProof Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">NrProof Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str128.html b/doc/html/struct_oct_str128.html
index 9cc2419..90694ae 100644
--- a/doc/html/struct_oct_str128.html
+++ b/doc/html/struct_oct_str128.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str128.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr128 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">OctStr128 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str16.html b/doc/html/struct_oct_str16.html
index 2d356a2..d81e6d1 100644
--- a/doc/html/struct_oct_str16.html
+++ b/doc/html/struct_oct_str16.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str16.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr16 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">OctStr16 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str256.html b/doc/html/struct_oct_str256.html
index 928d973..5996ad2 100644
--- a/doc/html/struct_oct_str256.html
+++ b/doc/html/struct_oct_str256.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str256.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr256 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">OctStr256 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str32.html b/doc/html/struct_oct_str32.html
index 30d8ca4..ab79790 100644
--- a/doc/html/struct_oct_str32.html
+++ b/doc/html/struct_oct_str32.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str32.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr32 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">OctStr32 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str512.html b/doc/html/struct_oct_str512.html
index d1e272e..c6c2584 100644
--- a/doc/html/struct_oct_str512.html
+++ b/doc/html/struct_oct_str512.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str512.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr512 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">OctStr512 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str600.html b/doc/html/struct_oct_str600.html
index 1ebe5d8..d0cc47d 100644
--- a/doc/html/struct_oct_str600.html
+++ b/doc/html/struct_oct_str600.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str600.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr600 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">OctStr600 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str64.html b/doc/html/struct_oct_str64.html
index df55982..b727f72 100644
--- a/doc/html/struct_oct_str64.html
+++ b/doc/html/struct_oct_str64.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str64.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr64 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">OctStr64 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str768.html b/doc/html/struct_oct_str768.html
index e603421..d9a2ffd 100644
--- a/doc/html/struct_oct_str768.html
+++ b/doc/html/struct_oct_str768.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str768.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr768 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">OctStr768 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str8.html b/doc/html/struct_oct_str8.html
index 0dcdd94..522412f 100644
--- a/doc/html/struct_oct_str8.html
+++ b/doc/html/struct_oct_str8.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str8.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr8 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">OctStr8 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_oct_str80.html b/doc/html/struct_oct_str80.html
index 2e6da78..8e5bd51 100644
--- a/doc/html/struct_oct_str80.html
+++ b/doc/html/struct_oct_str80.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_oct_str80.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">OctStr80 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">EPID 1.1 specific types</a></div></div> </div>
+<div class="title">OctStr80 Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a> &raquo; <a class="el" href="group___epid11_types.html">Intel(R) EPID 1.1 specific types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_priv_key.html b/doc/html/struct_priv_key.html
index 2a9f73c..a3d923f 100644
--- a/doc/html/struct_priv_key.html
+++ b/doc/html/struct_priv_key.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_priv_key.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">PrivKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">PrivKey Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_priv_rl.html b/doc/html/struct_priv_rl.html
index 8bc9deb..5ea47e4 100644
--- a/doc/html/struct_priv_rl.html
+++ b/doc/html/struct_priv_rl.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_priv_rl.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">PrivRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">PrivRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_sha256_digest.html b/doc/html/struct_sha256_digest.html
index b36ef58..6d43ddd 100644
--- a/doc/html/struct_sha256_digest.html
+++ b/doc/html/struct_sha256_digest.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_sha256_digest.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">Sha256Digest Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a> &raquo; <a class="el" href="group___hash_primitives.html">hash</a></div></div> </div>
+<div class="title">Sha256Digest Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a> &raquo; <a class="el" href="group___hash_primitives.html">hash</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_sig_rl.html b/doc/html/struct_sig_rl.html
index 37f8bf6..4aa31f6 100644
--- a/doc/html/struct_sig_rl.html
+++ b/doc/html/struct_sig_rl.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_sig_rl.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">SigRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">SigRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_sig_rl_entry.html b/doc/html/struct_sig_rl_entry.html
index d51ec85..8860624 100644
--- a/doc/html/struct_sig_rl_entry.html
+++ b/doc/html/struct_sig_rl_entry.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_sig_rl_entry.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">SigRlEntry Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">SigRlEntry Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_sign_commit_output.html b/doc/html/struct_sign_commit_output.html
deleted file mode 100644
index 7dca13d..0000000
--- a/doc/html/struct_sign_commit_output.html
+++ /dev/null
@@ -1,113 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: SignCommitOutput Struct Reference</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
- $(document).ready(initResizable);
- $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname"><a
- onclick="storeLink('index.html')"
- id="projectlink"
- class="index.html"
- href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
-</div>
- </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('struct_sign_commit_output.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
- <div class="summary">
-<a href="#pub-attribs">Data Fields</a> </div>
- <div class="headertitle">
-<div class="title">SignCommitOutput Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_member_module.html">member</a> &raquo; <a class="el" href="group___tpm_module.html">tpm</a></div></div> </div>
-</div><!--header-->
-<div class="contents">
-
-<p>Result of Sign Commit.
- <a href="struct_sign_commit_output.html#details">More...</a></p>
-
-<p><code>#include &lt;epid/member/tpm/sign.h&gt;</code></p>
-<table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
-Data Fields</h2></td></tr>
-<tr class="memitem:ae2ebcc07395e60187d9ccca373665dba"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae2ebcc07395e60187d9ccca373665dba"></a>
-<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sign_commit_output.html#ae2ebcc07395e60187d9ccca373665dba">B</a></td></tr>
-<tr class="memdesc:ae2ebcc07395e60187d9ccca373665dba"><td class="mdescLeft">&#160;</td><td class="mdescRight">B value for signature. <br /></td></tr>
-<tr class="separator:ae2ebcc07395e60187d9ccca373665dba"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a496bdc4d14fb73b1e85dfff3bc9fd3ba"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a496bdc4d14fb73b1e85dfff3bc9fd3ba"></a>
-<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sign_commit_output.html#a496bdc4d14fb73b1e85dfff3bc9fd3ba">K</a></td></tr>
-<tr class="memdesc:a496bdc4d14fb73b1e85dfff3bc9fd3ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">K value for signature. <br /></td></tr>
-<tr class="separator:a496bdc4d14fb73b1e85dfff3bc9fd3ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a9ce3b28916094f5fa108d5f5c86631b0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9ce3b28916094f5fa108d5f5c86631b0"></a>
-<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sign_commit_output.html#a9ce3b28916094f5fa108d5f5c86631b0">T</a></td></tr>
-<tr class="memdesc:a9ce3b28916094f5fa108d5f5c86631b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">T value for signature. <br /></td></tr>
-<tr class="separator:a9ce3b28916094f5fa108d5f5c86631b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ad01513f153f51f7ce211cf323a224499"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad01513f153f51f7ce211cf323a224499"></a>
-<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sign_commit_output.html#ad01513f153f51f7ce211cf323a224499">R1</a></td></tr>
-<tr class="memdesc:ad01513f153f51f7ce211cf323a224499"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized G1 element. <br /></td></tr>
-<tr class="separator:ad01513f153f51f7ce211cf323a224499"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:a0f35f1d619ea972acbdf9d45af630de0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0f35f1d619ea972acbdf9d45af630de0"></a>
-<a class="el" href="struct_gt_elem_str.html">GtElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sign_commit_output.html#a0f35f1d619ea972acbdf9d45af630de0">R2</a></td></tr>
-<tr class="memdesc:a0f35f1d619ea972acbdf9d45af630de0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized GT element. <br /></td></tr>
-<tr class="separator:a0f35f1d619ea972acbdf9d45af630de0"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Result of Sign Commit. </p>
-</div><hr/>The documentation for this struct was generated from the following file:<ul>
-<li>epid/member/tpm/<a class="el" href="sign_8h.html">sign.h</a></li>
-</ul>
-</div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <li class="navelem"><a class="el" href="struct_sign_commit_output.html">SignCommitOutput</a></li>
- <li class="footer">
- &copy; 2016-2017 Intel Corporation
- </li>
- </ul>
-</div>
-</body>
-</html>
diff --git a/doc/html/struct_nr_prove_commit_output.html b/doc/html/struct_tpm2_ctx.html
index 3b24a32..abce046 100644
--- a/doc/html/struct_nr_prove_commit_output.html
+++ b/doc/html/struct_tpm2_ctx.html
@@ -5,7 +5,7 @@
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: NrProveCommitOutput Struct Reference</title>
+<title>Intel&reg; Enhanced Privacy ID SDK: Tpm2Ctx Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -53,41 +53,45 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('struct_nr_prove_commit_output.html','');});
+$(document).ready(function(){initNavTree('struct_tpm2_ctx.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">NrProveCommitOutput Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_member_module.html">member</a> &raquo; <a class="el" href="group___tpm_module.html">tpm</a></div></div> </div>
+<div class="title">Tpm2Ctx Struct Reference</div> </div>
</div><!--header-->
<div class="contents">
-<p>Result of NrProve Commit.
- <a href="struct_nr_prove_commit_output.html#details">More...</a></p>
+<p>TPM TSS context definition.
+ <a href="struct_tpm2_ctx.html#details">More...</a></p>
-<p><code>#include &lt;epid/member/tpm/nrprove.h&gt;</code></p>
+<p><code>#include &lt;epid/member/tpm2/ibm_tss/state.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
-<tr class="memitem:a00234dfa2443d49f5a294c58fdacb064"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a00234dfa2443d49f5a294c58fdacb064"></a>
-<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_nr_prove_commit_output.html#a00234dfa2443d49f5a294c58fdacb064">T</a></td></tr>
-<tr class="memdesc:a00234dfa2443d49f5a294c58fdacb064"><td class="mdescLeft">&#160;</td><td class="mdescRight">T value for <a class="el" href="struct_nr_proof.html" title="non-revoked Proof. ">NrProof</a>. <br /></td></tr>
-<tr class="separator:a00234dfa2443d49f5a294c58fdacb064"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:af9c605d560f83ccd69e35d8b9cfe51b3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af9c605d560f83ccd69e35d8b9cfe51b3"></a>
-<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_nr_prove_commit_output.html#af9c605d560f83ccd69e35d8b9cfe51b3">R1</a></td></tr>
-<tr class="memdesc:af9c605d560f83ccd69e35d8b9cfe51b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized G1 element. <br /></td></tr>
-<tr class="separator:af9c605d560f83ccd69e35d8b9cfe51b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:aab0f11e55d3b8d838e472242e27a1a43"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aab0f11e55d3b8d838e472242e27a1a43"></a>
-<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_nr_prove_commit_output.html#aab0f11e55d3b8d838e472242e27a1a43">R2</a></td></tr>
-<tr class="memdesc:aab0f11e55d3b8d838e472242e27a1a43"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized G1 element. <br /></td></tr>
-<tr class="separator:aab0f11e55d3b8d838e472242e27a1a43"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:add1c4c767abfee8bf87068ac03c52db1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="add1c4c767abfee8bf87068ac03c52db1"></a>
+TSS_CONTEXT *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_tpm2_ctx.html#add1c4c767abfee8bf87068ac03c52db1">tss</a></td></tr>
+<tr class="memdesc:add1c4c767abfee8bf87068ac03c52db1"><td class="mdescLeft">&#160;</td><td class="mdescRight">TSS context. <br /></td></tr>
+<tr class="separator:add1c4c767abfee8bf87068ac03c52db1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac9cb082159a9ca169b6666779985a705"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac9cb082159a9ca169b6666779985a705"></a>
+Epid2Params_ const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_tpm2_ctx.html#ac9cb082159a9ca169b6666779985a705">epid2_params</a></td></tr>
+<tr class="memdesc:ac9cb082159a9ca169b6666779985a705"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 2.0 params. <br /></td></tr>
+<tr class="separator:ac9cb082159a9ca169b6666779985a705"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad71eba97fbd7d36ac1dd51ffc67791ce"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad71eba97fbd7d36ac1dd51ffc67791ce"></a>
+TPM_HANDLE&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_tpm2_ctx.html#ad71eba97fbd7d36ac1dd51ffc67791ce">key_handle</a></td></tr>
+<tr class="memdesc:ad71eba97fbd7d36ac1dd51ffc67791ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handle to f value of private key. <br /></td></tr>
+<tr class="separator:ad71eba97fbd7d36ac1dd51ffc67791ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a48940c01483e2e6ba4bd1475fba16fdd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a48940c01483e2e6ba4bd1475fba16fdd"></a>
+<a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_tpm2_ctx.html#a48940c01483e2e6ba4bd1475fba16fdd">hash_alg</a></td></tr>
+<tr class="memdesc:a48940c01483e2e6ba4bd1475fba16fdd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hash algorithm to use. <br /></td></tr>
+<tr class="separator:a48940c01483e2e6ba4bd1475fba16fdd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Result of NrProve Commit. </p>
+<div class="textblock"><p>TPM TSS context definition. </p>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
-<li>epid/member/tpm/<a class="el" href="nrprove_8h.html">nrprove.h</a></li>
+<li>epid/member/tpm2/ibm_tss/<a class="el" href="state_8h.html">state.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
@@ -95,7 +99,7 @@ Data Fields</h2></td></tr>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="navelem"><a class="el" href="struct_nr_prove_commit_output.html">NrProveCommitOutput</a></li>
+ <li class="navelem"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a></li>
<li class="footer">
&copy; 2016-2017 Intel Corporation
</li>
diff --git a/doc/html/struct_verifier_precomp.html b/doc/html/struct_verifier_precomp.html
index 86def45..302db67 100644
--- a/doc/html/struct_verifier_precomp.html
+++ b/doc/html/struct_verifier_precomp.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_verifier_precomp.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">VerifierPrecomp Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_verifier_module.html">verifier</a></div></div> </div>
+<div class="title">VerifierPrecomp Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_verifier_module.html">verifier</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/struct_verifier_rl.html b/doc/html/struct_verifier_rl.html
index fc32725..9d3eb7d 100644
--- a/doc/html/struct_verifier_rl.html
+++ b/doc/html/struct_verifier_rl.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@ $(document).ready(function(){initNavTree('struct_verifier_rl.html','');});
<div class="summary">
<a href="#pub-attribs">Data Fields</a> </div>
<div class="headertitle">
-<div class="title">VerifierRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
+<div class="title">VerifierRl Struct Reference<div class="ingroups"><a class="el" href="group___epid_module.html">epid&amp;nbsp;</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_types.html">types</a></div></div> </div>
</div><!--header-->
<div class="contents">
diff --git a/doc/html/tatepairing_8h.html b/doc/html/tatepairing_8h.html
index 0dce09c..359015e 100644
--- a/doc/html/tatepairing_8h.html
+++ b/doc/html/tatepairing_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -68,9 +68,9 @@ $(document).ready(function(){initNavTree('tatepairing_8h.html','');});
<p>Intel(R) EPID 1.1 Pairing interface.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ecgroup_8h.html">epid/common/math/ecgroup.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="finitefield_8h.html">epid/common/math/finitefield.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
diff --git a/doc/html/tpm__considerations_8dox.html b/doc/html/tpm__considerations_8dox.html
new file mode 100644
index 0000000..e9745d7
--- /dev/null
+++ b/doc/html/tpm__considerations_8dox.html
@@ -0,0 +1,82 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: doc/docsrc/tpm_considerations.dox File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('tpm__considerations_8dox.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">doc/docsrc/tpm_considerations.dox File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>This file is used by Doxygen to generate documentation.
+<a href="#details">More...</a></p>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>This file is used by Doxygen to generate documentation. </p>
+</div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="tpm__considerations_8dox.html">tpm_considerations.dox</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/tpm__member_8h.html b/doc/html/tpm__member_8h.html
new file mode 100644
index 0000000..33cb3da
--- /dev/null
+++ b/doc/html/tpm__member_8h.html
@@ -0,0 +1,82 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: epid/member/tpm_member.h File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('tpm__member_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">tpm_member.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Member creation parameters for TPM implementation.
+<a href="#details">More...</a></p>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>Member creation parameters for TPM implementation. </p>
+</div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="tpm__member_8h.html">tpm_member.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/types_8h.html b/doc/html/types_8h.html
index a598d3e..2aba609 100644
--- a/doc/html/types_8h.html
+++ b/doc/html/types_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/uml_sequence.png b/doc/html/uml_sequence.png
new file mode 100644
index 0000000..69e5e4f
--- /dev/null
+++ b/doc/html/uml_sequence.png
Binary files differ
diff --git a/doc/html/using__ikgf_8dox.html b/doc/html/using__ikgf_8dox.html
new file mode 100644
index 0000000..86bdbae
--- /dev/null
+++ b/doc/html/using__ikgf_8dox.html
@@ -0,0 +1,82 @@
+<!-- HTML header for doxygen 1.8.10-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.11"/>
+<title>Intel&reg; Enhanced Privacy ID SDK: doc/docsrc/using_ikgf.dox File Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="navtree.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="resize.js"></script>
+<script type="text/javascript" src="navtreedata.js"></script>
+<script type="text/javascript" src="navtree.js"></script>
+<script type="text/javascript">
+ $(document).ready(initResizable);
+ $(window).load(resizeHeight);
+</script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td id="projectalign" style="padding-left: 0.5em;">
+ <div id="projectname"><a
+ onclick="storeLink('index.html')"
+ id="projectlink"
+ class="index.html"
+ href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
+&#160;<span id="projectnumber">5.0.0</span>
+</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.11 -->
+</div><!-- top -->
+<div id="side-nav" class="ui-resizable side-nav-resizable">
+ <div id="nav-tree">
+ <div id="nav-tree-contents">
+ <div id="nav-sync" class="sync"></div>
+ </div>
+ </div>
+ <div id="splitbar" style="-moz-user-select:none;"
+ class="ui-resizable-handle">
+ </div>
+</div>
+<script type="text/javascript">
+$(document).ready(function(){initNavTree('using__ikgf_8dox.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">doc/docsrc/using_ikgf.dox File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>This file is used by Doxygen to generate documentation.
+<a href="#details">More...</a></p>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>This file is used by Doxygen to generate documentation. </p>
+</div></div><!-- contents -->
+</div><!-- doc-content -->
+<!-- HTML footer for doxygen 1.8.10-->
+<!-- start footer part -->
+<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
+ <ul>
+ <li class="navelem"><a class="el" href="using__ikgf_8dox.html">using_ikgf.dox</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/verifier_21_81_2api_8h.html b/doc/html/verifier_21_81_2api_8h.html
index fd74c4c..504ce96 100644
--- a/doc/html/verifier_21_81_2api_8h.html
+++ b/doc/html/verifier_21_81_2api_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -69,9 +69,9 @@ $(document).ready(function(){initNavTree('verifier_21_81_2api_8h.html','');});
<p>Intel(R) EPID SDK verifier Intel(R) EPID 1.1 API.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
-<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="1_81_2types_8h.html">epid/common/1.1/types.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="verifier_2api_8h.html">epid/verifier/api.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
diff --git a/doc/html/verifier_2api_8h.html b/doc/html/verifier_2api_8h.html
index 86a5972..cb90b98 100644
--- a/doc/html/verifier_2api_8h.html
+++ b/doc/html/verifier_2api_8h.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
@@ -69,9 +69,9 @@ $(document).ready(function(){initNavTree('verifier_2api_8h.html','');});
<p>Intel(R) EPID SDK verifier API.
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
+<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="stdtypes_8h.html">epid/common/stdtypes.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
diff --git a/doc/html/verifysig__walkthrough_8dox.html b/doc/html/verifysig__walkthrough_8dox.html
index 9150010..f1ccd9c 100644
--- a/doc/html/verifysig__walkthrough_8dox.html
+++ b/doc/html/verifysig__walkthrough_8dox.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">4.0.0</span>
+&#160;<span id="projectnumber">5.0.0</span>
</div>
</td>
</tr>
diff --git a/epid/common-testhelper/1.1/epid_params-testhelper.cc b/epid/common-testhelper/1.1/epid_params-testhelper.cc
index f1be7e9..46aa850 100644
--- a/epid/common-testhelper/1.1/epid_params-testhelper.cc
+++ b/epid/common-testhelper/1.1/epid_params-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,10 +22,10 @@
#include <cstring>
#include "epid/common-testhelper/1.1/epid_params-testhelper.h"
+#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
-#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
extern "C" {
#include "epid/common/math/src/ecgroup-internal.h"
@@ -98,9 +98,9 @@ Epid11ParamsObj::Epid11ParamsObj() {
// cofactor is 1 for G2
const BigNumStr h2_str_ = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
// Create G2
// Set G2 = E(Fqd).init(orderG2, param(Fqd), twista, twistb, g2.x, g2.y).
@@ -111,42 +111,42 @@ Epid11ParamsObj::Epid11ParamsObj() {
}
const BigNumStr Epid11ParamsObj::p_str_ = {
- {{0x00, 0x00, 0x89, 0x57, 0x3F, 0x17, 0x47, 0x30, 0x8C, 0x43, 0xD5, 0xEE,
- 0x41, 0x97, 0x96, 0x19, 0x72, 0xBB, 0x86, 0x88, 0xED, 0x4B, 0xEF, 0x04,
- 0xAB, 0xAE, 0xC3, 0x8E, 0xEC, 0x51, 0xC3, 0xD3}}};
+ {{0x00, 0x00, 0x89, 0x57, 0x3F, 0x17, 0x47, 0x30, 0x8C, 0x43, 0xD5,
+ 0xEE, 0x41, 0x97, 0x96, 0x19, 0x72, 0xBB, 0x86, 0x88, 0xED, 0x4B,
+ 0xEF, 0x04, 0xAB, 0xAE, 0xC3, 0x8E, 0xEC, 0x51, 0xC3, 0xD3}}};
const BigNumStr Epid11ParamsObj::q_str_ = {
- {{0x09, 0xF9, 0x24, 0xE5, 0xD9, 0xBC, 0x67, 0x7F, 0x81, 0x0D, 0xF0, 0x25,
- 0x58, 0xF7, 0x53, 0x13, 0xA9, 0x8A, 0xA6, 0x10, 0x47, 0x65, 0x5D, 0x73,
- 0x9E, 0xF1, 0x94, 0xEB, 0x05, 0xB1, 0xA7, 0x11}}};
+ {{0x09, 0xF9, 0x24, 0xE5, 0xD9, 0xBC, 0x67, 0x7F, 0x81, 0x0D, 0xF0,
+ 0x25, 0x58, 0xF7, 0x53, 0x13, 0xA9, 0x8A, 0xA6, 0x10, 0x47, 0x65,
+ 0x5D, 0x73, 0x9E, 0xF1, 0x94, 0xEB, 0x05, 0xB1, 0xA7, 0x11}}};
const std::vector<uint8_t> Epid11ParamsObj::h_str_ = {0x00, 0x00, 0x12, 0x97};
const FqElemStr Epid11ParamsObj::a_str_ = {
- {{0x05, 0x53, 0xD7, 0xC8, 0x81, 0xF7, 0x78, 0xC2, 0x2C, 0x37, 0xB6, 0xC0,
- 0x16, 0x3E, 0x68, 0x24, 0x3A, 0x84, 0x78, 0x1C, 0x0A, 0xDF, 0x9B, 0xB3,
- 0xED, 0x21, 0xC4, 0x46, 0xE5, 0xA7, 0xA3, 0x92}}};
+ {{0x05, 0x53, 0xD7, 0xC8, 0x81, 0xF7, 0x78, 0xC2, 0x2C, 0x37, 0xB6,
+ 0xC0, 0x16, 0x3E, 0x68, 0x24, 0x3A, 0x84, 0x78, 0x1C, 0x0A, 0xDF,
+ 0x9B, 0xB3, 0xED, 0x21, 0xC4, 0x46, 0xE5, 0xA7, 0xA3, 0x92}}};
const FqElemStr Epid11ParamsObj::b_str_ = {
- {{0x00, 0x3A, 0x2E, 0x39, 0x0E, 0x10, 0xD8, 0xAC, 0x47, 0xCB, 0x29, 0xC8,
- 0xF1, 0x2C, 0x7F, 0x11, 0x99, 0x2A, 0x18, 0xB7, 0xEF, 0x73, 0x48, 0xA6,
- 0xBE, 0x70, 0xA6, 0x8B, 0x97, 0x34, 0x8A, 0xB1}}};
+ {{0x00, 0x3A, 0x2E, 0x39, 0x0E, 0x10, 0xD8, 0xAC, 0x47, 0xCB, 0x29,
+ 0xC8, 0xF1, 0x2C, 0x7F, 0x11, 0x99, 0x2A, 0x18, 0xB7, 0xEF, 0x73,
+ 0x48, 0xA6, 0xBE, 0x70, 0xA6, 0x8B, 0x97, 0x34, 0x8A, 0xB1}}};
const BigNumStr Epid11ParamsObj::coeffs_str_[3] = {
- {{{0x02, 0x16, 0x7A, 0x61, 0x53, 0xDD, 0xF6, 0xE2, 0x89, 0x15, 0xA0, 0x94,
- 0xF1, 0xB5, 0xDC, 0x65, 0x21, 0x15, 0x62, 0xE1, 0x7D, 0xC5, 0x43, 0x89,
- 0xEE, 0xB4, 0xEF, 0xC8, 0xA0, 0x8E, 0x34, 0x0F}}},
+ {{{0x02, 0x16, 0x7A, 0x61, 0x53, 0xDD, 0xF6, 0xE2, 0x89, 0x15, 0xA0,
+ 0x94, 0xF1, 0xB5, 0xDC, 0x65, 0x21, 0x15, 0x62, 0xE1, 0x7D, 0xC5,
+ 0x43, 0x89, 0xEE, 0xB4, 0xEF, 0xC8, 0xA0, 0x8E, 0x34, 0x0F}}},
- {{{0x04, 0x82, 0x27, 0xE1, 0xEB, 0x98, 0x64, 0xC2, 0x8D, 0x8F, 0xDD, 0x0E,
- 0x82, 0x40, 0xAE, 0xD4, 0x31, 0x63, 0xD6, 0x46, 0x32, 0x16, 0x85, 0x7A,
- 0xB7, 0x18, 0x68, 0xB8, 0x17, 0x02, 0x81, 0xA6}}},
+ {{{0x04, 0x82, 0x27, 0xE1, 0xEB, 0x98, 0x64, 0xC2, 0x8D, 0x8F, 0xDD,
+ 0x0E, 0x82, 0x40, 0xAE, 0xD4, 0x31, 0x63, 0xD6, 0x46, 0x32, 0x16,
+ 0x85, 0x7A, 0xB7, 0x18, 0x68, 0xB8, 0x17, 0x02, 0x81, 0xA6}}},
- {{{0x06, 0x20, 0x76, 0xE8, 0x54, 0x54, 0x53, 0xB4, 0xA9, 0xD8, 0x44, 0x4B,
- 0xAA, 0xFB, 0x1C, 0xFD, 0xAE, 0x15, 0xCA, 0x29, 0x79, 0xA6, 0x24, 0xA4,
- 0x0A, 0xF6, 0x1E, 0xAC, 0xED, 0xFB, 0x10, 0x41}}}};
+ {{{0x06, 0x20, 0x76, 0xE8, 0x54, 0x54, 0x53, 0xB4, 0xA9, 0xD8, 0x44,
+ 0x4B, 0xAA, 0xFB, 0x1C, 0xFD, 0xAE, 0x15, 0xCA, 0x29, 0x79, 0xA6,
+ 0x24, 0xA4, 0x0A, 0xF6, 0x1E, 0xAC, 0xED, 0xFB, 0x10, 0x41}}}};
const FqElemStr Epid11ParamsObj::qnr_str = {
- {0x08, 0x66, 0xA7, 0x67, 0x36, 0x6E, 0x62, 0x71, 0xB7, 0xA6, 0x52, 0x94,
- 0x8F, 0xFB, 0x25, 0x9E, 0xE6, 0x4F, 0x25, 0xE5, 0x26, 0x9A, 0x2B, 0x6E,
- 0x7E, 0xF8, 0xA6, 0x39, 0xAE, 0x46, 0xAA, 0x24}};
+ {0x08, 0x66, 0xA7, 0x67, 0x36, 0x6E, 0x62, 0x71, 0xB7, 0xA6, 0x52,
+ 0x94, 0x8F, 0xFB, 0x25, 0x9E, 0xE6, 0x4F, 0x25, 0xE5, 0x26, 0x9A,
+ 0x2B, 0x6E, 0x7E, 0xF8, 0xA6, 0x39, 0xAE, 0x46, 0xAA, 0x24}};
const std::vector<uint8_t> Epid11ParamsObj::orderG2_str = {
0x00, 0x03, 0xDF, 0xFC, 0xBE, 0x2F, 0x5C, 0x2E, 0x45, 0x49, 0x7A, 0x2A,
@@ -159,58 +159,58 @@ const std::vector<uint8_t> Epid11ParamsObj::orderG2_str = {
0xF4, 0xD0, 0x37, 0x74, 0x93, 0x56, 0x62, 0x7B, 0x95, 0xCC, 0x2C, 0xB0};
const BigNumStr Epid11ParamsObj::p1_str_ = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17, 0x9E, 0x84,
- 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xE6, 0xFA, 0xAD, 0xA7, 0x17,
+ 0x9E, 0x84, 0xF3, 0xB9, 0xCA, 0xC2, 0xFC, 0x63, 0x25, 0x51}}};
const BigNumStr Epid11ParamsObj::q1_str_ = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}}};
const std::vector<uint8_t> Epid11ParamsObj::h1_str_ = {0x00, 0x00, 0x00, 0x01};
const FqElemStr Epid11ParamsObj::a1_str_ = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC}}};
const FqElemStr Epid11ParamsObj::b1_str_ = {
- {{0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, 0xE7, 0xB3, 0xEB, 0xBD, 0x55,
- 0x76, 0x98, 0x86, 0xBC, 0x65, 0x1D, 0x06, 0xB0, 0xCC, 0x53, 0xB0, 0xF6,
- 0x3B, 0xCE, 0x3C, 0x3E, 0x27, 0xD2, 0x60, 0x4B}}};
+ {{0x5A, 0xC6, 0x35, 0xD8, 0xAA, 0x3A, 0x93, 0xE7, 0xB3, 0xEB, 0xBD,
+ 0x55, 0x76, 0x98, 0x86, 0xBC, 0x65, 0x1D, 0x06, 0xB0, 0xCC, 0x53,
+ 0xB0, 0xF6, 0x3B, 0xCE, 0x3C, 0x3E, 0x27, 0xD2, 0x60, 0x4B}}};
const Epid11G1ElemStr Epid11ParamsObj::g1_str_ = {
- {{{0x07, 0x78, 0x3B, 0x0D, 0xFE, 0x4A, 0xA3, 0x19, 0x49, 0xB0, 0xCE, 0xAF,
- 0x3F, 0x74, 0x0F, 0x32, 0x16, 0x0C, 0x8B, 0x46, 0x94, 0x5B, 0xA5, 0xB0,
- 0xE4, 0x8A, 0xDA, 0xD8, 0x88, 0x32, 0x90, 0x53}}},
- {{{0x08, 0xF7, 0xA2, 0xAA, 0xBA, 0x62, 0xB3, 0xFE, 0x29, 0x80, 0xC9, 0x5B,
- 0x63, 0x53, 0xC8, 0x24, 0x3C, 0x7C, 0x1F, 0x4C, 0xDA, 0xCD, 0xE5, 0x5F,
- 0xA2, 0x36, 0x93, 0x04, 0x3C, 0x3A, 0xBC, 0x2E}}}};
+ {{{0x07, 0x78, 0x3B, 0x0D, 0xFE, 0x4A, 0xA3, 0x19, 0x49, 0xB0, 0xCE,
+ 0xAF, 0x3F, 0x74, 0x0F, 0x32, 0x16, 0x0C, 0x8B, 0x46, 0x94, 0x5B,
+ 0xA5, 0xB0, 0xE4, 0x8A, 0xDA, 0xD8, 0x88, 0x32, 0x90, 0x53}}},
+ {{{0x08, 0xF7, 0xA2, 0xAA, 0xBA, 0x62, 0xB3, 0xFE, 0x29, 0x80, 0xC9,
+ 0x5B, 0x63, 0x53, 0xC8, 0x24, 0x3C, 0x7C, 0x1F, 0x4C, 0xDA, 0xCD,
+ 0xE5, 0x5F, 0xA2, 0x36, 0x93, 0x04, 0x3C, 0x3A, 0xBC, 0x2E}}}};
const Fq3ElemStr Epid11ParamsObj::g2x_str_ = {
- {{{{0x02, 0x10, 0x9A, 0xF4, 0x06, 0x32, 0x30, 0x89, 0xCB, 0x95, 0xE9, 0x55,
- 0x0E, 0x9D, 0xAF, 0x0E, 0x98, 0xCD, 0xCA, 0xDC, 0xB1, 0xFF, 0xFC, 0xD1,
- 0x45, 0x66, 0xBB, 0x86, 0x46, 0x1E, 0x8C, 0x30}}},
- {{{0x04, 0x78, 0x53, 0xE1, 0x3F, 0x96, 0xC5, 0xE4, 0x15, 0x23, 0x7B, 0x1F,
- 0x3F, 0x2C, 0xD3, 0x95, 0x40, 0xBC, 0x7A, 0x31, 0x1F, 0x14, 0x38, 0x9E,
- 0x1A, 0xA5, 0xD6, 0x63, 0x10, 0x91, 0xE4, 0xD3}}},
- {{{0x00, 0xB4, 0x02, 0xBC, 0x47, 0xFA, 0xA6, 0x29, 0x82, 0x0B, 0xB1, 0xD5,
- 0xFF, 0xF2, 0xE6, 0xB0, 0xC6, 0xAE, 0xE8, 0x7B, 0x91, 0xD9, 0xEE, 0x66,
- 0x07, 0x1F, 0xFD, 0xA2, 0xE7, 0x02, 0x66, 0xDD}}}}};
+ {{{{0x02, 0x10, 0x9A, 0xF4, 0x06, 0x32, 0x30, 0x89, 0xCB, 0x95, 0xE9,
+ 0x55, 0x0E, 0x9D, 0xAF, 0x0E, 0x98, 0xCD, 0xCA, 0xDC, 0xB1, 0xFF,
+ 0xFC, 0xD1, 0x45, 0x66, 0xBB, 0x86, 0x46, 0x1E, 0x8C, 0x30}}},
+ {{{0x04, 0x78, 0x53, 0xE1, 0x3F, 0x96, 0xC5, 0xE4, 0x15, 0x23, 0x7B,
+ 0x1F, 0x3F, 0x2C, 0xD3, 0x95, 0x40, 0xBC, 0x7A, 0x31, 0x1F, 0x14,
+ 0x38, 0x9E, 0x1A, 0xA5, 0xD6, 0x63, 0x10, 0x91, 0xE4, 0xD3}}},
+ {{{0x00, 0xB4, 0x02, 0xBC, 0x47, 0xFA, 0xA6, 0x29, 0x82, 0x0B, 0xB1,
+ 0xD5, 0xFF, 0xF2, 0xE6, 0xB0, 0xC6, 0xAE, 0xE8, 0x7B, 0x91, 0xD9,
+ 0xEE, 0x66, 0x07, 0x1F, 0xFD, 0xA2, 0xE7, 0x02, 0x66, 0xDD}}}}};
const Fq3ElemStr Epid11ParamsObj::g2y_str_ = {
- {{{{0x05, 0x2E, 0xF8, 0xC6, 0xC1, 0x6A, 0xEF, 0x3C, 0xC1, 0x95, 0xF6, 0x26,
- 0xCE, 0x5E, 0x55, 0xD1, 0x64, 0x13, 0x28, 0xB1, 0x18, 0x57, 0xD8, 0x1B,
- 0x84, 0xFA, 0xEC, 0x7E, 0x5D, 0x99, 0x06, 0x49}}},
- {{{0x05, 0x73, 0x35, 0xA9, 0xA7, 0xF2, 0xA1, 0x92, 0x5F, 0x3E, 0x7C, 0xDF,
- 0xAC, 0xFE, 0x0F, 0xF5, 0x08, 0xD0, 0x3C, 0xAE, 0xCD, 0x58, 0x00, 0x5F,
- 0xD0, 0x84, 0x7E, 0xEA, 0x63, 0x57, 0xFE, 0xC6}}},
- {{{0x01, 0x56, 0xDA, 0xF3, 0x72, 0x61, 0xDA, 0xC6, 0x93, 0xB0, 0xAC, 0xEF,
- 0xAA, 0xD4, 0x51, 0x6D, 0xCA, 0x71, 0x1E, 0x06, 0x73, 0xEA, 0x83, 0xB2,
- 0xB1, 0x99, 0x4A, 0x4D, 0x4A, 0x0D, 0x35, 0x07}}}}};
+ {{{{0x05, 0x2E, 0xF8, 0xC6, 0xC1, 0x6A, 0xEF, 0x3C, 0xC1, 0x95, 0xF6,
+ 0x26, 0xCE, 0x5E, 0x55, 0xD1, 0x64, 0x13, 0x28, 0xB1, 0x18, 0x57,
+ 0xD8, 0x1B, 0x84, 0xFA, 0xEC, 0x7E, 0x5D, 0x99, 0x06, 0x49}}},
+ {{{0x05, 0x73, 0x35, 0xA9, 0xA7, 0xF2, 0xA1, 0x92, 0x5F, 0x3E, 0x7C,
+ 0xDF, 0xAC, 0xFE, 0x0F, 0xF5, 0x08, 0xD0, 0x3C, 0xAE, 0xCD, 0x58,
+ 0x00, 0x5F, 0xD0, 0x84, 0x7E, 0xEA, 0x63, 0x57, 0xFE, 0xC6}}},
+ {{{0x01, 0x56, 0xDA, 0xF3, 0x72, 0x61, 0xDA, 0xC6, 0x93, 0xB0, 0xAC,
+ 0xEF, 0xAA, 0xD4, 0x51, 0x6D, 0xCA, 0x71, 0x1E, 0x06, 0x73, 0xEA,
+ 0x83, 0xB2, 0xB1, 0x99, 0x4A, 0x4D, 0x4A, 0x0D, 0x35, 0x07}}}}};
const Epid11G3ElemStr Epid11ParamsObj::g3_str_ = {
- {{{0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6, 0xE5,
- 0x63, 0xA4, 0x40, 0xF2, 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB, 0x33, 0xA0,
- 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96}}},
- {{{0x4F, 0xE3, 0x42, 0xE2, 0xFE, 0x1A, 0x7F, 0x9B, 0x8E, 0xE7, 0xEB, 0x4A,
- 0x7C, 0x0F, 0x9E, 0x16, 0x2B, 0xCE, 0x33, 0x57, 0x6B, 0x31, 0x5E, 0xCE,
- 0xCB, 0xB6, 0x40, 0x68, 0x37, 0xBF, 0x51, 0xF5}}}};
+ {{{0x6B, 0x17, 0xD1, 0xF2, 0xE1, 0x2C, 0x42, 0x47, 0xF8, 0xBC, 0xE6,
+ 0xE5, 0x63, 0xA4, 0x40, 0xF2, 0x77, 0x03, 0x7D, 0x81, 0x2D, 0xEB,
+ 0x33, 0xA0, 0xF4, 0xA1, 0x39, 0x45, 0xD8, 0x98, 0xC2, 0x96}}},
+ {{{0x4F, 0xE3, 0x42, 0xE2, 0xFE, 0x1A, 0x7F, 0x9B, 0x8E, 0xE7, 0xEB,
+ 0x4A, 0x7C, 0x0F, 0x9E, 0x16, 0x2B, 0xCE, 0x33, 0x57, 0x6B, 0x31,
+ 0x5E, 0xCE, 0xCB, 0xB6, 0x40, 0x68, 0x37, 0xBF, 0x51, 0xF5}}}};
diff --git a/epid/common-testhelper/1.1/epid_params-testhelper.h b/epid/common-testhelper/1.1/epid_params-testhelper.h
index 82b80d3..1792392 100644
--- a/epid/common-testhelper/1.1/epid_params-testhelper.h
+++ b/epid/common-testhelper/1.1/epid_params-testhelper.h
@@ -1,5 +1,5 @@
/*############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -25,16 +25,16 @@
#include <vector>
extern "C" {
+#include "epid/common/1.1/types.h"
#include "epid/common/math/bignum.h"
-#include "epid/common/math/finitefield.h"
#include "epid/common/math/ecgroup.h"
-#include "epid/common/1.1/types.h"
+#include "epid/common/math/finitefield.h"
}
-#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
+#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
class Epid11ParamsObj {
public:
diff --git a/epid/common-testhelper/1.1/testdata/grp01/member0/sig_bsn0_msg_0_255_sha256.inc b/epid/common-testhelper/1.1/testdata/grp01/member0/sig_bsn0_msg_0_255_sha256.inc
new file mode 100644
index 0000000..b8639f5
--- /dev/null
+++ b/epid/common-testhelper/1.1/testdata/grp01/member0/sig_bsn0_msg_0_255_sha256.inc
@@ -0,0 +1,89 @@
+ /*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/*!
+ * \file
+ * \brief Test data.
+ *
+ * Type : Intel(R) EPID 1.1 Signature
+ * Group : groupA
+ * Signer : member0
+ * HashAlg : Sha512
+ * Message : bytes [0, 255]
+ * Basename: Random
+ * SigRl : SigRl of group
+ */
+0x8d, 0x1c, 0x17, 0x76, 0x00, 0x19, 0xe0, 0xdd,
+0xd7, 0xf3, 0xad, 0x12, 0xf0, 0x68, 0xd2, 0xa4, 0x45, 0xfb, 0xfb, 0x79,
+0x4d, 0x8d, 0xef, 0x13, 0x62, 0x19, 0x12, 0x7a, 0x5f, 0xfb, 0xdb, 0x49,
+0x6a, 0x73, 0x37, 0x9e, 0xe7, 0x9f, 0x91, 0x3b, 0xba, 0x77, 0xac, 0xae,
+0x10, 0x91, 0xb0, 0xa5, 0xab, 0x3d, 0xc8, 0x69, 0x07, 0x9a, 0x73, 0xdd,
+0x64, 0x3b, 0xed, 0x0b, 0x26, 0x63, 0x28, 0xc7, 0x5b, 0x84, 0xb9, 0x94,
+0xdb, 0xac, 0xfc, 0xcc, 0x7c, 0x46, 0xd7, 0x12, 0xee, 0xb2, 0x49, 0x8e,
+0xb9, 0x9f, 0xf7, 0x96, 0xf9, 0x83, 0xf3, 0xfb, 0xb5, 0xd6, 0x26, 0x3b,
+0xde, 0x99, 0xa3, 0x97, 0x7e, 0xe8, 0x57, 0x93, 0xe2, 0xd9, 0xa3, 0x8c,
+0xc6, 0xb0, 0x74, 0xfd, 0x2d, 0x2d, 0xe7, 0x9f, 0xe3, 0xf0, 0xf5, 0x4c,
+0xe5, 0xb3, 0xdc, 0xfc, 0xac, 0xac, 0xe7, 0x83, 0x2c, 0xe7, 0x8a, 0xe1,
+0x03, 0x6c, 0xfd, 0xa5, 0x46, 0xab, 0xe0, 0x50, 0xd4, 0x86, 0x5e, 0xbf,
+0x03, 0xfb, 0xac, 0xca, 0x4f, 0x89, 0x2c, 0x7c, 0xeb, 0xad, 0x43, 0x19,
+0x21, 0x7d, 0x00, 0x2a, 0x2c, 0x14, 0x20, 0x4d, 0x06, 0xc0, 0x28, 0x96,
+0x1c, 0x3a, 0x3c, 0x81, 0x01, 0x9b, 0x38, 0xd1, 0x4c, 0x00, 0xe8, 0x6c,
+0x44, 0xe6, 0x3a, 0xeb, 0x72, 0x94, 0x06, 0xd4, 0x06, 0x46, 0xc0, 0xf3,
+0xd3, 0xc5, 0xdf, 0x5e, 0x02, 0x13, 0x72, 0x81, 0x96, 0x2c, 0x98, 0x19,
+0x9c, 0x61, 0xc1, 0xe7, 0xf8, 0x94, 0x24, 0x33, 0x7b, 0xea, 0x97, 0x9a,
+0x2f, 0x99, 0x46, 0x0e, 0xd6, 0x0f, 0x3a, 0x66, 0xf0, 0xb9, 0xa6, 0xa7,
+0x03, 0xee, 0xb1, 0xfc, 0x8b, 0xa8, 0xf4, 0xad, 0x77, 0xc1, 0x26, 0x63,
+0x47, 0x81, 0x5c, 0x01, 0x67, 0xf5, 0x43, 0xfb, 0xec, 0x58, 0xd7, 0x20,
+0xd8, 0xe2, 0xba, 0xdb, 0x95, 0x74, 0xd5, 0x18, 0xda, 0x7d, 0xf7, 0xf6,
+0xa8, 0x4d, 0x0f, 0x82, 0x60, 0xe7, 0x21, 0x38, 0x11, 0x4b, 0x81, 0x40,
+0x63, 0x08, 0x5c, 0x9c, 0x86, 0xbe, 0x2a, 0x53, 0x69, 0x54, 0xbe, 0x0f,
+0x4f, 0xb6, 0x60, 0x88, 0xd0, 0x28, 0x83, 0xf7, 0xea, 0xaa, 0xcb, 0xdb,
+0xdf, 0x89, 0x00, 0x00, 0x56, 0xac, 0x9e, 0x51, 0x7d, 0xc0, 0xe1, 0x77,
+0x93, 0xb8, 0x18, 0x2a, 0x1a, 0x95, 0xe4, 0x7c, 0x21, 0x14, 0x5a, 0xa7,
+0x35, 0x8d, 0xb9, 0xcd, 0x0c, 0xc8, 0x33, 0x93, 0x47, 0x87, 0x00, 0x00,
+0x5a, 0xf8, 0x3f, 0x82, 0x6a, 0x6f, 0x85, 0x75, 0x83, 0xfe, 0x50, 0x3d,
+0xeb, 0x68, 0xbd, 0x6d, 0xe6, 0x14, 0xb9, 0x16, 0xab, 0x84, 0x76, 0x59,
+0x42, 0x4a, 0x9f, 0x61, 0xac, 0xa7, 0x00, 0x80, 0xbb, 0x20, 0xfe, 0xb1,
+0x3e, 0xee, 0x68, 0x07, 0xc7, 0xcf, 0x2d, 0x2d, 0x98, 0x18, 0xa0, 0x8d,
+0x91, 0xd5, 0x7f, 0x23, 0x05, 0x2e, 0x35, 0x06, 0xdd, 0xe0, 0xab, 0xd7,
+0x90, 0x2e, 0x53, 0xcc, 0xa1, 0xfd, 0x17, 0x28, 0xbf, 0x91, 0xd6, 0x32,
+0xc8, 0x48, 0xdc, 0x97, 0xae, 0xe2, 0xf4, 0x22, 0x4d, 0xb0, 0x7c, 0xc4,
+0x14, 0xb6, 0x6f, 0x02, 0x54, 0xc3, 0x9a, 0x89, 0xec, 0xbf, 0x41, 0x5f,
+0xda, 0x16, 0x34, 0xd3, 0x1f, 0x77, 0x50, 0x44, 0xb6, 0x00, 0x00, 0x19,
+0xa9, 0x7e, 0xc9, 0x58, 0x95, 0x9d, 0xc7, 0x3e, 0x25, 0x78, 0x75, 0xa1,
+0x1a, 0x68, 0x61, 0x42, 0x94, 0x1a, 0xdc, 0x73, 0xee, 0x23, 0x2e, 0x85,
+0xa1, 0x3e, 0xe8, 0xdc, 0x9d, 0x00, 0x00, 0x65, 0x16, 0x55, 0x42, 0xbc,
+0x48, 0xdc, 0x13, 0xf5, 0xd9, 0x77, 0x89, 0x25, 0x4a, 0x1f, 0x12, 0xf0,
+0x7a, 0xce, 0x98, 0xd8, 0xbe, 0x96, 0x08, 0x04, 0x75, 0x45, 0xc1, 0x63,
+0xd6, 0x00, 0x00, 0x21, 0xdb, 0x1d, 0x9f, 0xe5, 0xbc, 0x64, 0x2c, 0x3c,
+0x37, 0xac, 0xd4, 0x18, 0xf6, 0xf5, 0x52, 0xae, 0xe6, 0x54, 0x19, 0x6e,
+0xac, 0x83, 0x28, 0x43, 0xa7, 0x49, 0xea, 0x94, 0x6f, 0x00, 0x00, 0x72,
+0x8d, 0x9d, 0x41, 0x1d, 0x81, 0x24, 0x13, 0xe4, 0x92, 0x3e, 0x1d, 0x94,
+0x1a, 0x79, 0x04, 0x33, 0xd1, 0x9a, 0xe5, 0x17, 0xf4, 0x7f, 0xf8, 0xd0,
+0x23, 0x2f, 0x15, 0x20, 0x0e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+0x01, 0x79, 0xc4, 0x6e, 0xb2, 0xb9, 0x0d, 0x82, 0x0e, 0x43, 0x6b, 0x62,
+0xdd, 0xaa, 0xf4, 0xe5, 0x60, 0x60, 0xa0, 0xf6, 0x0f, 0x0a, 0x3a, 0xd4,
+0x10, 0xfb, 0x3d, 0x9e, 0x65, 0x3d, 0xf8, 0xf2, 0x6b, 0x9e, 0x4f, 0xb1,
+0xe1, 0xad, 0x06, 0x71, 0xc1, 0xe2, 0xb8, 0x9b, 0xcd, 0x56, 0x2b, 0xca,
+0xa7, 0x0a, 0x44, 0x9a, 0xdb, 0xa6, 0x4d, 0x7d, 0xb5, 0xe0, 0x76, 0x9d,
+0x24, 0x45, 0x87, 0x5f, 0x01, 0x79, 0xce, 0xb3, 0xc1, 0x34, 0xa3, 0xab,
+0x7f, 0x86, 0x95, 0x19, 0x02, 0xa4, 0xdc, 0xb0, 0x47, 0xd6, 0x69, 0x21,
+0x22, 0x00, 0xc5, 0x82, 0xc6, 0x70, 0x1d, 0x5d, 0xaf, 0xe4, 0x20, 0xa3,
+0x71, 0xf3, 0x29, 0x5a, 0xe1, 0x59, 0x3a, 0x66, 0x02, 0x0d, 0xe1, 0x01,
+0x10, 0xab, 0x17, 0x17, 0x30, 0x8e, 0x1d, 0xb2, 0x1b, 0x71, 0x92, 0x02,
+0xe1, 0x91, 0xa9, 0xd5, 0xdb, 0xc7, 0x20, 0x72, 0x09, 0x93, 0xe8, 0x64,
+0x63, 0x3a, 0x6a, 0x4a, 0xc9, 0x4e, 0x20, 0x19, 0x6f, 0xb5, 0x5e, 0x37,
+0x01, 0x38, 0x82, 0x7a, 0x74, 0x87, 0x29, 0xbb, 0xd2, 0xca, 0x24, 0xf5,
+0x75, 0x17, 0xdc, 0xd3, 0x60
diff --git a/epid/common-testhelper/1.1/verifier_wrapper-testhelper.cc b/epid/common-testhelper/1.1/verifier_wrapper-testhelper.cc
index cea2e06..ea95b07 100644
--- a/epid/common-testhelper/1.1/verifier_wrapper-testhelper.cc
+++ b/epid/common-testhelper/1.1/verifier_wrapper-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
* \brief EcGroup C++ wrapper implementation.
*/
#include <cstdio>
-#include <string>
#include <stdexcept>
+#include <string>
#include "epid/common-testhelper/1.1/verifier_wrapper-testhelper.h"
diff --git a/epid/common-testhelper/Makefile b/epid/common-testhelper/Makefile
index 04f322b..b5a0b63 100644
--- a/epid/common-testhelper/Makefile
+++ b/epid/common-testhelper/Makefile
@@ -12,7 +12,7 @@ COMMON_TESTHELPER_UTEST_SRC = $(wildcard ./unittests/*.cc)
COMMON_TESTHELPER_OBJ = $(COMMON_TESTHELPER_SRC:.cc=.o)
COMMON_TESTHELPER_UTEST_OBJ = $(COMMON_TESTHELPER_UTEST_SRC:.cc=.o)
COMMON_TESTHELPER_LIB = ./libcommon-testhelper.a
-COMMON_TESTHELPER_UTEST_EXE = ./unittests/common-testhelper-utest
+COMMON_TESTHELPER_UTEST_EXE = ./unittests/common-testhelper-utest$(EXE_EXTENSION)
LIB_COMMON_TESTHELPER_DIR = .
LIB_COMMON_DIR = ../common
diff --git a/epid/common-testhelper/bignum_wrapper-testhelper.cc b/epid/common-testhelper/bignum_wrapper-testhelper.cc
index 75585e2..680dd59 100644
--- a/epid/common-testhelper/bignum_wrapper-testhelper.cc
+++ b/epid/common-testhelper/bignum_wrapper-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@
* \file
* \brief Bignum C++ wrapper implementation.
*/
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common/math/bignum.h"
/// bignum deleter type
diff --git a/epid/common-testhelper/common-testhelper.parts b/epid/common-testhelper/common-testhelper.parts
index 99365c9..c0b6a41 100644
--- a/epid/common-testhelper/common-testhelper.parts
+++ b/epid/common-testhelper/common-testhelper.parts
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,49 +16,44 @@
Import('*')
env.PartName('common-testhelper')
-src_files = Pattern(src_dir='.',
- includes=['*-testhelper.cc'],
- excludes=[],
- recursive=False).files()
-inc_files = Pattern(src_dir='.',
- includes=['*-testhelper.h'],
- excludes=[],
- recursive=False).files()
-epid11_src_files = Pattern(src_dir='1.1',
- includes=['*-testhelper.cc'],
- excludes=[],
- recursive=False).files()
-epid11_inc_files = Pattern(src_dir='1.1',
- includes=['*-testhelper.h'],
- excludes=[],
- recursive=False).files()
-test_data_files = Pattern(src_dir='testdata',
- includes=['*'],
- excludes=[],
- recursive=True)
-epid11_test_data_files = Pattern(src_dir='1.1/testdata',
- includes=['*'],
- excludes=[],
- recursive=True)
+src_files = Pattern(
+ src_dir='.', includes=['*-testhelper.cc'], excludes=[],
+ recursive=False).files()
+inc_files = Pattern(
+ src_dir='.', includes=['*-testhelper.h'], excludes=[],
+ recursive=False).files()
+epid11_src_files = Pattern(
+ src_dir='1.1', includes=['*-testhelper.cc'], excludes=[],
+ recursive=False).files()
+epid11_inc_files = Pattern(
+ src_dir='1.1', includes=['*-testhelper.h'], excludes=[],
+ recursive=False).files()
+test_data_files = Pattern(
+ src_dir='testdata', includes=['*'], excludes=[], recursive=True)
+epid11_test_data_files = Pattern(
+ src_dir='1.1/testdata', includes=['*'], excludes=[], recursive=True)
# unit tests
-utest_files = Pattern(src_dir='.',
- includes=['*-test.cc'],
- excludes=[],
- recursive=True).files()
+utest_files = Pattern(
+ src_dir='.', includes=['*-test.cc'], excludes=[], recursive=True).files()
+
+if 'use_tss' in env['MODE']:
+ env.Append(CPPDEFINES=['TPM_TSS'])
if 'install_package' in env['MODE']:
env.InstallTopLevel(src_files, sub_dir='epid/${PART_SHORT_NAME}')
env.InstallTopLevel(inc_files, sub_dir='epid/${PART_SHORT_NAME}')
- env.InstallTopLevel(utest_files,
- sub_dir='epid/${PART_SHORT_NAME}/unittests')
- env.InstallTopLevel(test_data_files,
- sub_dir='epid/${PART_SHORT_NAME}/testdata')
+ env.InstallTopLevel(
+ utest_files, sub_dir='epid/${PART_SHORT_NAME}/unittests')
+ env.InstallTopLevel(
+ test_data_files, sub_dir='epid/${PART_SHORT_NAME}/testdata')
- env.InstallTopLevel(epid11_src_files, sub_dir='epid/${PART_SHORT_NAME}/1.1')
- env.InstallTopLevel(epid11_inc_files, sub_dir='epid/${PART_SHORT_NAME}/1.1')
- env.InstallTopLevel(epid11_test_data_files,
- sub_dir='epid/${PART_SHORT_NAME}/1.1/testdata')
+ env.InstallTopLevel(
+ epid11_src_files, sub_dir='epid/${PART_SHORT_NAME}/1.1')
+ env.InstallTopLevel(
+ epid11_inc_files, sub_dir='epid/${PART_SHORT_NAME}/1.1')
+ env.InstallTopLevel(
+ epid11_test_data_files, sub_dir='epid/${PART_SHORT_NAME}/1.1/testdata')
parts_file = ['common-testhelper.parts']
env.InstallTopLevel(parts_file, sub_dir='epid/${PART_SHORT_NAME}')
@@ -77,15 +72,15 @@ else:
env.Sdk(outputs)
testenv['UNIT_TEST_TARGET_NAME'] = "${PART_NAME}-${UNIT_TEST_TARGET}"
- testenv.UnitTest("utest",
- utest_files,
- command_args=[
- '--gtest_color=yes',
- '--gtest_print_time=1',
- '--gtest_output=xml',
- '--gtest_filter=**',
- ],
- make_pdb=(env.isConfigBasedOn('debug')),
- depends=[Component('gtest'),
- Component('common-testhelper')],
- INSTALL_BIN='${INSTALL_TEST_BIN}')
+ testenv.UnitTest(
+ "utest",
+ utest_files,
+ command_args=[
+ '--gtest_color=yes',
+ '--gtest_print_time=1',
+ '--gtest_output=xml',
+ '--gtest_filter=**',
+ ],
+ make_pdb=(env.isConfigBasedOn('debug')),
+ depends=[Component('gtest'), Component('common-testhelper')],
+ INSTALL_BIN='${INSTALL_TEST_BIN}')
diff --git a/epid/common-testhelper/ecgroup_wrapper-testhelper.cc b/epid/common-testhelper/ecgroup_wrapper-testhelper.cc
index 3ce5959..34dfd7e 100644
--- a/epid/common-testhelper/ecgroup_wrapper-testhelper.cc
+++ b/epid/common-testhelper/ecgroup_wrapper-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,12 +18,12 @@
* \file
* \brief EcGroup C++ wrapper implementation.
*/
-#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common/math/bignum.h"
#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
-#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
+#include "epid/common/math/bignum.h"
/// ecgroup deleter type
struct EcGroupDeleter {
@@ -58,28 +58,28 @@ struct EcGroupObj::State {
EcGroupObj::EcGroupObj() : state_(new State()) {
const BigNumStr q_str = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
- 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98,
+ 0x0A, 0x82, 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}}};
const FqElemStr b_str = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
const BigNumStr p_str = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99, 0x92, 0x1A,
- 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99,
+ 0x92, 0x1A, 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
const BigNumStr h1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
const G1ElemStr g1_str = {
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
FiniteFieldObj fq(q_str);
EcGroup* temp = nullptr;
NewEcGroup(fq, FfElementObj(&fq), FfElementObj(&fq, b_str),
diff --git a/epid/common-testhelper/ecpoint_wrapper-testhelper.cc b/epid/common-testhelper/ecpoint_wrapper-testhelper.cc
index f1aa18c..354338b 100644
--- a/epid/common-testhelper/ecpoint_wrapper-testhelper.cc
+++ b/epid/common-testhelper/ecpoint_wrapper-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,9 +18,9 @@
* \file
* \brief EcPoint C++ wrapper implementation.
*/
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common/math/bignum.h"
/// ecpoint deleter type
diff --git a/epid/common-testhelper/ecpoint_wrapper-testhelper.h b/epid/common-testhelper/ecpoint_wrapper-testhelper.h
index 87b3af2..6e75df4 100644
--- a/epid/common-testhelper/ecpoint_wrapper-testhelper.h
+++ b/epid/common-testhelper/ecpoint_wrapper-testhelper.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -25,9 +25,9 @@
#include <vector>
extern "C" {
+#include "epid/common/1.1/types.h"
#include "epid/common/math/bignum.h"
#include "epid/common/math/ecgroup.h"
-#include "epid/common/1.1/types.h"
}
class EcGroupObj;
diff --git a/epid/common-testhelper/epid2params_wrapper-testhelper.cc b/epid/common-testhelper/epid2params_wrapper-testhelper.cc
new file mode 100644
index 0000000..b9636f8
--- /dev/null
+++ b/epid/common-testhelper/epid2params_wrapper-testhelper.cc
@@ -0,0 +1,49 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// Epid2Params C++ wrapper implementation.
+/*! \file */
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+
+#include <cstdio>
+#include <stdexcept>
+#include <string>
+
+extern "C" {
+#include "epid/common/src/epid2params.h"
+}
+
+Epid2ParamsObj::Epid2ParamsObj() : params_(nullptr) {
+ EpidStatus sts = kEpidNoErr;
+ sts = CreateEpid2Params(&params_);
+ if (kEpidNoErr != sts) {
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "CreateEpid2Params()");
+ }
+}
+
+Epid2ParamsObj::~Epid2ParamsObj() { DeleteEpid2Params(&params_); }
+
+Epid2Params_* Epid2ParamsObj::ctx() const { return params_; }
+
+Epid2ParamsObj::operator Epid2Params_*() const { return params_; }
+
+Epid2ParamsObj::operator const Epid2Params_*() const { return params_; }
+
+FiniteField* Epid2ParamsObj::Fp() const { return params_->Fp; }
+
+EcGroup* Epid2ParamsObj::G1() const { return params_->G1; }
diff --git a/epid/common-testhelper/epid2params_wrapper-testhelper.h b/epid/common-testhelper/epid2params_wrapper-testhelper.h
new file mode 100644
index 0000000..90ddcee
--- /dev/null
+++ b/epid/common-testhelper/epid2params_wrapper-testhelper.h
@@ -0,0 +1,55 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// Epid2Params C++ wrapper interface.
+/*! \file */
+
+#ifndef EPID_COMMON_TESTHELPER_EPID2PARAMS_WRAPPER_TESTHELPER_H_
+#define EPID_COMMON_TESTHELPER_EPID2PARAMS_WRAPPER_TESTHELPER_H_
+
+typedef struct Epid2Params_ Epid2Params_;
+typedef struct FiniteField FiniteField;
+typedef struct EcGroup EcGroup;
+
+/// C++ Wrapper to manage memory for Epid2Params via RAII
+class Epid2ParamsObj {
+ public:
+ /// Create a Epid2Params
+ Epid2ParamsObj();
+
+ // This class instances are not meant to be copied.
+ // Explicitly delete copy constructor and assignment operator.
+ Epid2ParamsObj(const Epid2ParamsObj&) = delete;
+ Epid2ParamsObj& operator=(const Epid2ParamsObj&) = delete;
+
+ /// Destroy the Epid2Params
+ ~Epid2ParamsObj();
+ /// get a pointer to the stored Epid2Params
+ Epid2Params_* ctx() const;
+ /// cast operator to get the pointer to the stored Epid2Params
+ operator Epid2Params_*() const;
+ /// const cast operator to get the pointer to the stored Epid2Params
+ operator const Epid2Params_*() const;
+ /// get a pointer to the prime field Fp
+ FiniteField* Fp() const;
+ /// get a pointer to elliptic curve group G1
+ EcGroup* G1() const;
+
+ private:
+ /// The stored parameters
+ Epid2Params_* params_;
+};
+
+#endif // EPID_COMMON_TESTHELPER_EPID2PARAMS_WRAPPER_TESTHELPER_H_
diff --git a/epid/common-testhelper/epid_gtest-testhelper.cc b/epid/common-testhelper/epid_gtest-testhelper.cc
index 930734e..33c2a9b 100644
--- a/epid/common-testhelper/epid_gtest-testhelper.cc
+++ b/epid/common-testhelper/epid_gtest-testhelper.cc
@@ -16,7 +16,7 @@
/*!
* \file
- * \brief Implementation of Epid specific predicates for gtest
+ * \brief Implementation of Intel(R) EPID specific predicates for gtest
*/
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include <string>
diff --git a/epid/common-testhelper/epid_gtest-testhelper.h b/epid/common-testhelper/epid_gtest-testhelper.h
index 13b82a4..3831f3d 100644
--- a/epid/common-testhelper/epid_gtest-testhelper.h
+++ b/epid/common-testhelper/epid_gtest-testhelper.h
@@ -16,7 +16,7 @@
/*!
* \file
- * \brief Epid specific predicates for gtest
+ * \brief Intel(R) EPID specific predicates for gtest
*/
#ifndef EPID_COMMON_TESTHELPER_EPID_GTEST_TESTHELPER_H_
#define EPID_COMMON_TESTHELPER_EPID_GTEST_TESTHELPER_H_
diff --git a/epid/common-testhelper/epid_params-testhelper.cc b/epid/common-testhelper/epid_params-testhelper.cc
index 57fa53b..1991db9 100644
--- a/epid/common-testhelper/epid_params-testhelper.cc
+++ b/epid/common-testhelper/epid_params-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,7 +19,10 @@
* \brief Intel(R) EPID parameters C++ wrapper implementation.
*/
+#include <cstdio>
#include <cstring>
+#include <stdexcept>
+#include <string>
#include <vector>
#include "epid/common-testhelper/epid_params-testhelper.h"
@@ -31,9 +34,13 @@ extern "C" {
#include "epid/common/math/src/ecgroup-internal.h"
#include "epid/common/math/src/finitefield-internal.h"
#include "epid/common/math/src/pairing-internal.h"
+#include "epid/common/src/epid2params.h"
}
Epid20Params::Epid20Params() {
+ // construct Fp finite field
+ fp = FiniteFieldObj(p_str_);
+
// construct Fq finite field
fq = FiniteFieldObj(q_str_);
@@ -53,9 +60,9 @@ Epid20Params::Epid20Params() {
GT = FiniteFieldObj(fq6, neg_v, 2);
const BigNumStr h1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
// Create G1
// G1 is an elliptic curve group E(Fq).It can be initialized as follows :
@@ -66,20 +73,20 @@ Epid20Params::Epid20Params() {
// set h = 2q - p, aka cofactor
std::vector<uint8_t> cofactor_str(
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xfc, 0xf0, 0xcd, 0x46, 0xe5, 0xf2, 0x5e, 0xee, 0x71, 0xa4, 0xa0,
- 0x0c, 0xdc, 0x65, 0xfb, 0x12, 0x96, 0x82, 0xea, 0xb0, 0x25, 0x08, 0x4a,
- 0x8c, 0x9b, 0x10, 0x19});
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xcd, 0x46, 0xe5, 0xf2, 0x5e,
+ 0xee, 0x71, 0xa4, 0xa0, 0x0c, 0xdc, 0x65, 0xfb, 0x12, 0x96, 0x82,
+ 0xea, 0xb0, 0x25, 0x08, 0x4a, 0x8c, 0x9b, 0x10, 0x19});
// set n = p * h, AKA order
std::vector<uint8_t> order_str(
- {0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xe1, 0x9a, 0x8d, 0xcb, 0xe4, 0xc7,
- 0x38, 0xfa, 0x9b, 0x98, 0x4d, 0x1c, 0x12, 0x9f, 0x64, 0x97, 0xe8, 0x54,
- 0xa3, 0x0a, 0x81, 0xac, 0x42, 0xf9, 0x39, 0x16, 0xa7, 0x70, 0x21, 0xdc,
- 0xfb, 0xb6, 0xe7, 0x7e, 0x1f, 0x5b, 0x55, 0xcc, 0x4e, 0x84, 0xcd, 0x19,
- 0x4f, 0x49, 0x20, 0x94, 0xb5, 0xd8, 0x12, 0xa0, 0x2e, 0x7f, 0x40, 0x13,
- 0xb2, 0xfa, 0xa1, 0x45});
+ {0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xe1, 0x9a, 0x8d, 0xcb, 0xe4,
+ 0xc7, 0x38, 0xfa, 0x9b, 0x98, 0x4d, 0x1c, 0x12, 0x9f, 0x64, 0x97,
+ 0xe8, 0x54, 0xa3, 0x0a, 0x81, 0xac, 0x42, 0xf9, 0x39, 0x16, 0xa7,
+ 0x70, 0x21, 0xdc, 0xfb, 0xb6, 0xe7, 0x7e, 0x1f, 0x5b, 0x55, 0xcc,
+ 0x4e, 0x84, 0xcd, 0x19, 0x4f, 0x49, 0x20, 0x94, 0xb5, 0xd8, 0x12,
+ 0xa0, 0x2e, 0x7f, 0x40, 0x13, 0xb2, 0xfa, 0xa1, 0x45});
// Compute xi' = Fq2.inverse(xi).
FfElementObj inv_xi(&fq2);
@@ -96,69 +103,69 @@ Epid20Params::Epid20Params() {
}
const BigNumStr Epid20Params::q_str_ = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
- 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98,
+ 0x0A, 0x82, 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}}};
const FqElemStr Epid20Params::beta_str_ = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
- 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x12}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98,
+ 0x0A, 0x82, 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x12}}};
const Fq6ElemStr Epid20Params::v_str_ = {
- {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
+ {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
const BigNumStr Epid20Params::p_str_ = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99, 0x92, 0x1A,
- 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99,
+ 0x92, 0x1A, 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
const FqElemStr Epid20Params::b_str_ = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
const FqElemStr Epid20Params::h_str_ = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
const G1ElemStr Epid20Params::g1_str_ = {
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
const Fq2ElemStr Epid20Params::xi_str_ = {
- {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
+ {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
const G2ElemStr Epid20Params::g2_str_ = {
- {{{{0xE2, 0x01, 0x71, 0xC5, 0x4A, 0xA3, 0xDA, 0x05, 0x21, 0x67, 0x04, 0x13,
- 0x74, 0x3C, 0xCF, 0x22, 0xD2, 0x5D, 0x52, 0x68, 0x3D, 0x32, 0x47, 0x0E,
- 0xF6, 0x02, 0x13, 0x43, 0xBF, 0x28, 0x23, 0x94}}},
- {{{0x59, 0x2D, 0x1E, 0xF6, 0x53, 0xA8, 0x5A, 0x80, 0x46, 0xCC, 0xDC, 0x25,
- 0x4F, 0xBB, 0x56, 0x56, 0x43, 0x43, 0x3B, 0xF6, 0x28, 0x96, 0x53, 0xE2,
- 0x7D, 0xF7, 0xB2, 0x12, 0xBA, 0xA1, 0x89, 0xBE}}}},
- {{{{0xAE, 0x60, 0xA4, 0xE7, 0x51, 0xFF, 0xD3, 0x50, 0xC6, 0x21, 0xE7, 0x03,
- 0x31, 0x28, 0x26, 0xBD, 0x55, 0xE8, 0xB5, 0x9A, 0x4D, 0x91, 0x68, 0x38,
- 0x41, 0x4D, 0xB8, 0x22, 0xDD, 0x23, 0x35, 0xAE}}},
- {{{0x1A, 0xB4, 0x42, 0xF9, 0x89, 0xAF, 0xE5, 0xAD, 0xF8, 0x02, 0x74, 0xF8,
- 0x76, 0x45, 0xE2, 0x53, 0x2C, 0xDC, 0x61, 0x81, 0x90, 0x93, 0xD6, 0x13,
- 0x2C, 0x90, 0xFE, 0x89, 0x51, 0xB9, 0x24, 0x21}}}}};
+ {{{{0xE2, 0x01, 0x71, 0xC5, 0x4A, 0xA3, 0xDA, 0x05, 0x21, 0x67, 0x04,
+ 0x13, 0x74, 0x3C, 0xCF, 0x22, 0xD2, 0x5D, 0x52, 0x68, 0x3D, 0x32,
+ 0x47, 0x0E, 0xF6, 0x02, 0x13, 0x43, 0xBF, 0x28, 0x23, 0x94}}},
+ {{{0x59, 0x2D, 0x1E, 0xF6, 0x53, 0xA8, 0x5A, 0x80, 0x46, 0xCC, 0xDC,
+ 0x25, 0x4F, 0xBB, 0x56, 0x56, 0x43, 0x43, 0x3B, 0xF6, 0x28, 0x96,
+ 0x53, 0xE2, 0x7D, 0xF7, 0xB2, 0x12, 0xBA, 0xA1, 0x89, 0xBE}}}},
+ {{{{0xAE, 0x60, 0xA4, 0xE7, 0x51, 0xFF, 0xD3, 0x50, 0xC6, 0x21, 0xE7,
+ 0x03, 0x31, 0x28, 0x26, 0xBD, 0x55, 0xE8, 0xB5, 0x9A, 0x4D, 0x91,
+ 0x68, 0x38, 0x41, 0x4D, 0xB8, 0x22, 0xDD, 0x23, 0x35, 0xAE}}},
+ {{{0x1A, 0xB4, 0x42, 0xF9, 0x89, 0xAF, 0xE5, 0xAD, 0xF8, 0x02, 0x74,
+ 0xF8, 0x76, 0x45, 0xE2, 0x53, 0x2C, 0xDC, 0x61, 0x81, 0x90, 0x93,
+ 0xD6, 0x13, 0x2C, 0x90, 0xFE, 0x89, 0x51, 0xB9, 0x24, 0x21}}}}};
diff --git a/epid/common-testhelper/epid_params-testhelper.h b/epid/common-testhelper/epid_params-testhelper.h
index 42e2a5c..5ed7631 100644
--- a/epid/common-testhelper/epid_params-testhelper.h
+++ b/epid/common-testhelper/epid_params-testhelper.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -26,15 +26,17 @@
extern "C" {
#include "epid/common/math/bignum.h"
-#include "epid/common/math/finitefield.h"
#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/finitefield.h"
}
-#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
+#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
-#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
+#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
+
+typedef struct Epid2Params_ Epid2Params_;
class Epid20Params {
public:
@@ -50,6 +52,8 @@ class Epid20Params {
FiniteFieldObj GT;
EcGroupObj G1;
EcGroupObj G2;
+ FiniteFieldObj fq;
+ FiniteFieldObj fp;
private:
static const BigNumStr q_str_;
@@ -64,7 +68,6 @@ class Epid20Params {
static const Fq2ElemStr xi_str_;
static const G2ElemStr g2_str_;
- FiniteFieldObj fq;
FiniteFieldObj fq2;
FiniteFieldObj fq6;
};
diff --git a/epid/common-testhelper/errors-testhelper.h b/epid/common-testhelper/errors-testhelper.h
index f61de1b..9950f26 100644
--- a/epid/common-testhelper/errors-testhelper.h
+++ b/epid/common-testhelper/errors-testhelper.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,11 +21,11 @@
#ifndef EPID_COMMON_TESTHELPER_ERRORS_TESTHELPER_H_
#define EPID_COMMON_TESTHELPER_ERRORS_TESTHELPER_H_
-#include <string>
#include <cstdio>
+#include <initializer_list>
#include <stdexcept>
+#include <string>
#include <vector>
-#include <initializer_list>
extern "C" {
#include "epid/common/math/bignum.h"
@@ -38,4 +38,11 @@ extern "C" {
throw std::logic_error(std::string("Failed to call: ") + #actual); \
}
+/// Macro used to indicate fatal error during unit test run
+#define THROW_NE(expected, actual) \
+ if (expected != actual) { \
+ printf("%s(%d): error: %s\n", __FILE__, __LINE__, "test defect"); \
+ throw std::logic_error(std::string("Failed to call: ") + #actual); \
+ }
+
#endif // EPID_COMMON_TESTHELPER_ERRORS_TESTHELPER_H_
diff --git a/epid/common-testhelper/ffelement_wrapper-testhelper.cc b/epid/common-testhelper/ffelement_wrapper-testhelper.cc
index 675142e..fcebe50 100644
--- a/epid/common-testhelper/ffelement_wrapper-testhelper.cc
+++ b/epid/common-testhelper/ffelement_wrapper-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@
* \file
* \brief FfElement C++ wrapper implementation.
*/
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
#include "epid/common/math/bignum.h"
diff --git a/epid/common-testhelper/ffelement_wrapper-testhelper.h b/epid/common-testhelper/ffelement_wrapper-testhelper.h
index df09065..c86a68a 100644
--- a/epid/common-testhelper/ffelement_wrapper-testhelper.h
+++ b/epid/common-testhelper/ffelement_wrapper-testhelper.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -25,9 +25,9 @@
#include <vector>
extern "C" {
+#include "epid/common/1.1/types.h"
#include "epid/common/math/bignum.h"
#include "epid/common/math/finitefield.h"
-#include "epid/common/1.1/types.h"
}
class FiniteFieldObj;
diff --git a/epid/common-testhelper/finite_field_wrapper-testhelper.cc b/epid/common-testhelper/finite_field_wrapper-testhelper.cc
index 12bf5d3..6bb0cee 100644
--- a/epid/common-testhelper/finite_field_wrapper-testhelper.cc
+++ b/epid/common-testhelper/finite_field_wrapper-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,10 +18,10 @@
* \file
* \brief FiniteField C++ wrapper implementation.
*/
-#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common/math/bignum.h"
#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common/math/bignum.h"
/// finite field deleter type
struct FiniteFieldDeleter {
diff --git a/epid/common-testhelper/mem_params-testhelper.cc b/epid/common-testhelper/mem_params-testhelper.cc
new file mode 100644
index 0000000..621b691
--- /dev/null
+++ b/epid/common-testhelper/mem_params-testhelper.cc
@@ -0,0 +1,35 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+
+/*!
+ * \file
+ * \brief Implementation of Intel(R) EPID specific predicates for Set MemParams
+ * strcuture
+ */
+#include "epid/common-testhelper/mem_params-testhelper.h"
+
+void SetMemberParams(BitSupplier rnd_func, void* rnd_param, const FpElemStr* f,
+ MemberParams* params) {
+#ifdef TPM_TSS
+ (void)rnd_func;
+ (void)rnd_param;
+ params->f = f;
+#else
+ params->rnd_func = rnd_func;
+ params->rnd_param = rnd_param;
+ params->f = f;
+#endif
+}
diff --git a/epid/common-testhelper/mem_params-testhelper.h b/epid/common-testhelper/mem_params-testhelper.h
new file mode 100644
index 0000000..48277ae
--- /dev/null
+++ b/epid/common-testhelper/mem_params-testhelper.h
@@ -0,0 +1,48 @@
+/*############################################################################
+ # Copyright 2016-2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+
+/*!
+ * \file
+ * \brief Intel(R) EPID 2.0 parameters C++ wrapper interface.
+ */
+#ifndef EPID_COMMON_TESTHELPER_MEM_PARAMS_TESTHELPER_H_
+#define EPID_COMMON_TESTHELPER_MEM_PARAMS_TESTHELPER_H_
+
+extern "C" {
+#include "epid/common/bitsupplier.h"
+#include "epid/common/types.h"
+#ifdef TPM_TSS
+#include "epid/member/tpm_member.h"
+#else
+#include "epid/member/software_member.h"
+#endif
+}
+/// Implementation specific configuration parameters.
+typedef struct MemberParams MemberParams;
+
+/// Set MemmberParams structure
+/*!
+
+MemberParams had different structure between TPM_TSS build
+and non TPM_TSS build
+
+\returns ::void
+
+*/
+void SetMemberParams(BitSupplier rnd_func, void* rnd_param, const FpElemStr* f,
+ MemberParams* params);
+
+#endif // EPID_COMMON_TESTHELPER_MEM_PARAMS_TESTHELPER_H_
diff --git a/epid/common-testhelper/octstr-testhelper.cc b/epid/common-testhelper/octstr-testhelper.cc
index 7364839..18e9fff 100644
--- a/epid/common-testhelper/octstr-testhelper.cc
+++ b/epid/common-testhelper/octstr-testhelper.cc
@@ -22,8 +22,8 @@
extern "C" {
#include "epid/common/src/memory.h"
}
-#include "ext/ipp/include/ippcp.h"
#include "epid/common/types.h"
+#include "ext/ipp/include/ippcp.h"
typedef Ipp8u* IppOctStr;
diff --git a/epid/common-testhelper/prng-testhelper.h b/epid/common-testhelper/prng-testhelper.h
index f3008e1..8eaae83 100644
--- a/epid/common-testhelper/prng-testhelper.h
+++ b/epid/common-testhelper/prng-testhelper.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,7 +27,13 @@
#define __STDCALL
#endif
#include <limits.h> // for CHAR_BIT
+#include <stdint.h>
#include <random>
+#include <vector>
+
+extern "C" {
+#include "epid/common/types.h"
+}
/// Return status for Prng Generate function
typedef enum {
@@ -53,30 +59,23 @@ class Prng {
static int __STDCALL Generate(unsigned int* random_data, int num_bits,
void* user_data) {
unsigned int num_bytes = num_bits / CHAR_BIT;
- unsigned int num_words = num_bytes / sizeof(unsigned int);
- unsigned int extra_bytes = num_bytes % sizeof(unsigned int);
+
+ unsigned int extra_bits = num_bits % CHAR_BIT;
+ unsigned char* random_bytes = reinterpret_cast<unsigned char*>(random_data);
if (!random_data) {
return kPrngBadArgErr;
}
if (num_bits <= 0) {
return kPrngBadArgErr;
}
- Prng* myprng = (Prng*)user_data;
- std::uniform_int_distribution<> dis(0x0, 0xffff);
- if (num_words > 0) {
- for (unsigned int n = 0; n < num_words; n++) {
- random_data[n] =
- (dis(myprng->generator_) << 16) + dis(myprng->generator_);
- }
+ if (0 != extra_bits) {
+ num_bytes += 1;
}
- if (extra_bytes > 0) {
- unsigned int data =
- (dis(myprng->generator_) << 16) + dis(myprng->generator_);
- unsigned char* byte_data = (unsigned char*)&data;
- unsigned char* random_bytes = (unsigned char*)&random_data[num_words];
- for (unsigned int n = 0; n < extra_bytes; n++) {
- random_bytes[n] = byte_data[n];
- }
+
+ Prng* myprng = (Prng*)user_data;
+ for (unsigned int n = 0; n < num_bytes; n++) {
+ random_bytes[n] =
+ static_cast<unsigned char>(myprng->generator_() & 0x000000ff);
}
return kPrngNoErr;
@@ -87,4 +86,31 @@ class Prng {
std::mt19937 generator_;
};
+// BitSupplier implementation returns pre-defined bytes.
+class StaticPrng {
+ public:
+ StaticPrng(ConstOctStr bytes, size_t length)
+ : bytes_((uint8_t const*)bytes, (uint8_t const*)bytes + length) {}
+ ~StaticPrng() {}
+ /// Generates random number
+ static int __STDCALL Generate(unsigned int* random_data, int num_bits,
+ void* user_data) {
+ unsigned int num_bytes = num_bits / CHAR_BIT;
+ if (!random_data) {
+ return kPrngBadArgErr;
+ }
+ if (num_bits <= 0) {
+ return kPrngBadArgErr;
+ }
+ StaticPrng* myprng = (StaticPrng*)user_data;
+ for (size_t i = 0; i < num_bytes; i++) {
+ random_data[i] = myprng->bytes_[i % myprng->bytes_.size()];
+ }
+ return kPrngNoErr;
+ }
+
+ private:
+ std::vector<uint8_t> bytes_;
+};
+
#endif // EPID_COMMON_TESTHELPER_PRNG_TESTHELPER_H_
diff --git a/epid/common-testhelper/testapp-testhelper.cc b/epid/common-testhelper/testapp-testhelper.cc
new file mode 100644
index 0000000..7fde385
--- /dev/null
+++ b/epid/common-testhelper/testapp-testhelper.cc
@@ -0,0 +1,74 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/*!
+* \file
+* \brief Main entry point helpers unit tests.
+*/
+#include "epid/common-testhelper/testapp-testhelper.h"
+#include <sstream>
+#include <string>
+#include <vector>
+
+void split_filter(std::vector<std::string>* positive,
+ std::vector<std::string>* negative, std::string filter_expr) {
+ std::istringstream f(filter_expr);
+ std::string s;
+ bool is_neg = false;
+ while (getline(f, s, ':')) {
+ if (!is_neg) {
+ if (s.compare(0, 1, "-") == 0) {
+ is_neg = true;
+ s = s.substr(1);
+ } else {
+ positive->push_back(s);
+ }
+ }
+ if (is_neg) {
+ negative->push_back(s);
+ }
+ }
+}
+
+std::string join_filter(std::vector<std::string> const& positive,
+ std::vector<std::string> const& negative) {
+ std::ostringstream s;
+ bool first = true;
+ bool first_neg = true;
+ if (!positive.empty() || !negative.empty()) {
+ s << "--gtest_filter=";
+ }
+ for (const auto& i : positive) {
+ if (!first) {
+ s << ":";
+ } else {
+ first = false;
+ }
+ s << i;
+ }
+ for (const auto& i : negative) {
+ if (!first) {
+ s << ":";
+ } else {
+ first = false;
+ }
+ if (first_neg) {
+ s << "-";
+ first_neg = false;
+ }
+ s << i;
+ }
+ return s.str();
+}
diff --git a/parts-site/configurations/instr_release/intelc_posix-any.py b/epid/common-testhelper/testapp-testhelper.h
index ed8b94a..4c33768 100644
--- a/parts-site/configurations/instr_release/intelc_posix-any.py
+++ b/epid/common-testhelper/testapp-testhelper.h
@@ -1,4 +1,4 @@
-############################################################################
+/*############################################################################
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,22 +12,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
+############################################################################*/
+/*!
+* \file
+* \brief Main entry point helpers unit tests.
+*/
-"""Intel posix compiler configuration for release
-"""
+#ifndef EPID_COMMON_TESTHELPER_TESTAPP_TESTHELPER_H_
+#define EPID_COMMON_TESTHELPER_TESTAPP_TESTHELPER_H_
-from parts.config import ConfigValues, configuration
+#include <string>
+#include <vector>
-def map_default_version(env):
- return env['INTELC_VERSION']
+void split_filter(std::vector<std::string>* positive,
+ std::vector<std::string>* negative, std::string filter_expr);
+std::string join_filter(std::vector<std::string> const& positive,
+ std::vector<std::string> const& negative);
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- append=ConfigValues(
- CCFLAGS=['-finstrument-functions'],
- )
- )
+#endif // EPID_COMMON_TESTHELPER_TESTAPP_TESTHELPER_H_
diff --git a/epid/common-testhelper/testdata/grp01/member0/sig_bsn0_msg_0_255_sha512.inc b/epid/common-testhelper/testdata/grp01/member0/sig_bsn0_msg_0_255_sha512.inc
new file mode 100644
index 0000000..e57d201
--- /dev/null
+++ b/epid/common-testhelper/testdata/grp01/member0/sig_bsn0_msg_0_255_sha512.inc
@@ -0,0 +1,72 @@
+ /*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/*!
+ * \file
+ * \brief Test data.
+ *
+ * Type : Intel(R) EPID 2.0 Signature
+ * Group : groupA
+ * Signer : member0
+ * HashAlg : Sha512
+ * Message : bytes [0, 255]
+ * Basename: "bsn0"
+ * SigRl : SigRl of group
+ */
+ 0x72, 0xed, 0x4f, 0x01, 0xf2, 0xfe, 0xc9, 0xf4, 0x56, 0x4f, 0x11, 0x31,
+ 0x62, 0x07, 0x02, 0x0f, 0xed, 0xd0, 0x6b, 0xe8, 0xbf, 0xa9, 0x0b, 0x55,
+ 0xb8, 0xf7, 0xe9, 0x6e, 0xaa, 0x13, 0x2e, 0x6f, 0xa7, 0xd5, 0xec, 0x4b,
+ 0x3e, 0x23, 0x5f, 0x4f, 0x61, 0x44, 0x52, 0xc1, 0x75, 0x0b, 0x13, 0xad,
+ 0xa1, 0x53, 0x0d, 0x6a, 0x73, 0xed, 0x5e, 0x49, 0xa9, 0xed, 0x1d, 0x88,
+ 0xde, 0xa6, 0x93, 0x18, 0xa4, 0xaa, 0xcc, 0x21, 0xc0, 0xbb, 0x90, 0xc1,
+ 0xb4, 0x1c, 0x8d, 0xf6, 0xd9, 0xb4, 0x6d, 0xd8, 0xa6, 0x66, 0xed, 0xc4,
+ 0x33, 0x97, 0x6d, 0xc1, 0x68, 0x44, 0x3e, 0xd1, 0x08, 0x75, 0x6e, 0x1d,
+ 0xf5, 0x81, 0xee, 0x39, 0xaa, 0xbf, 0xc9, 0x38, 0x14, 0x8a, 0x57, 0x93,
+ 0x85, 0x6a, 0x98, 0xbf, 0x1a, 0xed, 0xa5, 0x96, 0x1f, 0x97, 0x1e, 0xc6,
+ 0xc5, 0x28, 0x8e, 0x6f, 0xf4, 0xca, 0x2f, 0xe5, 0xc6, 0x4c, 0xc8, 0x9d,
+ 0xdc, 0x63, 0x46, 0x5b, 0xab, 0x79, 0xea, 0x49, 0x76, 0x47, 0x68, 0xe6,
+ 0x2e, 0x7d, 0x0b, 0x49, 0xc0, 0x29, 0xe4, 0xc8, 0x84, 0xb5, 0x04, 0x2d,
+ 0x15, 0xaa, 0x0d, 0xd4, 0x71, 0x43, 0xd0, 0x24, 0x3e, 0x00, 0xf4, 0x94,
+ 0xad, 0x1e, 0x1e, 0x32, 0xea, 0x21, 0x4d, 0x83, 0xae, 0x63, 0x3c, 0x5a,
+ 0xd4, 0xa5, 0x79, 0x9b, 0x2c, 0xad, 0x03, 0x50, 0xb6, 0x57, 0x0a, 0xbf,
+ 0x3f, 0xeb, 0xf5, 0x72, 0x9f, 0x5f, 0x9f, 0x95, 0x5c, 0x66, 0xc9, 0x1f,
+ 0xfe, 0x71, 0x50, 0xee, 0xf6, 0x09, 0xf5, 0x1f, 0x08, 0x0c, 0x78, 0xd0,
+ 0xc3, 0xcf, 0x4a, 0x7b, 0xba, 0xb5, 0xf7, 0xbb, 0xc4, 0x5e, 0x1f, 0x0c,
+ 0xc3, 0x25, 0xe3, 0x7f, 0x8d, 0x15, 0x16, 0xec, 0x6a, 0xae, 0x58, 0xf8,
+ 0xb9, 0x73, 0x0f, 0xa4, 0x73, 0xdb, 0xe7, 0x29, 0x72, 0x07, 0xda, 0xcc,
+ 0x0f, 0xc4, 0xfc, 0x9b, 0xd3, 0xe5, 0xbd, 0x26, 0xf5, 0xb6, 0x05, 0xaf,
+ 0x93, 0x31, 0xf5, 0x62, 0x6d, 0xf4, 0xdd, 0xea, 0x16, 0xf9, 0xe9, 0x2e,
+ 0x3f, 0x10, 0xa4, 0x6f, 0xfd, 0x7c, 0x06, 0x10, 0x74, 0x51, 0xf1, 0x8e,
+ 0x1e, 0x49, 0xd2, 0xb1, 0x4c, 0x89, 0xe1, 0x16, 0x5e, 0xbc, 0xbb, 0xfc,
+ 0x5f, 0xad, 0x33, 0xb9, 0x7a, 0x9b, 0xf4, 0x59, 0x0b, 0xf2, 0x0e, 0x63,
+ 0x39, 0xc7, 0x90, 0xce, 0x0a, 0xef, 0x5c, 0x72, 0x7a, 0x05, 0xbb, 0xe5,
+ 0xfe, 0xfc, 0xbe, 0x2c, 0xdf, 0xd1, 0xba, 0x0c, 0x3f, 0x40, 0xe0, 0x8c,
+ 0xa4, 0x25, 0xe8, 0xc3, 0x54, 0x8d, 0x32, 0xba, 0x2d, 0x96, 0x3c, 0x5e,
+ 0x44, 0x61, 0xd1, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ // sigma
+ 0x9a, 0x8a, 0x3c, 0x2d, 0x96, 0x27, 0x84, 0xfc, 0x3f, 0x11, 0x87, 0x30,
+ 0x51, 0x30, 0x62, 0xba, 0x51, 0x93, 0x09, 0x87, 0x80, 0x44, 0x02, 0x10,
+ 0x95, 0x09, 0xe7, 0x7f, 0x27, 0x9d, 0x8f, 0xae, 0xc7, 0x06, 0xad, 0xd8,
+ 0xe2, 0xe4, 0x79, 0x07, 0x0c, 0xc1, 0xba, 0x5f, 0x64, 0xe2, 0xee, 0xe5,
+ 0xc5, 0x89, 0x6d, 0xc4, 0xde, 0x2c, 0xd3, 0x88, 0x31, 0x09, 0x47, 0x3d,
+ 0xd4, 0x5a, 0xe1, 0x55, 0x43, 0xbc, 0x23, 0x60, 0xdd, 0x63, 0xf9, 0x21,
+ 0x07, 0xde, 0x56, 0x85, 0x9f, 0x0c, 0xbe, 0x04, 0xfe, 0x35, 0x67, 0x75,
+ 0x23, 0x27, 0x11, 0x8e, 0x7b, 0xcd, 0x7d, 0x85, 0x2e, 0xd2, 0xfe, 0x25,
+ 0x6a, 0x34, 0xf2, 0xed, 0x5d, 0x2b, 0x1e, 0x63, 0x46, 0x88, 0x72, 0x47,
+ 0x5e, 0xf3, 0x1b, 0x70, 0x3d, 0xd7, 0x06, 0x7a, 0x07, 0xb1, 0x62, 0xd4,
+ 0x55, 0x6a, 0xed, 0x0b, 0x4e, 0x52, 0xcd, 0x8d, 0x5c, 0x35, 0x6b, 0x58,
+ 0xad, 0x69, 0x14, 0x96, 0xe7, 0x0c, 0x43, 0x14, 0xd6, 0x28, 0x33, 0xbc,
+ 0xe4, 0x2c, 0x23, 0x58, 0xee, 0x05, 0xa2, 0x6f, 0x7b, 0x88, 0xab, 0xc8,
+ 0x93, 0x6e, 0x99, 0xba,
diff --git a/epid/common-testhelper/testdata/grp_x/member0/sig_sha512_huge_bsn_msg0.inc b/epid/common-testhelper/testdata/grp_x/member0/sig_sha512_huge_bsn_msg0.inc
new file mode 100644
index 0000000..6d56d48
--- /dev/null
+++ b/epid/common-testhelper/testdata/grp_x/member0/sig_sha512_huge_bsn_msg0.inc
@@ -0,0 +1,99 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/*!
+ * \file
+ * \brief Test data.
+ *
+ * Type : Intel(R) EPID 2.0 Signature
+ * Group : grpX
+ * Signer : member0
+ * HashAlg : Sha512
+ * Message : "msg0"
+ * Basename: huge (1024 KB) bsn
+ * SigRl : group x sigrl
+ */
+//unsigned char sig_grpx_member0_sha512_huge_bsn_msg0_dat[] = {
+ 0xd8, 0xf7, 0xcd, 0x26, 0xa1, 0x86, 0x2e, 0x25, 0xa5, 0x17, 0x84, 0x98,
+ 0x80, 0x5b, 0xb6, 0x10, 0x1c, 0xd, 0xe1, 0xf4, 0xaa, 0x50, 0xfa, 0xdd,
+ 0x67, 0x2f, 0xfd, 0x96, 0x95, 0x57, 0x1d, 0xf, 0x92, 0xcd, 0xd1, 0x99,
+ 0x27, 0x29, 0xbe, 0x7c, 0x66, 0x27, 0x8e, 0x5b, 0xc7, 0xf, 0x9f, 0xad,
+ 0xd7, 0x29, 0x54, 0xf, 0xea, 0xa8, 0x1, 0x42, 0xf9, 0x47, 0x1d, 0xec,
+ 0x5c, 0xc, 0x2e, 0xdb, 0x56, 0xd3, 0x35, 0x74, 0xca, 0x88, 0x50, 0xc3,
+ 0x3, 0xdf, 0x66, 0x33, 0xe3, 0xb2, 0x70, 0xc2, 0x6b, 0x2b, 0xa3, 0xb7,
+ 0x7d, 0x45, 0x4f, 0xcd, 0xeb, 0x39, 0x47, 0x4b, 0x5c, 0xad, 0x60, 0x2a,
+ 0x9b, 0x1e, 0xeb, 0xd5, 0xfa, 0x4b, 0x0, 0x33, 0xf1, 0xbb, 0xc0, 0xbb,
+ 0xe6, 0xf0, 0x8b, 0xe7, 0xd9, 0xaa, 0x84, 0x44, 0x5c, 0x7f, 0x11, 0xa1,
+ 0x78, 0x5e, 0x45, 0xc1, 0x58, 0x85, 0x9d, 0xb7, 0xba, 0xec, 0xaa, 0x96,
+ 0x22, 0xa9, 0xaa, 0xb3, 0x4f, 0x19, 0x9e, 0xf3, 0xed, 0x82, 0xcc, 0xf2,
+ 0x69, 0x4c, 0x17, 0x39, 0x27, 0xf4, 0x18, 0x98, 0xf, 0xdc, 0xc9, 0x4e,
+ 0x93, 0x9c, 0x5e, 0xad, 0x77, 0xbd, 0xe2, 0x74, 0xb, 0xa9, 0x8a, 0x8a,
+ 0xfc, 0xa6, 0x79, 0xb, 0x72, 0x7b, 0x2a, 0x9b, 0xba, 0x25, 0x51, 0x6,
+ 0x6, 0x14, 0xc4, 0x6d, 0xa6, 0x2f, 0xf5, 0xdd, 0x3d, 0xd6, 0x49, 0x61,
+ 0x62, 0xb, 0x56, 0x28, 0xa8, 0xe9, 0xe2, 0x77, 0x6a, 0x15, 0x44, 0xb0,
+ 0x7a, 0xaa, 0x32, 0x5c, 0xe9, 0xbf, 0xfb, 0xaf, 0xfe, 0xca, 0x47, 0x13,
+ 0xe8, 0xc8, 0xfe, 0xb3, 0xd2, 0x88, 0x45, 0xcd, 0x96, 0x79, 0x2b, 0x6a,
+ 0x26, 0xb2, 0xd7, 0x33, 0x7e, 0x8c, 0x6b, 0xff, 0x9b, 0x49, 0x1c, 0xc2,
+ 0x3e, 0xff, 0x70, 0x63, 0x4a, 0x2c, 0x8a, 0x7, 0x7c, 0xe9, 0x1a, 0x92,
+ 0x7a, 0x53, 0xe1, 0x30, 0xf0, 0x29, 0xe6, 0xe3, 0x58, 0x5a, 0x3f, 0xa1,
+ 0x8b, 0x2c, 0xfe, 0x57, 0xb0, 0x2c, 0x96, 0x5e, 0xd2, 0xbd, 0xff, 0x92,
+ 0xaf, 0xb4, 0xb5, 0x71, 0x5c, 0x27, 0x89, 0x7f, 0x72, 0xc5, 0x2c, 0x41,
+ 0x2b, 0xbd, 0xf7, 0xd, 0xb8, 0xfd, 0xe4, 0x94, 0x27, 0x62, 0x7f, 0x64,
+ 0xb8, 0xf4, 0x47, 0x64, 0x90, 0x8b, 0x96, 0xb7, 0x59, 0xd2, 0xee, 0xee,
+ 0x55, 0x8e, 0x2b, 0x82, 0xde, 0x72, 0x23, 0x5, 0xdc, 0x1e, 0xa, 0xd4,
+ 0xc4, 0xe6, 0x7d, 0x9b, 0x96, 0xfc, 0xb4, 0x17, 0x38, 0xea, 0x7b, 0x9d,
+ 0xf7, 0xd8, 0x95, 0xfa, 0xfb, 0x99, 0x26, 0xa, 0x13, 0x96, 0xf3, 0x7b,
+ 0x20, 0xc4, 0x39, 0xb7, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x3,
+ 0x43, 0x4, 0xf0, 0xea, 0xe0, 0xca, 0x2, 0x65, 0x22, 0xd4, 0x68, 0x5c,
+ 0x12, 0xfa, 0xe0, 0x39, 0x23, 0x5a, 0xde, 0x7e, 0xb2, 0xed, 0x2, 0x4f,
+ 0xcc, 0x10, 0xe4, 0xf7, 0x5f, 0x7d, 0x69, 0xbc, 0x6d, 0xf9, 0xe9, 0xb,
+ 0x88, 0x1b, 0x60, 0xad, 0xee, 0xab, 0x56, 0xc1, 0x36, 0x44, 0x58, 0x92,
+ 0x28, 0x64, 0x87, 0xdc, 0x2a, 0xfb, 0x1e, 0x59, 0x24, 0xbb, 0x7, 0xf5,
+ 0x1c, 0x3a, 0xee, 0xe7, 0x73, 0xc2, 0x83, 0xb8, 0xd6, 0x93, 0x41, 0x78,
+ 0xb, 0xc2, 0xe6, 0xee, 0x8a, 0xa0, 0xc1, 0x4b, 0xc8, 0x4a, 0x89, 0x3f,
+ 0xc9, 0x56, 0x6d, 0x7f, 0xf3, 0x51, 0x2e, 0x9, 0x68, 0x35, 0xca, 0x45,
+ 0x89, 0x39, 0x2d, 0xc9, 0xa1, 0x30, 0xfb, 0xf0, 0xae, 0x90, 0x39, 0x9f,
+ 0x68, 0x7, 0xab, 0xea, 0x8c, 0xf1, 0x83, 0x4c, 0x5d, 0x46, 0xb9, 0xe2,
+ 0xc0, 0xbf, 0x1f, 0x91, 0xa5, 0xed, 0x7, 0xb8, 0x35, 0x15, 0x55, 0x19,
+ 0x32, 0xd5, 0x42, 0x3d, 0xea, 0x1e, 0x60, 0x37, 0x44, 0x75, 0xe0, 0x57,
+ 0x93, 0x58, 0x3b, 0x4f, 0xcc, 0x17, 0x97, 0x5, 0xba, 0x67, 0x3e, 0x6a,
+ 0xfc, 0x69, 0x1, 0x93, 0x78, 0xd9, 0xf1, 0x6b, 0x41, 0x4f, 0xeb, 0xe4,
+ 0x25, 0x0, 0x45, 0xd4, 0xab, 0xce, 0xd2, 0x1, 0xa0, 0x18, 0xd1, 0x37,
+ 0x6c, 0xb1, 0xb4, 0x44, 0xef, 0x62, 0x18, 0x76, 0x2a, 0xd8, 0x56, 0x26,
+ 0xee, 0x6c, 0x68, 0xd9, 0xf8, 0x91, 0xd9, 0x5a, 0x10, 0x52, 0x75, 0xb0,
+ 0x3e, 0xe8, 0x98, 0xa9, 0x37, 0x3d, 0x18, 0x50, 0xfd, 0x7c, 0x18, 0x43,
+ 0xbd, 0x25, 0x4e, 0x8, 0x2, 0xc0, 0x9e, 0xa5, 0xc0, 0xdc, 0x6b, 0xb,
+ 0x39, 0x7a, 0xc0, 0x6d, 0x8e, 0x59, 0x70, 0x31, 0x77, 0x88, 0xdc, 0xf1,
+ 0x27, 0xf4, 0x5d, 0x28, 0xed, 0x3c, 0x61, 0x24, 0x77, 0x5f, 0x3f, 0xf4,
+ 0x64, 0x73, 0x1a, 0x40, 0xb3, 0xab, 0xfa, 0x76, 0x7b, 0xc0, 0x1f, 0x53,
+ 0xd1, 0xa9, 0x28, 0xff, 0x2c, 0x24, 0xe5, 0xf3, 0x3c, 0xcc, 0x44, 0xe5,
+ 0x48, 0x47, 0x73, 0xd8, 0x86, 0xa8, 0x2e, 0xd7, 0xff, 0xc0, 0x5a, 0x86,
+ 0xde, 0xa4, 0x31, 0xe4, 0xfd, 0xe4, 0x7d, 0x62, 0x75, 0xf, 0x47, 0x62,
+ 0xfc, 0x56, 0xa5, 0x3f, 0x34, 0xd6, 0xf6, 0x74, 0x18, 0x93, 0xa8, 0xfd,
+ 0x8d, 0xfe, 0x7a, 0xc7, 0x85, 0xe, 0xbe, 0xf1, 0x13, 0xab, 0x6, 0x8b,
+ 0xb7, 0x7, 0xa0, 0x7c, 0x17, 0x1a, 0x62, 0xa3, 0xdf, 0x86, 0xcd, 0xd0,
+ 0x3a, 0xc1, 0x4f, 0x80, 0xd, 0x64, 0x8e, 0xf8, 0xe6, 0xf9, 0xed, 0x35,
+ 0x26, 0xe5, 0x4, 0x3e, 0x61, 0xd9, 0x32, 0x5a, 0x5c, 0x56, 0x51, 0xb2,
+ 0xdf, 0xab, 0x5c, 0x7e, 0xce, 0xd6, 0xb7, 0x6d, 0x10, 0xc5, 0xb4, 0xf6,
+ 0x66, 0xe0, 0xb7, 0x1b, 0x36, 0x78, 0x5, 0xde, 0xa7, 0xdd, 0x93, 0xdd,
+ 0x78, 0xe, 0xdb, 0x7f, 0x9, 0x2f, 0x4, 0x66, 0x4d, 0xe2, 0x4c, 0xe0,
+ 0x87, 0x66, 0x38, 0xf1, 0x7c, 0xa5, 0xce, 0xce, 0x98, 0x4d, 0x1e, 0x77,
+ 0xae, 0x55, 0x94, 0xa5, 0xd5, 0x32, 0xc7, 0x11, 0x2d, 0x63, 0x1a, 0x38,
+ 0x5f, 0xae, 0x6a, 0xd1, 0x22, 0xbd, 0xc5, 0xc4, 0x7f, 0xab, 0x98, 0xb2,
+ 0x9b, 0xb5, 0x72, 0x2f, 0xb4, 0x96, 0x2e, 0xdf, 0x4c, 0x83, 0x87, 0x44,
+ 0xc8, 0x5f, 0x41, 0x1, 0xf4, 0x55, 0xfc, 0x28, 0xa3, 0xab, 0xb0, 0xfb,
+ 0x2e, 0xc7, 0x98, 0xd, 0xa9, 0x6d, 0x74, 0x10, 0x2a, 0x9f, 0xd1, 0xb6,
+ 0x7d, 0x50, 0x81, 0x24, 0x9c, 0xba, 0x32, 0x6, 0x57, 0xeb, 0xa9, 0xca
+//};
diff --git a/epid/common-testhelper/testdata/ikgf/groupa/member0/mprecomp.inc b/epid/common-testhelper/testdata/ikgf/groupa/member0/mprecomp.inc
index 2195797..0fae8b7 100644
--- a/epid/common-testhelper/testdata/ikgf/groupa/member0/mprecomp.inc
+++ b/epid/common-testhelper/testdata/ikgf/groupa/member0/mprecomp.inc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -103,4 +103,4 @@
0x32, 0x8d, 0xac, 0x7b, 0x8f, 0x2a, 0x8a, 0x5f, 0xf1, 0xea, 0xbb, 0x8e,
0x6d, 0xbf, 0xe0, 0x59, 0x90, 0xc2, 0xd3, 0x3d, 0x8a, 0x03, 0x64, 0x11,
0xdd, 0xf1, 0xfc, 0x2d, 0x26, 0x8a, 0x6f, 0x39, 0x25, 0xa9, 0xaa, 0x61,
- 0x45, 0x5b, 0x7b, 0x36, 0xfd, 0x82, 0xd2, 0x6a, 0x8c, 0x9a, 0xf1, 0xc2 \ No newline at end of file
+ 0x45, 0x5b, 0x7b, 0x36, 0xfd, 0x82, 0xd2, 0x6a, 0x8c, 0x9a, 0xf1, 0xc2
diff --git a/epid/common-testhelper/testdata/ikgf/groupa/member0/mprivkey.inc b/epid/common-testhelper/testdata/ikgf/groupa/member0/mprivkey.inc
index 2017fa0..44de32a 100644
--- a/epid/common-testhelper/testdata/ikgf/groupa/member0/mprivkey.inc
+++ b/epid/common-testhelper/testdata/ikgf/groupa/member0/mprivkey.inc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -33,4 +33,4 @@
0x0e, 0x2f, 0x12, 0xac, 0x95, 0xb9, 0x26, 0x6d, 0x1d, 0xe2, 0xcf, 0x64,
0x4a, 0x09, 0xdd, 0x4f, 0x15, 0x9d, 0x08, 0x6b, 0x93, 0xbf, 0x95, 0x89,
0x11, 0xb8, 0x31, 0x11, 0xb1, 0x36, 0x76, 0x4d, 0x0a, 0xbe, 0x5a, 0x42,
- 0xe7, 0x44, 0xbb, 0x17, 0x6d, 0x36, 0x7b, 0x80, 0x0b, 0x10, 0x1e, 0xc6 \ No newline at end of file
+ 0xe7, 0x44, 0xbb, 0x17, 0x6d, 0x36, 0x7b, 0x80, 0x0b, 0x10, 0x1e, 0xc6
diff --git a/epid/common-testhelper/testdata/ikgf/groupa/sigrevokedmember0/mprivkey.inc b/epid/common-testhelper/testdata/ikgf/groupa/sigrevokedmember0/mprivkey.inc
index e8059b8..08b48b9 100644
--- a/epid/common-testhelper/testdata/ikgf/groupa/sigrevokedmember0/mprivkey.inc
+++ b/epid/common-testhelper/testdata/ikgf/groupa/sigrevokedmember0/mprivkey.inc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -33,4 +33,4 @@
0x96, 0xfd, 0xdc, 0x71, 0x8a, 0x88, 0x5c, 0x13, 0x55, 0x1b, 0x22, 0xbd,
0x42, 0x0e, 0xc2, 0x49, 0x48, 0x5b, 0xa0, 0x03, 0xea, 0x4b, 0x79, 0x0b,
0xb5, 0xed, 0x1a, 0x81, 0x6d, 0xb2, 0xe8, 0x41, 0xca, 0x1b, 0xb1, 0xc0,
- 0xf7, 0x11, 0x42, 0x3f, 0x24, 0xea, 0x55, 0x02, 0x82, 0x4d, 0x11, 0x48 \ No newline at end of file
+ 0xf7, 0x11, 0x42, 0x3f, 0x24, 0xea, 0x55, 0x02, 0x82, 0x4d, 0x11, 0x48
diff --git a/epid/common-testhelper/testdata/ikgf/groupb/member0/mprivkey.inc b/epid/common-testhelper/testdata/ikgf/groupb/member0/mprivkey.inc
index 33408c9..1ff48ee 100644
--- a/epid/common-testhelper/testdata/ikgf/groupb/member0/mprivkey.inc
+++ b/epid/common-testhelper/testdata/ikgf/groupb/member0/mprivkey.inc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -33,4 +33,4 @@
0x9f, 0xe1, 0xb0, 0x93, 0x74, 0x58, 0xdd, 0x13, 0x8f, 0xc8, 0xce, 0x87,
0x76, 0x80, 0x02, 0x8b, 0x8f, 0xb9, 0x5d, 0x46, 0x25, 0xcb, 0x20, 0x43,
0xda, 0x66, 0xd3, 0x50, 0x6e, 0x10, 0xf2, 0x32, 0x6a, 0x39, 0x36, 0xd2,
- 0x97, 0x01, 0x08, 0x6c, 0x8e, 0x9e, 0x25, 0xa7, 0x7c, 0x86, 0xd4, 0xad \ No newline at end of file
+ 0x97, 0x01, 0x08, 0x6c, 0x8e, 0x9e, 0x25, 0xa7, 0x7c, 0x86, 0xd4, 0xad
diff --git a/epid/common-testhelper/unittests/bignum_wrapper-test.cc b/epid/common-testhelper/unittests/bignum_wrapper-test.cc
index 318532c..2f4db3f 100644
--- a/epid/common-testhelper/unittests/bignum_wrapper-test.cc
+++ b/epid/common-testhelper/unittests/bignum_wrapper-test.cc
@@ -22,8 +22,8 @@
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
extern "C" {
#include "epid/common/math/bignum.h"
diff --git a/epid/common-testhelper/unittests/ecgroup_wrapper-test.cc b/epid/common-testhelper/unittests/ecgroup_wrapper-test.cc
index fae63e7..fc9ba85 100644
--- a/epid/common-testhelper/unittests/ecgroup_wrapper-test.cc
+++ b/epid/common-testhelper/unittests/ecgroup_wrapper-test.cc
@@ -22,12 +22,12 @@
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
-#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
extern "C" {
#include "epid/common/math/bignum.h"
@@ -46,28 +46,28 @@ class EcGroupObjTest : public ::testing::Test {
static const G1ElemStr g1_str;
};
const BigNumStr EcGroupObjTest::q_str = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
- 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98,
+ 0x0A, 0x82, 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}}};
const FqElemStr EcGroupObjTest::b_str = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
const BigNumStr EcGroupObjTest::p_str = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99, 0x92, 0x1A,
- 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99,
+ 0x92, 0x1A, 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
const BigNumStr EcGroupObjTest::h1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
const G1ElemStr EcGroupObjTest::g1_str = {
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
TEST_F(EcGroupObjTest, ObjDefaultConstructedIsNotNull) {
EcGroupObj group;
diff --git a/epid/common-testhelper/unittests/ecpoint_wrapper-test.cc b/epid/common-testhelper/unittests/ecpoint_wrapper-test.cc
index c35a060..db77afc 100644
--- a/epid/common-testhelper/unittests/ecpoint_wrapper-test.cc
+++ b/epid/common-testhelper/unittests/ecpoint_wrapper-test.cc
@@ -22,9 +22,9 @@
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
-#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
+#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
extern "C" {
#include "epid/common/math/bignum.h"
@@ -41,20 +41,20 @@ class EcPointObjTest : public ::testing::Test {
};
const G1ElemStr EcPointObjTest::group_str_1 = {
- {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D, 0x52,
- 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A, 0x37, 0xE0,
- 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
- {{{0x78, 0x65, 0x28, 0xCB, 0xAF, 0x07, 0x52, 0x50, 0x55, 0x7A, 0x5F, 0x30,
- 0x0A, 0xC0, 0xB4, 0x6B, 0xEA, 0x6F, 0xE2, 0xF6, 0x6D, 0x96, 0xF7, 0xCD,
- 0xC8, 0xD3, 0x12, 0x7F, 0x1F, 0x3A, 0x8B, 0x42}}}};
+ {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D,
+ 0x52, 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A,
+ 0x37, 0xE0, 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
+ {{{0x78, 0x65, 0x28, 0xCB, 0xAF, 0x07, 0x52, 0x50, 0x55, 0x7A, 0x5F,
+ 0x30, 0x0A, 0xC0, 0xB4, 0x6B, 0xEA, 0x6F, 0xE2, 0xF6, 0x6D, 0x96,
+ 0xF7, 0xCD, 0xC8, 0xD3, 0x12, 0x7F, 0x1F, 0x3A, 0x8B, 0x42}}}};
const G1ElemStr EcPointObjTest::group_str_2 = {
- {{{0xE6, 0x65, 0x23, 0x9B, 0xD4, 0x07, 0x16, 0x83, 0x38, 0x23, 0xB2, 0x67,
- 0x57, 0xEB, 0x0F, 0x23, 0x3A, 0xF4, 0x8E, 0xDA, 0x71, 0x5E, 0xD9, 0x98,
- 0x63, 0x98, 0x2B, 0xBC, 0x78, 0xD1, 0x94, 0xF2}}},
- {{{0x63, 0xB0, 0xAD, 0xB8, 0x2C, 0xE8, 0x14, 0xFD, 0xA2, 0x39, 0x0E, 0x66,
- 0xB7, 0xD0, 0x6A, 0xAB, 0xEE, 0xFA, 0x2E, 0x24, 0x9B, 0xB5, 0x14, 0x35,
- 0xFE, 0xB6, 0xB0, 0xFF, 0xFD, 0x5F, 0x73, 0x19}}}};
+ {{{0xE6, 0x65, 0x23, 0x9B, 0xD4, 0x07, 0x16, 0x83, 0x38, 0x23, 0xB2,
+ 0x67, 0x57, 0xEB, 0x0F, 0x23, 0x3A, 0xF4, 0x8E, 0xDA, 0x71, 0x5E,
+ 0xD9, 0x98, 0x63, 0x98, 0x2B, 0xBC, 0x78, 0xD1, 0x94, 0xF2}}},
+ {{{0x63, 0xB0, 0xAD, 0xB8, 0x2C, 0xE8, 0x14, 0xFD, 0xA2, 0x39, 0x0E,
+ 0x66, 0xB7, 0xD0, 0x6A, 0xAB, 0xEE, 0xFA, 0x2E, 0x24, 0x9B, 0xB5,
+ 0x14, 0x35, 0xFE, 0xB6, 0xB0, 0xFF, 0xFD, 0x5F, 0x73, 0x19}}}};
EcGroupObj EcPointObjTest::group;
diff --git a/epid/common-testhelper/unittests/finite_field_wrapper-test.cc b/epid/common-testhelper/unittests/finite_field_wrapper-test.cc
index 36d9cdc..62a29c6 100644
--- a/epid/common-testhelper/unittests/finite_field_wrapper-test.cc
+++ b/epid/common-testhelper/unittests/finite_field_wrapper-test.cc
@@ -23,8 +23,8 @@
#include "gtest/gtest.h"
#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
extern "C" {
#include "epid/common/math/bignum.h"
diff --git a/epid/common-testhelper/verifier_wrapper-testhelper.cc b/epid/common-testhelper/verifier_wrapper-testhelper.cc
index ef9ba8b..943d308 100644
--- a/epid/common-testhelper/verifier_wrapper-testhelper.cc
+++ b/epid/common-testhelper/verifier_wrapper-testhelper.cc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
* \brief Verifier C++ wrapper implementation.
*/
#include <cstdio>
-#include <string>
#include <stdexcept>
+#include <string>
#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
diff --git a/epid/common/1.1/file_parser.h b/epid/common/1.1/file_parser.h
index d6d5c89..70ccfdc 100644
--- a/epid/common/1.1/file_parser.h
+++ b/epid/common/1.1/file_parser.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-/// Epid 1.1 issuer material parsing utilities.
+/// Intel(R) EPID 1.1 issuer material parsing utilities.
/*!
* \file
*/
@@ -28,13 +28,13 @@
/// Parser for 1.1 issuer material
/*!
- \defgroup Epid11FileParserModule EPID 1.1 support
+ \defgroup Epid11FileParserModule Intel(R) EPID 1.1 support
Defines the APIs needed to parse Intel(R) EPID 1.1 issuer material.
\ingroup FileParser
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
-support</b></a>
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R)
+ EPID 1.1 support</b></a>
@{
*/
@@ -68,7 +68,8 @@ support</b></a>
\retval ::kEpidSigInvalid
Parsing failed due to data authentication failure.
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R)
+ EPID 1.1
support</b></a>
*/
@@ -113,8 +114,8 @@ EpidStatus Epid11ParseGroupPubKeyFile(void const* buf, size_t len,
\retval ::kEpidSigInvalid
Parsing failed due to data authentication failure.
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
- support</b></a>
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R)
+ EPID 1.1 support</b></a>
*/
EpidStatus Epid11ParsePrivRlFile(void const* buf, size_t len,
@@ -159,8 +160,8 @@ EpidStatus Epid11ParsePrivRlFile(void const* buf, size_t len,
\retval ::kEpidSigInvalid
Parsing failed due to data authentication failure.
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
- support</b></a>
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R)
+ EPID 1.1 support</b></a>
*/
EpidStatus Epid11ParseSigRlFile(void const* buf, size_t len,
@@ -204,8 +205,8 @@ EpidStatus Epid11ParseSigRlFile(void const* buf, size_t len,
\retval ::kEpidSigInvalid
Parsing failed due to data authentication failure.
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
- support</b></a>
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R)
+ EPID 1.1 support</b></a>
*/
EpidStatus Epid11ParseGroupRlFile(void const* buf, size_t len,
diff --git a/epid/common/1.1/src/commitment.c b/epid/common/1.1/src/commitment.c
index 7749fa6..cf16144 100644
--- a/epid/common/1.1/src/commitment.c
+++ b/epid/common/1.1/src/commitment.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,13 +18,13 @@
* \file
* \brief Commitment hash implementation.
*/
-#include <stdio.h>
-#include <limits.h>
#include "epid/common/1.1/src/commitment.h"
-#include "epid/common/src/memory.h"
+#include <limits.h>
+#include <stdio.h>
#include "epid/common/math/bignum.h"
#include "epid/common/math/src/bignum-internal.h"
#include "epid/common/src/endian_convert.h"
+#include "epid/common/src/memory.h"
EpidStatus SetKeySpecificEpid11CommitValues(Epid11GroupPubKey const* pub_key,
Epid11CommitValues* values) {
diff --git a/epid/common/1.1/src/commitment.h b/epid/common/1.1/src/commitment.h
index b606590..ee3d9b1 100644
--- a/epid/common/1.1/src/commitment.h
+++ b/epid/common/1.1/src/commitment.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
* \addtogroup EpidCommon
* @{
*/
-#include "epid/common/errors.h"
#include "epid/common/1.1/types.h"
+#include "epid/common/errors.h"
#include "epid/common/math/ecgroup.h"
#include "epid/common/math/finitefield.h"
#include "epid/common/math/hash.h"
diff --git a/epid/common/1.1/src/epid11params.c b/epid/common/1.1/src/epid11params.c
index 0a1e620..8692f0e 100644
--- a/epid/common/1.1/src/epid11params.c
+++ b/epid/common/1.1/src/epid11params.c
@@ -1,5 +1,5 @@
/*############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
* \brief Intel(R) EPID 1.1 constant parameters implementation.
*/
#include "epid/common/1.1/src/epid11params.h"
-#include "epid/common/src/memory.h"
#include "epid/common/math/tatepairing.h"
+#include "epid/common/src/memory.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
diff --git a/epid/common/1.1/src/file_parser.c b/epid/common/1.1/src/file_parser.c
index ed78ad5..a971632 100644
--- a/epid/common/1.1/src/file_parser.c
+++ b/epid/common/1.1/src/file_parser.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
#include <string.h>
#include "epid/common/math/ecdsa.h"
-#include "epid/common/src/memory.h"
#include "epid/common/src/file_parser-internal.h"
+#include "epid/common/src/memory.h"
/// Intel(R) EPID 1.1 Group Public Key binary format
typedef struct Epid11GroupPubKeyCertificate {
diff --git a/epid/common/1.1/src/grouppubkey.h b/epid/common/1.1/src/grouppubkey.h
index 49db330..3cb83a3 100644
--- a/epid/common/1.1/src/grouppubkey.h
+++ b/epid/common/1.1/src/grouppubkey.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,9 +21,9 @@
* \addtogroup EpidCommon
* @{
*/
+#include "epid/common/1.1/types.h"
#include "epid/common/errors.h"
#include "epid/common/math/ecgroup.h"
-#include "epid/common/1.1/types.h"
/// Internal representation of Epid11GroupPubKey
typedef struct Epid11GroupPubKey_ {
diff --git a/epid/common/1.1/types.h b/epid/common/1.1/types.h
index af534d9..5ef8359 100644
--- a/epid/common/1.1/types.h
+++ b/epid/common/1.1/types.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,13 +27,13 @@
/// Intel(R) EPID 1.1 specific data types.
/*!
-\defgroup Epid11Types EPID 1.1 specific types
+\defgroup Epid11Types Intel(R) EPID 1.1 specific types
Defines serialized data types used by the SDK. These data types
are only used by components that need to do Intel(R) EPID 1.1
verification.
\ingroup EpidTypes
-\see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+\see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
@{
*/
diff --git a/epid/common/1.1/unittests/file_parser-test.cc b/epid/common/1.1/unittests/file_parser-test.cc
index ab894e2..a2bf244 100644
--- a/epid/common/1.1/unittests/file_parser-test.cc
+++ b/epid/common/1.1/unittests/file_parser-test.cc
@@ -69,9 +69,9 @@ class Epid11FileParser : public ::testing::Test {
static const std::vector<uint8_t> kShortGroupRl;
};
const EpidCaCertificate Epid11FileParser::kCert = {
- // EpidFileHeader::epid_version
+ // Intel(R) EPID Version
0x02, 0x00,
- // EpidFileHeader::file_type
+ // File type
0x00, 0x11,
// pubkey
0x24, 0x42, 0xa5, 0xcc, 0x0e, 0xcd, 0x01, 0x5f, 0xa3, 0xca, 0x31, 0xdc,
@@ -114,9 +114,9 @@ const EpidCaCertificate Epid11FileParser::kCert = {
0x1c, 0x01, 0x5b, 0xc9, 0x08, 0xce, 0x3e, 0x68};
const std::vector<uint8_t> Epid11FileParser::kGroupPublicKeyFile = {
- // Epid Version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0c,
// GID
0x00, 0x00, 0x00, 0x7b,
@@ -194,9 +194,9 @@ const std::vector<uint8_t> Epid11FileParser::kGroupPublicKey = {
0xa5, 0xfd, 0x6b, 0xc4, 0x1d, 0xfb, 0x47, 0x27, 0xaf, 0xc1, 0x94, 0xcd};
const std::vector<uint8_t> Epid11FileParser::kGroupMultiPublicKeyFile = {
- // Epid Version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0c,
// GID
0x00, 0x00, 0x00, 0x7b,
@@ -238,9 +238,9 @@ const std::vector<uint8_t> Epid11FileParser::kGroupMultiPublicKeyFile = {
0x68, 0x6f, 0x9e, 0x3b, 0xcf, 0xfd, 0x98, 0xcc, 0xae, 0x92, 0xcc, 0x94,
0x23, 0xb6, 0xbd, 0x57, 0xac, 0x06, 0x3c, 0xa1, 0xe5, 0x3e, 0xe9, 0xf5,
0x0e, 0x55, 0xb4, 0xe5,
- // Epid Version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0c,
// GID
0x00, 0x00, 0x04, 0xd2,
@@ -284,9 +284,9 @@ const std::vector<uint8_t> Epid11FileParser::kGroupMultiPublicKeyFile = {
0xfb, 0x79, 0xa0, 0xa5};
const std::vector<uint8_t> Epid11FileParser::kEmptyPrivRlFile = {
- // Epid Version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0d,
// GID
0x00, 0x00, 0x00, 0x7b,
@@ -311,9 +311,9 @@ const std::vector<uint8_t> Epid11FileParser::kEmptyPrivRl = {
0x00, 0x00, 0x00, 0x00};
const std::vector<uint8_t> Epid11FileParser::kShortPrivRlFile = {
- // Epid Version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0d,
// GID
0x00, 0x00, 0x00, 0x7b,
@@ -347,9 +347,9 @@ const std::vector<uint8_t> Epid11FileParser::kShortPrivRl = {
};
const std::vector<uint8_t> Epid11FileParser::kEmptySigRlFile = {
- // Epid Version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0e,
// GID
0x00, 0x00, 0x00, 0x7b,
@@ -373,9 +373,9 @@ const std::vector<uint8_t> Epid11FileParser::kEmptySigRl = {
0x00, 0x00, 0x00, 0x00};
const std::vector<uint8_t> Epid11FileParser::kShortSigRlFile = {
- // Epid Version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0e,
// GID
0x00, 0x00, 0x00, 0x7b,
@@ -468,9 +468,9 @@ const std::vector<uint8_t> Epid11FileParser::kShortSigRl = {
0x48, 0xc2, 0x89, 0xb6, 0x27, 0x3b, 0x95, 0x89};
const std::vector<uint8_t> Epid11FileParser::kEmptyGroupRlFile = {
- // Epid version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0f,
// RL ver
0x00, 0x00, 0x00, 0x00,
@@ -490,9 +490,9 @@ const std::vector<uint8_t> Epid11FileParser::kEmptyGroupRl = {
0x00, 0x00, 0x00, 0x00};
const std::vector<uint8_t> Epid11FileParser::kShortGroupRlFile = {
- // Epid version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0f,
// RL ver
0x00, 0x00, 0x00, 0x03,
@@ -861,9 +861,9 @@ TEST_F(Epid11FileParser, PrivRlParseParsesLongPrivRl) {
};
std::vector<uint8_t> long_privrl_file = {
- // Epid Version
+ // Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0d,
// GID
0x00, 0x00, 0x00, 0x7b,
@@ -1119,9 +1119,9 @@ TEST_F(Epid11FileParser, SigRlParseParsesLongSigRl) {
0x23, 0x1d, 0x31, 0x17, 0x88, 0x49, 0x13, 0x47, 0xe7, 0xda, 0xfe,
0x8d, 0x67, 0xba, 0x16, 0x1d, 0x0a, 0xd3, 0x4a, 0x2d, 0xd1, 0xf8,
0x60, 0x21, 0xa5, 0x00, 0x9a, 0x0d, 0x4d, 0xc4, 0xbd};
- std::vector<uint8_t> long_sigrl_file = {// EPID Version
+ std::vector<uint8_t> long_sigrl_file = {// Intel(R) EPID Version
0x01, 0x00,
- // Epid type
+ // File type
0x00, 0x0e,
// GID
0x00, 0x00, 0x00, 0x7b,
@@ -1362,7 +1362,7 @@ TEST_F(Epid11FileParser, ParsesLongGroupRl) {
0x30, 0x90, 0x53, 0x8f, 0x55, 0x50, 0xcf, 0xed, 0x9e, 0xaa, 0x31,
0x4f, 0x7f, 0xb2, 0x27, 0xf9, 0xbb, 0xfa, 0x52, 0x70};
std::vector<uint8_t> long_grouprl_file = {
- /// EPID version
+ /// Intel(R) EPID version
0x01, 0x00,
// File type
0x00, 0x0f,
diff --git a/epid/common/Makefile b/epid/common/Makefile
index 0baf6a8..4dfe984 100644
--- a/epid/common/Makefile
+++ b/epid/common/Makefile
@@ -21,7 +21,7 @@ COMMON_SRC += $(wildcard ./1.1/src/*.c)
COMMON_OBJ = $(COMMON_SRC:.c=.o)
COMMON_LIB = ./libcommon.a
-COMMON_UTEST_EXE = ./common-utest
+COMMON_UTEST_EXE = ./common-utest$(EXE_EXTENSION)
COMMON_UTEST_SRC = $(wildcard ./math/unittests/*.cc)
COMMON_UTEST_SRC += $(wildcard ./unittests/*.cc)
COMMON_UTEST_SRC += $(wildcard ./1.1/unittests/*.cc)
diff --git a/epid/common/bitsupplier.h b/epid/common/bitsupplier.h
index 85ec7fd..fb544a1 100644
--- a/epid/common/bitsupplier.h
+++ b/epid/common/bitsupplier.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
You need to pass a pointer to your
implementation of the random number generator into
- methods that require it, such as ::EpidMemberCreate.
+ methods that require it.
For an example of how a BitSupplier is created, see
the `signmsg` example.
@@ -53,8 +53,6 @@
\returns zero on success and non-zero value on error.
\ingroup EpidCommon
-
- \see EpidMemberCreate
*/
typedef int(__STDCALL* BitSupplier)(unsigned int* rand_data, int num_bits,
void* user_data);
diff --git a/epid/common/file_parser.h b/epid/common/file_parser.h
index f3d45a5..0cc7b3b 100644
--- a/epid/common/file_parser.h
+++ b/epid/common/file_parser.h
@@ -16,15 +16,15 @@
/*!
* \file
- * \brief Epid issuer material parsing utilities.
+ * \brief Intel(R) EPID issuer material parsing utilities.
*/
#ifndef EPID_COMMON_FILE_PARSER_H_
#define EPID_COMMON_FILE_PARSER_H_
#include <stddef.h>
-#include "epid/common/types.h"
#include "epid/common/errors.h"
+#include "epid/common/types.h"
/// Parser for issuer material
/*!
@@ -42,7 +42,7 @@
typedef enum EpidVersion {
kEpid1x, ///< Intel(R) EPID version 1.x
kEpid2x, ///< Intel(R) EPID version 2.x
- kNumEpidVersions, ///< Maximum number of EPID versions
+ kNumEpidVersions, ///< Maximum number of versions
} EpidVersion;
/// Encoding of issuer material Intel(R) EPID versions
@@ -94,12 +94,12 @@ typedef struct EpidCaCertificate {
The size of buf in bytes.
\param[out] epid_version
- The extracted EPID version or kNumEpidVersions if EPID version is unknown.
- Pass NULL to not extract.
+ The extracted Intel(R) EPID version or kNumEpidVersions if Intel(R) EPID
+ version is unknown. Pass NULL to not extract.
\param[out] file_type
- The extracted EPID file type or kNumFileTypes if file type is unknown.
- Pass NULL to not extract.
+ The extracted Intel(R) EPID file type or kNumFileTypes if file type is
+ unknown. Pass NULL to not extract.
\returns ::EpidStatus
diff --git a/epid/common/math/bignum.h b/epid/common/math/bignum.h
index e2b5712..000d2a1 100644
--- a/epid/common/math/bignum.h
+++ b/epid/common/math/bignum.h
@@ -24,8 +24,8 @@
#include <stddef.h>
#include <stdint.h>
-#include "epid/common/stdtypes.h"
#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
#include "epid/common/types.h"
/// Big number operations
diff --git a/epid/common/math/ecdsa.h b/epid/common/math/ecdsa.h
index 0ab5764..92567f7 100644
--- a/epid/common/math/ecdsa.h
+++ b/epid/common/math/ecdsa.h
@@ -24,9 +24,9 @@
#include <stddef.h>
+#include "epid/common/bitsupplier.h"
#include "epid/common/errors.h"
#include "epid/common/types.h"
-#include "epid/common/bitsupplier.h"
/// Elliptic Curve Digital Signature Algorithm Primitives
/*!
diff --git a/epid/common/math/ecgroup.h b/epid/common/math/ecgroup.h
index bd19179..85e90b9 100644
--- a/epid/common/math/ecgroup.h
+++ b/epid/common/math/ecgroup.h
@@ -22,10 +22,10 @@
#ifndef EPID_COMMON_MATH_ECGROUP_H_
#define EPID_COMMON_MATH_ECGROUP_H_
-#include "epid/common/stdtypes.h"
#include "epid/common/errors.h"
#include "epid/common/math/bignum.h"
#include "epid/common/math/finitefield.h"
+#include "epid/common/stdtypes.h"
#include "epid/common/types.h"
/// Elliptic curve group operations
@@ -396,6 +396,8 @@ EpidStatus Epid11EcHash(EcGroup* g, ConstOctStr msg, size_t msg_len,
The hash algorithm.
\param[out] r
The hashed value.
+ \param[out] iterations
+ The number of hash iterations needed to find a valid hash. Can be NULL.
\returns ::EpidStatus
@@ -403,7 +405,7 @@ EpidStatus Epid11EcHash(EcGroup* g, ConstOctStr msg, size_t msg_len,
\see NewEcPoint
*/
EpidStatus EcHash(EcGroup* g, ConstOctStr msg, size_t msg_len, HashAlg hash_alg,
- EcPoint* r);
+ EcPoint* r, uint32_t* iterations);
/// Sets an EcPoint variable to a point on a curve.
/*!
diff --git a/epid/common/math/finitefield.h b/epid/common/math/finitefield.h
index cc87186..6a8d5a2 100644
--- a/epid/common/math/finitefield.h
+++ b/epid/common/math/finitefield.h
@@ -22,10 +22,10 @@
#ifndef EPID_COMMON_MATH_FINITEFIELD_H_
#define EPID_COMMON_MATH_FINITEFIELD_H_
-#include "epid/common/stdtypes.h"
#include "epid/common/bitsupplier.h"
#include "epid/common/errors.h"
#include "epid/common/math/bignum.h"
+#include "epid/common/stdtypes.h"
#include "epid/common/types.h"
/// Finite field operations
diff --git a/epid/common/math/hash.h b/epid/common/math/hash.h
index 30e8e20..014f6a5 100644
--- a/epid/common/math/hash.h
+++ b/epid/common/math/hash.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@
#ifndef EPID_COMMON_MATH_HASH_H_
#define EPID_COMMON_MATH_HASH_H_
+#include <limits.h> // for CHAR_BIT
#include <stddef.h>
#include <stdint.h>
-#include <limits.h> // for CHAR_BIT
#include "epid/common/errors.h"
/// Hash primitives
diff --git a/epid/common/math/pairing.h b/epid/common/math/pairing.h
index 31d0e09..ff41a76 100644
--- a/epid/common/math/pairing.h
+++ b/epid/common/math/pairing.h
@@ -23,9 +23,9 @@
#define EPID_COMMON_MATH_PAIRING_H_
#include "epid/common/errors.h"
-#include "epid/common/types.h"
-#include "epid/common/math/finitefield.h"
#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/finitefield.h"
+#include "epid/common/types.h"
/// Pairing operations
/*!
diff --git a/epid/common/math/printutils.h b/epid/common/math/printutils.h
index 6f21b09..9c2efd4 100644
--- a/epid/common/math/printutils.h
+++ b/epid/common/math/printutils.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,10 +21,10 @@
#ifndef EPID_COMMON_MATH_PRINTUTILS_H_
#define EPID_COMMON_MATH_PRINTUTILS_H_
-#include "epid/common/types.h"
#include "epid/common/math/bignum.h"
-#include "epid/common/math/finitefield.h"
#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/finitefield.h"
+#include "epid/common/types.h"
/// Debug print routines
/*!
diff --git a/epid/common/math/src/bignum-internal.h b/epid/common/math/src/bignum-internal.h
index 3c6fc19..fcddee9 100644
--- a/epid/common/math/src/bignum-internal.h
+++ b/epid/common/math/src/bignum-internal.h
@@ -22,10 +22,10 @@
#ifndef EPID_COMMON_MATH_SRC_BIGNUM_INTERNAL_H_
#define EPID_COMMON_MATH_SRC_BIGNUM_INTERNAL_H_
-#include "ext/ipp/include/ippcp.h"
+#include "epid/common/errors.h"
#include "epid/common/stdtypes.h"
#include "epid/common/types.h"
-#include "epid/common/errors.h"
+#include "ext/ipp/include/ippcp.h"
typedef void* BNU;
typedef void const* ConstBNU;
@@ -71,20 +71,4 @@ Length of octet string in bytes.
*/
size_t OctStrBitSize(ConstOctStr octstr_ptr, size_t octstr_len);
-/// Initializes a BigNum from a BNU.
-/*!
- \param[in] bnu
- The desired value as a bnu.
- \param[in] bnu_len
- The size of bnu_str in 32 bit words.
- \param[out] bn
- The target BigNum.
-
- \note A BNU is a big integer represented as array of 4 byte words written in
- little endian order
-
- \returns ::EpidStatus
-*/
-EpidStatus InitBigNumFromBnu(ConstBNU bnu, size_t bnu_len, struct BigNum* bn);
-
#endif // EPID_COMMON_MATH_SRC_BIGNUM_INTERNAL_H_
diff --git a/epid/common/math/src/bignum.c b/epid/common/math/src/bignum.c
index cd8df13..4ea62d7 100644
--- a/epid/common/math/src/bignum.c
+++ b/epid/common/math/src/bignum.c
@@ -139,43 +139,6 @@ EpidStatus ReadBigNum(ConstOctStr bn_str, size_t strlen, BigNum* bn) {
return kEpidNoErr;
}
-/// Initializes a BigNum from a BNU.
-/*!
- \param[in] bnu
- The desired value as a bnu.
- \param[in] bnu_len
- The size of bnu_str in 32 bit words.
- \param[out] bn
- The target BigNum.
-
- \returns ::EpidStatus
-
- \note A BNU is a big integer represented as array of 4 byte words written in
- little endian order
-
- \note This is re-documented here because doxygen does not pull in the
- internal headers
-*/
-EpidStatus InitBigNumFromBnu(ConstBNU bnu, size_t bnu_len, struct BigNum* bn) {
- IppStatus sts;
- if (!bn || !bnu) return kEpidBadArgErr;
-
- if (!bn->ipp_bn) return kEpidBadArgErr;
-
- if (INT_MAX < bnu_len || bnu_len <= 0) return kEpidBadArgErr;
-
- sts = ippsSet_BN(IppsBigNumPOS, (int)bnu_len, bnu, bn->ipp_bn);
- if (sts != ippStsNoErr) {
- if (ippStsContextMatchErr == sts || ippStsSizeErr == sts ||
- ippStsLengthErr == sts || ippStsOutOfRangeErr == sts)
- return kEpidBadArgErr;
- else
- return kEpidMathErr;
- }
-
- return kEpidNoErr;
-}
-
EpidStatus WriteBigNum(BigNum const* bn, size_t strlen, OctStr bn_str) {
IppStatus sts;
int ipp_strlen = (int)strlen;
diff --git a/epid/common/math/src/ecdsa_sign.c b/epid/common/math/src/ecdsa_sign.c
index bbc927e..2225ea5 100644
--- a/epid/common/math/src/ecdsa_sign.c
+++ b/epid/common/math/src/ecdsa_sign.c
@@ -19,10 +19,10 @@
* \brief EcdsaSignBuffer implementation.
*/
-#include "epid/common/math/ecdsa.h"
#include "epid/common/math/bignum.h"
-#include "epid/common/math/src/bignum-internal.h"
+#include "epid/common/math/ecdsa.h"
#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/src/bignum-internal.h"
#include "epid/common/src/memory.h"
#include "ext/ipp/include/ippcp.h"
diff --git a/epid/common/math/src/ecgroup-internal.h b/epid/common/math/src/ecgroup-internal.h
index ed3c83c..55dbab4 100644
--- a/epid/common/math/src/ecgroup-internal.h
+++ b/epid/common/math/src/ecgroup-internal.h
@@ -22,8 +22,8 @@
#ifndef EPID_COMMON_MATH_SRC_ECGROUP_INTERNAL_H_
#define EPID_COMMON_MATH_SRC_ECGROUP_INTERNAL_H_
-#include "ext/ipp/include/ippcp.h"
#include "epid/common/math/src/finitefield-internal.h"
+#include "ext/ipp/include/ippcp.h"
/// Elpitic Curve Group
struct EcGroup {
diff --git a/epid/common/math/src/ecgroup.c b/epid/common/math/src/ecgroup.c
index 717d6a8..ba6b5c3 100644
--- a/epid/common/math/src/ecgroup.c
+++ b/epid/common/math/src/ecgroup.c
@@ -19,17 +19,17 @@
* \brief Elliptic curve group implementation.
*/
+#include "epid/common/math/ecgroup.h"
#include <string.h>
+#include "epid/common/1.1/types.h"
+#include "epid/common/math/hash.h"
#include "epid/common/math/src/bignum-internal.h"
#include "epid/common/math/src/ecgroup-internal.h"
-#include "epid/common/math/ecgroup.h"
#include "epid/common/math/src/finitefield-internal.h"
-#include "epid/common/math/hash.h"
-#include "epid/common/src/memory.h"
#include "epid/common/src/endian_convert.h"
+#include "epid/common/src/memory.h"
#include "ext/ipp/include/ippcp.h"
#include "ext/ipp/include/ippcpdefs.h"
-#include "epid/common/1.1/types.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -1070,11 +1070,11 @@ EpidStatus Epid11EcHash(EcGroup* g, ConstOctStr msg, size_t msg_len,
}
EpidStatus EcHash(EcGroup* g, ConstOctStr msg, size_t msg_len, HashAlg hash_alg,
- EcPoint* r) {
+ EcPoint* r, uint32_t* iterations) {
IppStatus sts = ippStsNoErr;
IppHashAlgId hash_id;
int ipp_msg_len = 0;
- Ipp32u i = 0;
+ Ipp32u ipp_i = 0;
if (!g || (!msg && msg_len > 0) || !r) {
return kEpidBadArgErr;
} else if (!g->ff || !g->ipp_ec || !r->ipp_ec_pt) {
@@ -1104,9 +1104,14 @@ EpidStatus EcHash(EcGroup* g, ConstOctStr msg, size_t msg_len, HashAlg hash_alg,
}
do {
- sts = ippsGFpECSetPointHash(i, msg, ipp_msg_len, r->ipp_ec_pt, g->ipp_ec,
- hash_id, g->scratch_buffer);
- } while (ippStsQuadraticNonResidueErr == sts && i++ < EPID_ECHASH_WATCHDOG);
+ sts = ippsGFpECSetPointHash(ipp_i, msg, ipp_msg_len, r->ipp_ec_pt,
+ g->ipp_ec, hash_id, g->scratch_buffer);
+ } while (ippStsQuadraticNonResidueErr == sts &&
+ ipp_i++ < EPID_ECHASH_WATCHDOG);
+
+ if (iterations) {
+ *iterations = (uint32_t)ipp_i;
+ }
if (ippStsContextMatchErr == sts || ippStsBadArgErr == sts ||
ippStsLengthErr == sts) {
diff --git a/epid/common/math/src/finitefield-internal.h b/epid/common/math/src/finitefield-internal.h
index fa1e0ea..1123f3d 100644
--- a/epid/common/math/src/finitefield-internal.h
+++ b/epid/common/math/src/finitefield-internal.h
@@ -22,9 +22,9 @@
#ifndef EPID_COMMON_MATH_SRC_FINITEFIELD_INTERNAL_H_
#define EPID_COMMON_MATH_SRC_FINITEFIELD_INTERNAL_H_
-#include "ext/ipp/include/ippcp.h"
#include "epid/common/math/bignum.h"
#include "epid/common/math/src/bignum-internal.h"
+#include "ext/ipp/include/ippcp.h"
/// Finite Field
struct FiniteField {
diff --git a/epid/common/math/src/finitefield.c b/epid/common/math/src/finitefield.c
index b02b43f..5589e75 100644
--- a/epid/common/math/src/finitefield.c
+++ b/epid/common/math/src/finitefield.c
@@ -19,10 +19,10 @@
* \brief Finite field implementation.
*/
+#include "epid/common/math/finitefield.h"
#include <limits.h>
-#include <string.h>
#include <stdint.h>
-#include "epid/common/math/finitefield.h"
+#include <string.h>
#include "epid/common/math/src/finitefield-internal.h"
#include "epid/common/src/memory.h"
diff --git a/epid/common/math/src/pairing.c b/epid/common/math/src/pairing.c
index ef4c224..b8da1d3 100644
--- a/epid/common/math/src/pairing.c
+++ b/epid/common/math/src/pairing.c
@@ -19,11 +19,11 @@
* \brief Pairing implementation.
*/
-#include <limits.h>
#include "epid/common/math/pairing.h"
+#include <limits.h>
#include "epid/common/math/src/bignum-internal.h"
-#include "epid/common/math/src/finitefield-internal.h"
#include "epid/common/math/src/ecgroup-internal.h"
+#include "epid/common/math/src/finitefield-internal.h"
#include "epid/common/math/src/pairing-internal.h"
#include "epid/common/src/memory.h"
#include "ext/ipp/include/ippcp.h"
diff --git a/epid/common/math/src/printutils.c b/epid/common/math/src/printutils.c
index 48fd00a..cd47463 100644
--- a/epid/common/math/src/printutils.c
+++ b/epid/common/math/src/printutils.c
@@ -27,11 +27,11 @@
#include <stdio.h>
#include <string.h>
-#include "ext/ipp/include/ippcp.h"
#include "epid/common/math/src/bignum-internal.h"
#include "epid/common/math/src/ecgroup-internal.h"
#include "epid/common/math/src/finitefield-internal.h"
#include "epid/common/src/memory.h"
+#include "ext/ipp/include/ippcp.h"
/// Allowed number of characters printed in one line
#define WIDTH 49
diff --git a/epid/common/math/src/tatepairing.c b/epid/common/math/src/tatepairing.c
index dd65789..adc42eb 100644
--- a/epid/common/math/src/tatepairing.c
+++ b/epid/common/math/src/tatepairing.c
@@ -16,14 +16,14 @@
/*!
* \file
-* \brief EPID 1.1 pairing implementation.
+* \brief Intel(R) EPID 1.1 pairing implementation.
*/
#include "epid/common/math/tatepairing.h"
#include "epid/common/1.1/types.h"
#include "epid/common/math/src/bignum-internal.h"
-#include "epid/common/math/src/finitefield-internal.h"
#include "epid/common/math/src/ecgroup-internal.h"
+#include "epid/common/math/src/finitefield-internal.h"
#include "epid/common/math/src/tatepairing-internal.h"
#include "epid/common/src/memory.h"
#include "ext/ipp/include/ippcp.h"
@@ -126,7 +126,7 @@ EpidStatus NewEpid11PairingState(EcGroup const* ga, EcGroup const* gb,
break;
}
- // store EPID fields and groups
+ // store Intel(R) EPID fields and groups
pairing_state_ctx->ga = (EcGroup*)ga;
pairing_state_ctx->gb = (EcGroup*)gb;
pairing_state_ctx->ff = (FiniteField*)ff;
diff --git a/epid/common/math/tatepairing.h b/epid/common/math/tatepairing.h
index 8849c87..4ac09e8 100644
--- a/epid/common/math/tatepairing.h
+++ b/epid/common/math/tatepairing.h
@@ -23,14 +23,14 @@
#define EPID_COMMON_MATH_TATEPAIRING_H_
#include "epid/common/errors.h"
-#include "epid/common/types.h"
-#include "epid/common/math/finitefield.h"
#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/finitefield.h"
+#include "epid/common/types.h"
-/// EPID 1.1 pairing operations
+/// Intel(R) EPID 1.1 pairing operations
/*!
- \defgroup Epid11PairingPrimitives EPID 1.1 specific pairing
+ \defgroup Epid11PairingPrimitives Intel(R) EPID 1.1 specific pairing
Provides APIs for defining and using a pairing relationship between two
Elliptic curve groups.
@@ -38,7 +38,8 @@
1.1 verification.
\ingroup PairingPrimitives
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID
+ 1.1
support</b></a>
@{
*/
@@ -70,7 +71,7 @@ typedef struct Epid11PairingState Epid11PairingState;
ff exist for the entire lifetime of the new Epid11PairingState.
\see DeleteEpid11PairingState
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus NewEpid11PairingState(EcGroup const* ga, EcGroup const* gb,
@@ -88,7 +89,7 @@ EpidStatus NewEpid11PairingState(EcGroup const* ga, EcGroup const* gb,
The pairing state. Can be NULL.
\see NewEpid11PairingState
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
void DeleteEpid11PairingState(Epid11PairingState** ps);
@@ -110,7 +111,7 @@ This pairing operation is intended to support Intel(R) EPID
\returns ::EpidStatus
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11Pairing(Epid11PairingState* ps, EcPoint const* a,
diff --git a/epid/common/math/unittests/bignum-test.cc b/epid/common/math/unittests/bignum-test.cc
index 0c84d5e..5de5c17 100644
--- a/epid/common/math/unittests/bignum-test.cc
+++ b/epid/common/math/unittests/bignum-test.cc
@@ -22,8 +22,8 @@
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
extern "C" {
#include "epid/common/math/bignum.h"
diff --git a/epid/common/math/unittests/ecgroup-test.cc b/epid/common/math/unittests/ecgroup-test.cc
index 665a6e7..9e2f012 100644
--- a/epid/common/math/unittests/ecgroup-test.cc
+++ b/epid/common/math/unittests/ecgroup-test.cc
@@ -21,8 +21,8 @@
#include <cstring>
#include <memory>
-#include <string>
#include <stdexcept>
+#include <string>
#include <vector>
#include "epid/common-testhelper/epid_gtest-testhelper.h"
@@ -32,13 +32,13 @@ extern "C" {
#include "epid/common/math/ecgroup.h"
#include "epid/common/math/finitefield.h"
}
-#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common-testhelper/prng-testhelper.h"
#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
-#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
/// compares G1ElemStr values
bool operator==(G1ElemStr const& lhs, G1ElemStr const& rhs) {
@@ -89,9 +89,9 @@ class EFq2Params {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
static const FqElemStr param_b = {
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}};
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}};
// Setup Fq2 with parameters (q, beta)
// Fq^2 = Fq[u] / (u^2 - beta)
@@ -114,22 +114,22 @@ class EFq2Params {
// set h = 2q - p, aka cofactor
std::vector<uint8_t> cofactor_str(
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xfc, 0xf0, 0xcd, 0x46, 0xe5, 0xf2, 0x5e, 0xee, 0x71, 0xa4, 0xa0,
- 0x0c, 0xdc, 0x65, 0xfb, 0x12, 0x96, 0x82, 0xea, 0xb0, 0x25, 0x08, 0x4a,
- 0x8c, 0x9b, 0x10, 0x19});
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xcd, 0x46, 0xe5, 0xf2, 0x5e,
+ 0xee, 0x71, 0xa4, 0xa0, 0x0c, 0xdc, 0x65, 0xfb, 0x12, 0x96, 0x82,
+ 0xea, 0xb0, 0x25, 0x08, 0x4a, 0x8c, 0x9b, 0x10, 0x19});
cofactor = BigNumObj(cofactor_str);
// set n = p * h, AKA order
std::vector<uint8_t> order_str(
- {0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xe1, 0x9a, 0x8d, 0xcb, 0xe4, 0xc7,
- 0x38, 0xfa, 0x9b, 0x98, 0x4d, 0x1c, 0x12, 0x9f, 0x64, 0x97, 0xe8, 0x54,
- 0xa3, 0x0a, 0x81, 0xac, 0x42, 0xf9, 0x39, 0x16, 0xa7, 0x70, 0x21, 0xdc,
- 0xfb, 0xb6, 0xe7, 0x7e, 0x1f, 0x5b, 0x55, 0xcc, 0x4e, 0x84, 0xcd, 0x19,
- 0x4f, 0x49, 0x20, 0x94, 0xb5, 0xd8, 0x12, 0xa0, 0x2e, 0x7f, 0x40, 0x13,
- 0xb2, 0xfa, 0xa1, 0x45});
+ {0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xe1, 0x9a, 0x8d, 0xcb, 0xe4,
+ 0xc7, 0x38, 0xfa, 0x9b, 0x98, 0x4d, 0x1c, 0x12, 0x9f, 0x64, 0x97,
+ 0xe8, 0x54, 0xa3, 0x0a, 0x81, 0xac, 0x42, 0xf9, 0x39, 0x16, 0xa7,
+ 0x70, 0x21, 0xdc, 0xfb, 0xb6, 0xe7, 0x7e, 0x1f, 0x5b, 0x55, 0xcc,
+ 0x4e, 0x84, 0xcd, 0x19, 0x4f, 0x49, 0x20, 0x94, 0xb5, 0xd8, 0x12,
+ 0xa0, 0x2e, 0x7f, 0x40, 0x13, 0xb2, 0xfa, 0xa1, 0x45});
order = BigNumObj(order_str);
}
@@ -175,13 +175,13 @@ class EcGroupTest : public ::testing::Test {
static const G2ElemStr efq2_inv_a_str;
static const G2ElemStr efq2_identity_str;
- // Epid 1.1 hash of message "aad"
+ // Intel(R) EPID 1.1 hash of message "aad"
static const Epid11G3ElemStr kAadHash;
- // Epid 1.1 hash of message "bsn0"
+ // Intel(R) EPID 1.1 hash of message "bsn0"
static const Epid11G3ElemStr kBsn0Hash;
- // Epid 1.1 hash of message "test"
+ // Intel(R) EPID 1.1 hash of message "test"
static const Epid11G3ElemStr kTestHash;
- // Epid 1.1 hash of message "aac"
+ // Intel(R) EPID 1.1 hash of message "aac"
static const Epid11G3ElemStr kAacHash;
virtual void SetUp() {
@@ -268,277 +268,277 @@ class EcGroupTest : public ::testing::Test {
};
const G1ElemStr EcGroupTest::g1_str = {
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
const G2ElemStr EcGroupTest::g2_str = {
- {{{{0xE2, 0x01, 0x71, 0xC5, 0x4A, 0xA3, 0xDA, 0x05, 0x21, 0x67, 0x04, 0x13,
- 0x74, 0x3C, 0xCF, 0x22, 0xD2, 0x5D, 0x52, 0x68, 0x3D, 0x32, 0x47, 0x0E,
- 0xF6, 0x02, 0x13, 0x43, 0xBF, 0x28, 0x23, 0x94}}},
- {{{0x59, 0x2D, 0x1E, 0xF6, 0x53, 0xA8, 0x5A, 0x80, 0x46, 0xCC, 0xDC, 0x25,
- 0x4F, 0xBB, 0x56, 0x56, 0x43, 0x43, 0x3B, 0xF6, 0x28, 0x96, 0x53, 0xE2,
- 0x7D, 0xF7, 0xB2, 0x12, 0xBA, 0xA1, 0x89, 0xBE}}}},
- {{{{0xAE, 0x60, 0xA4, 0xE7, 0x51, 0xFF, 0xD3, 0x50, 0xC6, 0x21, 0xE7, 0x03,
- 0x31, 0x28, 0x26, 0xBD, 0x55, 0xE8, 0xB5, 0x9A, 0x4D, 0x91, 0x68, 0x38,
- 0x41, 0x4D, 0xB8, 0x22, 0xDD, 0x23, 0x35, 0xAE}}},
- {{{0x1A, 0xB4, 0x42, 0xF9, 0x89, 0xAF, 0xE5, 0xAD, 0xF8, 0x02, 0x74, 0xF8,
- 0x76, 0x45, 0xE2, 0x53, 0x2C, 0xDC, 0x61, 0x81, 0x90, 0x93, 0xD6, 0x13,
- 0x2C, 0x90, 0xFE, 0x89, 0x51, 0xB9, 0x24, 0x21}}}}};
+ {{{{0xE2, 0x01, 0x71, 0xC5, 0x4A, 0xA3, 0xDA, 0x05, 0x21, 0x67, 0x04,
+ 0x13, 0x74, 0x3C, 0xCF, 0x22, 0xD2, 0x5D, 0x52, 0x68, 0x3D, 0x32,
+ 0x47, 0x0E, 0xF6, 0x02, 0x13, 0x43, 0xBF, 0x28, 0x23, 0x94}}},
+ {{{0x59, 0x2D, 0x1E, 0xF6, 0x53, 0xA8, 0x5A, 0x80, 0x46, 0xCC, 0xDC,
+ 0x25, 0x4F, 0xBB, 0x56, 0x56, 0x43, 0x43, 0x3B, 0xF6, 0x28, 0x96,
+ 0x53, 0xE2, 0x7D, 0xF7, 0xB2, 0x12, 0xBA, 0xA1, 0x89, 0xBE}}}},
+ {{{{0xAE, 0x60, 0xA4, 0xE7, 0x51, 0xFF, 0xD3, 0x50, 0xC6, 0x21, 0xE7,
+ 0x03, 0x31, 0x28, 0x26, 0xBD, 0x55, 0xE8, 0xB5, 0x9A, 0x4D, 0x91,
+ 0x68, 0x38, 0x41, 0x4D, 0xB8, 0x22, 0xDD, 0x23, 0x35, 0xAE}}},
+ {{{0x1A, 0xB4, 0x42, 0xF9, 0x89, 0xAF, 0xE5, 0xAD, 0xF8, 0x02, 0x74,
+ 0xF8, 0x76, 0x45, 0xE2, 0x53, 0x2C, 0xDC, 0x61, 0x81, 0x90, 0x93,
+ 0xD6, 0x13, 0x2C, 0x90, 0xFE, 0x89, 0x51, 0xB9, 0x24, 0x21}}}}};
const FqElemStr EcGroupTest::a1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}};
const FqElemStr EcGroupTest::b1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
const BigNumStr EcGroupTest::h1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
const BigNumStr EcGroupTest::p = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99, 0x92, 0x1A,
- 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99,
+ 0x92, 0x1A, 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
const BigNumStr EcGroupTest::q = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
- 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}}};
+ {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98,
+ 0x0A, 0x82, 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}}};
const G1ElemStr EcGroupTest::efq_a_str = {
- {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D, 0x52,
- 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A, 0x37, 0xE0,
- 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
- {{{0x78, 0x65, 0x28, 0xCB, 0xAF, 0x07, 0x52, 0x50, 0x55, 0x7A, 0x5F, 0x30,
- 0x0A, 0xC0, 0xB4, 0x6B, 0xEA, 0x6F, 0xE2, 0xF6, 0x6D, 0x96, 0xF7, 0xCD,
- 0xC8, 0xD3, 0x12, 0x7F, 0x1F, 0x3A, 0x8B, 0x42}}}};
+ {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D,
+ 0x52, 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A,
+ 0x37, 0xE0, 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
+ {{{0x78, 0x65, 0x28, 0xCB, 0xAF, 0x07, 0x52, 0x50, 0x55, 0x7A, 0x5F,
+ 0x30, 0x0A, 0xC0, 0xB4, 0x6B, 0xEA, 0x6F, 0xE2, 0xF6, 0x6D, 0x96,
+ 0xF7, 0xCD, 0xC8, 0xD3, 0x12, 0x7F, 0x1F, 0x3A, 0x8B, 0x42}}}};
const G1ElemStr EcGroupTest::efq_b_str = {
- {{{0xE6, 0x65, 0x23, 0x9B, 0xD4, 0x07, 0x16, 0x83, 0x38, 0x23, 0xB2, 0x67,
- 0x57, 0xEB, 0x0F, 0x23, 0x3A, 0xF4, 0x8E, 0xDA, 0x71, 0x5E, 0xD9, 0x98,
- 0x63, 0x98, 0x2B, 0xBC, 0x78, 0xD1, 0x94, 0xF2}}},
- {{{0x63, 0xB0, 0xAD, 0xB8, 0x2C, 0xE8, 0x14, 0xFD, 0xA2, 0x39, 0x0E, 0x66,
- 0xB7, 0xD0, 0x6A, 0xAB, 0xEE, 0xFA, 0x2E, 0x24, 0x9B, 0xB5, 0x14, 0x35,
- 0xFE, 0xB6, 0xB0, 0xFF, 0xFD, 0x5F, 0x73, 0x19}}}};
+ {{{0xE6, 0x65, 0x23, 0x9B, 0xD4, 0x07, 0x16, 0x83, 0x38, 0x23, 0xB2,
+ 0x67, 0x57, 0xEB, 0x0F, 0x23, 0x3A, 0xF4, 0x8E, 0xDA, 0x71, 0x5E,
+ 0xD9, 0x98, 0x63, 0x98, 0x2B, 0xBC, 0x78, 0xD1, 0x94, 0xF2}}},
+ {{{0x63, 0xB0, 0xAD, 0xB8, 0x2C, 0xE8, 0x14, 0xFD, 0xA2, 0x39, 0x0E,
+ 0x66, 0xB7, 0xD0, 0x6A, 0xAB, 0xEE, 0xFA, 0x2E, 0x24, 0x9B, 0xB5,
+ 0x14, 0x35, 0xFE, 0xB6, 0xB0, 0xFF, 0xFD, 0x5F, 0x73, 0x19}}}};
const BigNumStr EcGroupTest::x_str = {
- {{0xFF, 0xFB, 0x3E, 0x5D, 0xFF, 0x9A, 0xFF, 0x02, 0x00, 0xFF, 0xFF, 0xFF,
- 0xF2, 0xE1, 0x85, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x81,
- 0xFF, 0xFD, 0xFF, 0xEB, 0xFF, 0x29, 0xA7, 0xFF}}};
+ {{0xFF, 0xFB, 0x3E, 0x5D, 0xFF, 0x9A, 0xFF, 0x02, 0x00, 0xFF, 0xFF,
+ 0xFF, 0xF2, 0xE1, 0x85, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x81, 0xFF, 0xFD, 0xFF, 0xEB, 0xFF, 0x29, 0xA7, 0xFF}}};
const BigNumStr EcGroupTest::y_str = {
- {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B, 0x08, 0xFF, 0xFF,
- 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF,
- 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF}}};
+ {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B, 0x08, 0xFF,
+ 0xFF, 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF,
+ 0xEB, 0xFF, 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF}}};
const G1ElemStr EcGroupTest::efq_mul_ab_str = {
- {{{0x30, 0xF8, 0x33, 0xB7, 0x1C, 0x85, 0x94, 0x6D, 0x6F, 0x3C, 0x97, 0x77,
- 0x81, 0xA5, 0xC2, 0x98, 0x93, 0x5C, 0x8C, 0xC1, 0xFF, 0x35, 0x9E, 0x68,
- 0xF6, 0x4D, 0x18, 0xDD, 0x65, 0xA9, 0xC0, 0x60}}},
- {{{0x89, 0xE5, 0x08, 0x2D, 0xD1, 0xD8, 0xC7, 0xBF, 0xDE, 0x16, 0x24, 0xA7,
- 0x2F, 0xF1, 0x48, 0x00, 0x26, 0xAF, 0x89, 0xEA, 0xC9, 0x94, 0x78, 0xFF,
- 0x2A, 0xB0, 0x20, 0xED, 0x33, 0x0C, 0x4E, 0x88}}}};
+ {{{0x30, 0xF8, 0x33, 0xB7, 0x1C, 0x85, 0x94, 0x6D, 0x6F, 0x3C, 0x97,
+ 0x77, 0x81, 0xA5, 0xC2, 0x98, 0x93, 0x5C, 0x8C, 0xC1, 0xFF, 0x35,
+ 0x9E, 0x68, 0xF6, 0x4D, 0x18, 0xDD, 0x65, 0xA9, 0xC0, 0x60}}},
+ {{{0x89, 0xE5, 0x08, 0x2D, 0xD1, 0xD8, 0xC7, 0xBF, 0xDE, 0x16, 0x24,
+ 0xA7, 0x2F, 0xF1, 0x48, 0x00, 0x26, 0xAF, 0x89, 0xEA, 0xC9, 0x94,
+ 0x78, 0xFF, 0x2A, 0xB0, 0x20, 0xED, 0x33, 0x0C, 0x4E, 0x88}}}};
const G1ElemStr EcGroupTest::efq_exp_ax_str = {
- {{{0x44, 0x45, 0xFA, 0x16, 0x23, 0x66, 0x26, 0x9D, 0x44, 0xB9, 0x43, 0xAB,
- 0x87, 0xE3, 0x56, 0xCA, 0x9C, 0x89, 0x44, 0x8E, 0xE8, 0x19, 0x29, 0x4D,
- 0x4D, 0x59, 0x7D, 0xBE, 0x46, 0x3F, 0x55, 0x0D}}},
- {{{0x98, 0x09, 0xCF, 0x43, 0x46, 0x75, 0xB8, 0x71, 0xFF, 0x37, 0xBA, 0xA0,
- 0x63, 0xE2, 0xAC, 0x09, 0x38, 0x10, 0x70, 0xAC, 0x15, 0x52, 0x28, 0xF4,
- 0x77, 0x68, 0x32, 0x7B, 0x6E, 0xFB, 0xC1, 0x43}}}};
+ {{{0x44, 0x45, 0xFA, 0x16, 0x23, 0x66, 0x26, 0x9D, 0x44, 0xB9, 0x43,
+ 0xAB, 0x87, 0xE3, 0x56, 0xCA, 0x9C, 0x89, 0x44, 0x8E, 0xE8, 0x19,
+ 0x29, 0x4D, 0x4D, 0x59, 0x7D, 0xBE, 0x46, 0x3F, 0x55, 0x0D}}},
+ {{{0x98, 0x09, 0xCF, 0x43, 0x46, 0x75, 0xB8, 0x71, 0xFF, 0x37, 0xBA,
+ 0xA0, 0x63, 0xE2, 0xAC, 0x09, 0x38, 0x10, 0x70, 0xAC, 0x15, 0x52,
+ 0x28, 0xF4, 0x77, 0x68, 0x32, 0x7B, 0x6E, 0xFB, 0xC1, 0x43}}}};
const G1ElemStr EcGroupTest::efq_multiexp_abxy_str = {
- {{{0x63, 0x4A, 0xD4, 0xC1, 0x6B, 0x90, 0x67, 0xA2, 0x0B, 0xE2, 0xB3, 0xE9,
- 0x95, 0x3F, 0x82, 0x7E, 0x21, 0xBF, 0x9F, 0xCD, 0xA0, 0x16, 0x56, 0x6B,
- 0x31, 0x66, 0x68, 0xBB, 0x25, 0xF8, 0xBD, 0xF3}}},
- {{{0xBD, 0x5F, 0xF8, 0x48, 0xD4, 0xBF, 0x35, 0x2D, 0xDC, 0xD1, 0x78, 0x74,
- 0xFF, 0xB1, 0x47, 0xD5, 0x6B, 0x21, 0xE5, 0x15, 0x01, 0xA8, 0xDC, 0x8B,
- 0x3C, 0x9D, 0x96, 0xC7, 0xC6, 0xB0, 0x05, 0x20}}}};
+ {{{0x63, 0x4A, 0xD4, 0xC1, 0x6B, 0x90, 0x67, 0xA2, 0x0B, 0xE2, 0xB3,
+ 0xE9, 0x95, 0x3F, 0x82, 0x7E, 0x21, 0xBF, 0x9F, 0xCD, 0xA0, 0x16,
+ 0x56, 0x6B, 0x31, 0x66, 0x68, 0xBB, 0x25, 0xF8, 0xBD, 0xF3}}},
+ {{{0xBD, 0x5F, 0xF8, 0x48, 0xD4, 0xBF, 0x35, 0x2D, 0xDC, 0xD1, 0x78,
+ 0x74, 0xFF, 0xB1, 0x47, 0xD5, 0x6B, 0x21, 0xE5, 0x15, 0x01, 0xA8,
+ 0xDC, 0x8B, 0x3C, 0x9D, 0x96, 0xC7, 0xC6, 0xB0, 0x05, 0x20}}}};
const G1ElemStr EcGroupTest::efq_inv_a_str = {
- {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D, 0x52,
- 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A, 0x37, 0xE0,
- 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
- {{{0x87, 0x9A, 0xD7, 0x34, 0x50, 0xF5, 0x9E, 0x7C, 0xF1, 0x6B, 0x93, 0x2E,
- 0xE3, 0xB0, 0xF0, 0x33, 0x22, 0x6C, 0x83, 0x04, 0xA5, 0x01, 0x12, 0xB5,
- 0x0A, 0x56, 0x1B, 0x5C, 0x8F, 0x98, 0xA4, 0xD1}}}};
+ {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D,
+ 0x52, 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A,
+ 0x37, 0xE0, 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
+ {{{0x87, 0x9A, 0xD7, 0x34, 0x50, 0xF5, 0x9E, 0x7C, 0xF1, 0x6B, 0x93,
+ 0x2E, 0xE3, 0xB0, 0xF0, 0x33, 0x22, 0x6C, 0x83, 0x04, 0xA5, 0x01,
+ 0x12, 0xB5, 0x0A, 0x56, 0x1B, 0x5C, 0x8F, 0x98, 0xA4, 0xD1}}}};
const G1ElemStr EcGroupTest::efq_identity_str = {
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}};
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}};
const uint8_t EcGroupTest::sha_msg[] = {'a', 'b', 'c'};
const G1ElemStr EcGroupTest::efq_r_sha256_str = {
- {{{0x2E, 0xBB, 0x50, 0x4D, 0x88, 0xFF, 0x25, 0x62, 0xF3, 0x71, 0x65, 0x81,
- 0xAD, 0xBE, 0x83, 0x6E, 0x54, 0xF5, 0xA6, 0x2A, 0x70, 0xE6, 0x18, 0x6B,
- 0xD5, 0x4A, 0x10, 0x3C, 0x80, 0x08, 0x95, 0x3D}}},
- {{{0x8A, 0x43, 0xA1, 0x04, 0xB1, 0x3F, 0x3C, 0xB4, 0xBD, 0x67, 0x38, 0xB1,
- 0x07, 0xF0, 0x7A, 0x32, 0x7E, 0xCD, 0xF0, 0x2E, 0x62, 0x3E, 0x2C, 0x1F,
- 0x48, 0xAA, 0x0D, 0x6C, 0xDC, 0x48, 0xF9, 0xF7}}}};
+ {{{0x2E, 0xBB, 0x50, 0x4D, 0x88, 0xFF, 0x25, 0x62, 0xF3, 0x71, 0x65,
+ 0x81, 0xAD, 0xBE, 0x83, 0x6E, 0x54, 0xF5, 0xA6, 0x2A, 0x70, 0xE6,
+ 0x18, 0x6B, 0xD5, 0x4A, 0x10, 0x3C, 0x80, 0x08, 0x95, 0x3D}}},
+ {{{0x8A, 0x43, 0xA1, 0x04, 0xB1, 0x3F, 0x3C, 0xB4, 0xBD, 0x67, 0x38,
+ 0xB1, 0x07, 0xF0, 0x7A, 0x32, 0x7E, 0xCD, 0xF0, 0x2E, 0x62, 0x3E,
+ 0x2C, 0x1F, 0x48, 0xAA, 0x0D, 0x6C, 0xDC, 0x48, 0xF9, 0xF7}}}};
const G1ElemStr EcGroupTest::efq_r_sha384_str = {
- {{{0xE1, 0xC8, 0x28, 0xB1, 0x9A, 0xDF, 0x5D, 0x4B, 0xC4, 0x25, 0x90, 0xFB,
- 0x38, 0x20, 0xD4, 0x8B, 0x30, 0x8F, 0x95, 0x76, 0xC3, 0x7F, 0x9D, 0xAD,
- 0x94, 0xC4, 0x31, 0x80, 0xD7, 0xDF, 0xD5, 0xFE}}},
- {{{0x0E, 0x86, 0x11, 0x90, 0xAF, 0xEF, 0xEB, 0x79, 0x4B, 0x3E, 0x80, 0x92,
- 0x94, 0x3B, 0x2F, 0x5E, 0x72, 0x21, 0xEF, 0xF8, 0xBC, 0xE3, 0x48, 0xA9,
- 0xD0, 0x31, 0x19, 0xAC, 0xD1, 0xD7, 0x49, 0x87}}}};
+ {{{0xE1, 0xC8, 0x28, 0xB1, 0x9A, 0xDF, 0x5D, 0x4B, 0xC4, 0x25, 0x90,
+ 0xFB, 0x38, 0x20, 0xD4, 0x8B, 0x30, 0x8F, 0x95, 0x76, 0xC3, 0x7F,
+ 0x9D, 0xAD, 0x94, 0xC4, 0x31, 0x80, 0xD7, 0xDF, 0xD5, 0xFE}}},
+ {{{0x0E, 0x86, 0x11, 0x90, 0xAF, 0xEF, 0xEB, 0x79, 0x4B, 0x3E, 0x80,
+ 0x92, 0x94, 0x3B, 0x2F, 0x5E, 0x72, 0x21, 0xEF, 0xF8, 0xBC, 0xE3,
+ 0x48, 0xA9, 0xD0, 0x31, 0x19, 0xAC, 0xD1, 0xD7, 0x49, 0x87}}}};
const G1ElemStr EcGroupTest::efq_r_sha512_str = {
- {{{0x8C, 0x62, 0xA0, 0x2D, 0x55, 0x55, 0x55, 0x86, 0xBC, 0x82, 0xA6, 0xA2,
- 0x21, 0x97, 0x9B, 0x9B, 0xB4, 0x03, 0x3D, 0x83, 0xF3, 0xBA, 0xDA, 0x9C,
- 0x42, 0xF7, 0xB3, 0x94, 0x99, 0x2A, 0x96, 0xE4}}},
- {{{0x4C, 0x0E, 0xA7, 0x62, 0x17, 0xB9, 0xFB, 0xE5, 0x21, 0x7D, 0x54, 0x24,
- 0xE0, 0x2B, 0x87, 0xF7, 0x69, 0x54, 0x0C, 0xC6, 0xAD, 0xF2, 0xF2, 0x7B,
- 0xE6, 0x91, 0xD8, 0xF3, 0x40, 0x6C, 0x8F, 0x03}}}};
+ {{{0x8C, 0x62, 0xA0, 0x2D, 0x55, 0x55, 0x55, 0x86, 0xBC, 0x82, 0xA6,
+ 0xA2, 0x21, 0x97, 0x9B, 0x9B, 0xB4, 0x03, 0x3D, 0x83, 0xF3, 0xBA,
+ 0xDA, 0x9C, 0x42, 0xF7, 0xB3, 0x94, 0x99, 0x2A, 0x96, 0xE4}}},
+ {{{0x4C, 0x0E, 0xA7, 0x62, 0x17, 0xB9, 0xFB, 0xE5, 0x21, 0x7D, 0x54,
+ 0x24, 0xE0, 0x2B, 0x87, 0xF7, 0x69, 0x54, 0x0C, 0xC6, 0xAD, 0xF2,
+ 0xF2, 0x7B, 0xE6, 0x91, 0xD8, 0xF3, 0x40, 0x6C, 0x8F, 0x03}}}};
const G1ElemStr EcGroupTest::efq_r_sha512256_str = {
- {{{0x63, 0x28, 0x40, 0x14, 0x73, 0xd5, 0x91, 0xc4, 0xa2, 0xa4, 0xb6, 0xd8,
- 0xa8, 0x75, 0x21, 0xd1, 0x26, 0x4e, 0x42, 0x13, 0x1f, 0xfa, 0xed, 0x90,
- 0x8d, 0x56, 0x34, 0x57, 0x8a, 0x3a, 0x47, 0xa0}}},
- {{{0x30, 0xbe, 0x3f, 0x12, 0x00, 0x74, 0x48, 0xaa, 0x91, 0x90, 0x84, 0x12,
- 0x4d, 0x58, 0x54, 0xe7, 0x04, 0x65, 0x37, 0x97, 0x88, 0xcf, 0x67, 0xa0,
- 0x8c, 0x56, 0x93, 0xa7, 0x7f, 0xe8, 0x74, 0xfc}}}};
+ {{{0x63, 0x28, 0x40, 0x14, 0x73, 0xd5, 0x91, 0xc4, 0xa2, 0xa4, 0xb6,
+ 0xd8, 0xa8, 0x75, 0x21, 0xd1, 0x26, 0x4e, 0x42, 0x13, 0x1f, 0xfa,
+ 0xed, 0x90, 0x8d, 0x56, 0x34, 0x57, 0x8a, 0x3a, 0x47, 0xa0}}},
+ {{{0x30, 0xbe, 0x3f, 0x12, 0x00, 0x74, 0x48, 0xaa, 0x91, 0x90, 0x84,
+ 0x12, 0x4d, 0x58, 0x54, 0xe7, 0x04, 0x65, 0x37, 0x97, 0x88, 0xcf,
+ 0x67, 0xa0, 0x8c, 0x56, 0x93, 0xa7, 0x7f, 0xe8, 0x74, 0xfc}}}};
const G2ElemStr EcGroupTest::efq2_a_str = {
{
- {0x2F, 0x8C, 0xC7, 0xD7, 0xD4, 0x1E, 0x4A, 0xCB, 0x82, 0x92, 0xC7, 0x9C,
- 0x0F, 0xA2, 0xF2, 0x1B, 0xDF, 0xEA, 0x96, 0x64, 0x8B, 0xA2, 0x32, 0x7C,
- 0xDF, 0xD8, 0x89, 0x10, 0xFD, 0xBB, 0x38, 0xCD},
- {0xB1, 0x23, 0x46, 0x13, 0x4D, 0x9B, 0x8E, 0x8A, 0x95, 0x64, 0xDD, 0x37,
- 0x29, 0x44, 0x1F, 0x76, 0xB5, 0x3A, 0x47, 0xD3, 0xE0, 0x18, 0x1E, 0x60,
- 0xE9, 0x94, 0x13, 0xA4, 0x47, 0xCD, 0xBE, 0x03},
+ {0x2F, 0x8C, 0xC7, 0xD7, 0xD4, 0x1E, 0x4A, 0xCB, 0x82, 0x92, 0xC7,
+ 0x9C, 0x0F, 0xA2, 0xF2, 0x1B, 0xDF, 0xEA, 0x96, 0x64, 0x8B, 0xA2,
+ 0x32, 0x7C, 0xDF, 0xD8, 0x89, 0x10, 0xFD, 0xBB, 0x38, 0xCD},
+ {0xB1, 0x23, 0x46, 0x13, 0x4D, 0x9B, 0x8E, 0x8A, 0x95, 0x64, 0xDD,
+ 0x37, 0x29, 0x44, 0x1F, 0x76, 0xB5, 0x3A, 0x47, 0xD3, 0xE0, 0x18,
+ 0x1E, 0x60, 0xE9, 0x94, 0x13, 0xA4, 0x47, 0xCD, 0xBE, 0x03},
},
{
- {0xD3, 0x67, 0xA5, 0xCC, 0xEF, 0x7B, 0xD1, 0x8D, 0x4A, 0x7F, 0xF1, 0x8F,
- 0x66, 0xCB, 0x5E, 0x86, 0xAC, 0xCB, 0x36, 0x5F, 0x29, 0x90, 0x28, 0x55,
- 0xF0, 0xDC, 0x6E, 0x8B, 0x87, 0xB5, 0xD8, 0x32},
- {0x6C, 0x0A, 0xC5, 0x58, 0xB1, 0x4E, 0xCA, 0x85, 0x44, 0x3E, 0xDE, 0x71,
- 0x9B, 0xC7, 0x90, 0x19, 0x06, 0xD2, 0xA0, 0x4E, 0xC7, 0x33, 0xF4, 0x5C,
- 0xE8, 0x16, 0xE2, 0x67, 0xDB, 0xBF, 0x64, 0x84},
+ {0xD3, 0x67, 0xA5, 0xCC, 0xEF, 0x7B, 0xD1, 0x8D, 0x4A, 0x7F, 0xF1,
+ 0x8F, 0x66, 0xCB, 0x5E, 0x86, 0xAC, 0xCB, 0x36, 0x5F, 0x29, 0x90,
+ 0x28, 0x55, 0xF0, 0xDC, 0x6E, 0x8B, 0x87, 0xB5, 0xD8, 0x32},
+ {0x6C, 0x0A, 0xC5, 0x58, 0xB1, 0x4E, 0xCA, 0x85, 0x44, 0x3E, 0xDE,
+ 0x71, 0x9B, 0xC7, 0x90, 0x19, 0x06, 0xD2, 0xA0, 0x4E, 0xC7, 0x33,
+ 0xF4, 0x5C, 0xE8, 0x16, 0xE2, 0x67, 0xDB, 0xBF, 0x64, 0x84},
},
};
const G2ElemStr EcGroupTest::efq2_b_str = {
{
- {0x16, 0xF1, 0x61, 0x76, 0x06, 0x3E, 0xE9, 0xC0, 0xB9, 0xB1, 0x3A, 0x75,
- 0xFC, 0xDB, 0x90, 0xCD, 0x01, 0xF4, 0x9F, 0xCC, 0xAA, 0x24, 0x69, 0x83,
- 0xBE, 0x20, 0x44, 0x87, 0x58, 0x90, 0x0F, 0x4F},
- {0xC7, 0x50, 0x37, 0xC1, 0xB9, 0x2D, 0xE1, 0xE3, 0x79, 0x20, 0x7B, 0x62,
- 0x90, 0xF8, 0xC7, 0xF0, 0xD7, 0x5A, 0xE7, 0xAD, 0x65, 0xE1, 0xC7, 0x50,
- 0x59, 0xA1, 0xFC, 0x49, 0xBC, 0x2A, 0xE5, 0xD7},
+ {0x16, 0xF1, 0x61, 0x76, 0x06, 0x3E, 0xE9, 0xC0, 0xB9, 0xB1, 0x3A,
+ 0x75, 0xFC, 0xDB, 0x90, 0xCD, 0x01, 0xF4, 0x9F, 0xCC, 0xAA, 0x24,
+ 0x69, 0x83, 0xBE, 0x20, 0x44, 0x87, 0x58, 0x90, 0x0F, 0x4F},
+ {0xC7, 0x50, 0x37, 0xC1, 0xB9, 0x2D, 0xE1, 0xE3, 0x79, 0x20, 0x7B,
+ 0x62, 0x90, 0xF8, 0xC7, 0xF0, 0xD7, 0x5A, 0xE7, 0xAD, 0x65, 0xE1,
+ 0xC7, 0x50, 0x59, 0xA1, 0xFC, 0x49, 0xBC, 0x2A, 0xE5, 0xD7},
},
{
- {0x12, 0x73, 0x3B, 0xA4, 0xDD, 0x0F, 0xBB, 0x35, 0x38, 0x4A, 0xE0, 0x3D,
- 0x79, 0x63, 0x66, 0x73, 0x9C, 0x07, 0xE1, 0xEC, 0x71, 0x16, 0x50, 0x75,
- 0xA1, 0xBA, 0xE5, 0x37, 0x45, 0x1A, 0x0C, 0x59},
- {0xC9, 0x49, 0xB9, 0xDB, 0x7E, 0x76, 0xC5, 0xC5, 0x0A, 0x87, 0xB7, 0x56,
- 0x88, 0x09, 0x21, 0xC6, 0xF6, 0x6C, 0xCC, 0x5E, 0x80, 0xFD, 0x05, 0xD0,
- 0x5F, 0xC6, 0x2E, 0x06, 0xA1, 0xBE, 0x5B, 0xA0},
+ {0x12, 0x73, 0x3B, 0xA4, 0xDD, 0x0F, 0xBB, 0x35, 0x38, 0x4A, 0xE0,
+ 0x3D, 0x79, 0x63, 0x66, 0x73, 0x9C, 0x07, 0xE1, 0xEC, 0x71, 0x16,
+ 0x50, 0x75, 0xA1, 0xBA, 0xE5, 0x37, 0x45, 0x1A, 0x0C, 0x59},
+ {0xC9, 0x49, 0xB9, 0xDB, 0x7E, 0x76, 0xC5, 0xC5, 0x0A, 0x87, 0xB7,
+ 0x56, 0x88, 0x09, 0x21, 0xC6, 0xF6, 0x6C, 0xCC, 0x5E, 0x80, 0xFD,
+ 0x05, 0xD0, 0x5F, 0xC6, 0x2E, 0x06, 0xA1, 0xBE, 0x5B, 0xA0},
},
};
const G2ElemStr EcGroupTest::efq2_mul_ab_str = {
{
- {0x25, 0xCC, 0x11, 0x80, 0x8F, 0x08, 0x1D, 0x66, 0xF8, 0xDB, 0xBC, 0x98,
- 0x26, 0x24, 0x26, 0xCF, 0x04, 0x02, 0xB6, 0x99, 0x1B, 0x52, 0xA8, 0xE3,
- 0x4E, 0x9A, 0x85, 0xB0, 0x5C, 0xCE, 0xDD, 0xC5},
- {0xFC, 0x3C, 0xC2, 0x2C, 0x4B, 0x63, 0x72, 0x5F, 0xA9, 0xF9, 0x8C, 0x62,
- 0xF4, 0xE7, 0x30, 0x71, 0x6F, 0x78, 0xF5, 0xFE, 0xF6, 0xDF, 0xF7, 0xB5,
- 0x21, 0x69, 0x7C, 0x50, 0xAC, 0x56, 0xD9, 0xB5},
+ {0x25, 0xCC, 0x11, 0x80, 0x8F, 0x08, 0x1D, 0x66, 0xF8, 0xDB, 0xBC,
+ 0x98, 0x26, 0x24, 0x26, 0xCF, 0x04, 0x02, 0xB6, 0x99, 0x1B, 0x52,
+ 0xA8, 0xE3, 0x4E, 0x9A, 0x85, 0xB0, 0x5C, 0xCE, 0xDD, 0xC5},
+ {0xFC, 0x3C, 0xC2, 0x2C, 0x4B, 0x63, 0x72, 0x5F, 0xA9, 0xF9, 0x8C,
+ 0x62, 0xF4, 0xE7, 0x30, 0x71, 0x6F, 0x78, 0xF5, 0xFE, 0xF6, 0xDF,
+ 0xF7, 0xB5, 0x21, 0x69, 0x7C, 0x50, 0xAC, 0x56, 0xD9, 0xB5},
},
{
- {0xA5, 0xD6, 0xAB, 0x2D, 0xED, 0x8E, 0xFE, 0x43, 0xCB, 0xC9, 0xEF, 0x09,
- 0xC8, 0x2D, 0xE8, 0xD0, 0x3B, 0xC0, 0x5C, 0x7F, 0xE5, 0x3A, 0x1D, 0x72,
- 0xF2, 0xF5, 0x03, 0xBD, 0xE5, 0xEB, 0x08, 0xA0},
- {0xE6, 0xF3, 0x59, 0xE4, 0xD2, 0x52, 0xFD, 0x4F, 0xEC, 0xCE, 0x49, 0x9F,
- 0x86, 0x50, 0x2D, 0x4A, 0x59, 0x2C, 0xA2, 0x4E, 0xE3, 0xFE, 0xF2, 0xFC,
- 0xB9, 0xF4, 0x22, 0x88, 0xBC, 0x79, 0x21, 0xD0},
+ {0xA5, 0xD6, 0xAB, 0x2D, 0xED, 0x8E, 0xFE, 0x43, 0xCB, 0xC9, 0xEF,
+ 0x09, 0xC8, 0x2D, 0xE8, 0xD0, 0x3B, 0xC0, 0x5C, 0x7F, 0xE5, 0x3A,
+ 0x1D, 0x72, 0xF2, 0xF5, 0x03, 0xBD, 0xE5, 0xEB, 0x08, 0xA0},
+ {0xE6, 0xF3, 0x59, 0xE4, 0xD2, 0x52, 0xFD, 0x4F, 0xEC, 0xCE, 0x49,
+ 0x9F, 0x86, 0x50, 0x2D, 0x4A, 0x59, 0x2C, 0xA2, 0x4E, 0xE3, 0xFE,
+ 0xF2, 0xFC, 0xB9, 0xF4, 0x22, 0x88, 0xBC, 0x79, 0x21, 0xD0},
},
};
const G2ElemStr EcGroupTest::efq2_exp_ax_str = {
{
- {0xC0, 0x5A, 0x37, 0xAD, 0x08, 0xAB, 0x22, 0xCF, 0xF7, 0xF9, 0xCC, 0xD4,
- 0x5A, 0x47, 0x38, 0x82, 0xE1, 0xC2, 0x06, 0x35, 0x4D, 0x5B, 0x95, 0xA1,
- 0xA3, 0xC1, 0x83, 0x6C, 0x0F, 0x31, 0x24, 0xD2},
- {0xC7, 0x86, 0xE1, 0x59, 0x63, 0xCE, 0x21, 0x2A, 0x57, 0x77, 0xE5, 0x48,
- 0xF7, 0x60, 0x21, 0x00, 0x40, 0x2F, 0x09, 0x18, 0x5C, 0x32, 0x32, 0x75,
- 0xD7, 0xB9, 0xE7, 0xB1, 0x95, 0xD5, 0xDF, 0x02},
+ {0xC0, 0x5A, 0x37, 0xAD, 0x08, 0xAB, 0x22, 0xCF, 0xF7, 0xF9, 0xCC,
+ 0xD4, 0x5A, 0x47, 0x38, 0x82, 0xE1, 0xC2, 0x06, 0x35, 0x4D, 0x5B,
+ 0x95, 0xA1, 0xA3, 0xC1, 0x83, 0x6C, 0x0F, 0x31, 0x24, 0xD2},
+ {0xC7, 0x86, 0xE1, 0x59, 0x63, 0xCE, 0x21, 0x2A, 0x57, 0x77, 0xE5,
+ 0x48, 0xF7, 0x60, 0x21, 0x00, 0x40, 0x2F, 0x09, 0x18, 0x5C, 0x32,
+ 0x32, 0x75, 0xD7, 0xB9, 0xE7, 0xB1, 0x95, 0xD5, 0xDF, 0x02},
},
{
- {0xE5, 0xDE, 0xC6, 0x3E, 0x05, 0xFC, 0x6F, 0x7A, 0xE3, 0x2D, 0x7D, 0x90,
- 0x5F, 0x43, 0xE2, 0xB0, 0x9E, 0xCD, 0xEC, 0x7B, 0x37, 0x4C, 0x0A, 0x3E,
- 0x87, 0x4E, 0xE6, 0xDA, 0xD1, 0x90, 0xC0, 0xD1},
- {0x70, 0x90, 0x54, 0x7F, 0x78, 0x93, 0xFA, 0xC4, 0xF7, 0x3A, 0x4D, 0xBC,
- 0x03, 0x5E, 0x83, 0xDF, 0xEF, 0xF7, 0x52, 0xF9, 0x64, 0x7F, 0x17, 0xC1,
- 0x69, 0xD6, 0xD7, 0x96, 0x18, 0x62, 0x46, 0xD1},
+ {0xE5, 0xDE, 0xC6, 0x3E, 0x05, 0xFC, 0x6F, 0x7A, 0xE3, 0x2D, 0x7D,
+ 0x90, 0x5F, 0x43, 0xE2, 0xB0, 0x9E, 0xCD, 0xEC, 0x7B, 0x37, 0x4C,
+ 0x0A, 0x3E, 0x87, 0x4E, 0xE6, 0xDA, 0xD1, 0x90, 0xC0, 0xD1},
+ {0x70, 0x90, 0x54, 0x7F, 0x78, 0x93, 0xFA, 0xC4, 0xF7, 0x3A, 0x4D,
+ 0xBC, 0x03, 0x5E, 0x83, 0xDF, 0xEF, 0xF7, 0x52, 0xF9, 0x64, 0x7F,
+ 0x17, 0xC1, 0x69, 0xD6, 0xD7, 0x96, 0x18, 0x62, 0x46, 0xD1},
},
};
const G2ElemStr EcGroupTest::efq2_multiexp_abxy_str = {
{
- {0xE8, 0x6E, 0x02, 0x7A, 0xEC, 0xEA, 0xBA, 0x7E, 0xE5, 0x7C, 0xAD, 0x98,
- 0x37, 0x54, 0xB2, 0x15, 0x64, 0x9C, 0x81, 0xFF, 0x69, 0xCC, 0xD6, 0xA6,
- 0xAA, 0xA7, 0x10, 0x4F, 0x9B, 0x0C, 0x50, 0x14},
- {0x7C, 0xAF, 0xC0, 0x6F, 0xC8, 0x87, 0xFF, 0x4A, 0x6F, 0xB5, 0x9E, 0x63,
- 0x74, 0x20, 0xB5, 0xC6, 0x4F, 0x14, 0x0B, 0x6C, 0xBF, 0x00, 0x71, 0xE2,
- 0x6D, 0x6C, 0x41, 0x6A, 0x0B, 0xA5, 0x5B, 0xCF},
+ {0xE8, 0x6E, 0x02, 0x7A, 0xEC, 0xEA, 0xBA, 0x7E, 0xE5, 0x7C, 0xAD,
+ 0x98, 0x37, 0x54, 0xB2, 0x15, 0x64, 0x9C, 0x81, 0xFF, 0x69, 0xCC,
+ 0xD6, 0xA6, 0xAA, 0xA7, 0x10, 0x4F, 0x9B, 0x0C, 0x50, 0x14},
+ {0x7C, 0xAF, 0xC0, 0x6F, 0xC8, 0x87, 0xFF, 0x4A, 0x6F, 0xB5, 0x9E,
+ 0x63, 0x74, 0x20, 0xB5, 0xC6, 0x4F, 0x14, 0x0B, 0x6C, 0xBF, 0x00,
+ 0x71, 0xE2, 0x6D, 0x6C, 0x41, 0x6A, 0x0B, 0xA5, 0x5B, 0xCF},
},
{
- {0x16, 0xCC, 0x9B, 0x37, 0xE7, 0xCB, 0x16, 0x5C, 0x39, 0x7C, 0x10, 0x7E,
- 0xE0, 0xDD, 0x34, 0x90, 0xBE, 0x56, 0x28, 0x76, 0x27, 0x59, 0xCE, 0xB3,
- 0xD7, 0xB4, 0x56, 0xD4, 0x0D, 0xD1, 0xB8, 0xFB},
- {0x5E, 0x9E, 0x27, 0x30, 0x60, 0x87, 0x3B, 0xA4, 0x9B, 0x15, 0xEE, 0x86,
- 0x15, 0x1D, 0xF4, 0xF3, 0x07, 0x31, 0x46, 0xFD, 0xB7, 0x51, 0xFF, 0xC0,
- 0x42, 0x94, 0x38, 0xB7, 0x84, 0x5F, 0x86, 0x3A},
+ {0x16, 0xCC, 0x9B, 0x37, 0xE7, 0xCB, 0x16, 0x5C, 0x39, 0x7C, 0x10,
+ 0x7E, 0xE0, 0xDD, 0x34, 0x90, 0xBE, 0x56, 0x28, 0x76, 0x27, 0x59,
+ 0xCE, 0xB3, 0xD7, 0xB4, 0x56, 0xD4, 0x0D, 0xD1, 0xB8, 0xFB},
+ {0x5E, 0x9E, 0x27, 0x30, 0x60, 0x87, 0x3B, 0xA4, 0x9B, 0x15, 0xEE,
+ 0x86, 0x15, 0x1D, 0xF4, 0xF3, 0x07, 0x31, 0x46, 0xFD, 0xB7, 0x51,
+ 0xFF, 0xC0, 0x42, 0x94, 0x38, 0xB7, 0x84, 0x5F, 0x86, 0x3A},
},
};
const G2ElemStr EcGroupTest::efq2_inv_a_str = {
{
- {0x2F, 0x8C, 0xC7, 0xD7, 0xD4, 0x1E, 0x4A, 0xCB, 0x82, 0x92, 0xC7, 0x9C,
- 0x0F, 0xA2, 0xF2, 0x1B, 0xDF, 0xEA, 0x96, 0x64, 0x8B, 0xA2, 0x32, 0x7C,
- 0xDF, 0xD8, 0x89, 0x10, 0xFD, 0xBB, 0x38, 0xCD},
- {0xB1, 0x23, 0x46, 0x13, 0x4D, 0x9B, 0x8E, 0x8A, 0x95, 0x64, 0xDD, 0x37,
- 0x29, 0x44, 0x1F, 0x76, 0xB5, 0x3A, 0x47, 0xD3, 0xE0, 0x18, 0x1E, 0x60,
- 0xE9, 0x94, 0x13, 0xA4, 0x47, 0xCD, 0xBE, 0x03},
+ {0x2F, 0x8C, 0xC7, 0xD7, 0xD4, 0x1E, 0x4A, 0xCB, 0x82, 0x92, 0xC7,
+ 0x9C, 0x0F, 0xA2, 0xF2, 0x1B, 0xDF, 0xEA, 0x96, 0x64, 0x8B, 0xA2,
+ 0x32, 0x7C, 0xDF, 0xD8, 0x89, 0x10, 0xFD, 0xBB, 0x38, 0xCD},
+ {0xB1, 0x23, 0x46, 0x13, 0x4D, 0x9B, 0x8E, 0x8A, 0x95, 0x64, 0xDD,
+ 0x37, 0x29, 0x44, 0x1F, 0x76, 0xB5, 0x3A, 0x47, 0xD3, 0xE0, 0x18,
+ 0x1E, 0x60, 0xE9, 0x94, 0x13, 0xA4, 0x47, 0xCD, 0xBE, 0x03},
},
{
- {0x2C, 0x98, 0x5A, 0x33, 0x10, 0x81, 0x1F, 0x3F, 0xFC, 0x66, 0x00, 0xCF,
- 0x87, 0xA6, 0x46, 0x18, 0x60, 0x11, 0x2F, 0x9B, 0xE9, 0x07, 0xE2, 0x2C,
- 0xE2, 0x4C, 0xBF, 0x50, 0x27, 0x1D, 0x57, 0xE1},
- {0x93, 0xF5, 0x3A, 0xA7, 0x4E, 0xAE, 0x26, 0x48, 0x02, 0xA7, 0x13, 0xED,
- 0x52, 0xAA, 0x14, 0x86, 0x06, 0x09, 0xC5, 0xAC, 0x4B, 0x64, 0x16, 0x25,
- 0xEB, 0x12, 0x4B, 0x73, 0xD3, 0x13, 0xCB, 0x8F},
+ {0x2C, 0x98, 0x5A, 0x33, 0x10, 0x81, 0x1F, 0x3F, 0xFC, 0x66, 0x00,
+ 0xCF, 0x87, 0xA6, 0x46, 0x18, 0x60, 0x11, 0x2F, 0x9B, 0xE9, 0x07,
+ 0xE2, 0x2C, 0xE2, 0x4C, 0xBF, 0x50, 0x27, 0x1D, 0x57, 0xE1},
+ {0x93, 0xF5, 0x3A, 0xA7, 0x4E, 0xAE, 0x26, 0x48, 0x02, 0xA7, 0x13,
+ 0xED, 0x52, 0xAA, 0x14, 0x86, 0x06, 0x09, 0xC5, 0xAC, 0x4B, 0x64,
+ 0x16, 0x25, 0xEB, 0x12, 0x4B, 0x73, 0xD3, 0x13, 0xCB, 0x8F},
},
};
const G2ElemStr EcGroupTest::efq2_identity_str = {
{
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
},
{
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
},
};
@@ -585,10 +585,10 @@ const G1ElemStr EcGroupTest::kAacHash = {
// NewEcGroup
TEST_F(EcGroupTest, NewFailsGivenArgumentsMismatch) {
// construct Fq^2 finite field
- FqElemStr beta_str = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46,
- 0xE5, 0xF2, 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC,
- 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82, 0xD3, 0x29, 0x2D,
- 0xDB, 0xAE, 0xD3, 0x30, 0x12}};
+ FqElemStr beta_str = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD,
+ 0x46, 0xE5, 0xF2, 0x5E, 0xEE, 0x71, 0xA4, 0x9F,
+ 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
+ 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x12}};
FfElementObj neg_beta(&fq);
THROW_ON_EPIDERR(FfNeg(fq, FfElementObj(&fq, beta_str), neg_beta));
FiniteFieldObj fq2(fq, neg_beta, 2);
@@ -1030,14 +1030,14 @@ TEST_F(EcGroupTest, MultiExpFailsGivenArgumentsMismatch) {
EcPoint const* pts_ec1[] = {this->efq_a, this->efq_b};
EcPoint const* pts_ec2[] = {this->efq2_a, this->efq2_b};
EcPoint const* pts_ec1_ec2[] = {this->efq_a, this->efq2_b};
- const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B,
- 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8,
- 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF, 0xF2, 0x6A, 0xFF,
- 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
- const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB, 0xFF,
- 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xBD,
- 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF, 0x84, 0xFF, 0xFF,
- 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
+ const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3,
+ 0x6B, 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27,
+ 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF,
+ 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
+ const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB,
+ 0xFF, 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xBD, 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF,
+ 0x84, 0xFF, 0xFF, 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
BigNumStr const* b[] = {&bnm0, &bnm1};
size_t m = 2;
@@ -1050,14 +1050,14 @@ TEST_F(EcGroupTest, MultiExpFailsGivenArgumentsMismatch) {
TEST_F(EcGroupTest, MultiExpFailsGivenNullPointer) {
EcPoint const* pts[] = {this->efq_a, this->efq_b};
EcPoint const* pts_withnull[] = {nullptr, this->efq_b};
- const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B,
- 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8,
- 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF, 0xF2, 0x6A, 0xFF,
- 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
- const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB, 0xFF,
- 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xBD,
- 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF, 0x84, 0xFF, 0xFF,
- 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
+ const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3,
+ 0x6B, 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27,
+ 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF,
+ 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
+ const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB,
+ 0xFF, 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xBD, 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF,
+ 0x84, 0xFF, 0xFF, 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
BigNumStr const* b[] = {&bnm0, &bnm1};
BigNumStr const* b_withnull[] = {nullptr, &bnm1};
size_t m = 2;
@@ -1203,14 +1203,14 @@ TEST_F(EcGroupTest, MultiExpBnFailsGivenArgumentsMismatch) {
EcPoint const* pts_ec1[] = {this->efq_a, this->efq_b};
EcPoint const* pts_ec2[] = {this->efq2_a, this->efq2_b};
EcPoint const* pts_ec1_ec2[] = {this->efq_a, this->efq2_b};
- const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B,
- 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8,
- 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF, 0xF2, 0x6A, 0xFF,
- 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
- const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB, 0xFF,
- 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xBD,
- 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF, 0x84, 0xFF, 0xFF,
- 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
+ const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3,
+ 0x6B, 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27,
+ 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF,
+ 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
+ const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB,
+ 0xFF, 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xBD, 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF,
+ 0x84, 0xFF, 0xFF, 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
BigNumObj bno0(bnm0);
BigNumObj bno1(bnm1);
BigNum const* b[] = {bno0, bno1};
@@ -1227,14 +1227,14 @@ TEST_F(EcGroupTest, MultiExpBnFailsGivenArgumentsMismatch) {
TEST_F(EcGroupTest, MultiExpBnFailsGivenNullPointer) {
EcPoint const* pts[] = {this->efq_a, this->efq_b};
EcPoint const* pts_withnull[] = {nullptr, this->efq_b};
- const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B,
- 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8,
- 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF, 0xF2, 0x6A, 0xFF,
- 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
- const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB, 0xFF,
- 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xBD,
- 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF, 0x84, 0xFF, 0xFF,
- 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
+ const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3,
+ 0x6B, 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27,
+ 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF,
+ 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
+ const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB,
+ 0xFF, 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xBD, 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF,
+ 0x84, 0xFF, 0xFF, 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
BigNumObj bno0(bnm0);
BigNumObj bno1(bnm1);
BigNum const* b[] = {bno0, bno1};
@@ -1437,9 +1437,9 @@ TEST_F(EcGroupTest, MultiExpBnWorksGivenTwoDifferentSizeG3Exponents) {
0x39, 0x57, 0xd4, 0xc5, 0x78, 0xf2, 0x77, 0x5c, 0x9f, 0x6c, 0xfe,
0x12, 0x00, 0xa8, 0xe0, 0xd3, 0x81, 0x38, 0xaa, 0x5a};
const BigNumStr bnm_nc_tick_str = {{{
- 0xcd, 0x2e, 0xe8, 0xf4, 0x85, 0x95, 0x04, 0x09, 0xbd, 0xa4, 0xfa, 0x07,
- 0xe3, 0x1c, 0xb9, 0x5a, 0x82, 0x73, 0xa6, 0xea, 0x47, 0x5c, 0x31, 0x74,
- 0x3c, 0x0a, 0xeb, 0x62, 0x94, 0x2f, 0x7b, 0x10,
+ 0xcd, 0x2e, 0xe8, 0xf4, 0x85, 0x95, 0x04, 0x09, 0xbd, 0xa4, 0xfa,
+ 0x07, 0xe3, 0x1c, 0xb9, 0x5a, 0x82, 0x73, 0xa6, 0xea, 0x47, 0x5c,
+ 0x31, 0x74, 0x3c, 0x0a, 0xeb, 0x62, 0x94, 0x2f, 0x7b, 0x10,
}}};
BigNumObj bno_sf(bnm_sf_str);
// In order to callculate exp sf data should be devided by group order
@@ -1470,14 +1470,14 @@ TEST_F(EcGroupTest, SscmMultiExpFailsGivenArgumentsMismatch) {
EcPoint const* pts_ec1[] = {this->efq_a, this->efq_b};
EcPoint const* pts_ec2[] = {this->efq2_a, this->efq2_b};
EcPoint const* pts_ec1_ec2[] = {this->efq_a, this->efq2_b};
- const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B,
- 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8,
- 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF, 0xF2, 0x6A, 0xFF,
- 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
- const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB, 0xFF,
- 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xBD,
- 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF, 0x84, 0xFF, 0xFF,
- 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
+ const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3,
+ 0x6B, 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27,
+ 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF,
+ 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
+ const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB,
+ 0xFF, 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xBD, 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF,
+ 0x84, 0xFF, 0xFF, 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
BigNumStr const* b[] = {&bnm0, &bnm1};
size_t m = 2;
@@ -1493,14 +1493,14 @@ TEST_F(EcGroupTest, SscmMultiExpFailsGivenArgumentsMismatch) {
TEST_F(EcGroupTest, SscmMultiExpFailsGivenNullPointer) {
EcPoint const* pts[] = {this->efq_a, this->efq_b};
EcPoint const* pts_withnull[] = {nullptr, this->efq_b};
- const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B,
- 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8,
- 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF, 0xF2, 0x6A, 0xFF,
- 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
- const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB, 0xFF,
- 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xBD,
- 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF, 0x84, 0xFF, 0xFF,
- 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
+ const BigNumStr bnm0 = {{0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3,
+ 0x6B, 0x08, 0xFF, 0xFF, 0x0B, 0xF3, 0xAF, 0x27,
+ 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF,
+ 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF}};
+ const BigNumStr bnm1 = {{0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB,
+ 0xFF, 0xFF, 0x6B, 0xD5, 0x3E, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xBD, 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF,
+ 0x84, 0xFF, 0xFF, 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
BigNumStr const* b[] = {&bnm0, &bnm1};
BigNumStr const* b_withnull[] = {nullptr, &bnm1};
size_t m = 2;
@@ -1736,65 +1736,65 @@ TEST_F(EcGroupTest, InGroupFailsGivenContextMismatch) {
TEST_F(EcGroupTest, HashFailsGivenArgumentsMismatch) {
uint8_t const msg[] = {0};
EXPECT_EQ(kEpidBadArgErr,
- EcHash(this->efq2, msg, sizeof(msg), kSha256, this->efq_r));
+ EcHash(this->efq2, msg, sizeof(msg), kSha256, this->efq_r, NULL));
EXPECT_EQ(kEpidBadArgErr,
- EcHash(this->efq, msg, sizeof(msg), kSha256, this->efq2_r));
+ EcHash(this->efq, msg, sizeof(msg), kSha256, this->efq2_r, NULL));
}
TEST_F(EcGroupTest, HashFailsGivenNullPointer) {
uint8_t const msg[] = {0};
EXPECT_EQ(kEpidBadArgErr,
- EcHash(nullptr, msg, sizeof(msg), kSha256, this->efq_r));
- EXPECT_EQ(kEpidBadArgErr,
- EcHash(this->efq, nullptr, sizeof(msg), kSha256, this->efq_r));
+ EcHash(nullptr, msg, sizeof(msg), kSha256, this->efq_r, NULL));
+ EXPECT_EQ(kEpidBadArgErr, EcHash(this->efq, nullptr, sizeof(msg), kSha256,
+ this->efq_r, NULL));
EXPECT_EQ(kEpidBadArgErr,
- EcHash(this->efq, msg, sizeof(msg), kSha256, nullptr));
+ EcHash(this->efq, msg, sizeof(msg), kSha256, nullptr, NULL));
}
TEST_F(EcGroupTest, HashFailsGivenUnsupportedHashAlg) {
uint8_t const msg[] = {0};
EXPECT_EQ(kEpidHashAlgorithmNotSupported,
- EcHash(this->efq, msg, sizeof(msg), kSha3_256, this->efq_r));
+ EcHash(this->efq, msg, sizeof(msg), kSha3_256, this->efq_r, NULL));
EXPECT_EQ(kEpidHashAlgorithmNotSupported,
- EcHash(this->efq, msg, sizeof(msg), kSha3_384, this->efq_r));
+ EcHash(this->efq, msg, sizeof(msg), kSha3_384, this->efq_r, NULL));
EXPECT_EQ(kEpidHashAlgorithmNotSupported,
- EcHash(this->efq, msg, sizeof(msg), kSha3_512, this->efq_r));
+ EcHash(this->efq, msg, sizeof(msg), kSha3_512, this->efq_r, NULL));
}
TEST_F(EcGroupTest, HashFailsGivenIncorrectMsgLen) {
uint8_t const msg[] = {0};
EXPECT_EQ(kEpidBadArgErr,
- EcHash(this->efq, nullptr, 1, kSha256, this->efq_r));
+ EcHash(this->efq, nullptr, 1, kSha256, this->efq_r, NULL));
EXPECT_EQ(kEpidBadArgErr,
EcHash(this->efq, msg, std::numeric_limits<size_t>::max(), kSha256,
- this->efq_r));
- EXPECT_EQ(kEpidBadArgErr,
- EcHash(this->efq, msg, (size_t)INT_MAX + 1, kSha256, this->efq_r));
+ this->efq_r, NULL));
+ EXPECT_EQ(kEpidBadArgErr, EcHash(this->efq, msg, (size_t)INT_MAX + 1, kSha256,
+ this->efq_r, NULL));
#if (SIZE_MAX >= 0x100000001) // When size_t value allowed to be 0x100000001
- EXPECT_EQ(kEpidBadArgErr,
- EcHash(this->efq, msg, (size_t)0x100000001, kSha256, this->efq_r));
+ EXPECT_EQ(kEpidBadArgErr, EcHash(this->efq, msg, (size_t)0x100000001, kSha256,
+ this->efq_r, NULL));
#endif
}
TEST_F(EcGroupTest, HashAcceptsZeroLengthMessage) {
- EXPECT_EQ(kEpidNoErr, EcHash(this->efq, "", 0, kSha256, this->efq_r));
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, "", 0, kSha256, this->efq_r, NULL));
}
TEST_F(EcGroupTest, HashWorksGivenSHA256HashAlg) {
G1ElemStr efq_r_str;
- EXPECT_EQ(kEpidNoErr,
- EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha256, this->efq_r));
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha256,
+ this->efq_r, NULL));
THROW_ON_EPIDERR(
WriteEcPoint(this->efq, this->efq_r, &efq_r_str, sizeof(efq_r_str)));
EXPECT_EQ(this->efq_r_sha256_str, efq_r_str);
}
TEST_F(EcGroupTest, HashWorksGivenSHA384HashAlg) {
G1ElemStr efq_r_str;
- EXPECT_EQ(kEpidNoErr,
- EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha384, this->efq_r));
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha384,
+ this->efq_r, NULL));
THROW_ON_EPIDERR(
WriteEcPoint(this->efq, this->efq_r, &efq_r_str, sizeof(efq_r_str)));
EXPECT_EQ(this->efq_r_sha384_str, efq_r_str);
}
TEST_F(EcGroupTest, HashWorksGivenSHA512HashAlg) {
G1ElemStr efq_r_str;
- EXPECT_EQ(kEpidNoErr,
- EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha512, this->efq_r));
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha512,
+ this->efq_r, NULL));
THROW_ON_EPIDERR(
WriteEcPoint(this->efq, this->efq_r, &efq_r_str, sizeof(efq_r_str)));
EXPECT_EQ(this->efq_r_sha512_str, efq_r_str);
@@ -1802,11 +1802,35 @@ TEST_F(EcGroupTest, HashWorksGivenSHA512HashAlg) {
TEST_F(EcGroupTest, HashWorksGivenSHA512256HashAlg) {
G1ElemStr efq_r_str;
EXPECT_EQ(kEpidNoErr, EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha512_256,
- this->efq_r));
+ this->efq_r, NULL));
THROW_ON_EPIDERR(
WriteEcPoint(this->efq, this->efq_r, &efq_r_str, sizeof(efq_r_str)));
EXPECT_EQ(this->efq_r_sha512256_str, efq_r_str);
}
+TEST_F(EcGroupTest, HashReturnsValidISha256) {
+ uint32_t i = 0;
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha256,
+ this->efq_r, &i));
+ EXPECT_EQ((uint32_t)4, i);
+}
+TEST_F(EcGroupTest, HashReturnsValidISha384) {
+ uint32_t i = 0;
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha384,
+ this->efq_r, &i));
+ EXPECT_EQ((uint32_t)0, i);
+}
+TEST_F(EcGroupTest, HashReturnsValidISha512) {
+ uint32_t i = 0;
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha512,
+ this->efq_r, &i));
+ EXPECT_EQ((uint32_t)1, i);
+}
+TEST_F(EcGroupTest, HashReturnsValidISha512256) {
+ uint32_t i = 0;
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, sha_msg, sizeof(sha_msg), kSha512_256,
+ this->efq_r, &i));
+ EXPECT_EQ((uint32_t)0, i);
+}
///////////////////////////////////////////////////////////////////////
// 1.1 EcHash
TEST_F(EcGroupTest, Epid11HashFailsGivenMismatchedArguments) {
@@ -1896,12 +1920,12 @@ TEST_F(EcGroupTest, MakePointSucceedsGivenElement) {
// a pre-computed point in eqf
G1ElemStr efq_ref_str = {
- {{0X1C, 0X53, 0X40, 0X69, 0X8B, 0X77, 0X75, 0XAA, 0X2B, 0X7D, 0X91, 0XD6,
- 0X29, 0X49, 0X05, 0X7F, 0XF6, 0X4C, 0X63, 0X90, 0X58, 0X22, 0X06, 0XF5,
- 0X1F, 0X3B, 0X9F, 0XA2, 0X04, 0X39, 0XA9, 0X67}},
- {{0X3B, 0X65, 0X58, 0XAC, 0X97, 0X46, 0X47, 0XC9, 0X84, 0X57, 0X3F, 0XFA,
- 0X4F, 0XB0, 0X64, 0X8D, 0X48, 0XC8, 0X14, 0XEB, 0XF1, 0X94, 0X87, 0XDC,
- 0XB3, 0X73, 0X90, 0X1D, 0X75, 0XAD, 0XD5, 0X56}}};
+ {{0X1C, 0X53, 0X40, 0X69, 0X8B, 0X77, 0X75, 0XAA, 0X2B, 0X7D, 0X91,
+ 0XD6, 0X29, 0X49, 0X05, 0X7F, 0XF6, 0X4C, 0X63, 0X90, 0X58, 0X22,
+ 0X06, 0XF5, 0X1F, 0X3B, 0X9F, 0XA2, 0X04, 0X39, 0XA9, 0X67}},
+ {{0X3B, 0X65, 0X58, 0XAC, 0X97, 0X46, 0X47, 0XC9, 0X84, 0X57, 0X3F,
+ 0XFA, 0X4F, 0XB0, 0X64, 0X8D, 0X48, 0XC8, 0X14, 0XEB, 0XF1, 0X94,
+ 0X87, 0XDC, 0XB3, 0X73, 0X90, 0X1D, 0X75, 0XAD, 0XD5, 0X56}}};
// create a point with x == ref.x
FfElementObj elem(&this->fq, efq_ref_str.x);
diff --git a/epid/common/math/unittests/ffelement-test.cc b/epid/common/math/unittests/ffelement-test.cc
index 2f6a910..212e09e 100644
--- a/epid/common/math/unittests/ffelement-test.cc
+++ b/epid/common/math/unittests/ffelement-test.cc
@@ -19,19 +19,19 @@
* \brief FfElement unit tests.
*/
+#include <algorithm>
#include <cstring>
#include <limits>
-#include <algorithm>
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
+#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common-testhelper/prng-testhelper.h"
-#include "epid/common-testhelper/octstr-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
-#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
+#include "epid/common-testhelper/octstr-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
extern "C" {
#include "epid/common/math/finitefield.h"
@@ -114,10 +114,10 @@ class FfElementTest : public ::testing::Test {
fq_4 = FfElementObj(&fq, &fq_4_str, sizeof(fq_4_str));
fq_5 = FfElementObj(&fq, &fq_5_str, sizeof(fq_5_str));
fq_a = FfElementObj(&fq, &bn_a_str, sizeof(bn_a_str));
- // construct EPID 1.1 Fq finite field
+ // construct Intel(R) EPID 1.1 Fq finite field
epid11_fq = FiniteFieldObj(bn_epid11_bn_q_str);
- // construct EPID 1.1 Fqd finite field
+ // construct Intel(R) EPID 1.1 Fqd finite field
epid11_fqd = FiniteFieldObj(epid11_fq, bn_epid11_fq_coeffs,
COUNT_OF(bn_epid11_fq_coeffs));
@@ -129,7 +129,7 @@ class FfElementTest : public ::testing::Test {
THROW_ON_EPIDERR(WriteFfElement(epid11_fq, epid11_neg_qnr,
&epid11_ground_element_str.a[0],
sizeof(epid11_ground_element_str.a[0])));
- // construct EPID 1.1 Fqk finite field
+ // construct Intel(R) EPID 1.1 Fqk finite field
epid11_GT = FiniteFieldObj(
epid11_fqd, FfElementObj(&epid11_fqd, epid11_ground_element_str), 2);
@@ -327,7 +327,7 @@ class FfElementTest : public ::testing::Test {
static const BigNumStr fq_multi_exp_exp_6[6];
static const FqElemStr fq_multi_exp_res_6;
- // EPID 1.1 GT Multi Exp Data
+ // Intel(R) EPID 1.1 GT Multi Exp Data
static const Fq6ElemStr epid11_GT_multi_exp_base_3[3];
static const std::vector<uint8_t> epid11_GT_multi_exp_exp_3[3];
static const Fq6ElemStr epid11_GT_multi_exp_res_3;
@@ -339,31 +339,31 @@ class FfElementTest : public ::testing::Test {
};
const Fq2ElemStr FfElementTest::fq2_2_1_str = {
- {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
+ {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
const Fq6ElemStr FfElementTest::fq6_0_0_1_0_0_0_str = {
- {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
+ {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
// Intel(R) EPID 2.0 parameter p
const BigNumStr FfElementTest::bn_p_str = {
@@ -427,23 +427,23 @@ const BigNumStr FfElementTest::bn_epid11_bn_q_str = {
// Intel(R) EPID 1.1 parameter qnr
const FqElemStr FfElementTest::fq_epid11_fq_qnr = {
- {0x08, 0x66, 0xA7, 0x67, 0x36, 0x6E, 0x62, 0x71, 0xB7, 0xA6, 0x52, 0x94,
- 0x8F, 0xFB, 0x25, 0x9E, 0xE6, 0x4F, 0x25, 0xE5, 0x26, 0x9A, 0x2B, 0x6E,
- 0x7E, 0xF8, 0xA6, 0x39, 0xAE, 0x46, 0xAA, 0x24}};
+ {0x08, 0x66, 0xA7, 0x67, 0x36, 0x6E, 0x62, 0x71, 0xB7, 0xA6, 0x52,
+ 0x94, 0x8F, 0xFB, 0x25, 0x9E, 0xE6, 0x4F, 0x25, 0xE5, 0x26, 0x9A,
+ 0x2B, 0x6E, 0x7E, 0xF8, 0xA6, 0x39, 0xAE, 0x46, 0xAA, 0x24}};
// Intel(R) EPID 1.1 parameter coeff
const BigNumStr FfElementTest::bn_epid11_fq_coeffs[3] = {
- {{{0x02, 0x16, 0x7A, 0x61, 0x53, 0xDD, 0xF6, 0xE2, 0x89, 0x15, 0xA0, 0x94,
- 0xF1, 0xB5, 0xDC, 0x65, 0x21, 0x15, 0x62, 0xE1, 0x7D, 0xC5, 0x43, 0x89,
- 0xEE, 0xB4, 0xEF, 0xC8, 0xA0, 0x8E, 0x34, 0x0F}}},
+ {{{0x02, 0x16, 0x7A, 0x61, 0x53, 0xDD, 0xF6, 0xE2, 0x89, 0x15, 0xA0,
+ 0x94, 0xF1, 0xB5, 0xDC, 0x65, 0x21, 0x15, 0x62, 0xE1, 0x7D, 0xC5,
+ 0x43, 0x89, 0xEE, 0xB4, 0xEF, 0xC8, 0xA0, 0x8E, 0x34, 0x0F}}},
- {{{0x04, 0x82, 0x27, 0xE1, 0xEB, 0x98, 0x64, 0xC2, 0x8D, 0x8F, 0xDD, 0x0E,
- 0x82, 0x40, 0xAE, 0xD4, 0x31, 0x63, 0xD6, 0x46, 0x32, 0x16, 0x85, 0x7A,
- 0xB7, 0x18, 0x68, 0xB8, 0x17, 0x02, 0x81, 0xA6}}},
+ {{{0x04, 0x82, 0x27, 0xE1, 0xEB, 0x98, 0x64, 0xC2, 0x8D, 0x8F, 0xDD,
+ 0x0E, 0x82, 0x40, 0xAE, 0xD4, 0x31, 0x63, 0xD6, 0x46, 0x32, 0x16,
+ 0x85, 0x7A, 0xB7, 0x18, 0x68, 0xB8, 0x17, 0x02, 0x81, 0xA6}}},
- {{{0x06, 0x20, 0x76, 0xE8, 0x54, 0x54, 0x53, 0xB4, 0xA9, 0xD8, 0x44, 0x4B,
- 0xAA, 0xFB, 0x1C, 0xFD, 0xAE, 0x15, 0xCA, 0x29, 0x79, 0xA6, 0x24, 0xA4,
- 0x0A, 0xF6, 0x1E, 0xAC, 0xED, 0xFB, 0x10, 0x41}}}};
+ {{{0x06, 0x20, 0x76, 0xE8, 0x54, 0x54, 0x53, 0xB4, 0xA9, 0xD8, 0x44,
+ 0x4B, 0xAA, 0xFB, 0x1C, 0xFD, 0xAE, 0x15, 0xCA, 0x29, 0x79, 0xA6,
+ 0x24, 0xA4, 0x0A, 0xF6, 0x1E, 0xAC, 0xED, 0xFB, 0x10, 0x41}}}};
// zero
const BigNumStr FfElementTest::bn_0_str = {
@@ -513,12 +513,12 @@ const FqElemStr FfElementTest::fq_a_str = {
0x37, 0xE0, 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A};
const Fq2ElemStr FfElementTest::fq2_a_str = {
- {{{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D, 0x52,
- 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A, 0x37, 0xE0,
- 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
- {{{0xDD, 0x2B, 0xE9, 0x59, 0x24, 0xA5, 0xB3, 0xFD, 0xEB, 0xE1, 0x3C, 0xC0,
- 0x73, 0x4E, 0x99, 0xEE, 0x36, 0xF6, 0xC0, 0x1A, 0x76, 0x01, 0x0A, 0xF0,
- 0xCB, 0xB4, 0x71, 0x88, 0x95, 0xCB, 0x35, 0xBA}}}}};
+ {{{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D,
+ 0x52, 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A,
+ 0x37, 0xE0, 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
+ {{{0xDD, 0x2B, 0xE9, 0x59, 0x24, 0xA5, 0xB3, 0xFD, 0xEB, 0xE1, 0x3C,
+ 0xC0, 0x73, 0x4E, 0x99, 0xEE, 0x36, 0xF6, 0xC0, 0x1A, 0x76, 0x01,
+ 0x0A, 0xF0, 0xCB, 0xB4, 0x71, 0x88, 0x95, 0xCB, 0x35, 0xBA}}}}};
// arbitrary constant b (256 bit value)
const BigNumStr FfElementTest::bn_b_str = {
@@ -538,32 +538,32 @@ const FqElemStr FfElementTest::fq_sum_ab_str = {
0x11, 0x78, 0xF6, 0x59, 0x23, 0x75, 0xEF, 0x7D, 0x46, 0x7C};
const Fq2ElemStr FfElementTest::fq2_sum_ab_str = {
- {{{{0xF9, 0x0B, 0x7F, 0x72, 0x65, 0x94, 0x67, 0x2A, 0x9F, 0x0F, 0x2F, 0xBA,
- 0x3B, 0x2B, 0x26, 0x83, 0xBA, 0xD3, 0xFB, 0x7B, 0x9D, 0x79, 0x11, 0x78,
- 0xF6, 0x59, 0x23, 0x75, 0xEF, 0x7D, 0x46, 0x7C}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
+ {{{{0xF9, 0x0B, 0x7F, 0x72, 0x65, 0x94, 0x67, 0x2A, 0x9F, 0x0F, 0x2F,
+ 0xBA, 0x3B, 0x2B, 0x26, 0x83, 0xBA, 0xD3, 0xFB, 0x7B, 0x9D, 0x79,
+ 0x11, 0x78, 0xF6, 0x59, 0x23, 0x75, 0xEF, 0x7D, 0x46, 0x7C}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
const Fq6ElemStr FfElementTest::fq6_sum_ab_str = {
- {{{{0xF9, 0x0B, 0x7F, 0x72, 0x65, 0x94, 0x67, 0x2A, 0x9F, 0x0F, 0x2F, 0xBA,
- 0x3B, 0x2B, 0x26, 0x83, 0xBA, 0xD3, 0xFB, 0x7B, 0x9D, 0x79, 0x11, 0x78,
- 0xF6, 0x59, 0x23, 0x75, 0xEF, 0x7D, 0x46, 0x7C},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
+ {{{{0xF9, 0x0B, 0x7F, 0x72, 0x65, 0x94, 0x67, 0x2A, 0x9F, 0x0F, 0x2F,
+ 0xBA, 0x3B, 0x2B, 0x26, 0x83, 0xBA, 0xD3, 0xFB, 0x7B, 0x9D, 0x79,
+ 0x11, 0x78, 0xF6, 0x59, 0x23, 0x75, 0xEF, 0x7D, 0x46, 0x7C},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
const Fq12ElemStr FfElementTest::fq12_sum_ab_str = {
{{{{{{0xF9, 0x0B, 0x7F, 0x72, 0x65, 0x94, 0x67, 0x2A, 0x9F, 0x0F, 0x2F,
@@ -611,12 +611,12 @@ const FqElemStr FfElementTest::fq_mul_ab_str = {
0x00, 0xCF, 0x82, 0x88, 0xBD, 0x39, 0x0B, 0xA2, 0x0B, 0x58};
const Fq2ElemStr FfElementTest::fq2_mul_ab_str = {
- {{{{0xE4, 0xAB, 0xE3, 0xE4, 0x08, 0xC3, 0x8A, 0x00, 0x78, 0x50, 0x01, 0xA9,
- 0x4A, 0xFC, 0x43, 0x15, 0xA2, 0x99, 0x51, 0x20, 0x6B, 0x9C, 0x00, 0xCF,
- 0x82, 0x88, 0xBD, 0x39, 0x0B, 0xA2, 0x0B, 0x58}}},
- {{{0xB4, 0xE4, 0x39, 0xEA, 0x70, 0xDE, 0x15, 0xC3, 0xC6, 0x91, 0xFD, 0x7F,
- 0xBE, 0x2B, 0xF5, 0xD2, 0xC0, 0xB7, 0x20, 0xFC, 0x1F, 0x02, 0x33, 0xC9,
- 0x39, 0x93, 0xB9, 0x5E, 0x55, 0x51, 0xB6, 0x46}}}}};
+ {{{{0xE4, 0xAB, 0xE3, 0xE4, 0x08, 0xC3, 0x8A, 0x00, 0x78, 0x50, 0x01,
+ 0xA9, 0x4A, 0xFC, 0x43, 0x15, 0xA2, 0x99, 0x51, 0x20, 0x6B, 0x9C,
+ 0x00, 0xCF, 0x82, 0x88, 0xBD, 0x39, 0x0B, 0xA2, 0x0B, 0x58}}},
+ {{{0xB4, 0xE4, 0x39, 0xEA, 0x70, 0xDE, 0x15, 0xC3, 0xC6, 0x91, 0xFD,
+ 0x7F, 0xBE, 0x2B, 0xF5, 0xD2, 0xC0, 0xB7, 0x20, 0xFC, 0x1F, 0x02,
+ 0x33, 0xC9, 0x39, 0x93, 0xB9, 0x5E, 0x55, 0x51, 0xB6, 0x46}}}}};
// 1/a
const FqElemStr FfElementTest::fq_inv_a_str = {
@@ -928,14 +928,14 @@ const Fq12ElemStr FfElementTest::fq12_mul_gb_str = {
};
const FqElemStr FfElementTest::fq_multi_exp_base_1[1] = {{
- 0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D, 0x52,
- 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A, 0x37, 0xE0,
- 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A,
+ 0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D,
+ 0x52, 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A,
+ 0x37, 0xE0, 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A,
}};
const BigNumStr FfElementTest::fq_multi_exp_exp_1[1] = {{
- 0xFF, 0xFB, 0x3E, 0x5D, 0xFF, 0x9A, 0xFF, 0x02, 0x00, 0xFF, 0xFF, 0xFF,
- 0xF2, 0xE1, 0x85, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x81,
- 0xFF, 0xFD, 0xFF, 0xEB, 0xFF, 0x29, 0xA7, 0xFF,
+ 0xFF, 0xFB, 0x3E, 0x5D, 0xFF, 0x9A, 0xFF, 0x02, 0x00, 0xFF, 0xFF,
+ 0xFF, 0xF2, 0xE1, 0x85, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x81, 0xFF, 0xFD, 0xFF, 0xEB, 0xFF, 0x29, 0xA7, 0xFF,
}};
const FqElemStr FfElementTest::fq_multi_exp_res_1 = {
0x6A, 0x21, 0xEC, 0x89, 0xCC, 0x13, 0x2F, 0x6F, 0x29, 0x1B, 0x3A,
@@ -944,9 +944,9 @@ const FqElemStr FfElementTest::fq_multi_exp_res_1 = {
};
const std::vector<uint8_t> FfElementTest::fq_multi_exp_exp_1_264({
- 0x08, 0xFF, 0xFB, 0x3E, 0x5D, 0xFF, 0x9A, 0xFF, 0x02, 0x00, 0xFF, 0xFF,
- 0xFF, 0xF2, 0xE1, 0x85, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x81, 0xFF, 0xFD, 0xFF, 0xEB, 0xFF, 0x29, 0xA7, 0xFF,
+ 0x08, 0xFF, 0xFB, 0x3E, 0x5D, 0xFF, 0x9A, 0xFF, 0x02, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xF2, 0xE1, 0x85, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x81, 0xFF, 0xFD, 0xFF, 0xEB, 0xFF, 0x29, 0xA7, 0xFF,
});
const FqElemStr FfElementTest::fq_multi_exp_res_1_264 = {
0x71, 0x41, 0xa1, 0xdb, 0xd1, 0xd1, 0x50, 0xc2, 0x73, 0x07, 0xc1,
@@ -958,19 +958,19 @@ const FqElemStr FfElementTest::fq_multi_exp_res_1_256_264 = {
0x99, 0xe9, 0x23, 0xf9, 0x6b, 0x10, 0x35, 0x7c, 0xf1, 0xa3};
const FqElemStr FfElementTest::fq_multi_exp_base_2[2] = {
- {0xE6, 0x65, 0x23, 0x9B, 0xD4, 0x07, 0x16, 0x83, 0x38, 0x23, 0xB2, 0x67,
- 0x57, 0xEB, 0x0F, 0x23, 0x3A, 0xF4, 0x8E, 0xDA, 0x71, 0x5E, 0xD9, 0x98,
- 0x63, 0x98, 0x2B, 0xBC, 0x78, 0xD1, 0x94, 0xF2},
- {0xDD, 0x2B, 0xE9, 0x59, 0x24, 0xA5, 0xB3, 0xFD, 0xEB, 0xE1, 0x3C, 0xC0,
- 0x73, 0x4E, 0x99, 0xEE, 0x36, 0xF6, 0xC0, 0x1A, 0x76, 0x01, 0x0A, 0xF0,
- 0xCB, 0xB4, 0x71, 0x88, 0x95, 0xCB, 0x35, 0xBA}};
+ {0xE6, 0x65, 0x23, 0x9B, 0xD4, 0x07, 0x16, 0x83, 0x38, 0x23, 0xB2,
+ 0x67, 0x57, 0xEB, 0x0F, 0x23, 0x3A, 0xF4, 0x8E, 0xDA, 0x71, 0x5E,
+ 0xD9, 0x98, 0x63, 0x98, 0x2B, 0xBC, 0x78, 0xD1, 0x94, 0xF2},
+ {0xDD, 0x2B, 0xE9, 0x59, 0x24, 0xA5, 0xB3, 0xFD, 0xEB, 0xE1, 0x3C,
+ 0xC0, 0x73, 0x4E, 0x99, 0xEE, 0x36, 0xF6, 0xC0, 0x1A, 0x76, 0x01,
+ 0x0A, 0xF0, 0xCB, 0xB4, 0x71, 0x88, 0x95, 0xCB, 0x35, 0xBA}};
const BigNumStr FfElementTest::fq_multi_exp_exp_2[2] = {
- {0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B, 0x08, 0xFF, 0xFF,
- 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF, 0xEB, 0xFF,
- 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF},
- {0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB, 0xFF, 0xFF, 0x6B, 0xD5,
- 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xBD, 0xFF, 0x5A, 0xFF, 0x5C, 0x7C, 0xFF,
- 0x84, 0xFF, 0xFF, 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
+ {0x11, 0xFF, 0xFF, 0xFF, 0x4F, 0x59, 0xB1, 0xD3, 0x6B, 0x08, 0xFF,
+ 0xFF, 0x0B, 0xF3, 0xAF, 0x27, 0xFF, 0xB8, 0xFF, 0xFF, 0x98, 0xFF,
+ 0xEB, 0xFF, 0xF2, 0x6A, 0xFF, 0xFF, 0xEA, 0x31, 0xFF, 0xFF},
+ {0xE2, 0xFF, 0x03, 0x1D, 0xFF, 0x19, 0x81, 0xCB, 0xFF, 0xFF, 0x6B,
+ 0xD5, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xBD, 0xFF, 0x5A, 0xFF, 0x5C,
+ 0x7C, 0xFF, 0x84, 0xFF, 0xFF, 0x8C, 0x03, 0xB2, 0x26, 0xFF}};
const FqElemStr FfElementTest::fq_multi_exp_res_2 = {
0x8A, 0xF7, 0x96, 0x53, 0x9C, 0xC3, 0x57, 0x89, 0x50, 0xE3, 0xAB,
0x12, 0x62, 0xEA, 0x0C, 0xE4, 0x65, 0xA6, 0x91, 0x09, 0x93, 0x81,
@@ -978,56 +978,56 @@ const FqElemStr FfElementTest::fq_multi_exp_res_2 = {
};
const FqElemStr FfElementTest::fq_multi_exp_base_3[3] = {
- {0x24, 0x9D, 0xDD, 0x1A, 0xC0, 0x07, 0x1F, 0x65, 0xDF, 0xBB, 0xC7, 0x39,
- 0x99, 0x44, 0x63, 0x8E, 0x7E, 0xB2, 0x85, 0x82, 0xC6, 0x4E, 0x2D, 0x39,
- 0xA8, 0x3F, 0x12, 0xB4, 0xE9, 0x9D, 0x67, 0x28},
- {0x6B, 0x51, 0x6B, 0x33, 0x0B, 0x2E, 0x2A, 0x94, 0x34, 0xCC, 0x7E, 0x97,
- 0xFA, 0x85, 0x51, 0x44, 0x30, 0xE5, 0xF2, 0x68, 0x23, 0x31, 0x84, 0xFF,
- 0xBB, 0x95, 0x9A, 0xB2, 0x80, 0x95, 0xC4, 0x91},
- {0x77, 0xED, 0xA2, 0x53, 0xA3, 0xBF, 0x6C, 0x58, 0x16, 0x7D, 0xEF, 0x8A,
- 0x7D, 0x38, 0x65, 0x3F, 0x92, 0xA6, 0x85, 0xD7, 0x9F, 0x80, 0xA4, 0xA1,
- 0x70, 0x02, 0xE5, 0x66, 0xF2, 0xD8, 0xD7, 0xD2}};
+ {0x24, 0x9D, 0xDD, 0x1A, 0xC0, 0x07, 0x1F, 0x65, 0xDF, 0xBB, 0xC7,
+ 0x39, 0x99, 0x44, 0x63, 0x8E, 0x7E, 0xB2, 0x85, 0x82, 0xC6, 0x4E,
+ 0x2D, 0x39, 0xA8, 0x3F, 0x12, 0xB4, 0xE9, 0x9D, 0x67, 0x28},
+ {0x6B, 0x51, 0x6B, 0x33, 0x0B, 0x2E, 0x2A, 0x94, 0x34, 0xCC, 0x7E,
+ 0x97, 0xFA, 0x85, 0x51, 0x44, 0x30, 0xE5, 0xF2, 0x68, 0x23, 0x31,
+ 0x84, 0xFF, 0xBB, 0x95, 0x9A, 0xB2, 0x80, 0x95, 0xC4, 0x91},
+ {0x77, 0xED, 0xA2, 0x53, 0xA3, 0xBF, 0x6C, 0x58, 0x16, 0x7D, 0xEF,
+ 0x8A, 0x7D, 0x38, 0x65, 0x3F, 0x92, 0xA6, 0x85, 0xD7, 0x9F, 0x80,
+ 0xA4, 0xA1, 0x70, 0x02, 0xE5, 0x66, 0xF2, 0xD8, 0xD7, 0xD2}};
const BigNumStr FfElementTest::fq_multi_exp_exp_3[3] = {
- {0xFF, 0xFF, 0xFF, 0xB4, 0x48, 0xFF, 0xFF, 0xFF, 0xA3, 0xFF, 0xE3, 0xFF,
- 0x61, 0xFF, 0xA2, 0x97, 0x9A, 0xFF, 0x6F, 0x04, 0xC6, 0xB9, 0xFF, 0x22,
- 0xFF, 0x20, 0x9E, 0xFF, 0x43, 0xFF, 0xFF, 0xFF},
- {0xB1, 0x19, 0xBF, 0xFF, 0x74, 0x7F, 0xCC, 0x34, 0x1E, 0x30, 0x7D, 0xC5,
- 0xC4, 0xFF, 0xE7, 0xF8, 0xFF, 0x5F, 0xFF, 0x73, 0xFF, 0x58, 0xFF, 0xD6,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xFF, 0xFF},
- {0xFF, 0xFF, 0x0D, 0xFF, 0xFF, 0xFF, 0xFF, 0x26, 0xA8, 0xFF, 0xFF, 0xFF,
- 0x3E, 0xFF, 0xFF, 0xFF, 0xE0, 0x4F, 0xFF, 0xE3, 0xFF, 0xFF, 0xEB, 0x04,
- 0x4B, 0xFF, 0x5D, 0x55, 0xFF, 0x2D, 0xFF, 0xFF}};
+ {0xFF, 0xFF, 0xFF, 0xB4, 0x48, 0xFF, 0xFF, 0xFF, 0xA3, 0xFF, 0xE3,
+ 0xFF, 0x61, 0xFF, 0xA2, 0x97, 0x9A, 0xFF, 0x6F, 0x04, 0xC6, 0xB9,
+ 0xFF, 0x22, 0xFF, 0x20, 0x9E, 0xFF, 0x43, 0xFF, 0xFF, 0xFF},
+ {0xB1, 0x19, 0xBF, 0xFF, 0x74, 0x7F, 0xCC, 0x34, 0x1E, 0x30, 0x7D,
+ 0xC5, 0xC4, 0xFF, 0xE7, 0xF8, 0xFF, 0x5F, 0xFF, 0x73, 0xFF, 0x58,
+ 0xFF, 0xD6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xFF, 0xFF},
+ {0xFF, 0xFF, 0x0D, 0xFF, 0xFF, 0xFF, 0xFF, 0x26, 0xA8, 0xFF, 0xFF,
+ 0xFF, 0x3E, 0xFF, 0xFF, 0xFF, 0xE0, 0x4F, 0xFF, 0xE3, 0xFF, 0xFF,
+ 0xEB, 0x04, 0x4B, 0xFF, 0x5D, 0x55, 0xFF, 0x2D, 0xFF, 0xFF}};
const FqElemStr FfElementTest::fq_multi_exp_res_3 = {
0x04, 0x22, 0x21, 0xE7, 0x9F, 0xE3, 0x07, 0x2F, 0xA4, 0xBB, 0x56,
0x84, 0xD5, 0x93, 0x4A, 0xDA, 0x5B, 0x89, 0x07, 0xBE, 0xC5, 0x5F,
0xE6, 0x5C, 0x18, 0xF0, 0xF8, 0x8E, 0x8E, 0x00, 0xB9, 0x87,
};
const FqElemStr FfElementTest::fq_multi_exp_base_4[4] = {
- {0x81, 0xEE, 0x78, 0x31, 0x4C, 0xC0, 0x3C, 0xDD, 0x16, 0x52, 0xC6, 0x7E,
- 0x07, 0x4C, 0xFE, 0xC4, 0x50, 0x63, 0x5A, 0x40, 0xC8, 0xDF, 0x94, 0x23,
- 0x1A, 0x90, 0xDD, 0x24, 0x61, 0x23, 0xDD, 0x87},
- {0x76, 0xBB, 0x2C, 0x1C, 0xB3, 0x78, 0x93, 0x7E, 0x10, 0x29, 0xC3, 0xEC,
- 0xBD, 0xA3, 0x75, 0x3A, 0xF1, 0x0B, 0xE1, 0xCA, 0xEE, 0x02, 0x58, 0x74,
- 0xC7, 0xDC, 0xB8, 0x4F, 0x3F, 0x7B, 0xA2, 0xFC},
- {0x3A, 0xD3, 0x04, 0xAA, 0x9D, 0x2A, 0xDE, 0x86, 0x56, 0x84, 0x80, 0x42,
- 0xA5, 0x68, 0xD8, 0x6E, 0x65, 0xC4, 0x08, 0x07, 0x87, 0x4B, 0xC1, 0x92,
- 0xCB, 0x68, 0x52, 0x6C, 0x5A, 0x4F, 0x7C, 0xFB},
- {0x56, 0xE7, 0xBD, 0x59, 0x54, 0xCC, 0x20, 0x16, 0xAE, 0x36, 0xD1, 0xB0,
- 0xE4, 0x82, 0x47, 0x27, 0x32, 0xD1, 0x38, 0x7C, 0x53, 0x7F, 0xDD, 0xF4,
- 0xDE, 0xFA, 0xF7, 0x0F, 0xDD, 0xDF, 0x48, 0xA9}};
+ {0x81, 0xEE, 0x78, 0x31, 0x4C, 0xC0, 0x3C, 0xDD, 0x16, 0x52, 0xC6,
+ 0x7E, 0x07, 0x4C, 0xFE, 0xC4, 0x50, 0x63, 0x5A, 0x40, 0xC8, 0xDF,
+ 0x94, 0x23, 0x1A, 0x90, 0xDD, 0x24, 0x61, 0x23, 0xDD, 0x87},
+ {0x76, 0xBB, 0x2C, 0x1C, 0xB3, 0x78, 0x93, 0x7E, 0x10, 0x29, 0xC3,
+ 0xEC, 0xBD, 0xA3, 0x75, 0x3A, 0xF1, 0x0B, 0xE1, 0xCA, 0xEE, 0x02,
+ 0x58, 0x74, 0xC7, 0xDC, 0xB8, 0x4F, 0x3F, 0x7B, 0xA2, 0xFC},
+ {0x3A, 0xD3, 0x04, 0xAA, 0x9D, 0x2A, 0xDE, 0x86, 0x56, 0x84, 0x80,
+ 0x42, 0xA5, 0x68, 0xD8, 0x6E, 0x65, 0xC4, 0x08, 0x07, 0x87, 0x4B,
+ 0xC1, 0x92, 0xCB, 0x68, 0x52, 0x6C, 0x5A, 0x4F, 0x7C, 0xFB},
+ {0x56, 0xE7, 0xBD, 0x59, 0x54, 0xCC, 0x20, 0x16, 0xAE, 0x36, 0xD1,
+ 0xB0, 0xE4, 0x82, 0x47, 0x27, 0x32, 0xD1, 0x38, 0x7C, 0x53, 0x7F,
+ 0xDD, 0xF4, 0xDE, 0xFA, 0xF7, 0x0F, 0xDD, 0xDF, 0x48, 0xA9}};
const BigNumStr FfElementTest::fq_multi_exp_exp_4[4] = {
- {0xFF, 0xA5, 0xC3, 0xFF, 0xFF, 0x09, 0x18, 0x18, 0x95, 0x40, 0xFF, 0xFF,
- 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0xFF, 0x25, 0xFF, 0xFF, 0x42, 0x07,
- 0xB5, 0xFF, 0x26, 0xE0, 0x4F, 0xB5, 0xB4, 0xFF},
- {0x1F, 0xFF, 0xAA, 0xF1, 0xFF, 0xFF, 0x7E, 0xFF, 0xFF, 0xFF, 0x07, 0xFF,
- 0xE7, 0xDF, 0xFF, 0xEE, 0xFF, 0x57, 0xFF, 0xFF, 0xFF, 0xB8, 0xB3, 0x9C,
- 0xFF, 0x8A, 0x89, 0xFF, 0xFE, 0x32, 0xFF, 0xC1},
- {0x9A, 0xFF, 0xFF, 0x9B, 0xFF, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x36, 0xF0, 0xC5, 0xAE, 0x87, 0x41, 0xFF, 0x5C, 0xDD, 0xFF, 0xFF,
- 0xFF, 0xFF, 0x59, 0xC9, 0xFF, 0x44, 0x5C, 0x58},
- {0x00, 0xFF, 0x95, 0xFF, 0x21, 0xFF, 0xFF, 0x1D, 0x1A, 0x06, 0xD3, 0xFF,
- 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xB0, 0x31, 0xFF, 0xFF, 0x1F,
- 0x61, 0x48, 0xFF, 0xFF, 0xFF, 0x17, 0xC9, 0x79}};
+ {0xFF, 0xA5, 0xC3, 0xFF, 0xFF, 0x09, 0x18, 0x18, 0x95, 0x40, 0xFF,
+ 0xFF, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0xFF, 0x25, 0xFF, 0xFF,
+ 0x42, 0x07, 0xB5, 0xFF, 0x26, 0xE0, 0x4F, 0xB5, 0xB4, 0xFF},
+ {0x1F, 0xFF, 0xAA, 0xF1, 0xFF, 0xFF, 0x7E, 0xFF, 0xFF, 0xFF, 0x07,
+ 0xFF, 0xE7, 0xDF, 0xFF, 0xEE, 0xFF, 0x57, 0xFF, 0xFF, 0xFF, 0xB8,
+ 0xB3, 0x9C, 0xFF, 0x8A, 0x89, 0xFF, 0xFE, 0x32, 0xFF, 0xC1},
+ {0x9A, 0xFF, 0xFF, 0x9B, 0xFF, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x36, 0xF0, 0xC5, 0xAE, 0x87, 0x41, 0xFF, 0x5C, 0xDD,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x59, 0xC9, 0xFF, 0x44, 0x5C, 0x58},
+ {0x00, 0xFF, 0x95, 0xFF, 0x21, 0xFF, 0xFF, 0x1D, 0x1A, 0x06, 0xD3,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xB0, 0x31, 0xFF,
+ 0xFF, 0x1F, 0x61, 0x48, 0xFF, 0xFF, 0xFF, 0x17, 0xC9, 0x79}};
const FqElemStr FfElementTest::fq_multi_exp_res_4 = {
0x26, 0x2C, 0x23, 0x55, 0xD5, 0xBD, 0x7B, 0x67, 0x60, 0xFE, 0x06,
0x7B, 0xCC, 0xB8, 0x6B, 0xC9, 0x00, 0x81, 0xAE, 0xCB, 0xEC, 0x91,
@@ -1183,24 +1183,24 @@ const Fq12ElemStr FfElementTest::fq12_multi_exp_base_4[4] = {
};
const BigNumStr FfElementTest::fq12_multi_exp_exp_4[4] = {
{
- 0x14, 0x92, 0xD1, 0x1F, 0xAC, 0x90, 0x4D, 0xC3, 0x3E, 0xB8, 0xA7, 0xFE,
- 0x35, 0x98, 0xDA, 0x94, 0xD6, 0xF3, 0x27, 0x29, 0x4B, 0x70, 0xCF, 0x0F,
- 0xDA, 0x14, 0x97, 0xA1, 0x9B, 0x6B, 0x24, 0x08,
+ 0x14, 0x92, 0xD1, 0x1F, 0xAC, 0x90, 0x4D, 0xC3, 0x3E, 0xB8, 0xA7,
+ 0xFE, 0x35, 0x98, 0xDA, 0x94, 0xD6, 0xF3, 0x27, 0x29, 0x4B, 0x70,
+ 0xCF, 0x0F, 0xDA, 0x14, 0x97, 0xA1, 0x9B, 0x6B, 0x24, 0x08,
},
{
- 0x76, 0x8D, 0xE5, 0xC2, 0xAB, 0x78, 0xD9, 0x76, 0x98, 0xFF, 0x92, 0xEA,
- 0x95, 0x58, 0xC5, 0x0C, 0x6F, 0x1B, 0x35, 0xC4, 0xBF, 0x4A, 0x9E, 0xC2,
- 0x6A, 0xEC, 0xE2, 0xF6, 0xAF, 0xEB, 0xAC, 0x06,
+ 0x76, 0x8D, 0xE5, 0xC2, 0xAB, 0x78, 0xD9, 0x76, 0x98, 0xFF, 0x92,
+ 0xEA, 0x95, 0x58, 0xC5, 0x0C, 0x6F, 0x1B, 0x35, 0xC4, 0xBF, 0x4A,
+ 0x9E, 0xC2, 0x6A, 0xEC, 0xE2, 0xF6, 0xAF, 0xEB, 0xAC, 0x06,
},
{
- 0x50, 0x38, 0x60, 0x31, 0xAB, 0x05, 0xCC, 0xB1, 0xC2, 0x06, 0xA0, 0xD7,
- 0x92, 0x12, 0xBD, 0x17, 0x81, 0xB9, 0x7E, 0x07, 0x9B, 0xD4, 0x3B, 0x2D,
- 0x3C, 0x15, 0x3A, 0x5A, 0xF1, 0xC0, 0xC4, 0x75,
+ 0x50, 0x38, 0x60, 0x31, 0xAB, 0x05, 0xCC, 0xB1, 0xC2, 0x06, 0xA0,
+ 0xD7, 0x92, 0x12, 0xBD, 0x17, 0x81, 0xB9, 0x7E, 0x07, 0x9B, 0xD4,
+ 0x3B, 0x2D, 0x3C, 0x15, 0x3A, 0x5A, 0xF1, 0xC0, 0xC4, 0x75,
},
{
- 0xA1, 0x3F, 0xEA, 0x99, 0x7E, 0xC7, 0x65, 0xF5, 0x41, 0xA6, 0xD6, 0xD3,
- 0x77, 0xEC, 0x27, 0xF8, 0x6C, 0x18, 0x28, 0x69, 0x97, 0x08, 0x0E, 0x63,
- 0x5A, 0xDA, 0xFE, 0x9F, 0xD1, 0x4A, 0x61, 0x4F,
+ 0xA1, 0x3F, 0xEA, 0x99, 0x7E, 0xC7, 0x65, 0xF5, 0x41, 0xA6, 0xD6,
+ 0xD3, 0x77, 0xEC, 0x27, 0xF8, 0x6C, 0x18, 0x28, 0x69, 0x97, 0x08,
+ 0x0E, 0x63, 0x5A, 0xDA, 0xFE, 0x9F, 0xD1, 0x4A, 0x61, 0x4F,
},
};
const Fq12ElemStr FfElementTest::fq12_multi_exp_res_4 = {
@@ -1241,38 +1241,38 @@ const Fq12ElemStr FfElementTest::fq12_multi_exp_res_4 = {
0x07, 0xD4, 0x39, 0xD2, 0x7D, 0x1A, 0x0C, 0xEF, 0xF2, 0x84, 0x84,
0x22, 0x8A, 0xB1, 0x80, 0x0D, 0xDC, 0x64, 0x86, 0xFD, 0x70}}}}}}};
const FqElemStr FfElementTest::fq_multi_exp_base_5[5] = {
- {0x7B, 0x26, 0x96, 0x84, 0x04, 0x0D, 0x6F, 0x10, 0xAA, 0x7F, 0xD0, 0x0C,
- 0x41, 0x3A, 0x68, 0x48, 0xBF, 0x3D, 0xB5, 0xCE, 0x3A, 0x9C, 0xA9, 0x10,
- 0xA4, 0x67, 0x7C, 0xC0, 0x41, 0x52, 0xCA, 0xE7},
- {0x2E, 0xD9, 0xEF, 0x86, 0xB6, 0x32, 0x72, 0x89, 0x37, 0xCF, 0x16, 0xCE,
- 0x27, 0x15, 0x7A, 0x95, 0xCF, 0x94, 0x1B, 0xF3, 0xCE, 0x49, 0x20, 0x29,
- 0x9A, 0x61, 0x2E, 0x0A, 0xF5, 0xE1, 0xDC, 0x9F},
- {0xE0, 0x19, 0x37, 0x44, 0xA7, 0x45, 0x49, 0x7E, 0x19, 0x02, 0x09, 0x78,
- 0xBE, 0xA4, 0x65, 0x60, 0x7A, 0xF5, 0xC8, 0xAF, 0x97, 0x5E, 0xDA, 0x3A,
- 0xB4, 0x16, 0x70, 0x31, 0xE3, 0xB4, 0x18, 0xA8},
- {0xBC, 0x92, 0x29, 0x92, 0x14, 0xD3, 0x3F, 0xB8, 0xB8, 0x8C, 0x41, 0xDF,
- 0xC5, 0xA1, 0xCA, 0x77, 0xE5, 0x73, 0xFE, 0xA7, 0xAC, 0x81, 0x66, 0x11,
- 0x5A, 0x6D, 0x7D, 0x97, 0x13, 0x92, 0x8D, 0x1D},
- {0xE1, 0xA0, 0x0D, 0xDC, 0x8F, 0x20, 0xF5, 0x2D, 0x1D, 0x1F, 0xBD, 0x24,
- 0x8C, 0xC2, 0x26, 0x06, 0x89, 0xE9, 0x46, 0xA9, 0xD2, 0x44, 0x8F, 0x1A,
- 0x8D, 0xAF, 0x20, 0x73, 0x60, 0x0B, 0x66, 0x9C}};
+ {0x7B, 0x26, 0x96, 0x84, 0x04, 0x0D, 0x6F, 0x10, 0xAA, 0x7F, 0xD0,
+ 0x0C, 0x41, 0x3A, 0x68, 0x48, 0xBF, 0x3D, 0xB5, 0xCE, 0x3A, 0x9C,
+ 0xA9, 0x10, 0xA4, 0x67, 0x7C, 0xC0, 0x41, 0x52, 0xCA, 0xE7},
+ {0x2E, 0xD9, 0xEF, 0x86, 0xB6, 0x32, 0x72, 0x89, 0x37, 0xCF, 0x16,
+ 0xCE, 0x27, 0x15, 0x7A, 0x95, 0xCF, 0x94, 0x1B, 0xF3, 0xCE, 0x49,
+ 0x20, 0x29, 0x9A, 0x61, 0x2E, 0x0A, 0xF5, 0xE1, 0xDC, 0x9F},
+ {0xE0, 0x19, 0x37, 0x44, 0xA7, 0x45, 0x49, 0x7E, 0x19, 0x02, 0x09,
+ 0x78, 0xBE, 0xA4, 0x65, 0x60, 0x7A, 0xF5, 0xC8, 0xAF, 0x97, 0x5E,
+ 0xDA, 0x3A, 0xB4, 0x16, 0x70, 0x31, 0xE3, 0xB4, 0x18, 0xA8},
+ {0xBC, 0x92, 0x29, 0x92, 0x14, 0xD3, 0x3F, 0xB8, 0xB8, 0x8C, 0x41,
+ 0xDF, 0xC5, 0xA1, 0xCA, 0x77, 0xE5, 0x73, 0xFE, 0xA7, 0xAC, 0x81,
+ 0x66, 0x11, 0x5A, 0x6D, 0x7D, 0x97, 0x13, 0x92, 0x8D, 0x1D},
+ {0xE1, 0xA0, 0x0D, 0xDC, 0x8F, 0x20, 0xF5, 0x2D, 0x1D, 0x1F, 0xBD,
+ 0x24, 0x8C, 0xC2, 0x26, 0x06, 0x89, 0xE9, 0x46, 0xA9, 0xD2, 0x44,
+ 0x8F, 0x1A, 0x8D, 0xAF, 0x20, 0x73, 0x60, 0x0B, 0x66, 0x9C}};
const BigNumStr FfElementTest::fq_multi_exp_exp_5[5] = {
- {0x78, 0xE6, 0x3F, 0x42, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD7, 0x6E,
- 0xE9, 0xFF, 0x4F, 0xFF, 0x23, 0xFF, 0x67, 0xB4, 0xED, 0xEE, 0xD7, 0xC6,
- 0xFF, 0x4B, 0x0B, 0x6F, 0x1F, 0xD6, 0xFD, 0x7F},
- {0xA1, 0x87, 0xFF, 0x1B, 0xFF, 0x85, 0x68, 0xFF, 0x1C, 0xFF, 0xD5, 0xFF,
- 0x95, 0x73, 0xFF, 0xFF, 0xFF, 0x9E, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x5E,
- 0x9E, 0x62, 0xFF, 0xFF, 0x97, 0xFF, 0xFF, 0xF3},
- {0x2E, 0xE8, 0x1E, 0x35, 0xFF, 0x82, 0x0B, 0x99, 0xEC, 0x30, 0x2B, 0xCE,
- 0xEC, 0x83, 0x05, 0xFF, 0x9E, 0x3C, 0xFF, 0xFF, 0xA1, 0xFF, 0xFF, 0xFF,
- 0x57, 0x26, 0x5B, 0x6C, 0xFF, 0xE6, 0x94, 0xFF},
- {0xFF, 0xFF, 0xFF, 0xFF, 0x94, 0xFF, 0xFF, 0x79, 0xFC, 0xFF, 0x83, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xA9, 0xFF, 0x2F, 0x6B, 0xD1, 0xE7, 0xFF, 0xFF,
- 0xFF, 0x7C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
- {0x63, 0x53, 0x53, 0xFF, 0xFF, 0xFF, 0x4F, 0xFF, 0xFF, 0xFF, 0x09, 0xFF,
- 0xC0, 0xD8, 0x17, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x45,
- 0xFF, 0x3A, 0xFF, 0xFF, 0xFF, 0xFF, 0x60, 0x06}};
+ {0x78, 0xE6, 0x3F, 0x42, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD7,
+ 0x6E, 0xE9, 0xFF, 0x4F, 0xFF, 0x23, 0xFF, 0x67, 0xB4, 0xED, 0xEE,
+ 0xD7, 0xC6, 0xFF, 0x4B, 0x0B, 0x6F, 0x1F, 0xD6, 0xFD, 0x7F},
+ {0xA1, 0x87, 0xFF, 0x1B, 0xFF, 0x85, 0x68, 0xFF, 0x1C, 0xFF, 0xD5,
+ 0xFF, 0x95, 0x73, 0xFF, 0xFF, 0xFF, 0x9E, 0x7E, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x5E, 0x9E, 0x62, 0xFF, 0xFF, 0x97, 0xFF, 0xFF, 0xF3},
+ {0x2E, 0xE8, 0x1E, 0x35, 0xFF, 0x82, 0x0B, 0x99, 0xEC, 0x30, 0x2B,
+ 0xCE, 0xEC, 0x83, 0x05, 0xFF, 0x9E, 0x3C, 0xFF, 0xFF, 0xA1, 0xFF,
+ 0xFF, 0xFF, 0x57, 0x26, 0x5B, 0x6C, 0xFF, 0xE6, 0x94, 0xFF},
+ {0xFF, 0xFF, 0xFF, 0xFF, 0x94, 0xFF, 0xFF, 0x79, 0xFC, 0xFF, 0x83,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA9, 0xFF, 0x2F, 0x6B, 0xD1, 0xE7,
+ 0xFF, 0xFF, 0xFF, 0x7C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
+ {0x63, 0x53, 0x53, 0xFF, 0xFF, 0xFF, 0x4F, 0xFF, 0xFF, 0xFF, 0x09,
+ 0xFF, 0xC0, 0xD8, 0x17, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x45, 0xFF, 0x3A, 0xFF, 0xFF, 0xFF, 0xFF, 0x60, 0x06}};
const FqElemStr FfElementTest::fq_multi_exp_res_5 = {
0x8F, 0x6D, 0x54, 0xCA, 0x00, 0x85, 0xD8, 0x78, 0xA4, 0x45, 0x36,
@@ -1280,43 +1280,43 @@ const FqElemStr FfElementTest::fq_multi_exp_res_5 = {
0x99, 0xD9, 0xD3, 0x0A, 0x0E, 0x86, 0x98, 0xC2, 0xA7, 0x97,
};
const FqElemStr FfElementTest::fq_multi_exp_base_6[6] = {
- {0x75, 0x18, 0x6A, 0x3D, 0xCC, 0x76, 0x33, 0x92, 0xD0, 0x57, 0xDA, 0xE0,
- 0x37, 0x6F, 0x71, 0xD5, 0x9E, 0x7E, 0x65, 0xED, 0xD7, 0xFD, 0x82, 0xC0,
- 0x6C, 0x83, 0x60, 0x30, 0xC1, 0xD3, 0x3D, 0x4D},
- {0xF5, 0x3A, 0x20, 0xAB, 0x22, 0x47, 0x07, 0xAE, 0x71, 0xC1, 0x91, 0x73,
- 0xEF, 0x1F, 0x1D, 0x76, 0x2E, 0xEE, 0x0D, 0xDE, 0xD9, 0xF8, 0x5C, 0x85,
- 0xC7, 0x5B, 0x93, 0x88, 0xF6, 0xFF, 0x4C, 0xA5},
- {0x21, 0xB3, 0x5E, 0xE8, 0xD2, 0xDA, 0x14, 0x1C, 0xB5, 0x2C, 0xFC, 0x61,
- 0x9D, 0xEB, 0x65, 0x87, 0xBB, 0x5B, 0xBC, 0xFD, 0x37, 0x54, 0x6B, 0xDC,
- 0xD9, 0xFA, 0x7A, 0xCD, 0x18, 0x7E, 0x8B, 0x89},
- {0x70, 0xB7, 0x19, 0x42, 0xB4, 0x41, 0x2C, 0x1B, 0xBD, 0x7B, 0x25, 0x06,
- 0xA2, 0x95, 0xB5, 0xB6, 0x70, 0xDF, 0x58, 0x71, 0xCA, 0x09, 0x12, 0x66,
- 0x5A, 0x7B, 0xF0, 0x5F, 0x43, 0x69, 0x32, 0xF6},
- {0x3D, 0x57, 0xE8, 0x3F, 0x1E, 0x39, 0x2B, 0xE5, 0xD0, 0xCF, 0xA9, 0xC8,
- 0x72, 0x10, 0x7F, 0xC5, 0x4F, 0xAE, 0xE9, 0x73, 0x28, 0x4C, 0xFC, 0x3F,
- 0xD5, 0xFF, 0xE8, 0xCF, 0x2C, 0xEB, 0x33, 0xD3},
- {0x51, 0x80, 0x15, 0x1C, 0xE6, 0x9C, 0x4B, 0x80, 0x40, 0xBA, 0x40, 0x29,
- 0x3A, 0x86, 0xA8, 0xB2, 0x66, 0x08, 0x97, 0x8D, 0xEB, 0x8B, 0xA7, 0x93,
- 0xE3, 0x49, 0xC6, 0xC0, 0x46, 0x93, 0xC1, 0x75}};
+ {0x75, 0x18, 0x6A, 0x3D, 0xCC, 0x76, 0x33, 0x92, 0xD0, 0x57, 0xDA,
+ 0xE0, 0x37, 0x6F, 0x71, 0xD5, 0x9E, 0x7E, 0x65, 0xED, 0xD7, 0xFD,
+ 0x82, 0xC0, 0x6C, 0x83, 0x60, 0x30, 0xC1, 0xD3, 0x3D, 0x4D},
+ {0xF5, 0x3A, 0x20, 0xAB, 0x22, 0x47, 0x07, 0xAE, 0x71, 0xC1, 0x91,
+ 0x73, 0xEF, 0x1F, 0x1D, 0x76, 0x2E, 0xEE, 0x0D, 0xDE, 0xD9, 0xF8,
+ 0x5C, 0x85, 0xC7, 0x5B, 0x93, 0x88, 0xF6, 0xFF, 0x4C, 0xA5},
+ {0x21, 0xB3, 0x5E, 0xE8, 0xD2, 0xDA, 0x14, 0x1C, 0xB5, 0x2C, 0xFC,
+ 0x61, 0x9D, 0xEB, 0x65, 0x87, 0xBB, 0x5B, 0xBC, 0xFD, 0x37, 0x54,
+ 0x6B, 0xDC, 0xD9, 0xFA, 0x7A, 0xCD, 0x18, 0x7E, 0x8B, 0x89},
+ {0x70, 0xB7, 0x19, 0x42, 0xB4, 0x41, 0x2C, 0x1B, 0xBD, 0x7B, 0x25,
+ 0x06, 0xA2, 0x95, 0xB5, 0xB6, 0x70, 0xDF, 0x58, 0x71, 0xCA, 0x09,
+ 0x12, 0x66, 0x5A, 0x7B, 0xF0, 0x5F, 0x43, 0x69, 0x32, 0xF6},
+ {0x3D, 0x57, 0xE8, 0x3F, 0x1E, 0x39, 0x2B, 0xE5, 0xD0, 0xCF, 0xA9,
+ 0xC8, 0x72, 0x10, 0x7F, 0xC5, 0x4F, 0xAE, 0xE9, 0x73, 0x28, 0x4C,
+ 0xFC, 0x3F, 0xD5, 0xFF, 0xE8, 0xCF, 0x2C, 0xEB, 0x33, 0xD3},
+ {0x51, 0x80, 0x15, 0x1C, 0xE6, 0x9C, 0x4B, 0x80, 0x40, 0xBA, 0x40,
+ 0x29, 0x3A, 0x86, 0xA8, 0xB2, 0x66, 0x08, 0x97, 0x8D, 0xEB, 0x8B,
+ 0xA7, 0x93, 0xE3, 0x49, 0xC6, 0xC0, 0x46, 0x93, 0xC1, 0x75}};
const BigNumStr FfElementTest::fq_multi_exp_exp_6[6] = {
- {0xFF, 0xFF, 0xFF, 0x49, 0x50, 0xFF, 0x19, 0xFF, 0xEB, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x28, 0x4A, 0x0E, 0xFF, 0x74, 0xFF, 0xC7, 0xFF, 0xD9, 0x81, 0xFF,
- 0xFF, 0xFF, 0xD5, 0x2C, 0xFF, 0xFF, 0xFF, 0xAE},
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0C, 0x03, 0xFF, 0x95, 0xFF, 0x11, 0x9D, 0xFF, 0x9B, 0xFF, 0xFF,
- 0x68, 0x44, 0xFF, 0xC9, 0xFF, 0x10, 0xC7, 0xBF},
- {0x64, 0xFF, 0x89, 0x4A, 0xFF, 0x20, 0xFF, 0xE7, 0xFF, 0x36, 0x23, 0xDD,
- 0xFF, 0xFF, 0xFC, 0xFF, 0x6B, 0xFF, 0xFF, 0xFF, 0xFF, 0x48, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x94, 0xD3, 0x59, 0xBE},
- {0x0F, 0xFF, 0x76, 0xA5, 0x9E, 0x02, 0x9B, 0xFF, 0xA1, 0xFF, 0xC2, 0xFF,
- 0x9D, 0xFF, 0x23, 0xFF, 0xFF, 0xFF, 0xFF, 0x6B, 0x81, 0x2A, 0xFF, 0x98,
- 0xFF, 0xFF, 0xB9, 0xFF, 0xB7, 0x78, 0xE6, 0xFF},
- {0xAF, 0xF3, 0xFF, 0x3C, 0xA8, 0xFF, 0xB9, 0x3A, 0xFF, 0xFF, 0xFF, 0x70,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x85, 0xFF, 0xFF, 0x52,
- 0xFF, 0x41, 0x10, 0x62, 0xFF, 0x51, 0x35, 0xFF},
- {0xFF, 0xFF, 0xFF, 0xFF, 0xD3, 0xC3, 0xD9, 0xFF, 0xFF, 0x3A, 0x44, 0x88,
- 0x04, 0xFF, 0x0B, 0xFF, 0xFF, 0xFF, 0x64, 0xFF, 0xFF, 0x52, 0xFF, 0x7D,
- 0x6B, 0x24, 0x6E, 0xFF, 0xFF, 0xFF, 0xA7, 0x71}};
+ {0xFF, 0xFF, 0xFF, 0x49, 0x50, 0xFF, 0x19, 0xFF, 0xEB, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x28, 0x4A, 0x0E, 0xFF, 0x74, 0xFF, 0xC7, 0xFF, 0xD9,
+ 0x81, 0xFF, 0xFF, 0xFF, 0xD5, 0x2C, 0xFF, 0xFF, 0xFF, 0xAE},
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x0C, 0x03, 0xFF, 0x95, 0xFF, 0x11, 0x9D, 0xFF, 0x9B,
+ 0xFF, 0xFF, 0x68, 0x44, 0xFF, 0xC9, 0xFF, 0x10, 0xC7, 0xBF},
+ {0x64, 0xFF, 0x89, 0x4A, 0xFF, 0x20, 0xFF, 0xE7, 0xFF, 0x36, 0x23,
+ 0xDD, 0xFF, 0xFF, 0xFC, 0xFF, 0x6B, 0xFF, 0xFF, 0xFF, 0xFF, 0x48,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x94, 0xD3, 0x59, 0xBE},
+ {0x0F, 0xFF, 0x76, 0xA5, 0x9E, 0x02, 0x9B, 0xFF, 0xA1, 0xFF, 0xC2,
+ 0xFF, 0x9D, 0xFF, 0x23, 0xFF, 0xFF, 0xFF, 0xFF, 0x6B, 0x81, 0x2A,
+ 0xFF, 0x98, 0xFF, 0xFF, 0xB9, 0xFF, 0xB7, 0x78, 0xE6, 0xFF},
+ {0xAF, 0xF3, 0xFF, 0x3C, 0xA8, 0xFF, 0xB9, 0x3A, 0xFF, 0xFF, 0xFF,
+ 0x70, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x85, 0xFF,
+ 0xFF, 0x52, 0xFF, 0x41, 0x10, 0x62, 0xFF, 0x51, 0x35, 0xFF},
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xD3, 0xC3, 0xD9, 0xFF, 0xFF, 0x3A, 0x44,
+ 0x88, 0x04, 0xFF, 0x0B, 0xFF, 0xFF, 0xFF, 0x64, 0xFF, 0xFF, 0x52,
+ 0xFF, 0x7D, 0x6B, 0x24, 0x6E, 0xFF, 0xFF, 0xFF, 0xA7, 0x71}};
const FqElemStr FfElementTest::fq_multi_exp_res_6 = {
0xFB, 0x89, 0x4F, 0xBB, 0x91, 0xEE, 0xD6, 0x57, 0x2D, 0x34, 0xF9,
0x0B, 0xE3, 0xEB, 0x71, 0x1D, 0x63, 0x74, 0x96, 0x3B, 0xD4, 0x02,
@@ -1374,21 +1374,21 @@ const Fq6ElemStr FfElementTest::epid11_GT_multi_exp_base_3[3] = {
0x67, 0x8D, 0x1E, 0x07, 0xC7, 0x46, 0x87, 0xF6, 0x50, 0xC3, 0xA6, 0x6B}};
const std::vector<uint8_t> FfElementTest::epid11_GT_multi_exp_exp_3[3] = {
- {0x00, 0x00, 0xAF, 0x5B, 0x22, 0x71, 0x98, 0xB6, 0xEB, 0x67, 0x3D, 0x94,
- 0x4A, 0xB6, 0x5E, 0x99, 0x81, 0xC5, 0x96, 0x91, 0x55, 0xBA, 0x2F, 0x16,
- 0x01, 0x4E, 0xE1, 0x25, 0xAD, 0xCA, 0x94, 0x88, 0x60, 0x3B, 0xA2, 0x56,
- 0x0A, 0x94, 0x0B, 0x2C, 0x3E, 0xD0, 0x8F, 0x15, 0x07, 0x3D, 0xD5, 0xBE,
- 0x72, 0x3E, 0x2D, 0x06, 0x74, 0xFF, 0x06, 0xED, 0x47, 0x28, 0x08, 0x0C,
- 0xA0, 0x6F, 0xDB, 0x75, 0x55, 0x32, 0xDC, 0x97, 0x47, 0x60, 0x4E, 0x6F,
- 0xB4, 0x29, 0x89, 0x0C},
-
- {0x00, 0x00, 0x01, 0xB8, 0x40, 0xBB, 0xE1, 0x1C, 0x84, 0x8E, 0x02, 0xC0,
- 0xEF, 0x69, 0x84, 0x90, 0xED, 0xEB, 0x99, 0x94, 0xBC, 0x79, 0x48, 0xC8,
- 0x08, 0x3C, 0x25, 0xDA, 0xAC, 0xFF, 0x3A, 0xDD},
-
- {0x00, 0x00, 0x37, 0x1E, 0xCD, 0x0F, 0x66, 0x09, 0x7D, 0x33, 0x9A, 0xDC,
- 0x47, 0x28, 0xF7, 0x91, 0xF3, 0xC2, 0xBC, 0x3A, 0xA9, 0x05, 0x62, 0xFC,
- 0xDD, 0x8C, 0x65, 0xC2, 0xA8, 0x14, 0x55, 0x52},
+ {0x00, 0x00, 0xAF, 0x5B, 0x22, 0x71, 0x98, 0xB6, 0xEB, 0x67, 0x3D,
+ 0x94, 0x4A, 0xB6, 0x5E, 0x99, 0x81, 0xC5, 0x96, 0x91, 0x55, 0xBA,
+ 0x2F, 0x16, 0x01, 0x4E, 0xE1, 0x25, 0xAD, 0xCA, 0x94, 0x88, 0x60,
+ 0x3B, 0xA2, 0x56, 0x0A, 0x94, 0x0B, 0x2C, 0x3E, 0xD0, 0x8F, 0x15,
+ 0x07, 0x3D, 0xD5, 0xBE, 0x72, 0x3E, 0x2D, 0x06, 0x74, 0xFF, 0x06,
+ 0xED, 0x47, 0x28, 0x08, 0x0C, 0xA0, 0x6F, 0xDB, 0x75, 0x55, 0x32,
+ 0xDC, 0x97, 0x47, 0x60, 0x4E, 0x6F, 0xB4, 0x29, 0x89, 0x0C},
+
+ {0x00, 0x00, 0x01, 0xB8, 0x40, 0xBB, 0xE1, 0x1C, 0x84, 0x8E, 0x02,
+ 0xC0, 0xEF, 0x69, 0x84, 0x90, 0xED, 0xEB, 0x99, 0x94, 0xBC, 0x79,
+ 0x48, 0xC8, 0x08, 0x3C, 0x25, 0xDA, 0xAC, 0xFF, 0x3A, 0xDD},
+
+ {0x00, 0x00, 0x37, 0x1E, 0xCD, 0x0F, 0x66, 0x09, 0x7D, 0x33, 0x9A,
+ 0xDC, 0x47, 0x28, 0xF7, 0x91, 0xF3, 0xC2, 0xBC, 0x3A, 0xA9, 0x05,
+ 0x62, 0xFC, 0xDD, 0x8C, 0x65, 0xC2, 0xA8, 0x14, 0x55, 0x52},
};
const Fq6ElemStr FfElementTest::epid11_GT_multi_exp_res_3 = {
diff --git a/epid/common/math/unittests/finitefield-test.cc b/epid/common/math/unittests/finitefield-test.cc
index b6dcbb8..b39cd5c 100644
--- a/epid/common/math/unittests/finitefield-test.cc
+++ b/epid/common/math/unittests/finitefield-test.cc
@@ -23,8 +23,8 @@
#include "gtest/gtest.h"
#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
extern "C" {
#include "epid/common/math/finitefield.h"
@@ -36,58 +36,58 @@ extern "C" {
namespace {
/// Intel(R) EPID 2.0 parameters q, beta, xi and v
-BigNumStr q = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5,
- 0xF2, 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB,
- 0x12, 0x98, 0x0A, 0x82, 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3,
- 0x30, 0x13}};
-FqElemStr beta = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5,
- 0xF2, 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB,
- 0x12, 0x98, 0x0A, 0x82, 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3,
- 0x30, 0x12}};
+BigNumStr q = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD,
+ 0x46, 0xE5, 0xF2, 0x5E, 0xEE, 0x71, 0xA4, 0x9F,
+ 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
+ 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x13}};
+FqElemStr beta = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD,
+ 0x46, 0xE5, 0xF2, 0x5E, 0xEE, 0x71, 0xA4, 0x9F,
+ 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
+ 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x12}};
Fq2ElemStr xi = {
- {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
+ {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
Fq6ElemStr v = {
- {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
-
-FqElemStr qnr = {{0x08, 0x66, 0xA7, 0x67, 0x36, 0x6E, 0x62, 0x71, 0xB7, 0xA6,
- 0x52, 0x94, 0x8F, 0xFB, 0x25, 0x9E, 0xE6, 0x4F, 0x25, 0xE5,
- 0x26, 0x9A, 0x2B, 0x6E, 0x7E, 0xF8, 0xA6, 0x39, 0xAE, 0x46,
- 0xAA, 0x24}};
+ {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
+
+FqElemStr qnr = {{0x08, 0x66, 0xA7, 0x67, 0x36, 0x6E, 0x62, 0x71,
+ 0xB7, 0xA6, 0x52, 0x94, 0x8F, 0xFB, 0x25, 0x9E,
+ 0xE6, 0x4F, 0x25, 0xE5, 0x26, 0x9A, 0x2B, 0x6E,
+ 0x7E, 0xF8, 0xA6, 0x39, 0xAE, 0x46, 0xAA, 0x24}};
const BigNumStr coeffs[3] = {
- {{{0x02, 0x16, 0x7A, 0x61, 0x53, 0xDD, 0xF6, 0xE2, 0x89, 0x15, 0xA0, 0x94,
- 0xF1, 0xB5, 0xDC, 0x65, 0x21, 0x15, 0x62, 0xE1, 0x7D, 0xC5, 0x43, 0x89,
- 0xEE, 0xB4, 0xEF, 0xC8, 0xA0, 0x8E, 0x34, 0x0F}}},
+ {{{0x02, 0x16, 0x7A, 0x61, 0x53, 0xDD, 0xF6, 0xE2, 0x89, 0x15, 0xA0,
+ 0x94, 0xF1, 0xB5, 0xDC, 0x65, 0x21, 0x15, 0x62, 0xE1, 0x7D, 0xC5,
+ 0x43, 0x89, 0xEE, 0xB4, 0xEF, 0xC8, 0xA0, 0x8E, 0x34, 0x0F}}},
- {{{0x04, 0x82, 0x27, 0xE1, 0xEB, 0x98, 0x64, 0xC2, 0x8D, 0x8F, 0xDD, 0x0E,
- 0x82, 0x40, 0xAE, 0xD4, 0x31, 0x63, 0xD6, 0x46, 0x32, 0x16, 0x85, 0x7A,
- 0xB7, 0x18, 0x68, 0xB8, 0x17, 0x02, 0x81, 0xA6}}},
+ {{{0x04, 0x82, 0x27, 0xE1, 0xEB, 0x98, 0x64, 0xC2, 0x8D, 0x8F, 0xDD,
+ 0x0E, 0x82, 0x40, 0xAE, 0xD4, 0x31, 0x63, 0xD6, 0x46, 0x32, 0x16,
+ 0x85, 0x7A, 0xB7, 0x18, 0x68, 0xB8, 0x17, 0x02, 0x81, 0xA6}}},
- {{{0x06, 0x20, 0x76, 0xE8, 0x54, 0x54, 0x53, 0xB4, 0xA9, 0xD8, 0x44, 0x4B,
- 0xAA, 0xFB, 0x1C, 0xFD, 0xAE, 0x15, 0xCA, 0x29, 0x79, 0xA6, 0x24, 0xA4,
- 0x0A, 0xF6, 0x1E, 0xAC, 0xED, 0xFB, 0x10, 0x41}}}};
+ {{{0x06, 0x20, 0x76, 0xE8, 0x54, 0x54, 0x53, 0xB4, 0xA9, 0xD8, 0x44,
+ 0x4B, 0xAA, 0xFB, 0x1C, 0xFD, 0xAE, 0x15, 0xCA, 0x29, 0x79, 0xA6,
+ 0x24, 0xA4, 0x0A, 0xF6, 0x1E, 0xAC, 0xED, 0xFB, 0x10, 0x41}}}};
TEST(FiniteField, DeleteWorksGivenNewlyCreatedFiniteField) {
FiniteField* finitefield = nullptr;
diff --git a/epid/common/math/unittests/octstrconvert-test.cc b/epid/common/math/unittests/octstrconvert-test.cc
index 0794f9e..129c907 100644
--- a/epid/common/math/unittests/octstrconvert-test.cc
+++ b/epid/common/math/unittests/octstrconvert-test.cc
@@ -22,8 +22,8 @@
* math libraries. These tests can be omitted if you do not use this function.
*/
-#include "epid/common/stdtypes.h"
#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/common/stdtypes.h"
#include "gtest/gtest.h"
extern "C" {
diff --git a/epid/common/math/unittests/pairing-test.cc b/epid/common/math/unittests/pairing-test.cc
index 04783a2..5eac8c2 100644
--- a/epid/common/math/unittests/pairing-test.cc
+++ b/epid/common/math/unittests/pairing-test.cc
@@ -24,12 +24,12 @@
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
-#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common-testhelper/epid_params-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
-#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
extern "C" {
#include "epid/common/math/pairing.h"
diff --git a/epid/common/math/unittests/printutils-test.cc b/epid/common/math/unittests/printutils-test.cc
index f3c3fde..f012f9d 100644
--- a/epid/common/math/unittests/printutils-test.cc
+++ b/epid/common/math/unittests/printutils-test.cc
@@ -32,12 +32,12 @@ extern "C" {
#include "epid/common/math/bignum.h"
#include "epid/common/math/printutils.h"
}
+#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
+#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
+#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
-#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
-#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
-#include "epid/common-testhelper/bignum_wrapper-testhelper.h"
namespace {
@@ -126,20 +126,20 @@ class PrintutilsTest : public ::testing::Test {
// set h = 2q - p, aka cofactor
std::vector<uint8_t> cofactor_str(
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xfc, 0xf0, 0xcd, 0x46, 0xe5, 0xf2, 0x5e, 0xee, 0x71, 0xa4, 0xa0,
- 0x0c, 0xdc, 0x65, 0xfb, 0x12, 0x96, 0x82, 0xea, 0xb0, 0x25, 0x08, 0x4a,
- 0x8c, 0x9b, 0x10, 0x19});
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf0, 0xcd, 0x46, 0xe5, 0xf2, 0x5e,
+ 0xee, 0x71, 0xa4, 0xa0, 0x0c, 0xdc, 0x65, 0xfb, 0x12, 0x96, 0x82,
+ 0xea, 0xb0, 0x25, 0x08, 0x4a, 0x8c, 0x9b, 0x10, 0x19});
// set n = p * h, AKA order
std::vector<uint8_t> order_str(
- {0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xe1, 0x9a, 0x8d, 0xcb, 0xe4, 0xc7,
- 0x38, 0xfa, 0x9b, 0x98, 0x4d, 0x1c, 0x12, 0x9f, 0x64, 0x97, 0xe8, 0x54,
- 0xa3, 0x0a, 0x81, 0xac, 0x42, 0xf9, 0x39, 0x16, 0xa7, 0x70, 0x21, 0xdc,
- 0xfb, 0xb6, 0xe7, 0x7e, 0x1f, 0x5b, 0x55, 0xcc, 0x4e, 0x84, 0xcd, 0x19,
- 0x4f, 0x49, 0x20, 0x94, 0xb5, 0xd8, 0x12, 0xa0, 0x2e, 0x7f, 0x40, 0x13,
- 0xb2, 0xfa, 0xa1, 0x45});
+ {0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xe1, 0x9a, 0x8d, 0xcb, 0xe4,
+ 0xc7, 0x38, 0xfa, 0x9b, 0x98, 0x4d, 0x1c, 0x12, 0x9f, 0x64, 0x97,
+ 0xe8, 0x54, 0xa3, 0x0a, 0x81, 0xac, 0x42, 0xf9, 0x39, 0x16, 0xa7,
+ 0x70, 0x21, 0xdc, 0xfb, 0xb6, 0xe7, 0x7e, 0x1f, 0x5b, 0x55, 0xcc,
+ 0x4e, 0x84, 0xcd, 0x19, 0x4f, 0x49, 0x20, 0x94, 0xb5, 0xd8, 0x12,
+ 0xa0, 0x2e, 0x7f, 0x40, 0x13, 0xb2, 0xfa, 0xa1, 0x45});
// Compute xi' = Fq2.inverse(xi).
FfElementObj inv_xi(&fq2);
@@ -172,35 +172,35 @@ const FpElemStr PrintutilsTest::p_str = {
0x5E, 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99,
0x92, 0x1A, 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x00};
const FqElemStr PrintutilsTest::beta_str = {
- {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98, 0x0A, 0x82,
- 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x12}};
+ {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2,
+ 0x5E, 0xEE, 0x71, 0xA4, 0x9F, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x98,
+ 0x0A, 0x82, 0xD3, 0x29, 0x2D, 0xDB, 0xAE, 0xD3, 0x30, 0x12}};
const Fq2ElemStr PrintutilsTest::xi_str = {
- {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
+ {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}}};
const Fq6ElemStr PrintutilsTest::v_str = {
- {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
+ {{{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}}};
const Fq12ElemStr PrintutilsTest::a_str = {
0xba, 0x10, 0x1f, 0xf6, 0x46, 0x8b, 0xe9, 0x32, 0x4f, 0xc0, 0xa5, 0x01,
0xad, 0x5e, 0xe2, 0x31, 0x16, 0x29, 0x96, 0xed, 0xa7, 0xde, 0x4c, 0xe1,
@@ -236,60 +236,60 @@ const Fq12ElemStr PrintutilsTest::a_str = {
0xba, 0x6e, 0x2c, 0x36, 0xaf, 0x35, 0x1b, 0x75, 0x6d, 0x17, 0xdc, 0x8e,
};
const FqElemStr PrintutilsTest::a1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}};
const FqElemStr PrintutilsTest::b1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03}}};
const BigNumStr PrintutilsTest::h1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
const G1ElemStr PrintutilsTest::g1_str = {
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
const G2ElemStr PrintutilsTest::g2_str = {
- {{{{0xE2, 0x01, 0x71, 0xC5, 0x4A, 0xA3, 0xDA, 0x05, 0x21, 0x67, 0x04, 0x13,
- 0x74, 0x3C, 0xCF, 0x22, 0xD2, 0x5D, 0x52, 0x68, 0x3D, 0x32, 0x47, 0x0E,
- 0xF6, 0x02, 0x13, 0x43, 0xBF, 0x28, 0x23, 0x94}}},
- {{{0x59, 0x2D, 0x1E, 0xF6, 0x53, 0xA8, 0x5A, 0x80, 0x46, 0xCC, 0xDC, 0x25,
- 0x4F, 0xBB, 0x56, 0x56, 0x43, 0x43, 0x3B, 0xF6, 0x28, 0x96, 0x53, 0xE2,
- 0x7D, 0xF7, 0xB2, 0x12, 0xBA, 0xA1, 0x89, 0xBE}}}},
- {{{{0xAE, 0x60, 0xA4, 0xE7, 0x51, 0xFF, 0xD3, 0x50, 0xC6, 0x21, 0xE7, 0x03,
- 0x31, 0x28, 0x26, 0xBD, 0x55, 0xE8, 0xB5, 0x9A, 0x4D, 0x91, 0x68, 0x38,
- 0x41, 0x4D, 0xB8, 0x22, 0xDD, 0x23, 0x35, 0xAE}}},
- {{{0x1A, 0xB4, 0x42, 0xF9, 0x89, 0xAF, 0xE5, 0xAD, 0xF8, 0x02, 0x74, 0xF8,
- 0x76, 0x45, 0xE2, 0x53, 0x2C, 0xDC, 0x61, 0x81, 0x90, 0x93, 0xD6, 0x13,
- 0x2C, 0x90, 0xFE, 0x89, 0x51, 0xB9, 0x24, 0x21}}}}};
+ {{{{0xE2, 0x01, 0x71, 0xC5, 0x4A, 0xA3, 0xDA, 0x05, 0x21, 0x67, 0x04,
+ 0x13, 0x74, 0x3C, 0xCF, 0x22, 0xD2, 0x5D, 0x52, 0x68, 0x3D, 0x32,
+ 0x47, 0x0E, 0xF6, 0x02, 0x13, 0x43, 0xBF, 0x28, 0x23, 0x94}}},
+ {{{0x59, 0x2D, 0x1E, 0xF6, 0x53, 0xA8, 0x5A, 0x80, 0x46, 0xCC, 0xDC,
+ 0x25, 0x4F, 0xBB, 0x56, 0x56, 0x43, 0x43, 0x3B, 0xF6, 0x28, 0x96,
+ 0x53, 0xE2, 0x7D, 0xF7, 0xB2, 0x12, 0xBA, 0xA1, 0x89, 0xBE}}}},
+ {{{{0xAE, 0x60, 0xA4, 0xE7, 0x51, 0xFF, 0xD3, 0x50, 0xC6, 0x21, 0xE7,
+ 0x03, 0x31, 0x28, 0x26, 0xBD, 0x55, 0xE8, 0xB5, 0x9A, 0x4D, 0x91,
+ 0x68, 0x38, 0x41, 0x4D, 0xB8, 0x22, 0xDD, 0x23, 0x35, 0xAE}}},
+ {{{0x1A, 0xB4, 0x42, 0xF9, 0x89, 0xAF, 0xE5, 0xAD, 0xF8, 0x02, 0x74,
+ 0xF8, 0x76, 0x45, 0xE2, 0x53, 0x2C, 0xDC, 0x61, 0x81, 0x90, 0x93,
+ 0xD6, 0x13, 0x2C, 0x90, 0xFE, 0x89, 0x51, 0xB9, 0x24, 0x21}}}}};
const G1ElemStr PrintutilsTest::efq_a_str = {
- {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D, 0x52,
- 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A, 0x37, 0xE0,
- 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
- {{{0x78, 0x65, 0x28, 0xCB, 0xAF, 0x07, 0x52, 0x50, 0x55, 0x7A, 0x5F, 0x30,
- 0x0A, 0xC0, 0xB4, 0x6B, 0xEA, 0x6F, 0xE2, 0xF6, 0x6D, 0x96, 0xF7, 0xCD,
- 0xC8, 0xD3, 0x12, 0x7F, 0x1F, 0x3A, 0x8B, 0x42}}}};
+ {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D,
+ 0x52, 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A,
+ 0x37, 0xE0, 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
+ {{{0x78, 0x65, 0x28, 0xCB, 0xAF, 0x07, 0x52, 0x50, 0x55, 0x7A, 0x5F,
+ 0x30, 0x0A, 0xC0, 0xB4, 0x6B, 0xEA, 0x6F, 0xE2, 0xF6, 0x6D, 0x96,
+ 0xF7, 0xCD, 0xC8, 0xD3, 0x12, 0x7F, 0x1F, 0x3A, 0x8B, 0x42}}}};
const G2ElemStr PrintutilsTest::efq2_a_str = {
{
- {0x2F, 0x8C, 0xC7, 0xD7, 0xD4, 0x1E, 0x4A, 0xCB, 0x82, 0x92, 0xC7, 0x9C,
- 0x0F, 0xA2, 0xF2, 0x1B, 0xDF, 0xEA, 0x96, 0x64, 0x8B, 0xA2, 0x32, 0x7C,
- 0xDF, 0xD8, 0x89, 0x10, 0xFD, 0xBB, 0x38, 0xCD},
- {0xB1, 0x23, 0x46, 0x13, 0x4D, 0x9B, 0x8E, 0x8A, 0x95, 0x64, 0xDD, 0x37,
- 0x29, 0x44, 0x1F, 0x76, 0xB5, 0x3A, 0x47, 0xD3, 0xE0, 0x18, 0x1E, 0x60,
- 0xE9, 0x94, 0x13, 0xA4, 0x47, 0xCD, 0xBE, 0x03},
+ {0x2F, 0x8C, 0xC7, 0xD7, 0xD4, 0x1E, 0x4A, 0xCB, 0x82, 0x92, 0xC7,
+ 0x9C, 0x0F, 0xA2, 0xF2, 0x1B, 0xDF, 0xEA, 0x96, 0x64, 0x8B, 0xA2,
+ 0x32, 0x7C, 0xDF, 0xD8, 0x89, 0x10, 0xFD, 0xBB, 0x38, 0xCD},
+ {0xB1, 0x23, 0x46, 0x13, 0x4D, 0x9B, 0x8E, 0x8A, 0x95, 0x64, 0xDD,
+ 0x37, 0x29, 0x44, 0x1F, 0x76, 0xB5, 0x3A, 0x47, 0xD3, 0xE0, 0x18,
+ 0x1E, 0x60, 0xE9, 0x94, 0x13, 0xA4, 0x47, 0xCD, 0xBE, 0x03},
},
{
- {0xD3, 0x67, 0xA5, 0xCC, 0xEF, 0x7B, 0xD1, 0x8D, 0x4A, 0x7F, 0xF1, 0x8F,
- 0x66, 0xCB, 0x5E, 0x86, 0xAC, 0xCB, 0x36, 0x5F, 0x29, 0x90, 0x28, 0x55,
- 0xF0, 0xDC, 0x6E, 0x8B, 0x87, 0xB5, 0xD8, 0x32},
- {0x6C, 0x0A, 0xC5, 0x58, 0xB1, 0x4E, 0xCA, 0x85, 0x44, 0x3E, 0xDE, 0x71,
- 0x9B, 0xC7, 0x90, 0x19, 0x06, 0xD2, 0xA0, 0x4E, 0xC7, 0x33, 0xF4, 0x5C,
- 0xE8, 0x16, 0xE2, 0x67, 0xDB, 0xBF, 0x64, 0x84},
+ {0xD3, 0x67, 0xA5, 0xCC, 0xEF, 0x7B, 0xD1, 0x8D, 0x4A, 0x7F, 0xF1,
+ 0x8F, 0x66, 0xCB, 0x5E, 0x86, 0xAC, 0xCB, 0x36, 0x5F, 0x29, 0x90,
+ 0x28, 0x55, 0xF0, 0xDC, 0x6E, 0x8B, 0x87, 0xB5, 0xD8, 0x32},
+ {0x6C, 0x0A, 0xC5, 0x58, 0xB1, 0x4E, 0xCA, 0x85, 0x44, 0x3E, 0xDE,
+ 0x71, 0x9B, 0xC7, 0x90, 0x19, 0x06, 0xD2, 0xA0, 0x4E, 0xC7, 0x33,
+ 0xF4, 0x5C, 0xE8, 0x16, 0xE2, 0x67, 0xDB, 0xBF, 0x64, 0x84},
},
};
diff --git a/epid/common/math/unittests/tatepairing-test.cc b/epid/common/math/unittests/tatepairing-test.cc
index 91a46c7..8eb6f06 100644
--- a/epid/common/math/unittests/tatepairing-test.cc
+++ b/epid/common/math/unittests/tatepairing-test.cc
@@ -24,8 +24,8 @@
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/1.1/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
extern "C" {
diff --git a/epid/common/src/epid2params.c b/epid/common/src/epid2params.c
index 0d60f53..2679935 100644
--- a/epid/common/src/epid2params.c
+++ b/epid/common/src/epid2params.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -111,6 +111,15 @@ EpidStatus CreateEpid2Params(Epid2Params_** params) {
if (kEpidNoErr != result) {
break;
}
+ result = NewFfElement(internal_param->Fq, &internal_param->b);
+ if (kEpidNoErr != result) {
+ break;
+ }
+ result = ReadFfElement(internal_param->Fq, &params_str.b,
+ sizeof(params_str.b), internal_param->b);
+ if (kEpidNoErr != result) {
+ break;
+ }
result = NewFfElement(internal_param->Fq2, &internal_param->xi);
if (kEpidNoErr != result) {
break;
@@ -178,6 +187,7 @@ EpidStatus CreateEpid2Params(Epid2Params_** params) {
DeleteBigNum(&internal_param->p);
DeleteBigNum(&internal_param->q);
+ DeleteFfElement(&internal_param->b);
DeleteBigNum(&internal_param->t);
DeleteFp(&internal_param->Fp);
@@ -200,6 +210,7 @@ void DeleteEpid2Params(Epid2Params_** epid_params) {
DeleteBigNum(&(*epid_params)->p);
DeleteBigNum(&(*epid_params)->q);
+ DeleteFfElement(&(*epid_params)->b);
DeleteBigNum(&(*epid_params)->t);
DeleteFfElement(&(*epid_params)->xi);
DeleteEcPoint(&(*epid_params)->g1);
@@ -320,9 +331,9 @@ EpidStatus NewG1(Epid2Params const* param, FiniteField* Fq, EcGroup** G1) {
BigNum* cofactor = NULL;
// h = 1;
const BigNumStr h1 = {
- {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
+ {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}};
if (!param || !Fq || !G1) {
return kEpidBadArgErr;
diff --git a/epid/common/src/epid2params.h b/epid/common/src/epid2params.h
index 22978f3..ad2393a 100644
--- a/epid/common/src/epid2params.h
+++ b/epid/common/src/epid2params.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
typedef struct Epid2Params_ {
BigNum* p; ///< a prime
BigNum* q; ///< a prime
+ FfElement* b; ///< an integer between [0, q-1]
BigNum* t; ///< an integer
bool neg; ///< a boolean
FfElement* xi; ///< array of integers between [0, q-1]
diff --git a/epid/common/src/errors.c b/epid/common/src/errors.c
index 8f364ba..fbec3db 100644
--- a/epid/common/src/errors.c
+++ b/epid/common/src/errors.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
#include <stddef.h>
-#include "epid/common/stdtypes.h"
#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
/// Record mapping status code to string
struct ErrorTextEntry {
diff --git a/epid/common/src/file_parser-internal.h b/epid/common/src/file_parser-internal.h
index 2a1d88c..67086a9 100644
--- a/epid/common/src/file_parser-internal.h
+++ b/epid/common/src/file_parser-internal.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-/// Internal functions of Epid issuer material parsing utilities.
+/// Internal functions of Intel(R) EPID issuer material parsing utilities.
/*!
* \file
*/
@@ -22,9 +22,9 @@
#include <stddef.h>
+#include "epid/common/errors.h"
#include "epid/common/file_parser.h"
#include "epid/common/types.h"
-#include "epid/common/errors.h"
/// Verifies CA certificate to contain EC secp256r1 parameters
/*!
diff --git a/epid/common/src/file_parser.c b/epid/common/src/file_parser.c
index 84df2c6..a25beba 100644
--- a/epid/common/src/file_parser.c
+++ b/epid/common/src/file_parser.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@
#include <string.h>
#include "epid/common/math/ecdsa.h"
-#include "epid/common/src/memory.h"
#include "epid/common/src/file_parser-internal.h"
+#include "epid/common/src/memory.h"
const OctStr16 kEpidVersionCode[kNumEpidVersions] = {
{0x01, 0x00}, {0x02, 0x00},
diff --git a/epid/common/src/hashsize.c b/epid/common/src/hashsize.c
new file mode 100644
index 0000000..322de7a
--- /dev/null
+++ b/epid/common/src/hashsize.c
@@ -0,0 +1,44 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief EpidGetHashSize implementation.
+ */
+
+#include "epid/common/src/hashsize.h"
+#include <limits.h>
+
+size_t EpidGetHashSize(HashAlg hash_alg) {
+ switch (hash_alg) {
+ case kSha256:
+ return EPID_SHA256_DIGEST_BITSIZE / CHAR_BIT;
+ case kSha384:
+ return EPID_SHA384_DIGEST_BITSIZE / CHAR_BIT;
+ case kSha512:
+ return EPID_SHA512_DIGEST_BITSIZE / CHAR_BIT;
+ case kSha512_256:
+ return EPID_SHA512_256_DIGEST_BITSIZE / CHAR_BIT;
+ case kSha3_256:
+ return EPID_SHA3_256_DIGEST_BITSIZE / CHAR_BIT;
+ case kSha3_384:
+ return EPID_SHA3_384_DIGEST_BITSIZE / CHAR_BIT;
+ case kSha3_512:
+ return EPID_SHA3_512_DIGEST_BITSIZE / CHAR_BIT;
+ default:
+ return 0;
+ }
+}
diff --git a/epid/common/src/hashsize.h b/epid/common/src/hashsize.h
new file mode 100644
index 0000000..0fc7c20
--- /dev/null
+++ b/epid/common/src/hashsize.h
@@ -0,0 +1,46 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief EpidGetHashSize definition.
+ */
+
+#ifndef EPID_COMMON_SRC_HASHSIZE_H_
+#define EPID_COMMON_SRC_HASHSIZE_H_
+
+#include <stddef.h>
+#include "epid/common/types.h"
+
+/// Size of SHA-256 digest in bits
+#define EPID_SHA256_DIGEST_BITSIZE 256
+/// Size of SHA-384 digest in bits
+#define EPID_SHA384_DIGEST_BITSIZE 385
+/// Size of SHA-512 digest in bits
+#define EPID_SHA512_DIGEST_BITSIZE 512
+/// Size of SHA-512/256 digest in bits
+#define EPID_SHA512_256_DIGEST_BITSIZE 256
+/// Size of SHA3-256 digest in bits
+#define EPID_SHA3_256_DIGEST_BITSIZE 256
+/// Size of SHA3-384 digest in bits
+#define EPID_SHA3_384_DIGEST_BITSIZE 385
+/// Size of SHA3-512 digest in bits
+#define EPID_SHA3_512_DIGEST_BITSIZE 512
+
+/// Gets hash digest size in bytes.
+size_t EpidGetHashSize(HashAlg hash_alg);
+
+#endif // EPID_COMMON_SRC_HASHSIZE_H_
diff --git a/epid/common/src/memory.c b/epid/common/src/memory.c
index b37180f..99a48a8 100644
--- a/epid/common/src/memory.c
+++ b/epid/common/src/memory.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
#include "epid/common/src/memory.h"
-#include <string.h>
#include <stdint.h>
+#include <string.h>
/// Maximum size of the destination buffer
#ifndef RSIZE_MAX
diff --git a/epid/common/src/stack.c b/epid/common/src/stack.c
index 39911ae..314face 100644
--- a/epid/common/src/stack.c
+++ b/epid/common/src/stack.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,8 +17,8 @@
* \file
* \brief Stack container implementation.
*/
-#include <limits.h>
#include "epid/common/src/stack.h"
+#include <limits.h>
#include "epid/common/src/memory.h"
/// Internal representation of a Stack
@@ -85,6 +85,8 @@ size_t StackGetSize(Stack const* stack) {
return stack ? stack->top : (size_t)0;
}
+void* StackGetBuf(Stack const* stack) { return stack ? stack->buf : NULL; }
+
void DeleteStack(Stack** stack) {
if (stack && *stack) {
SAFE_FREE((*stack)->buf);
diff --git a/epid/common/src/stack.h b/epid/common/src/stack.h
index 7b13832..4ac1592 100644
--- a/epid/common/src/stack.h
+++ b/epid/common/src/stack.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -82,6 +82,17 @@ bool StackPopN(Stack* stack, size_t n, void* elements);
*/
size_t StackGetSize(Stack const* stack);
+/// Get number of elements in the stack
+/*!
+ \param[in] stack
+ Stack context
+
+ \returns Pointer to the buffer, returns NULL if stack is NULL
+
+ \see CreateStack
+*/
+void* StackGetBuf(Stack const* stack);
+
/// Deallocates memory used for the stack.
/*!
\param[in,out] stack
diff --git a/epid/member/Makefile b/epid/member/Makefile
index 8278bdd..d165032 100644
--- a/epid/member/Makefile
+++ b/epid/member/Makefile
@@ -9,18 +9,24 @@ LIB_INSTALL_DIR = $(epidinstalldir)/lib/posix-$(ARCH)/
TEST_INSTALL_DIR = $(epidinstalldir)/test/
HEADERS_INSTALL_DIR := $(epidinstalldir)/include/epid/member/
-API_HEADERS_INSTALL = ./api.h
+API_HEADERS_INSTALL = $(wildcard ./*.h)
MEMBER_INCLUDE_DIR = ../../
MEMBER_SRC = $(wildcard ./src/*.c)
-MEMBER_SRC += $(wildcard ./tpm/src/*.c)
+MEMBER_SRC += $(wildcard ./tpm2/src/*.c)
MEMBER_OBJ = $(MEMBER_SRC:.c=.o)
MEMBER_LIB = ./libmember.a
-MEMBER_UTEST_EXE = ./member-utest
-MEMBER_UTEST_SRC = $(wildcard ./unittests/*.cc)
+MEMBER_UTEST_EXE = ./member-utest$(EXE_EXTENSION)
+MEMBER_UTEST_SRC = $(wildcard ./unittests/*.cc) \
+ ./tpm2/unittests/tpm2_wrapper-testhelper.cc
MEMBER_UTEST_OBJ = $(MEMBER_UTEST_SRC:.cc=.o)
+MEMBER_TPM2_UTEST_EXE = ./member.tpm2-utest
+MEMBER_TPM2_TSS_UTEST_SRC = $(wildcard ./tpm2/unittests/*.cc)
+MEMBER_TPM2_UTEST_SRC = $(filter-out $(wildcard ./tpm2/unittests/*-tss-test.cc), \
+ $(MEMBER_TPM2_TSS_UTEST_SRC))
+MEMBER_TPM2_UTEST_OBJ = $(MEMBER_TPM2_UTEST_SRC:.cc=.o)
LIB_MEMBER_DIR = .
LIB_VERIFIER_DIR = ../verifier
LIB_COMMON_TESTHELPER_DIR = ../common-testhelper
@@ -48,6 +54,13 @@ $(MEMBER_UTEST_OBJ): %.o: %.cc
$(CXX) -o $@ $(CXXFLAGS) $(GTEST_DEFINES) -I$(MEMBER_INCLUDE_DIR) \
-I$(GTEST_INCLUDE_DIR) -c $^
+$(MEMBER_TPM2_UTEST_EXE): $(MEMBER_TPM2_UTEST_OBJ)
+ $(CXX) -o $@ $^ $(LDFLAGS)
+
+$(MEMBER_TPM2_UTEST_OBJ): %.o: %.cc
+ $(CXX) -o $@ $(CXXFLAGS) $(GTEST_DEFINES) -I$(MEMBER_INCLUDE_DIR) \
+ -I$(GTEST_INCLUDE_DIR) -c $^
+
build: all
all: $(MEMBER_LIB)
@@ -61,12 +74,14 @@ install:
ifneq (,$(wildcard $(MEMBER_UTEST_EXE)))
mkdir -p '$(TEST_INSTALL_DIR)'
cp $(MEMBER_UTEST_EXE) '$(TEST_INSTALL_DIR)'
+ cp $(MEMBER_TPM2_UTEST_EXE) '$(TEST_INSTALL_DIR)'
endif
-utest: $(MEMBER_UTEST_EXE)
+utest: $(MEMBER_UTEST_EXE) $(MEMBER_TPM2_UTEST_EXE)
run_utest:
$(MEMBER_UTEST_EXE) $(GTEST_FLAGS)
+ $(MEMBER_TPM2_UTEST_EXE) $(GTEST_FLAGS)
check: utest run_utest
@@ -75,4 +90,6 @@ clean:
$(MEMBER_LIB) \
$(MEMBER_UTEST_OBJ) \
$(MEMBER_UTEST_EXE) \
+ $(MEMBER_TPM2_UTEST_OBJ) \
+ $(MEMBER_TPM2_UTEST_EXE) \
*.xml
diff --git a/epid/member/api.h b/epid/member/api.h
index b8dffed..0124da5 100644
--- a/epid/member/api.h
+++ b/epid/member/api.h
@@ -13,19 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
+/// Intel(R) EPID SDK member API.
+/*! \file */
#ifndef EPID_MEMBER_API_H_
#define EPID_MEMBER_API_H_
#include <stddef.h>
-#include "epid/common/stdtypes.h"
-#include "epid/common/types.h"
-#include "epid/common/errors.h"
#include "epid/common/bitsupplier.h"
+#include "epid/common/errors.h"
+#include "epid/common/types.h"
-/*!
- * \file
- * \brief Intel(R) EPID SDK member API.
- */
+/// Internal context of member.
+typedef struct MemberCtx MemberCtx;
+
+/// Implementation specific configuration parameters.
+typedef struct MemberParams MemberParams;
/// Member functionality
/*!
@@ -40,64 +42,101 @@
@{
*/
-/// Internal context of member.
-typedef struct MemberCtx MemberCtx;
-
/// Creates a new member context.
/*!
- Must be called to create the member context that is used by
- other "Member" APIs.
-
- Allocates memory for the context, then initializes it.
-
- EpidMemberDelete() must be called to safely release the member context.
-
- You need to use a cryptographically secure random
- number generator to create a member context using
- ::EpidMemberCreate. The ::BitSupplier is provided
- as a function prototype for your own implementation
- of the random number generator.
-
- \param[in] pub_key
- The group certificate.
- \param[in] priv_key
- The member private key.
- \param[in] precomp
- Optional pre-computed data. If NULL the value is computed internally and is
- readable using EpidMemberWritePrecomp().
- \param[in] rnd_func
- Random number generator.
- \param[in] rnd_param
- Pass through user data that will be passed to the user_data
- parameter of the random number generator.
+ \param[in] params
+ Implementation specific configuration parameters.
\param[out] ctx
Newly constructed member context.
\returns ::EpidStatus
+ */
+EpidStatus EpidMemberCreate(MemberParams const* params, MemberCtx** ctx);
- \warning
- For security rnd_func should be a cryptographically secure random
- number generator.
+/// Creates a request to join a group.
+/*!
+The created request is part of the interaction with an issuer needed to join
+a group. This interaction with the issuer is outside the scope of this API.
+
+\param[in,out] ctx
+The member context.
+\param[in] pub_key
+The group certificate of group to join.
+\param[in] ni
+The nonce chosen by issuer as part of join protocol.
+\param[out] join_request
+The join request.
+
+\returns ::EpidStatus
+*/
+EpidStatus EpidCreateJoinRequest(MemberCtx* ctx, GroupPubKey const* pub_key,
+ IssuerNonce const* ni,
+ JoinRequest* join_request);
- \note
- If the result is not ::kEpidNoErr the content of ctx is undefined.
+/// Provisions a member context from a membership credential
+/*!
+\param[in,out] ctx
+The member context.
+\param[in] pub_key
+The group certificate of group to provision.
+\param[in] credential
+membership credential.
+\param[in] precomp_str
+Precomputed state (implementation specific optional)
+
+\returns ::EpidStatus
+*/
+EpidStatus EpidProvisionCredential(MemberCtx* ctx, GroupPubKey const* pub_key,
+ MembershipCredential const* credential,
+ MemberPrecomp const* precomp_str);
- \see EpidMemberDelete
- \see EpidMemberWritePrecomp
- \see BitSupplier
+/// Provisions a member context from a compressed private key
+/*!
+\param[in,out] ctx
+The member context.
+\param[in] pub_key
+The group certificate of group to provision.
+\param[in] compressed_privkey
+private key.
+\param[in] precomp_str
+Precomputed state (implementation specific optional)
+
+\returns ::EpidStatus
+*/
+EpidStatus EpidProvisionCompressed(MemberCtx* ctx, GroupPubKey const* pub_key,
+ CompressedPrivKey const* compressed_privkey,
+ MemberPrecomp const* precomp_str);
- \b Example
+/// Provisions a member context from a private key
+/*!
+\param[in,out] ctx
+The member context.
+\param[in] pub_key
+The group certificate of group to provision.
+\param[in] priv_key
+private key.
+\param[in] precomp_str
+Precomputed state (implementation specific optional)
+
+\returns ::EpidStatus
+*/
+EpidStatus EpidProvisionKey(MemberCtx* ctx, GroupPubKey const* pub_key,
+ PrivKey const* priv_key,
+ MemberPrecomp const* precomp_str);
- \ref UserManual_GeneratingAnIntelEpidSignature
- */
-EpidStatus EpidMemberCreate(GroupPubKey const* pub_key, PrivKey const* priv_key,
- MemberPrecomp const* precomp, BitSupplier rnd_func,
- void* rnd_param, MemberCtx** ctx);
+/// Change member from setup state to normal operation
+/*!
+\param[in,out] ctx
+The member context.
+
+\returns ::EpidStatus
+*/
+EpidStatus EpidMemberStartup(MemberCtx* ctx);
/// Deletes an existing member context.
/*!
Must be called to safely release a member context created using
- EpidMemberCreate().
+ ::EpidMemberCreate.
De-initializes the context, frees memory used by the context, and sets the
context pointer to NULL.
@@ -113,24 +152,6 @@ EpidStatus EpidMemberCreate(GroupPubKey const* pub_key, PrivKey const* priv_key,
*/
void EpidMemberDelete(MemberCtx** ctx);
-/// Serializes the pre-computed member settings.
-/*!
- \param[in] ctx
- The member context.
- \param[out] precomp
- The Serialized pre-computed member settings.
-
- \returns ::EpidStatus
-
- \note
- If the result is not ::kEpidNoErr, the content of precomp is undefined.
-
- \b Example
-
- \ref UserManual_GeneratingAnIntelEpidSignature
- */
-EpidStatus EpidMemberWritePrecomp(MemberCtx const* ctx, MemberPrecomp* precomp);
-
/// Sets the hash algorithm to be used by a member.
/*!
\param[in] ctx
@@ -237,14 +258,10 @@ size_t EpidGetSigSize(SigRl const* sig_rl);
\note
If the result is not ::kEpidNoErr the content of sig is undefined.
- \see
- EpidMemberCreate
- \see
- EpidMemberSetHashAlg
- \see
- EpidMemberSetSigRl
- \see
- EpidGetSigSize
+ \see EpidMemberCreate
+ \see EpidMemberSetHashAlg
+ \see EpidMemberSetSigRl
+ \see EpidGetSigSize
\b Example
@@ -318,149 +335,6 @@ EpidStatus EpidAddPreSigs(MemberCtx* ctx, size_t number_presigs);
*/
size_t EpidGetNumPreSigs(MemberCtx const* ctx);
-/// Creates a request to join a group.
-/*!
- The created request is part of the interaction with an issuer needed to join
- a group. This interaction with the issuer is outside the scope of this API.
-
- \param[in] pub_key
- The group certificate of group to join.
- \param[in] ni
- The nonce chosen by issuer as part of join protocol.
- \param[in] f
- A randomly selected integer in [1, p-1].
- \param[in] rnd_func
- Random number generator.
- \param[in] rnd_param
- Pass through context data for rnd_func.
- \param[in] hash_alg
- The hash algorithm to be used.
- \param[out] join_request
- The join request.
-
- \returns ::EpidStatus
-
- \warning
- For security rnd_func should be a cryptographically secure random
- number generator.
-
- \note
- The default hash algorithm in Member is SHA-512. This is the
- recommended option if you do not override the hash algorithm
- elsewhere.
-
- \note
- If the result is not ::kEpidNoErr, the content of join_request is undefined.
-
- \see ::HashAlg
- */
-EpidStatus EpidRequestJoin(GroupPubKey const* pub_key, IssuerNonce const* ni,
- FpElemStr const* f, BitSupplier rnd_func,
- void* rnd_param, HashAlg hash_alg,
- JoinRequest* join_request);
-
-/// Creates a basic signature for use in constrained environment.
-/*!
- Used in constrained environments where, due to limited memory, it may not
- be possible to process through a large and potentially unbounded revocation
- list.
-
- \param[in] ctx
- The member context.
- \param[in] msg
- The message.
- \param[in] msg_len
- The length of message in bytes.
- \param[in] basename
- Optional basename. If basename is NULL a random basename is used.
- Signatures generated using random basenames are anonymous. Signatures
- generated using the same basename are linkable by the verifier. If a
- basename is provided it must already be registered or
- ::kEpidBadArgErr is returned.
- \param[in] basename_len
- The size of basename in bytes. Must be 0 if basename is NULL.
- \param[out] sig
- The generated basic signature
-
- \returns ::EpidStatus
-
- \note
- This function should be used in conjunction with EpidNrProve()
-
- \note
- If the result is not ::kEpidNoErr the content of sig, is undefined.
-
- \see EpidMemberCreate
- \see EpidNrProve
- */
-EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
- void const* basename, size_t basename_len,
- BasicSignature* sig);
-
-/// Calculates a non-revoked proof for a single signature based revocation
-/// list entry.
-/*!
- Used in constrained environments where, due to limited memory, it may not
- be possible to process through a large and potentially unbounded revocation
- list.
-
- \param[in] ctx
- The member context.
- \param[in] msg
- The message.
- \param[in] msg_len
- The length of message in bytes.
- \param[in] sig
- The basic signature.
- \param[in] sigrl_entry
- The signature based revocation list entry.
- \param[out] proof
- The generated non-revoked proof.
-
- \returns ::EpidStatus
-
- \note
- This function should be used in conjunction with EpidSignBasic().
-
- \note
- If the result is not ::kEpidNoErr, the content of proof is undefined.
-
- \see EpidMemberCreate
- \see EpidSignBasic
- */
-EpidStatus EpidNrProve(MemberCtx const* ctx, void const* msg, size_t msg_len,
- BasicSignature const* sig, SigRlEntry const* sigrl_entry,
- NrProof* proof);
-
-/// Assembles member private key from membership credential and f value.
-/*!
-
- Combines membership credential obtained from the issuer in response
- to a successful join request with the f value chosen by the member
- to create a complete member private key.
-
- The assembled private key is sanity checked to confirm it is a
- possible key in the group. If it is not ::kEpidBadArgErr is
- returned.
-
- \param[in] credential
- Membership credential received.
- \param[in] f
- The f value used to generate the join request associated with the
- membership credential.
- \param[in] pub_key
- The public key of the group.
- \param[out] priv_key
- The private key.
-
- \returns ::EpidStatus
-
- \see EpidRequestJoin
-*/
-EpidStatus EpidAssemblePrivKey(MembershipCredential const* credential,
- FpElemStr const* f, GroupPubKey const* pub_key,
- PrivKey* priv_key);
-
/// Decompresses compressed member private key.
/*!
@@ -485,4 +359,5 @@ EpidStatus EpidDecompressPrivKey(GroupPubKey const* pub_key,
PrivKey* priv_key);
/*! @} */
+
#endif // EPID_MEMBER_API_H_
diff --git a/epid/member/member.parts b/epid/member/member.parts
index 2f881fe..f90df70 100644
--- a/epid/member/member.parts
+++ b/epid/member/member.parts
@@ -16,71 +16,56 @@
Import('*')
env.PartName('member')
-api_headers = Pattern(src_dir='.',
- includes=['api.h'],
- recursive=False).files()
-src_files = Pattern(src_dir='src',
- includes=['*.c'],
- recursive=False).files()
-internal_headers = Pattern(src_dir='src',
- includes=['*.h'],
- recursive=False).files()
+api_headers = Pattern(src_dir='.', includes=['*.h'], recursive=False).files()
+src_files = Pattern(src_dir='src', includes=['*.c'], recursive=False).files()
+internal_headers = Pattern(
+ src_dir='src', includes=['*.h'], recursive=False).files()
-tpm_src_files = Pattern(src_dir='tpm/src',
- includes=['*.c'],
- recursive=False).files()
-tpm_internal_headers = Pattern(src_dir='tpm/src',
- includes=['*.h'],
- recursive=False).files()
-tpm_headers = Pattern(src_dir='tpm',
- includes=['*.h'],
- recursive=False).files()
-tpm_utest_files = Pattern(src_dir='tpm/unittests',
- includes=['*-test.cc',
- '*-testhelper.cc',],
- recursive=False).files()
-tpm_utest_headers = Pattern(src_dir='tpm/unittests',
- includes=['*-testhelper.h',],
- recursive=False).files()
+tpm_utest_wrapper_files = Pattern(
+ src_dir='tpm2/unittests',
+ includes=['tpm2_wrapper-testhelper.cc'],
+ recursive=False).files()
-utest_files = Pattern(src_dir='unittests',
- includes=['*-test.cc',
- '*-testhelper.cc',],
- recursive=False).files()
-utest_headers = Pattern(src_dir='unittests',
- includes=['*-testhelper.h',],
- recursive=False).files()
+utest_files = Pattern(
+ src_dir='unittests',
+ includes=[
+ '*-test.cc',
+ '*-testhelper.cc',
+ ],
+ recursive=False).files()
+utest_headers = Pattern(
+ src_dir='unittests', includes=[
+ '*-testhelper.h',
+ ], recursive=False).files()
-build_files = Pattern(src_dir='.',
- includes=['*.parts', 'Makefile'],
- recursive=False).files()
+build_files = Pattern(
+ src_dir='.', includes=['*.parts', 'Makefile'], recursive=False).files()
-if 'install_package' in env['MODE']:
- env.InstallTopLevel(api_headers,
- sub_dir='epid/${PART_SHORT_NAME}')
- env.InstallTopLevel(src_files + internal_headers,
- sub_dir='epid/${PART_SHORT_NAME}/src')
- env.InstallTopLevel(utest_files + utest_headers,
- sub_dir='epid/${PART_SHORT_NAME}/unittests')
- env.InstallTopLevel(tpm_headers,
- sub_dir='epid/${PART_SHORT_NAME}/tpm')
- env.InstallTopLevel(tpm_src_files + tpm_internal_headers,
- sub_dir='epid/${PART_SHORT_NAME}/tpm/src')
- env.InstallTopLevel(tpm_utest_files + tpm_utest_headers,
- sub_dir='epid/${PART_SHORT_NAME}/tpm/unittests')
+env.Part(parts_file='tpm2/tpm2.parts')
+
+if 'use_tss' in env['MODE']:
+ env.Append(CPPDEFINES=['TPM_TSS'])
+if 'install_package' in env['MODE']:
+ env.InstallTopLevel(api_headers, sub_dir='epid/${PART_SHORT_NAME}')
+ env.InstallTopLevel(
+ src_files + internal_headers, sub_dir='epid/${PART_SHORT_NAME}/src')
+ env.InstallTopLevel(
+ utest_files + utest_headers,
+ sub_dir='epid/${PART_SHORT_NAME}/unittests')
env.InstallTopLevel(build_files, sub_dir='epid/${PART_SHORT_NAME}')
else:
env.DependsOn([
Component('common'),
+ Component('member.tpm2'),
])
env.Append(CPPPATH='#')
testenv = env.Clone()
- outputs = env.Library('${PART_NAME}', src_files + tpm_src_files)
+ outputs = env.Library('${PART_NAME}', src_files)
env.Sdk(outputs)
env.SdkInclude(api_headers, sub_dir='epid/${PART_SHORT_NAME}')
@@ -90,18 +75,19 @@ else:
#unit tests
testenv['UNIT_TEST_TARGET_NAME'] = "${PART_NAME}-${UNIT_TEST_TARGET}"
- testenv.UnitTest("utest",
- utest_files + tpm_utest_files,
- command_args=[
- '--gtest_color=yes',
- '--gtest_print_time=1',
- '--gtest_output=xml',
- '--gtest_filter=**',
- ],
- make_pdb=(env.isConfigBasedOn('debug') or
- env.isConfigBasedOn('static_crt_debug')),
- depends=[Component('gtest'),
- Component('common-testhelper'),
- Component('member'),
- Component('verifier')],
- INSTALL_BIN='${INSTALL_TEST_BIN}')
+ testenv.UnitTest(
+ "utest",
+ utest_files + tpm_utest_wrapper_files,
+ command_args=[
+ '--gtest_color=yes',
+ '--gtest_print_time=1',
+ '--gtest_output=xml',
+ '--gtest_filter=**',
+ ],
+ make_pdb=(env.isConfigBasedOn('debug') or
+ env.isConfigBasedOn('static_crt_debug')),
+ depends=[
+ Component('gtest'), Component('common-testhelper'),
+ Component('member'), Component('verifier')
+ ],
+ INSTALL_BIN='${INSTALL_TEST_BIN}')
diff --git a/epid/member/software_member.h b/epid/member/software_member.h
new file mode 100644
index 0000000..c9aeff1
--- /dev/null
+++ b/epid/member/software_member.h
@@ -0,0 +1,48 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// Member creation parameters for software only implementation.
+/*!
+ * \file
+ */
+#ifndef EPID_MEMBER_SOFTWARE_MEMBER_H_
+#define EPID_MEMBER_SOFTWARE_MEMBER_H_
+
+#include "epid/common/bitsupplier.h"
+#include "epid/common/types.h"
+
+/*!
+ \addtogroup EpidMemberModule member
+ @{
+ */
+
+/// Software only specific member parameters
+/*!
+ You need to use a cryptographically secure random
+ number generator to create a member context using
+ ::EpidMemberCreate. The ::BitSupplier is provided
+ as a function prototype for your own implementation
+ of the random number generator.
+*/
+typedef struct MemberParams {
+ BitSupplier rnd_func; ///< Random number generator.
+ void* rnd_param; ///< User data that will be passed to the user_data
+ /// parameter of the random number generator.
+ FpElemStr const* f; ///< Secret part of the private key. If NULL a random
+ /// value will be generated using rnd_func.
+} MemberParams;
+/*! @} */
+
+#endif // EPID_MEMBER_SOFTWARE_MEMBER_H_
diff --git a/epid/member/src/assemble_privkey.c b/epid/member/src/assemble_privkey.c
deleted file mode 100644
index 4f89f47..0000000
--- a/epid/member/src/assemble_privkey.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-
-/*!
- * \file
- * \brief EpidAssemblePrivKey implementation.
- */
-
-#include <epid/member/api.h>
-
-#include <string.h>
-
-#include "epid/common/src/epid2params.h"
-#include "epid/common/src/memory.h"
-#include "epid/member/tpm/context.h"
-#include "epid/member/tpm/validatekey.h"
-#include "epid/common/math/finitefield.h"
-#include "epid/common/math/ecgroup.h"
-#include "epid/common/types.h"
-
-/// Handle SDK Error with Break
-#define BREAK_ON_EPID_ERROR(ret) \
- if (kEpidNoErr != (ret)) { \
- break; \
- }
-
-// implements section 3.2.2 "Validation of Private Key" from
-// Intel(R) EPID 2.0 Spec
-static bool EpidIsPrivKeyInGroup(GroupPubKey const* pub_key,
- PrivKey const* priv_key) {
- bool result = false;
- Epid2Params_* params = NULL;
- TpmCtx* ctx = NULL;
- FfElement* x = NULL;
- EcPoint* h2 = NULL;
-
- if (!pub_key || !priv_key) {
- return false;
- }
-
- do {
- EpidStatus sts;
- sts = CreateEpid2Params(&params);
- BREAK_ON_EPID_ERROR(sts);
-
- // check if x and h2 are valid
- sts = NewFfElement(params->Fp, &x);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(params->Fp, &priv_key->x, sizeof(priv_key->x), x);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(params->G1, &h2);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadEcPoint(params->G1, &pub_key->h2, sizeof(pub_key->h2), h2);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = TpmCreate(NULL, NULL, params, &ctx);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = TpmProvision(ctx, &priv_key->f);
- BREAK_ON_EPID_ERROR(sts);
-
- // Step 1. The member verifies that the gid in the public key matches the
- // gid in the private key.
- if (0 != memcmp(&pub_key->gid, &priv_key->gid, sizeof(priv_key->gid))) {
- result = false;
- break;
- }
-
- result = TpmIsKeyValid(ctx, &priv_key->A, &priv_key->x, &pub_key->h1,
- &pub_key->w);
- } while (0);
-
- TpmDelete(&ctx);
- DeleteEpid2Params(&params);
- DeleteEcPoint(&h2);
- DeleteFfElement(&x);
-
- return result;
-}
-
-// Implements step 8 of 3.4 Join Protocol from Intel(R) EPID 2.0 Spec.
-EpidStatus EpidAssemblePrivKey(MembershipCredential const* credential,
- FpElemStr const* f, GroupPubKey const* pub_key,
- PrivKey* priv_key) {
- EpidStatus sts = kEpidErr;
- bool is_key_valid = false;
- PrivKey priv_key_tmp = {0};
- if (!credential || !f || !priv_key) {
- return kEpidBadArgErr;
- }
- do {
- priv_key_tmp.gid = credential->gid;
- priv_key_tmp.A = credential->A;
- priv_key_tmp.x = credential->x;
- priv_key_tmp.f = *f;
-
- is_key_valid = EpidIsPrivKeyInGroup(pub_key, &priv_key_tmp);
- if (!is_key_valid) {
- sts = kEpidBadArgErr;
- break;
- }
-
- *priv_key = priv_key_tmp;
- sts = kEpidNoErr;
- } while (0);
-
- EpidZeroMemory(&priv_key_tmp, sizeof(priv_key_tmp));
-
- return sts;
-}
diff --git a/epid/member/src/context.c b/epid/member/src/context.c
index 3a672ff..3509bce 100644
--- a/epid/member/src/context.c
+++ b/epid/member/src/context.c
@@ -22,17 +22,20 @@
#include <epid/member/api.h>
#include <string.h>
-
-#include "epid/member/tpm/context.h"
-#include "epid/member/tpm/init.h"
-#include "epid/member/src/context.h"
-#include "epid/common/src/memory.h"
#include "epid/common/src/endian_convert.h"
-#include "epid/common/src/sigrlvalid.h"
#include "epid/common/src/epid2params.h"
-#include "epid/member/tpm/presig.h"
-#include "epid/member/src/precomp.h"
+#include "epid/common/src/memory.h"
+#include "epid/common/src/sigrlvalid.h"
+#include "epid/common/src/stack.h"
+#include "epid/common/types.h"
+#include "epid/member/software_member.h"
#include "epid/member/src/allowed_basenames.h"
+#include "epid/member/src/context.h"
+#include "epid/member/src/precomp.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/createprimary.h"
+#include "epid/member/tpm2/load_external.h"
+#include "epid/member/tpm2/sign.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -40,22 +43,13 @@
break; \
}
-EpidStatus EpidMemberCreate(GroupPubKey const* pub_key, PrivKey const* priv_key,
- MemberPrecomp const* precomp, BitSupplier rnd_func,
- void* rnd_param, MemberCtx** ctx) {
+EpidStatus EpidMemberCreate(MemberParams const* params, MemberCtx** ctx) {
EpidStatus sts = kEpidErr;
MemberCtx* member_ctx = NULL;
- if (!pub_key || !priv_key || !rnd_func || !ctx) {
+ if (!params || !ctx) {
return kEpidBadArgErr;
}
-
- // The member verifies that gid in public key and in private key
- // match. If mismatch, abort and return operation failed.
- if (memcmp(&pub_key->gid, &priv_key->gid, sizeof(GroupId))) {
- return kEpidBadArgErr;
- }
-
// Allocate memory for MemberCtx
member_ctx = SAFE_ALLOC(sizeof(MemberCtx));
if (!member_ctx) {
@@ -63,12 +57,18 @@ EpidStatus EpidMemberCreate(GroupPubKey const* pub_key, PrivKey const* priv_key,
}
do {
+ const FpElemStr* f = NULL;
+
// set the default hash algorithm to sha512
member_ctx->hash_alg = kSha512;
- member_ctx->rnd_func = rnd_func;
- member_ctx->rnd_param = rnd_param;
- member_ctx->pub_key = *pub_key;
+#ifdef TPM_TSS // if build for TSS, make Sha256 default
+ member_ctx->hash_alg = kSha256;
+#endif
member_ctx->sig_rl = NULL;
+ member_ctx->precomp_ready = false;
+ member_ctx->is_initially_provisioned = false;
+ member_ctx->is_provisioned = false;
+ member_ctx->primary_key_set = false;
sts = CreateBasenames(&member_ctx->allowed_basenames);
BREAK_ON_EPID_ERROR(sts);
@@ -76,32 +76,54 @@ EpidStatus EpidMemberCreate(GroupPubKey const* pub_key, PrivKey const* priv_key,
sts = CreateEpid2Params(&member_ctx->epid2_params);
BREAK_ON_EPID_ERROR(sts);
- // create and minimally provision TPM
- sts = TpmCreate(rnd_func, rnd_param, member_ctx->epid2_params,
- &member_ctx->tpm_ctx);
+ // create TPM2 context
+ sts = Tpm2CreateContext(params, member_ctx->epid2_params,
+ &member_ctx->rnd_func, &member_ctx->rnd_param, &f,
+ &member_ctx->tpm2_ctx);
BREAK_ON_EPID_ERROR(sts);
- sts = TpmProvision(member_ctx->tpm_ctx, &priv_key->f);
- BREAK_ON_EPID_ERROR(sts);
-
- // pre-computation
- if (precomp) {
- member_ctx->precomp = *precomp;
- } else {
- sts = PrecomputeMemberPairing(member_ctx->epid2_params, pub_key,
- &priv_key->A, &member_ctx->precomp);
+ if (!CreateStack(sizeof(PreComputedSignature), &member_ctx->presigs)) {
+ sts = kEpidMemAllocErr;
BREAK_ON_EPID_ERROR(sts);
}
- // complete initialization of TPM
- sts = TpmInit(member_ctx->tpm_ctx, &priv_key->A, &priv_key->x, &pub_key->h1,
- &pub_key->h2, &pub_key->w, &member_ctx->precomp);
+ member_ctx->f = f;
+ member_ctx->join_ctr = 0;
+ member_ctx->rf_ctr = 0;
+ member_ctx->rnu_ctr = 0;
+
+ sts = NewEcPoint(member_ctx->epid2_params->G1, (EcPoint**)&member_ctx->A);
+ BREAK_ON_EPID_ERROR(sts);
+ sts =
+ NewFfElement(member_ctx->epid2_params->Fp, (FfElement**)&member_ctx->x);
BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(member_ctx->epid2_params->G1, (EcPoint**)&member_ctx->h1);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(member_ctx->epid2_params->G1, (EcPoint**)&member_ctx->h2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(member_ctx->epid2_params->G2, (EcPoint**)&member_ctx->w);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = NewFfElement(member_ctx->epid2_params->GT,
+ (FfElement**)&member_ctx->e12);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(member_ctx->epid2_params->GT,
+ (FfElement**)&member_ctx->e22);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(member_ctx->epid2_params->GT,
+ (FfElement**)&member_ctx->e2w);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(member_ctx->epid2_params->GT,
+ (FfElement**)&member_ctx->ea2);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = Tpm2SetHashAlg(member_ctx->tpm2_ctx, member_ctx->hash_alg);
+ BREAK_ON_EPID_ERROR(sts);
+ member_ctx->primary_key_set = true;
*ctx = member_ctx;
sts = kEpidNoErr;
} while (0);
-
if (kEpidNoErr != sts) {
EpidMemberDelete(&member_ctx);
}
@@ -109,35 +131,75 @@ EpidStatus EpidMemberCreate(GroupPubKey const* pub_key, PrivKey const* priv_key,
return (sts);
}
-void EpidMemberDelete(MemberCtx** ctx) {
- if (ctx && *ctx) {
- TpmDelete(&(*ctx)->tpm_ctx);
- DeleteEpid2Params(&(*ctx)->epid2_params);
- DeleteBasenames(&(*ctx)->allowed_basenames);
- SAFE_FREE(*ctx);
- }
-}
+EpidStatus EpidMemberInitialProvision(MemberCtx* ctx) {
+ EpidStatus sts = kEpidErr;
-EpidStatus EpidMemberWritePrecomp(MemberCtx const* ctx,
- MemberPrecomp* precomp) {
if (!ctx) {
return kEpidBadArgErr;
}
- if (!precomp) {
- return kEpidBadArgErr;
+ if (ctx->is_initially_provisioned) {
+ return kEpidOutOfSequenceError;
}
+ do {
+ if (ctx->f) {
+ sts = Tpm2LoadExternal(ctx->tpm2_ctx, ctx->f);
+ BREAK_ON_EPID_ERROR(sts);
+ } else {
+ G1ElemStr f;
+ sts = Tpm2CreatePrimary(ctx->tpm2_ctx, &f);
+ BREAK_ON_EPID_ERROR(sts);
+ }
- *precomp = ctx->precomp;
- return kEpidNoErr;
+ ctx->is_initially_provisioned = true;
+ // f value was set into TPM
+ ctx->primary_key_set = true;
+ sts = kEpidNoErr;
+ } while (0);
+
+ return (sts);
+}
+
+void EpidMemberDelete(MemberCtx** ctx) {
+ if (ctx && *ctx) {
+ size_t i;
+ size_t presig_size = StackGetSize((*ctx)->presigs);
+ PreComputedSignature* buf = StackGetBuf((*ctx)->presigs);
+ for (i = 0; i < presig_size; ++i) {
+ (void)Tpm2ReleaseCounter((*ctx)->tpm2_ctx, (buf++)->rf_ctr);
+ }
+ (void)Tpm2ReleaseCounter((*ctx)->tpm2_ctx, (*ctx)->join_ctr);
+ (void)Tpm2ReleaseCounter((*ctx)->tpm2_ctx, (*ctx)->rf_ctr);
+ (void)Tpm2ReleaseCounter((*ctx)->tpm2_ctx, (*ctx)->rnu_ctr);
+ DeleteStack(&(*ctx)->presigs);
+ (*ctx)->rnd_param = NULL;
+ DeleteEcPoint((EcPoint**)&((*ctx)->h1));
+ DeleteEcPoint((EcPoint**)&((*ctx)->h2));
+ DeleteEcPoint((EcPoint**)&((*ctx)->A));
+ DeleteFfElement((FfElement**)&(*ctx)->x);
+ DeleteEcPoint((EcPoint**)&((*ctx)->w));
+ DeleteFfElement((FfElement**)&(*ctx)->e12);
+ DeleteFfElement((FfElement**)&(*ctx)->e22);
+ DeleteFfElement((FfElement**)&(*ctx)->e2w);
+ DeleteFfElement((FfElement**)&(*ctx)->ea2);
+ Tpm2DeleteContext(&(*ctx)->tpm2_ctx);
+ DeleteEpid2Params(&(*ctx)->epid2_params);
+ DeleteBasenames(&(*ctx)->allowed_basenames);
+ SAFE_FREE(*ctx);
+ }
}
EpidStatus EpidMemberSetHashAlg(MemberCtx* ctx, HashAlg hash_alg) {
+ EpidStatus sts = kEpidErr;
if (!ctx) return kEpidBadArgErr;
if (kSha256 != hash_alg && kSha384 != hash_alg && kSha512 != hash_alg &&
kSha512_256 != hash_alg)
return kEpidBadArgErr;
- ctx->hash_alg = hash_alg;
- return kEpidNoErr;
+ do {
+ sts = Tpm2SetHashAlg(ctx->tpm2_ctx, hash_alg);
+ BREAK_ON_EPID_ERROR(sts);
+ ctx->hash_alg = hash_alg;
+ } while (0);
+ return sts;
}
EpidStatus EpidMemberSetSigRl(MemberCtx* ctx, SigRl const* sig_rl,
@@ -181,18 +243,3 @@ EpidStatus EpidRegisterBaseName(MemberCtx* ctx, void const* basename,
return sts;
}
-
-EpidStatus EpidAddPreSigs(MemberCtx* ctx, size_t number_presigs) {
- if (!ctx) {
- return kEpidBadArgErr;
- }
-
- return TpmAddPreSigs(ctx->tpm_ctx, number_presigs);
-}
-
-size_t EpidGetNumPreSigs(MemberCtx const* ctx) {
- if (!ctx) {
- return 0;
- }
- return TpmGetNumPreSigs(ctx->tpm_ctx);
-}
diff --git a/epid/member/src/context.h b/epid/member/src/context.h
index 48695c7..6e667ae 100644
--- a/epid/member/src/context.h
+++ b/epid/member/src/context.h
@@ -23,21 +23,24 @@
#include <epid/member/api.h>
#include <stddef.h>
-
+#include "epid/common/bitsupplier.h"
#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
#include "epid/common/types.h"
-#include "epid/common/bitsupplier.h"
/// \cond
-typedef struct TpmCtx TpmCtx;
+typedef struct Tpm2Ctx Tpm2Ctx;
typedef struct Epid2Params_ Epid2Params_;
typedef struct AllowedBasenames AllowedBasenames;
+typedef struct Stack Stack;
+typedef struct EcPoint EcPoint;
+typedef struct FfElement FfElement;
/// \endcond
/// Member context definition
struct MemberCtx {
Epid2Params_* epid2_params; ///< Intel(R) EPID 2.0 params
- TpmCtx* tpm_ctx; ///< TPM context
+ Tpm2Ctx* tpm2_ctx; ///< TPM2 context
GroupPubKey pub_key; ///< group public key
MemberPrecomp precomp; ///< Member pre-computed data
BitSupplier rnd_func; ///< Pseudo random number generation function
@@ -45,6 +48,52 @@ struct MemberCtx {
SigRl const* sig_rl; ///< Signature based revocation list - not owned
AllowedBasenames* allowed_basenames; ///< Base name list
HashAlg hash_alg; ///< Hash algorithm to use
+ MembershipCredential credential; ///< Membership credential
+ bool primary_key_set; ///< primary key is set
+ bool precomp_ready; ///< provisioned precomputed value is ready for use
+ bool is_initially_provisioned; ///< f initialized
+ bool is_provisioned; ///< member fully provisioned with key material
+ EcPoint const* h1; ///< Group public key h1 value
+ EcPoint const* h2; ///< Group group public key h2 value
+ EcPoint const* A; ///< Membership Credential A value
+ FfElement const* x; ///< Membership Credential x value
+ EcPoint const* w; ///< Group group public key w value
+ FfElement const* e12; ///< an element in GT, = pairing (h1, g2)
+ FfElement const* e22; ///< an element in GT, = pairing (h2, g2)
+ FfElement const* e2w; ///< an element in GT, = pairing (h2, w)
+ FfElement const* ea2; ///< an element in GT, = pairing (g1, g2)
+ uint16_t join_ctr; ///< counter for join commands
+ uint16_t rf_ctr; ///< a TPM commit counter for rf
+ uint16_t rnu_ctr; ///< TPM counter pointing to Nr Proof related random value
+ FpElemStr const* f; ///< If NULL an EPS based f is used otherwise f is
+ /// stored in TPM using load external
+ Stack* presigs; ///< Pre-computed signature pool
};
+/// Pre-computed signature.
+/*!
+ Serialized form of an intermediate signature that does not depend on
+ basename or message. This can be used to time-shift compute time needed to
+ sign a message.
+ */
+#pragma pack(1)
+typedef struct PreComputedSignature {
+ G1ElemStr B; ///< an element in G1
+ G1ElemStr K; ///< an element in G1
+ G1ElemStr T; ///< an element in G1
+ G1ElemStr R1; ///< an element in G1
+ GtElemStr R2; ///< an element in G1
+ FpElemStr a; ///< an integer between [0, p-1]
+ FpElemStr b; ///< an integer between [0, p-1]
+ FpElemStr rx; ///< an integer between [0, p-1]
+ uint16_t rf_ctr; ///< a TPM commit counter for rf
+ FpElemStr ra; ///< an integer between [0, p-1]
+ FpElemStr rb; ///< an integer between [0, p-1]
+ BigNumStr rnd_bsn; ///< random basename
+} PreComputedSignature;
+#pragma pack()
+
+/// Minimally provision member with f
+EpidStatus EpidMemberInitialProvision(MemberCtx* ctx);
+
#endif // EPID_MEMBER_SRC_CONTEXT_H_
diff --git a/epid/member/src/decompress_privkey.c b/epid/member/src/decompress_privkey.c
index 460d049..db40214 100644
--- a/epid/member/src/decompress_privkey.c
+++ b/epid/member/src/decompress_privkey.c
@@ -1,32 +1,33 @@
/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
+# Copyright 2016-2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
/*!
- * \file
- * \brief EpidDecompressPrivKey implementation.
- */
+* \file
+* \brief EpidDecompressPrivKey implementation.
+*/
#include "epid/member/api.h"
-#include "epid/member/tpm/context.h"
-#include "epid/member/tpm/decompress.h"
+#include "epid/common/errors.h"
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/hash.h"
+#include "epid/common/math/src/bignum-internal.h"
#include "epid/common/src/epid2params.h"
-
-#include "epid/member/tpm/src/types.h"
-#include "epid/common/math/finitefield.h"
+#include "epid/common/src/memory.h"
+#include "epid/common/types.h"
/// Handle Intel(R) EPID Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -34,44 +35,274 @@
break; \
}
+/*!
+* \brief
+* Internal implementation of PrivKey
+*/
+typedef struct PrivKey_ {
+ GroupId gid; ///< group ID
+ EcPoint* A; ///< an element in G1
+ FfElement* x; ///< an integer between [0, p-1]
+ FfElement* f; ///< an integer between [0, p-1]
+} PrivKey_;
+
+/// Implements the derivation method used by private key decompression
+/// Derives two integers x, f between [1, p-1] from the seed value
+static EpidStatus DeriveXF(FpElemStr* x, FpElemStr* f, Seed const* seed,
+ FpElemStr const* p);
+
EpidStatus EpidDecompressPrivKey(GroupPubKey const* pub_key,
CompressedPrivKey const* compressed_privkey,
PrivKey* priv_key) {
- EpidStatus sts = kEpidErr;
-
- Epid2Params_* params = NULL;
- TpmCtx* ctx = NULL;
+ EpidStatus result = kEpidErr;
+ Epid2Params_* epid2_params = 0;
+ PrivKey_ priv_key_ = {{{0}}, 0, 0, 0};
+ FfElement* Ax = 0;
+ EcPoint* t1 = 0;
+ EcPoint* t2 = 0;
+ FfElement* t3 = 0;
+ FfElement* t4 = 0;
+ BigNum* bn_pminus1 = 0;
+ BigNum* bn_one = 0;
+ EcPoint* h1 = 0;
+ EcPoint* w = 0;
+ // check parameters
if (!pub_key || !compressed_privkey || !priv_key) {
return kEpidBadArgErr;
}
+ // Internal representation of Epid2Params
+ result = CreateEpid2Params(&epid2_params);
+ if (kEpidNoErr != result) {
+ return result;
+ }
+
+ do {
+ uint8_t bn_one_str = 1;
+ FpElemStr p_str = {0};
+ bool is_valid = false;
+ // shortcuts
+ EcGroup* G1 = epid2_params->G1;
+ EcGroup* G2 = epid2_params->G2;
+ FiniteField* GT = epid2_params->GT;
+ EcPoint* g1 = epid2_params->g1;
+ EcPoint* g2 = epid2_params->g2;
+ PairingState* ps_ctx = epid2_params->pairing_state;
+ FiniteField* Fp = epid2_params->Fp;
+ FiniteField* Fq = epid2_params->Fq;
+ BigNum* p = epid2_params->p;
+
+ // In the following process, temporary variables t1 (an element of
+ // G2), t2 (an element of G1), t3, t4 (elements of GT) are used.
+ // Let the compressed private key be (gid, A.x, seed). Let the
+ // Intel(R) EPID public key be (gid, h1, h2, w).
+
+ // Create a new Priv Key
+ result = NewEcPoint(G1, &priv_key_.A);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewFfElement(Fp, &priv_key_.x);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewFfElement(Fp, &priv_key_.f);
+ BREAK_ON_EPID_ERROR(result);
+
+ result = NewFfElement(Fq, &Ax);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewEcPoint(G2, &t1);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewEcPoint(G1, &t2);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewFfElement(GT, &t3);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewFfElement(GT, &t4);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewBigNum(sizeof(BigNumStr), &bn_pminus1);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewBigNum(sizeof(bn_one_str), &bn_one);
+ BREAK_ON_EPID_ERROR(result);
+
+ result = NewEcPoint(G1, &h1);
+ BREAK_ON_EPID_ERROR(result);
+ result = ReadEcPoint(G1, &(pub_key->h1), sizeof(pub_key->h1), h1);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewEcPoint(G2, &w);
+ BREAK_ON_EPID_ERROR(result);
+ result = ReadEcPoint(G2, &(pub_key->w), sizeof(pub_key->w), w);
+ BREAK_ON_EPID_ERROR(result);
+
+ result = WriteBigNum(p, sizeof(p_str), &p_str);
+ BREAK_ON_EPID_ERROR(result);
+
+ result = ReadBigNum(&bn_one_str, sizeof(bn_one_str), bn_one);
+ BREAK_ON_EPID_ERROR(result);
+
+ // 1. The member derives x and f from seed. The derivation
+ // function must be the same as the one used in the key
+ // generation above. This step is out of scope of this
+ // specification.
+ result =
+ DeriveXF(&priv_key->x, &priv_key->f, &compressed_privkey->seed, &p_str);
+ BREAK_ON_EPID_ERROR(result);
+ // 2. The member computes A = G1.makePoint(A.x).
+ result = ReadFfElement(Fq, &compressed_privkey->ax,
+ sizeof(compressed_privkey->ax), Ax);
+ BREAK_ON_EPID_ERROR(result);
+ result = EcMakePoint(G1, Ax, priv_key_.A);
+ BREAK_ON_EPID_ERROR(result);
+ // 3. The member tests whether (A, x, f) is a valid Intel(R) EPID
+ // private key as follows:
+ // a. It computes t1 = G2.sscmExp(g2, x).
+ result = EcSscmExp(G2, g2, (BigNumStr const*)&priv_key->x, t1);
+ BREAK_ON_EPID_ERROR(result);
+ // b. It computes t1 = G2.mul(t1, w).
+ result = EcMul(G2, t1, w, t1);
+ BREAK_ON_EPID_ERROR(result);
+ // c. It computes t3 = pairing(A, t1).
+ result = Pairing(ps_ctx, priv_key_.A, t1, t3);
+ BREAK_ON_EPID_ERROR(result);
+ // d. It computes t2 = G1.sscmExp(h1, f).
+ result = EcSscmExp(G1, h1, (BigNumStr const*)&priv_key->f, t2);
+ BREAK_ON_EPID_ERROR(result);
+ // e. It computes t2 = G1.mul(t2, g1).
+ result = EcMul(G1, t2, g1, t2);
+ BREAK_ON_EPID_ERROR(result);
+ // f. It computes t4 = pairing(t2, g2).
+ result = Pairing(ps_ctx, t2, g2, t4);
+ BREAK_ON_EPID_ERROR(result);
+ // g. If GT.isEqual(t3, t4) = false
+ result = FfIsEqual(GT, t3, t4, &is_valid);
+ BREAK_ON_EPID_ERROR(result);
+ if (!is_valid) {
+ // i. It computes t3 = GT.exp(t3, p-1).
+ result = BigNumSub(p, bn_one, bn_pminus1);
+ BREAK_ON_EPID_ERROR(result);
+ result = FfExp(GT, t3, bn_pminus1, t3);
+ BREAK_ON_EPID_ERROR(result);
+ // ii. If GT.isEqual(t3, t4) = false again, it reports bad
+ // Intel(R) EPID private key and exits.
+ result = FfIsEqual(GT, t3, t4, &is_valid);
+ BREAK_ON_EPID_ERROR(result);
+ if (!is_valid) {
+ result = kEpidBadArgErr; // Invalid Member key
+ break;
+ }
+ // iii. It sets A = G1.inverse(A).
+ result = EcInverse(G1, priv_key_.A, priv_key_.A);
+ BREAK_ON_EPID_ERROR(result);
+ // NOTE A is modified here in this step.
+ }
+ // 4. The decompressed Intel(R) EPID private key is (gid, A, x, f).
+ // x, f already filled in.
+ priv_key->gid = pub_key->gid;
+ result = WriteEcPoint(G1, priv_key_.A, &priv_key->A, sizeof(priv_key->A));
+ BREAK_ON_EPID_ERROR(result);
+
+ result = kEpidNoErr;
+ } while (0);
+
+ DeleteEcPoint(&priv_key_.A);
+ DeleteFfElement(&priv_key_.x);
+ DeleteFfElement(&priv_key_.f);
+ DeleteFfElement(&Ax);
+ DeleteEcPoint(&t1);
+ DeleteEcPoint(&t2);
+ DeleteFfElement(&t3);
+ DeleteFfElement(&t4);
+ DeleteBigNum(&bn_pminus1);
+ DeleteBigNum(&bn_one);
+ DeleteEcPoint(&h1);
+ DeleteEcPoint(&w);
+ DeleteEpid2Params(&epid2_params);
+
+ return result;
+}
+
+/// Hash message buffer
+typedef struct HashMsg {
+ /// Message to be hashed
+ char data[11];
+} HashMsg;
+
+static EpidStatus DeriveXF(FpElemStr* x, FpElemStr* f, Seed const* seed,
+ FpElemStr const* p) {
+ EpidStatus result = kEpidErr;
+
+ BigNum* bn_x = 0;
+ BigNum* bn_f = 0;
+ BigNum* bn_p = 0;
+
do {
- PrivKey key = {0};
- sts = CreateEpid2Params(&params);
- BREAK_ON_EPID_ERROR(sts);
+ HashMsg msgstr = {{
+ 0x00, 0x45, 0x43, 0x43, 0x2d, 0x53, 0x61, 0x66, 0x65, 0x49, 0x44,
+ }};
+#pragma pack(1)
+ struct {
+ Seed seed;
+ HashMsg msg;
+ } hashbuf;
+#pragma pack()
+
+ Sha256Digest digest[2];
+ Ipp8u str512[512 / 8];
+
+ result = NewBigNum(sizeof(*p), &bn_p);
+ BREAK_ON_EPID_ERROR(result);
+ result = ReadBigNum(p, sizeof(*p), bn_p);
+ BREAK_ON_EPID_ERROR(result);
+
+ result = NewBigNum(sizeof(digest), &bn_x);
+ BREAK_ON_EPID_ERROR(result);
+ result = NewBigNum(sizeof(digest), &bn_f);
+ BREAK_ON_EPID_ERROR(result);
+
+ // compute x
+ hashbuf.seed = *seed;
+ hashbuf.msg = msgstr;
+ hashbuf.msg.data[0] = 0x06;
+ result = Sha256MessageDigest(&hashbuf, sizeof(hashbuf), &digest[0]);
+ BREAK_ON_EPID_ERROR(result);
+ hashbuf.msg.data[0] = 0x07;
+ result = Sha256MessageDigest(&hashbuf, sizeof(hashbuf), &digest[1]);
+ BREAK_ON_EPID_ERROR(result);
+
+ result = ReadBigNum(&digest, sizeof(digest), bn_x);
+ BREAK_ON_EPID_ERROR(result);
+
+ result = BigNumMod(bn_x, bn_p, bn_x);
+ BREAK_ON_EPID_ERROR(result);
+
+ result = WriteBigNum(bn_x, sizeof(str512), str512);
+ BREAK_ON_EPID_ERROR(result);
+
+ *x = *(FpElemStr*)&str512[sizeof(str512) / 2];
- sts = TpmCreate(NULL, NULL, params, &ctx);
- BREAK_ON_EPID_ERROR(sts);
+ // compute f
+ hashbuf.seed = *seed;
+ hashbuf.msg = msgstr;
+ hashbuf.msg.data[0] = 0x08;
+ result = Sha256MessageDigest(&hashbuf, sizeof(hashbuf), &digest[0]);
+ BREAK_ON_EPID_ERROR(result);
+ hashbuf.msg.data[0] = 0x09;
+ result = Sha256MessageDigest(&hashbuf, sizeof(hashbuf), &digest[1]);
+ BREAK_ON_EPID_ERROR(result);
- sts = TpmProvisionCompressed(ctx, &compressed_privkey->seed);
- BREAK_ON_EPID_ERROR(sts);
+ result = ReadBigNum(&digest, sizeof(digest), bn_f);
+ BREAK_ON_EPID_ERROR(result);
- sts = TpmDecompressKey(ctx, &pub_key->h1, &pub_key->w,
- &compressed_privkey->ax, &key.A, &key.x);
- BREAK_ON_EPID_ERROR(sts);
+ result = BigNumMod(bn_f, bn_p, bn_f);
+ BREAK_ON_EPID_ERROR(result);
- sts = WriteFfElement(params->Fp, ctx->secret.f, &key.f, sizeof(key.f));
- BREAK_ON_EPID_ERROR(sts);
+ result = WriteBigNum(bn_f, sizeof(str512), str512);
+ BREAK_ON_EPID_ERROR(result);
- key.gid = pub_key->gid;
- *priv_key = key;
+ *f = *(FpElemStr*)&str512[sizeof(str512) / 2];
- sts = kEpidNoErr;
+ result = kEpidNoErr;
} while (0);
- TpmDelete(&ctx);
- DeleteEpid2Params(&params);
+ DeleteBigNum(&bn_x);
+ DeleteBigNum(&bn_f);
+ DeleteBigNum(&bn_p);
- return sts;
+ return result;
}
diff --git a/epid/member/src/get_sigsize.c b/epid/member/src/get_sigsize.c
index 08c8964..10fafcd 100644
--- a/epid/member/src/get_sigsize.c
+++ b/epid/member/src/get_sigsize.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,8 +18,8 @@
* \file
* \brief EpidGetSigSize implementation.
*/
-#include "epid/member/api.h"
#include "epid/common/src/endian_convert.h"
+#include "epid/member/api.h"
size_t EpidGetSigSize(SigRl const* sig_rl) {
const size_t kMinSigSize = sizeof(EpidSignature) - sizeof(NrProof);
diff --git a/epid/member/src/hash_basename.c b/epid/member/src/hash_basename.c
index c2cc01d..1329960 100644
--- a/epid/member/src/hash_basename.c
+++ b/epid/member/src/hash_basename.c
@@ -27,7 +27,8 @@
}
EpidStatus HashBaseName(EcGroup* G1, HashAlg hash_alg, void const* basename,
- size_t basename_len, G1ElemStr* B_str) {
+ size_t basename_len, G1ElemStr* B_str,
+ uint32_t* iterations) {
EpidStatus sts = kEpidErr;
EcPoint* B = NULL;
@@ -39,7 +40,7 @@ EpidStatus HashBaseName(EcGroup* G1, HashAlg hash_alg, void const* basename,
sts = NewEcPoint(G1, &B);
BREAK_ON_EPID_ERROR(sts);
- sts = EcHash(G1, basename, basename_len, hash_alg, B);
+ sts = EcHash(G1, basename, basename_len, hash_alg, B, iterations);
BREAK_ON_EPID_ERROR(sts);
sts = WriteEcPoint(G1, B, B_str, sizeof(*B_str));
BREAK_ON_EPID_ERROR(sts);
diff --git a/epid/member/src/hash_basename.h b/epid/member/src/hash_basename.h
index 598a1bb..4d196c2 100644
--- a/epid/member/src/hash_basename.h
+++ b/epid/member/src/hash_basename.h
@@ -19,6 +19,7 @@
#define EPID_MEMBER_SRC_HASH_BASENAME_H_
#include <stddef.h>
+#include <stdint.h>
#include "epid/common/errors.h"
#include "epid/common/types.h" // HashAlg
@@ -45,12 +46,14 @@ typedef struct G1ElemStr G1ElemStr;
\param[out] B_str
The resulting hashed basename.
- \returns ::EpidStatus
+ \param[out] iterations
+ The number of hash iterations needed to find a valid hash. Can be NULL.
- \see TpmSignCommit
+ \returns ::EpidStatus
*/
EpidStatus HashBaseName(EcGroup* G1, HashAlg hash_alg, void const* basename,
- size_t basename_len, G1ElemStr* B_str);
+ size_t basename_len, G1ElemStr* B_str,
+ uint32_t* iterations);
#endif // EPID_MEMBER_SRC_HASH_BASENAME_H_
diff --git a/epid/member/src/join.c b/epid/member/src/join.c
index 8185145..bda9e8d 100644
--- a/epid/member/src/join.c
+++ b/epid/member/src/join.c
@@ -13,20 +13,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-
-/*!
- * \file
- * \brief EpidRequestJoin implementation.
- */
+/// Join Request related implementation.
+/*! \file */
#include <epid/member/api.h>
#include "epid/common/src/epid2params.h"
-#include "epid/member/tpm/context.h"
-#include "epid/member/tpm/join.h"
-#include "epid/common/types.h"
#include "epid/common/src/grouppubkey.h"
+#include "epid/common/src/hashsize.h"
+#include "epid/common/src/memory.h"
+#include "epid/common/types.h"
+#include "epid/member/src/context.h"
#include "epid/member/src/join_commitment.h"
+#include "epid/member/src/privateexp.h"
+#include "epid/member/src/resize.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/sign.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -34,48 +36,96 @@
break; \
}
-EpidStatus EpidRequestJoin(GroupPubKey const* pub_key, IssuerNonce const* ni,
- FpElemStr const* f, BitSupplier rnd_func,
- void* rnd_param, HashAlg hash_alg,
- JoinRequest* join_request) {
+EpidStatus EpidCreateJoinRequest(MemberCtx* ctx, GroupPubKey const* pub_key,
+ IssuerNonce const* ni,
+ JoinRequest* join_request) {
EpidStatus sts = kEpidErr;
- Epid2Params_* params = NULL;
- TpmCtx* ctx = NULL;
GroupPubKey_* pub_key_ = NULL;
+ EcPoint* t = NULL; // temporary used for F and R
+ EcPoint* h1 = NULL;
+ EcPoint* K = NULL;
+ EcPoint* l = NULL;
+ EcPoint* e = NULL;
- if (!pub_key || !ni || !f || !rnd_func || !join_request) {
+ FfElement* k = NULL;
+ FfElement* s = NULL;
+ uint8_t* digest = NULL;
+
+ if (!ctx || !pub_key || !ni || !join_request || !ctx->epid2_params) {
return kEpidBadArgErr;
}
- if (kSha256 != hash_alg && kSha384 != hash_alg && kSha512 != hash_alg &&
- kSha512_256 != hash_alg) {
+
+ if (kSha256 != ctx->hash_alg && kSha384 != ctx->hash_alg &&
+ kSha512 != ctx->hash_alg && kSha512_256 != ctx->hash_alg) {
return kEpidBadArgErr;
}
do {
JoinRequest request = {0};
G1ElemStr R = {0};
+ EcGroup* G1 = ctx->epid2_params->G1;
+ FiniteField* Fp = ctx->epid2_params->Fp;
+ size_t digest_size = 0;
- sts = CreateEpid2Params(&params);
- BREAK_ON_EPID_ERROR(sts);
+ if (!ctx->is_provisioned && !ctx->is_initially_provisioned) {
+ sts = EpidMemberInitialProvision(ctx);
+ BREAK_ON_EPID_ERROR(sts);
+ }
// validate public key by creating
- sts = CreateGroupPubKey(pub_key, params->G1, params->G2, &pub_key_);
+ sts = CreateGroupPubKey(pub_key, ctx->epid2_params->G1,
+ ctx->epid2_params->G2, &pub_key_);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = NewEcPoint(G1, &t);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &h1);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadEcPoint(G1, &pub_key->h1, sizeof(pub_key->h1), h1);
BREAK_ON_EPID_ERROR(sts);
- sts = TpmCreate(rnd_func, rnd_param, params, &ctx);
+ // 2. The member computes F = G1.sscmExp(h1, f).
+ sts = EpidPrivateExp(ctx, h1, t);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteEcPoint(G1, t, &request.F, sizeof(request.F));
BREAK_ON_EPID_ERROR(sts);
- sts = TpmProvision(ctx, f);
+ // 1. The member chooses a random integer r from [1, p-1].
+ // 3. The member computes R = G1.sscmExp(h1, r).
+ sts = NewEcPoint(G1, &K);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &l);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &e);
+ BREAK_ON_EPID_ERROR(sts);
+ sts =
+ Tpm2Commit(ctx->tpm2_ctx, h1, NULL, 0, NULL, K, l, e, &(ctx->join_ctr));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteEcPoint(G1, e, &R, sizeof(R));
BREAK_ON_EPID_ERROR(sts);
- sts = TpmJoinCommit(ctx, &request.F, &R);
+ sts = HashJoinCommitment(ctx->epid2_params->Fp, ctx->hash_alg, pub_key,
+ &request.F, &R, ni, &request.c);
BREAK_ON_EPID_ERROR(sts);
- sts = HashJoinCommitment(params->Fp, hash_alg, pub_key, &request.F, &R, ni,
- &request.c);
+ // Extend value c to be of a digest size.
+ digest_size = EpidGetHashSize(ctx->hash_alg);
+ digest = (uint8_t*)SAFE_ALLOC(digest_size);
+ if (!digest) {
+ sts = kEpidMemAllocErr;
+ break;
+ }
+ sts = ResizeOctStr(&request.c, sizeof(request.c), digest, digest_size);
BREAK_ON_EPID_ERROR(sts);
- sts = TpmJoin(ctx, &request.c, &request.s);
+ // Step 5. The member computes s = (r + c * f) mod p.
+ sts = NewFfElement(Fp, &k);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &s);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = Tpm2Sign(ctx->tpm2_ctx, digest, digest_size, ctx->join_ctr, k, s);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, s, &request.s, sizeof(request.s));
BREAK_ON_EPID_ERROR(sts);
// Step 6. The output join request is (F, c, s).
@@ -84,9 +134,19 @@ EpidStatus EpidRequestJoin(GroupPubKey const* pub_key, IssuerNonce const* ni,
sts = kEpidNoErr;
} while (0);
+ if (sts != kEpidNoErr) {
+ (void)Tpm2ReleaseCounter(ctx->tpm2_ctx, ctx->join_ctr);
+ }
+
+ DeleteEcPoint(&t);
+ DeleteEcPoint(&h1);
+ DeleteEcPoint(&K);
+ DeleteEcPoint(&l);
+ DeleteEcPoint(&e);
+ DeleteFfElement(&k);
+ DeleteFfElement(&s);
+ SAFE_FREE(digest);
DeleteGroupPubKey(&pub_key_);
- TpmDelete(&ctx);
- DeleteEpid2Params(&params);
return sts;
}
diff --git a/epid/member/src/join_commitment.c b/epid/member/src/join_commitment.c
index 96af97c..62e6dab 100644
--- a/epid/member/src/join_commitment.c
+++ b/epid/member/src/join_commitment.c
@@ -18,8 +18,8 @@
#include "epid/member/src/join_commitment.h"
-#include "epid/common/types.h"
#include "epid/common/math/finitefield.h"
+#include "epid/common/types.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
diff --git a/epid/member/src/join_commitment.h b/epid/member/src/join_commitment.h
index 24e8eb0..e42873d 100644
--- a/epid/member/src/join_commitment.h
+++ b/epid/member/src/join_commitment.h
@@ -55,9 +55,6 @@ typedef struct OctStr256 IssuerNonce;
\returns ::EpidStatus
- \see TpmJoinCommit
- \see TpmJoin
-
*/
EpidStatus HashJoinCommitment(FiniteField* Fp, HashAlg hash_alg,
GroupPubKey const* pub_key,
diff --git a/epid/member/src/nrprove.c b/epid/member/src/nrprove.c
index 8bc05e2..c7780bc 100644
--- a/epid/member/src/nrprove.c
+++ b/epid/member/src/nrprove.c
@@ -13,21 +13,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-/*!
- * \file
- * \brief EpidNrProve implementation.
- */
-#include <epid/member/api.h>
+/// EpidNrProve implementation.
+/*! \file */
+#include "epid/member/src/nrprove.h"
#include <stddef.h>
#include <stdint.h>
+#include "epid/common/src/endian_convert.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/hashsize.h"
+#include "epid/common/src/memory.h"
#include "epid/common/stdtypes.h"
-#include "epid/member/src/context.h"
#include "epid/common/types.h"
-#include "epid/common/src/epid2params.h"
-#include "epid/member/tpm/nrprove.h"
+#include "epid/member/src/context.h"
#include "epid/member/src/nrprove_commitment.h"
+#include "epid/member/src/privateexp.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/sign.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -35,6 +38,9 @@
break; \
}
+/// Count of elements in array
+#define COUNT_OF(A) (sizeof(A) / sizeof((A)[0]))
+
static bool IsIdentity(G1ElemStr const* elem_str) {
unsigned char* bytes = (unsigned char*)elem_str;
if (!bytes) {
@@ -49,32 +55,207 @@ static bool IsIdentity(G1ElemStr const* elem_str) {
}
EpidStatus EpidNrProve(MemberCtx const* ctx, void const* msg, size_t msg_len,
+ void const* basename, size_t basename_len,
BasicSignature const* sig, SigRlEntry const* sigrl_entry,
NrProof* proof) {
EpidStatus sts = kEpidErr;
+ EcPoint* B = NULL;
+ EcPoint* K = NULL;
+ EcPoint* rlB = NULL;
+ EcPoint* rlK = NULL;
+ EcPoint* t = NULL; // temp value in G1 either T, R1, R2
+ EcPoint* k_tpm = NULL;
+ EcPoint* l_tpm = NULL;
+ EcPoint* e_tpm = NULL;
+ EcPoint* D = NULL;
+ FfElement* y2 = NULL;
+ uint8_t* s2 = NULL;
+ FfElement* mu = NULL;
+ FfElement* nu = NULL;
+ FfElement* rmu = NULL;
+
+ FfElement* t2 = NULL; // temporary for multiplication
+ FfElement* c = NULL;
+ uint8_t* digest = NULL;
+
+ BigNumStr mu_str = {0};
+ BigNumStr nu_str = {0};
+ BigNumStr rmu_str = {0};
+
if (!ctx || (0 != msg_len && !msg) || !sig || !sigrl_entry || !proof)
return kEpidBadArgErr;
+ if (!basename || 0 == basename_len) {
+ // basename should not be empty
+ return kEpidBadArgErr;
+ }
if (!ctx->epid2_params) return kEpidBadArgErr;
do {
NrProveCommitOutput commit_out = {0};
FiniteField* Fp = ctx->epid2_params->Fp;
+ FiniteField* Fq = ctx->epid2_params->Fq;
+ EcGroup* G1 = ctx->epid2_params->G1;
+ BitSupplier rnd_func = ctx->rnd_func;
+ void* rnd_param = ctx->rnd_param;
+ uint32_t i = 0;
+ G1ElemStr B_str = {0};
+ const BigNumStr kOne = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
FpElemStr c_str = {0};
+ uint16_t rnu_ctr =
+ 0; ///< TPM counter pointing to Nr Proof related random value
+ size_t digest_len = EpidGetHashSize(ctx->hash_alg);
+
+ sts = NewEcPoint(G1, &B);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &K);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &rlB);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &rlK);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &D);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &t);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = NewFfElement(Fp, &y2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &k_tpm);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &l_tpm);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &e_tpm);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = NewFfElement(Fp, &mu);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &nu);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &rmu);
+ BREAK_ON_EPID_ERROR(sts);
+
+ s2 = SAFE_ALLOC(basename_len + sizeof(i));
+ if (!s2) {
+ sts = kEpidMemAllocErr;
+ break;
+ }
+ sts = ReadEcPoint(G1, &sig->K, sizeof(sig->K), K);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = ReadEcPoint(G1, &(sigrl_entry->b), sizeof(sigrl_entry->b), rlB);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadEcPoint(G1, &(sigrl_entry->k), sizeof(sigrl_entry->k), rlK);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 1. The member chooses random mu from [1, p-1].
+ sts = FfGetRandom(Fp, &kOne, rnd_func, rnd_param, mu);
+ BREAK_ON_EPID_ERROR(sts);
+ // 2. The member computes nu = -mu mod p.
+ sts = FfNeg(Fp, mu, nu);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 3.1. The member computes D = G1.privateExp(B', f)
+ sts = EpidPrivateExp((MemberCtx*)ctx, rlB, D);
+ BREAK_ON_EPID_ERROR(sts);
+ // 3.2.The member computes T = G1.sscmMultiExp(K', mu, D, nu).
+ sts = WriteFfElement(Fp, mu, &mu_str, sizeof(mu_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, nu, &nu_str, sizeof(nu_str));
+ BREAK_ON_EPID_ERROR(sts);
+ {
+ EcPoint const* points[2];
+ BigNumStr const* exponents[2];
+ points[0] = rlK;
+ points[1] = D;
+ exponents[0] = &mu_str;
+ exponents[1] = &nu_str;
+ sts = EcSscmMultiExp(G1, points, exponents, COUNT_OF(points), t);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteEcPoint(G1, t, &commit_out.T, sizeof(commit_out.T));
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ // 4.1. The member chooses rmu randomly from[1, p - 1].
+ sts = FfGetRandom(Fp, &kOne, rnd_func, rnd_param, rmu);
+ BREAK_ON_EPID_ERROR(sts);
+ // 4.2. (KTPM, LTPM, ETPM, counterTPM) = TPM2_Commit(P1 = B', P2 = B)
+ sts = EcHash(G1, basename, basename_len, ctx->hash_alg, B, &i);
+ BREAK_ON_EPID_ERROR(sts);
+ *(uint32_t*)s2 = ntohl(i);
+ sts = WriteEcPoint(G1, B, &B_str, sizeof(B_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fq, &B_str.y, sizeof(B_str.y), y2);
+ BREAK_ON_EPID_ERROR(sts);
+ if (0 != memcpy_S(s2 + sizeof(i), basename_len, basename, basename_len)) {
+ sts = kEpidErr;
+ break;
+ }
+ sts = Tpm2Commit(ctx->tpm2_ctx, rlB, s2, basename_len + sizeof(i), y2,
+ k_tpm, l_tpm, e_tpm, &rnu_ctr);
+ BREAK_ON_EPID_ERROR(sts);
- sts = TpmNrProveCommit(ctx->tpm_ctx, &sig->B, &sig->K, sigrl_entry,
- &commit_out);
+ // 5.1. The member computes R1 = G1.sscmExp(K, rmu).
+ sts = WriteFfElement(Fp, rmu, &rmu_str, sizeof(rmu_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = EcSscmExp(G1, K, &rmu_str, t);
+ BREAK_ON_EPID_ERROR(sts);
+ // 5.2. The member computes R1 = G1.mul(R1, LTPM).
+ sts = EcMul(G1, t, l_tpm, t);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteEcPoint(G1, t, &commit_out.R1, sizeof(commit_out.R1));
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 6.1. The member computes R2 = G1.sscmExp(K', rmu).
+ sts = EcSscmExp(G1, rlK, &rmu_str, t);
+ BREAK_ON_EPID_ERROR(sts);
+ // 6.2. The member computes R2 = G1.mul(R2, ETPM).
+ sts = EcMul(G1, t, e_tpm, t);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteEcPoint(G1, t, &commit_out.R2, sizeof(commit_out.R2));
BREAK_ON_EPID_ERROR(sts);
sts = HashNrProveCommitment(Fp, ctx->hash_alg, &sig->B, &sig->K,
sigrl_entry, &commit_out, msg, msg_len, &c_str);
BREAK_ON_EPID_ERROR(sts);
+ digest = SAFE_ALLOC(digest_len);
+ if (!digest) {
+ sts = kEpidMemAllocErr;
+ break;
+ }
+
+ sts = NewFfElement(Fp, &t2);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = NewFfElement(Fp, &c);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = ReadFfElement(Fp, &c_str, sizeof(c_str), c);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 8. The member computes smu = (rmu + c * mu) mod p.
+ sts = FfMul(Fp, c, mu, t2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfAdd(Fp, rmu, t2, t2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, t2, &proof->smu, sizeof(proof->smu));
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 9.1. The member computes c' = (c * nu) mod p
+ sts = FfMul(Fp, c, nu, t2);
+ BREAK_ON_EPID_ERROR(sts);
+ // 9.2. snu = TPM2_Sign(c = c', counterTPM)
+ sts = WriteFfElement(Fp, t2, digest, digest_len);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = Tpm2Sign(ctx->tpm2_ctx, digest, digest_len, rnu_ctr, NULL, t2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, t2, &proof->snu, sizeof(proof->snu));
+ BREAK_ON_EPID_ERROR(sts);
+
// 10. The member outputs sigma = (T, c, smu, snu), a non-revoked
// proof. If G1.is_identity(T) = true, the member also outputs
// "failed".
- sts = TpmNrProve(ctx->tpm_ctx, &c_str, &proof->smu, &proof->snu);
- BREAK_ON_EPID_ERROR(sts);
proof->T = commit_out.T;
proof->c = c_str;
@@ -87,5 +268,26 @@ EpidStatus EpidNrProve(MemberCtx const* ctx, void const* msg, size_t msg_len,
sts = kEpidNoErr;
} while (0);
+ SAFE_FREE(s2);
+ EpidZeroMemory(&mu_str, sizeof(mu_str));
+ EpidZeroMemory(&nu_str, sizeof(nu_str));
+ EpidZeroMemory(&rmu_str, sizeof(rmu_str));
+ DeleteFfElement(&y2);
+ DeleteEcPoint(&B);
+ DeleteEcPoint(&K);
+ DeleteEcPoint(&rlB);
+ DeleteEcPoint(&rlK);
+ DeleteEcPoint(&D);
+ DeleteEcPoint(&t);
+ DeleteEcPoint(&e_tpm);
+ DeleteEcPoint(&l_tpm);
+ DeleteEcPoint(&k_tpm);
+ DeleteFfElement(&mu);
+ DeleteFfElement(&nu);
+ DeleteFfElement(&rmu);
+ DeleteFfElement(&t2);
+ DeleteFfElement(&c);
+ SAFE_FREE(digest);
+
return sts;
}
diff --git a/epid/member/src/nrprove.h b/epid/member/src/nrprove.h
new file mode 100644
index 0000000..debc593
--- /dev/null
+++ b/epid/member/src/nrprove.h
@@ -0,0 +1,71 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// EpidNrProve interface.
+/*! \file */
+#ifndef EPID_MEMBER_SRC_NRPROVE_H_
+#define EPID_MEMBER_SRC_NRPROVE_H_
+
+#include <stddef.h>
+#include "epid/common/errors.h"
+
+/// \cond
+typedef struct MemberCtx MemberCtx;
+typedef struct BasicSignature BasicSignature;
+typedef struct SigRlEntry SigRlEntry;
+typedef struct NrProof NrProof;
+/// \endcond
+
+/// Calculates a non-revoked proof for a single signature based revocation
+/// list entry.
+/*!
+ Used in constrained environments where, due to limited memory, it may not
+ be possible to process through a large and potentially unbounded revocation
+ list.
+
+ \param[in] ctx
+ The member context.
+ \param[in] msg
+ The message.
+ \param[in] msg_len
+ The length of message in bytes.
+ \param[in] basename
+ The basename used in EpidSignBasic.
+ \param[in] basename_len
+ The length of the basename.
+ \param[in] sig
+ The basic signature.
+ \param[in] sigrl_entry
+ The signature based revocation list entry.
+ \param[out] proof
+ The generated non-revoked proof.
+
+ \returns ::EpidStatus
+
+ \note
+ This function should be used in conjunction with EpidSignBasic().
+
+ \note
+ If the result is not ::kEpidNoErr, the content of proof is undefined.
+
+ \see EpidMemberCreate
+ \see EpidSignBasic
+ */
+EpidStatus EpidNrProve(MemberCtx const* ctx, void const* msg, size_t msg_len,
+ void const* basename, size_t basename_len,
+ BasicSignature const* sig, SigRlEntry const* sigrl_entry,
+ NrProof* proof);
+
+#endif // EPID_MEMBER_SRC_NRPROVE_H_
diff --git a/epid/member/src/nrprove_commitment.c b/epid/member/src/nrprove_commitment.c
index 176b992..41618b8 100644
--- a/epid/member/src/nrprove_commitment.c
+++ b/epid/member/src/nrprove_commitment.c
@@ -19,7 +19,6 @@
#include "epid/member/src/nrprove_commitment.h"
#include <stdint.h>
-#include "epid/member/tpm/nrprove.h"
#include "epid/common/math/finitefield.h"
#include "epid/common/src/memory.h"
diff --git a/epid/member/src/nrprove_commitment.h b/epid/member/src/nrprove_commitment.h
index e6c4cfa..91f0cb4 100644
--- a/epid/member/src/nrprove_commitment.h
+++ b/epid/member/src/nrprove_commitment.h
@@ -20,16 +20,24 @@
#include <stddef.h>
#include "epid/common/errors.h"
-#include "epid/common/types.h" // HashAlg
+#include "epid/common/types.h" // HashAlg, G1ElemStr
/// \cond
typedef struct FiniteField FiniteField;
-typedef struct G1ElemStr G1ElemStr;
typedef struct FpElemStr FpElemStr;
typedef struct SigRlEntry SigRlEntry;
typedef struct NrProveCommitOutput NrProveCommitOutput;
/// \endcond
+#pragma pack(1)
+/// Result of NrProve Commit
+typedef struct NrProveCommitOutput {
+ G1ElemStr T; ///< T value for NrProof
+ G1ElemStr R1; ///< Serialized G1 element
+ G1ElemStr R2; ///< Serialized G1 element
+} NrProveCommitOutput;
+#pragma pack()
+
/// Calculates commitment hash of NrProve commit
/*!
@@ -63,9 +71,6 @@ typedef struct NrProveCommitOutput NrProveCommitOutput;
\returns ::EpidStatus
- \see TpmNrProveCommit
- \see TpmNrProve
-
*/
EpidStatus HashNrProveCommitment(FiniteField* Fp, HashAlg hash_alg,
G1ElemStr const* B_str, G1ElemStr const* K_str,
diff --git a/epid/member/src/precomp.c b/epid/member/src/precomp.c
index ff7f9cb..c87f479 100644
--- a/epid/member/src/precomp.c
+++ b/epid/member/src/precomp.c
@@ -17,9 +17,9 @@
/*! \file */
#include "epid/member/src/precomp.h"
-#include "epid/common/types.h"
#include "epid/common/src/epid2params.h"
#include "epid/common/src/grouppubkey.h"
+#include "epid/common/types.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
diff --git a/epid/member/src/precomp.h b/epid/member/src/precomp.h
index bb361c9..58a8c40 100644
--- a/epid/member/src/precomp.h
+++ b/epid/member/src/precomp.h
@@ -48,8 +48,7 @@ typedef struct MemberPrecomp MemberPrecomp;
\returns ::EpidStatus
- \see TpmJoinCommit
- \see TpmJoin
+ \see CreateEpid2Params
*/
EpidStatus PrecomputeMemberPairing(Epid2Params_ const* epid2_params,
diff --git a/epid/member/tpm/src/presig-internal.h b/epid/member/src/presig-internal.h
index 53c5afe..8620505 100644
--- a/epid/member/tpm/src/presig-internal.h
+++ b/epid/member/src/presig-internal.h
@@ -13,40 +13,41 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-/// Pre-computed signature APIs that must only be called inside TPM
+/// Internal pre-computed signature APIs
/*! \file */
-#ifndef EPID_MEMBER_TPM_SRC_PRESIG_INTERNAL_H_
-#define EPID_MEMBER_TPM_SRC_PRESIG_INTERNAL_H_
+#ifndef EPID_MEMBER_SRC_PRESIG_INTERNAL_H_
+#define EPID_MEMBER_SRC_PRESIG_INTERNAL_H_
#include "epid/common/errors.h"
/// \cond
-typedef struct TpmCtx TpmCtx;
+typedef struct MemberCtx MemberCtx;
typedef struct PreComputedSignature PreComputedSignature;
/// \endcond
/// Provides a precomputed signature
/*!
- Provides and removes a pre-computed signatures from TPM's pool if
+ Provides and removes a pre-computed signatures from members's pool if
available, otherwise provides a newly calculated a precomputed
signature.
\warning
- Pre-computed signatures must not be accessed outside of the TPM boundary.
+ Pre-computed signatures must not be accessed outside of the secure
+ boundary.
\param[in,out] ctx
- The TPM context.
+ The member context.
\param[out] presig
- The pre-computed signature removed from TPM's pool
+ The pre-computed signature removed from members's pool
\returns ::EpidStatus
*/
-EpidStatus TpmGetPreSig(TpmCtx* ctx, PreComputedSignature* presig);
+EpidStatus MemberGetPreSig(MemberCtx* ctx, PreComputedSignature* presig);
///@}
/*! @} */
-#endif // EPID_MEMBER_TPM_SRC_PRESIG_INTERNAL_H_
+#endif // EPID_MEMBER_SRC_PRESIG_INTERNAL_H_
diff --git a/epid/member/tpm/src/presig.c b/epid/member/src/presig.c
index d91ddee..4cd4c81 100644
--- a/epid/member/tpm/src/presig.c
+++ b/epid/member/src/presig.c
@@ -16,18 +16,23 @@
/// Sensitive pre-computed signature implementation
/*! \file */
-#include "epid/member/tpm/presig.h"
+#include <epid/member/api.h>
#include <string.h>
-#include "epid/member/tpm/src/types.h"
-#include "epid/common/src/stack.h"
#include "epid/common/math/ecgroup.h"
#include "epid/common/math/finitefield.h"
+#include "epid/common/src/endian_convert.h"
#include "epid/common/src/epid2params.h"
#include "epid/common/src/memory.h"
+#include "epid/common/src/stack.h"
+#include "epid/member/src/context.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/getrandom.h"
+#include "epid/member/tpm2/sign.h"
-/// Handle Intel(R) EPID Error with Break
+/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
if (kEpidNoErr != (ret)) { \
break; \
@@ -36,25 +41,25 @@
/// Count of elements in array
#define COUNT_OF(A) (sizeof(A) / sizeof((A)[0]))
-static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
- PreComputedSignature* precompsig);
+static EpidStatus MemberComputePreSig(MemberCtx const* ctx,
+ PreComputedSignature* precompsig);
-EpidStatus TpmAddPreSigs(TpmCtx* ctx, size_t number_presigs) {
+EpidStatus EpidAddPreSigs(MemberCtx* ctx, size_t number_presigs) {
PreComputedSignature* new_presigs = NULL;
size_t i = 0;
- if (!ctx || !ctx->secret.presigs) return kEpidBadArgErr;
+ if (!ctx || !ctx->presigs) return kEpidBadArgErr;
if (0 == number_presigs) return kEpidNoErr;
- new_presigs = (PreComputedSignature*)StackPushN(ctx->secret.presigs,
- number_presigs, NULL);
+ new_presigs =
+ (PreComputedSignature*)StackPushN(ctx->presigs, number_presigs, NULL);
if (!new_presigs) return kEpidMemAllocErr;
for (i = 0; i < number_presigs; i++) {
- EpidStatus sts = TpmComputePreSig(ctx, &new_presigs[i]);
+ EpidStatus sts = MemberComputePreSig(ctx, &new_presigs[i]);
if (kEpidNoErr != sts) {
// roll back pre-computed-signature pool
- StackPopN(ctx->secret.presigs, number_presigs, 0);
+ StackPopN(ctx->presigs, number_presigs, 0);
return sts;
}
}
@@ -62,35 +67,35 @@ EpidStatus TpmAddPreSigs(TpmCtx* ctx, size_t number_presigs) {
return kEpidNoErr;
}
-size_t TpmGetNumPreSigs(TpmCtx const* ctx) {
- return (ctx && ctx->secret.presigs) ? StackGetSize(ctx->secret.presigs)
- : (size_t)0;
+size_t EpidGetNumPreSigs(MemberCtx const* ctx) {
+ return (ctx && ctx->presigs) ? StackGetSize(ctx->presigs) : (size_t)0;
}
-EpidStatus TpmGetPreSig(TpmCtx* ctx, PreComputedSignature* presig) {
- EpidStatus sts = kEpidErr;
+EpidStatus MemberGetPreSig(MemberCtx* ctx, PreComputedSignature* presig) {
if (!ctx || !presig) {
return kEpidBadArgErr;
}
- if (StackGetSize(ctx->secret.presigs)) {
+ if (StackGetSize(ctx->presigs)) {
// Use existing pre-computed signature
- if (!StackPopN(ctx->secret.presigs, 1, presig)) {
+ if (!StackPopN(ctx->presigs, 1, presig)) {
return kEpidErr;
}
+ return kEpidNoErr;
}
// generate a new pre-computed signature
- sts = TpmComputePreSig(ctx, presig);
- return sts;
+ return MemberComputePreSig(ctx, presig);
}
/// Performs Pre-computation that can be used to speed up signing
-static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
- PreComputedSignature* precompsig) {
+EpidStatus MemberComputePreSig(MemberCtx const* ctx,
+ PreComputedSignature* precompsig) {
EpidStatus sts = kEpidErr;
EcPoint* B = NULL;
+ EcPoint* k = NULL;
EcPoint* t = NULL; // temporary, used for K, T, R1
+ EcPoint* e = NULL;
FfElement* R2 = NULL;
@@ -100,9 +105,13 @@ static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
FfElement* t1 = NULL;
FfElement* t2 = NULL;
- BigNumStr f_str = {0};
BigNumStr t1_str = {0};
BigNumStr t2_str = {0};
+ struct {
+ uint32_t i;
+ BigNumStr bsn;
+ } p2x = {0};
+ FfElement* p2y = NULL;
if (!ctx || !precompsig || !ctx->epid2_params) {
return kEpidBadArgErr;
@@ -110,26 +119,35 @@ static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
do {
// handy shorthands:
+ Tpm2Ctx* tpm = ctx->tpm2_ctx;
EcGroup* G1 = ctx->epid2_params->G1;
FiniteField* GT = ctx->epid2_params->GT;
FiniteField* Fp = ctx->epid2_params->Fp;
+ FiniteField* Fq = ctx->epid2_params->Fq;
EcPoint const* h2 = ctx->h2;
EcPoint const* A = ctx->A;
FfElement const* x = ctx->x;
- FfElement const* f = ctx->secret.f;
+ PairingState* ps_ctx = ctx->epid2_params->pairing_state;
- const BigNumStr one = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}};
+ const BigNumStr kOne = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
// 1. The member expects the pre-computation is done (e12, e22, e2w,
// ea2). Refer to Section 3.5 for the computation of these
// values.
+ sts = NewFfElement(Fq, &p2y);
// The following variables B, K, T, R1 (elements of G1), R2
// (elements of GT), a, b, rx, rf, ra, rb, t1, t2 (256-bit
// integers) are used.
+ BREAK_ON_EPID_ERROR(sts);
sts = NewEcPoint(G1, &B);
BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &k);
+ BREAK_ON_EPID_ERROR(sts);
sts = NewEcPoint(G1, &t);
BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &e);
+ BREAK_ON_EPID_ERROR(sts);
sts = NewFfElement(GT, &R2);
BREAK_ON_EPID_ERROR(sts);
sts = NewFfElement(Fp, &a);
@@ -144,41 +162,53 @@ static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
BREAK_ON_EPID_ERROR(sts);
// 3. The member computes B = G1.getRandom().
- sts = EcGetRandom(G1, ctx->rnd_func, ctx->secret.rnd_param, B);
+ // 4.a. If bsn is not provided, the member chooses randomly an integer bsn
+ // from [1, p-1].
+ sts = Tpm2GetRandom(tpm, sizeof(p2x.bsn) * 8, &p2x.bsn);
BREAK_ON_EPID_ERROR(sts);
+ precompsig->rnd_bsn = p2x.bsn;
+ // 4.b. The member computes (B, i2, y2) = G1.tpmHash(bsn).
+ sts = EcHash(G1, (const void*)&p2x.bsn, sizeof(p2x.bsn), ctx->hash_alg, B,
+ &p2x.i);
+ BREAK_ON_EPID_ERROR(sts);
+ p2x.i = htonl(p2x.i);
sts = WriteEcPoint(G1, B, &precompsig->B, sizeof(precompsig->B));
BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fq, &precompsig->B.y, sizeof(precompsig->B.y), p2y);
+ BREAK_ON_EPID_ERROR(sts);
- // 4. The member computes K = G1.sscmExp(B, f).
- sts = WriteFfElement(Fp, f, &f_str, sizeof(f_str));
+ // 4.c. (KTPM, LTPM, ETPM, counterTPM) = TPM2_Commit(P1=h1, (s2, y2) = (i1
+ // || bsn, y2)), K = KTPM
+ sts = Tpm2Commit(tpm, ctx->h1, &p2x, sizeof(p2x), p2y, k, t, e,
+ &precompsig->rf_ctr);
BREAK_ON_EPID_ERROR(sts);
- sts = EcExp(G1, B, &f_str, t);
+ sts = WriteEcPoint(G1, k, &precompsig->K, sizeof(precompsig->K));
BREAK_ON_EPID_ERROR(sts);
-
- sts = WriteEcPoint(G1, t, &precompsig->K, sizeof(precompsig->K));
+ // 4.k. The member computes R1 = LTPM.
+ sts = WriteEcPoint(G1, t, &precompsig->R1, sizeof(precompsig->R1));
BREAK_ON_EPID_ERROR(sts);
- // 5. The member chooses randomly an integer a from [1, p-1].
- sts = FfGetRandom(Fp, &one, ctx->rnd_func, ctx->secret.rnd_param, a);
+ // 4.d. The member chooses randomly an integer a from [1, p-1].
+ sts = FfGetRandom(Fp, &kOne, ctx->rnd_func, ctx->rnd_param, a);
BREAK_ON_EPID_ERROR(sts);
sts = WriteFfElement(Fp, a, &precompsig->a, sizeof(precompsig->a));
BREAK_ON_EPID_ERROR(sts);
- // 6. The member computes T = G1.sscmExp(h2, a).
+ // 4.e. The member computes T = G1.sscmExp(h2, a).
sts = EcExp(G1, h2, (BigNumStr*)&precompsig->a, t);
BREAK_ON_EPID_ERROR(sts);
- // 7. The member computes T = G1.mul(T, A).
+ // 4.k. The member computes T = G1.mul(T, A).
sts = EcMul(G1, t, A, t);
BREAK_ON_EPID_ERROR(sts);
sts = WriteEcPoint(G1, t, &precompsig->T, sizeof(precompsig->T));
BREAK_ON_EPID_ERROR(sts);
- // 9. The member chooses rx, rf, ra, rb randomly from [1, p-1].
+ // 4.h. The member chooses rx, ra, rb randomly from [1, p-1].
- // note : rx & rb are reused as rf & ra respectively
- sts = FfGetRandom(Fp, &one, ctx->rnd_func, ctx->secret.rnd_param, rx);
+ // note : rb are reused as ra
+ sts = FfGetRandom(Fp, &kOne, ctx->rnd_func, ctx->rnd_param, rx);
BREAK_ON_EPID_ERROR(sts);
- sts = FfGetRandom(Fp, &one, ctx->rnd_func, ctx->secret.rnd_param, rb);
+ sts = FfGetRandom(Fp, &kOne, ctx->rnd_func, ctx->rnd_param, rb);
BREAK_ON_EPID_ERROR(sts);
sts = WriteFfElement(Fp, rx, &precompsig->rx, sizeof(precompsig->rx));
@@ -186,11 +216,11 @@ static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
sts = WriteFfElement(Fp, rb, &precompsig->rb, sizeof(precompsig->rb));
BREAK_ON_EPID_ERROR(sts);
- // 10. The member computes t1 = (- rx) mod p.
+ // 4.i. The member computes t1 = (- rx) mod p.
sts = FfNeg(Fp, rx, t1);
BREAK_ON_EPID_ERROR(sts);
- // 11. The member computes t2 = (rb - a * rx) mod p.
+ // 4.j. The member computes t2 = (rb - a * rx) mod p.
sts = FfMul(Fp, a, rx, t2);
BREAK_ON_EPID_ERROR(sts);
sts = FfNeg(Fp, t2, t2);
@@ -198,31 +228,24 @@ static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
sts = FfAdd(Fp, rb, t2, t2);
BREAK_ON_EPID_ERROR(sts);
- // 8. The member computes b = (a * x) mod p.
+ // 4.g. The member computes b = (a * x) mod p.
sts = FfMul(Fp, a, x, a);
BREAK_ON_EPID_ERROR(sts);
sts = WriteFfElement(Fp, a, &precompsig->b, sizeof(precompsig->b));
BREAK_ON_EPID_ERROR(sts);
- // reusing rx as rf and rb as ra
- sts = FfGetRandom(Fp, &one, ctx->rnd_func, ctx->secret.rnd_param, rx);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfGetRandom(Fp, &one, ctx->rnd_func, ctx->secret.rnd_param, rb);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = WriteFfElement(Fp, rx, &precompsig->rf, sizeof(precompsig->rf));
+ // reusing rb as ra
+ sts = FfGetRandom(Fp, &kOne, ctx->rnd_func, ctx->rnd_param, rb);
BREAK_ON_EPID_ERROR(sts);
sts = WriteFfElement(Fp, rb, &precompsig->ra, sizeof(precompsig->ra));
BREAK_ON_EPID_ERROR(sts);
- // 12. The member computes R1 = G1.sscmExp(B, rf).
- sts = EcExp(G1, B, (BigNumStr*)&precompsig->rf, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteEcPoint(G1, t, &precompsig->R1, sizeof(precompsig->R1));
+ // 4.l.i e12rf = pairing(ETPM, g2)
+ sts = Pairing(ps_ctx, e, ctx->epid2_params->g2, R2);
BREAK_ON_EPID_ERROR(sts);
- // 13. The member computes R2 = GT.sscmMultiExp(ea2, t1, e12, rf,
- // e22, t2, e2w, ra).
+ // 4.l.ii. The member computes R2 = GT.sscmMultiExp(ea2, t1, e12rf, 1,
+ // e22, t2, e2w, ra).
sts = WriteFfElement(Fp, t1, &t1_str, sizeof(t1_str));
BREAK_ON_EPID_ERROR(sts);
sts = WriteFfElement(Fp, t2, &t2_str, sizeof(t2_str));
@@ -231,11 +254,11 @@ static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
FfElement const* points[4];
BigNumStr const* exponents[4];
points[0] = ctx->ea2;
- points[1] = ctx->e12;
+ points[1] = R2;
points[2] = ctx->e22;
points[3] = ctx->e2w;
exponents[0] = &t1_str;
- exponents[1] = (BigNumStr*)&precompsig->rf;
+ exponents[1] = &kOne;
exponents[2] = &t2_str;
exponents[3] = (BigNumStr*)&precompsig->ra;
sts = FfMultiExp(GT, points, exponents, COUNT_OF(points), R2);
@@ -248,12 +271,19 @@ static EpidStatus TpmComputePreSig(TpmCtx const* ctx,
sts = kEpidNoErr;
} while (0);
- EpidZeroMemory(&f_str, sizeof(f_str));
+ if (sts != kEpidNoErr) {
+ (void)Tpm2ReleaseCounter(ctx->tpm2_ctx, precompsig->rf_ctr);
+ }
+
EpidZeroMemory(&t1_str, sizeof(t1_str));
EpidZeroMemory(&t2_str, sizeof(t2_str));
+ EpidZeroMemory(&p2x, sizeof(p2x));
+ DeleteFfElement(&p2y);
DeleteEcPoint(&B);
+ DeleteEcPoint(&k);
DeleteEcPoint(&t);
+ DeleteEcPoint(&e);
DeleteFfElement(&R2);
DeleteFfElement(&a);
DeleteFfElement(&rx);
diff --git a/epid/member/src/privateexp.c b/epid/member/src/privateexp.c
new file mode 100644
index 0000000..9c1f0d9
--- /dev/null
+++ b/epid/member/src/privateexp.c
@@ -0,0 +1,141 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// Member private exponentiation implementation
+/*! \file */
+
+#include "epid/member/src/privateexp.h"
+
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/hashsize.h"
+#include "epid/common/src/memory.h"
+#include "epid/common/types.h"
+#include "epid/member/src/context.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/sign.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+EpidStatus EpidPrivateExp(MemberCtx* ctx, EcPoint const* a, EcPoint* r) {
+ EpidStatus sts = kEpidErr;
+
+ BigNumStr tmp_ff_str = {0};
+ uint16_t counter = 0;
+
+ EcPoint* k_pt = NULL;
+ EcPoint* l_pt = NULL;
+ EcPoint* e_pt = NULL;
+ EcPoint* t1 = NULL;
+ EcPoint* h = NULL;
+
+ FfElement* k = NULL;
+ FfElement* s = NULL;
+
+ size_t digest_len = 0;
+ uint8_t* digest = NULL;
+
+ if (!ctx || !ctx->epid2_params || !a || !r) {
+ return kEpidBadArgErr;
+ }
+
+ digest_len = EpidGetHashSize(ctx->hash_alg);
+ digest = SAFE_ALLOC(digest_len);
+ if (!digest) {
+ return kEpidMemAllocErr;
+ }
+
+ memset(digest, 0, digest_len);
+ digest[digest_len - 1] = 1;
+
+ do {
+ FiniteField* Fp = ctx->epid2_params->Fp;
+ EcGroup* G1 = ctx->epid2_params->G1;
+
+ if (!ctx->is_provisioned && !ctx->is_initially_provisioned) {
+ sts = EpidMemberInitialProvision(ctx);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+
+ // (K_PT, L_PT, E_PT, counter) = TPM2_Commit(P1=B')
+ sts = NewEcPoint(G1, &k_pt);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &l_pt);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &e_pt);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &t1);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &h);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts =
+ Tpm2Commit(ctx->tpm2_ctx, a, NULL, 0, NULL, k_pt, l_pt, e_pt, &counter);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // (k, s) = TPM2_Sign(c=1, counter)
+ sts = NewFfElement(Fp, &k);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &s);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = Tpm2Sign(ctx->tpm2_ctx, digest, digest_len, counter, k, s);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // k = Fq.inv(k)
+ sts = FfInv(Fp, k, k);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // t1 = G1.sscmExp(B', s)
+ sts = WriteFfElement(Fp, s, &tmp_ff_str, sizeof(tmp_ff_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = EcSscmExp(G1, a, &tmp_ff_str, t1);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // E_PT = G1.inv(E_PT)
+ sts = EcInverse(G1, e_pt, e_pt);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // h = G1.mul(t1, E_PT)
+ sts = EcMul(G1, t1, e_pt, h);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // h = G1.sscmExp(h, k)
+ sts = WriteFfElement(Fp, k, &tmp_ff_str, sizeof(tmp_ff_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = EcSscmExp(G1, h, &tmp_ff_str, r);
+ BREAK_ON_EPID_ERROR(sts);
+ } while (0);
+
+ if (sts != kEpidNoErr) {
+ (void)Tpm2ReleaseCounter(ctx->tpm2_ctx, counter);
+ }
+ DeleteFfElement(&s);
+ DeleteFfElement(&k);
+
+ DeleteEcPoint(&e_pt);
+ DeleteEcPoint(&l_pt);
+ DeleteEcPoint(&k_pt);
+ DeleteEcPoint(&t1);
+ DeleteEcPoint(&h);
+
+ EpidZeroMemory(&tmp_ff_str, sizeof(tmp_ff_str));
+ SAFE_FREE(digest);
+ return sts;
+}
diff --git a/epid/member/src/privateexp.h b/epid/member/src/privateexp.h
new file mode 100644
index 0000000..415bb1a
--- /dev/null
+++ b/epid/member/src/privateexp.h
@@ -0,0 +1,42 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// Member private exponentiation API
+/*! \file */
+#ifndef EPID_MEMBER_SRC_PRIVATEEXP_H_
+#define EPID_MEMBER_SRC_PRIVATEEXP_H_
+
+#include "epid/common/errors.h"
+
+/// \cond
+typedef struct EcPoint EcPoint;
+typedef struct MemberCtx MemberCtx;
+/// \endcond
+
+/// Raises a point in an elliptic curve group G1 to a private key f.
+/*!
+ \param[in] ctx
+ The member context.
+ \param[in] a
+ The base.
+ \param[out] r
+ The result of exponentiation.
+
+ \returns ::EpidStatus
+*/
+
+EpidStatus EpidPrivateExp(MemberCtx* ctx, EcPoint const* a, EcPoint* r);
+
+#endif // EPID_MEMBER_SRC_PRIVATEEXP_H_
diff --git a/epid/member/src/provision_bulk.c b/epid/member/src/provision_bulk.c
new file mode 100644
index 0000000..2c9a382
--- /dev/null
+++ b/epid/member/src/provision_bulk.c
@@ -0,0 +1,88 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// EpidProvisionKey implementation.
+/*!
+ * \file
+ */
+
+#include <epid/member/api.h>
+
+#include <string.h>
+#include "epid/common/src/memory.h"
+#include "epid/common/stdtypes.h"
+#include "epid/common/types.h"
+#include "epid/member/src/context.h"
+#include "epid/member/src/storage.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/load_external.h"
+
+EpidStatus EpidProvisionKey(MemberCtx* ctx, GroupPubKey const* pub_key,
+ PrivKey const* priv_key,
+ MemberPrecomp const* precomp_str) {
+ EpidStatus sts = kEpidErr;
+ uint32_t const nv_index = 0x01c10100;
+ MembershipCredential credential = {0};
+
+ if (!pub_key || !priv_key || !ctx) {
+ return kEpidBadArgErr;
+ }
+
+ // The member verifies that gid in public key and in private key
+ // match. If mismatch, abort and return operation failed.
+ if (memcmp(&pub_key->gid, &priv_key->gid, sizeof(GroupId))) {
+ return kEpidBadArgErr;
+ }
+
+ sts = Tpm2LoadExternal(ctx->tpm2_ctx, &priv_key->f);
+ if (kEpidNoErr != sts) {
+ return sts;
+ }
+
+ credential.A = priv_key->A;
+ credential.x = priv_key->x;
+ credential.gid = priv_key->gid;
+
+ if (ctx->primary_key_set) {
+ Tpm2ResetContext(&ctx->tpm2_ctx);
+ ctx->primary_key_set = false;
+ }
+ sts = Tpm2LoadExternal(ctx->tpm2_ctx, &priv_key->f);
+ if (kEpidNoErr != sts) {
+ return sts;
+ }
+ ctx->primary_key_set = true;
+
+ sts = EpidNvWriteMembershipCredential(ctx->tpm2_ctx, pub_key, &credential,
+ nv_index);
+
+ if (kEpidNoErr == sts) {
+ if (precomp_str) {
+ ctx->precomp = *precomp_str;
+ ctx->precomp_ready = true;
+ } else {
+ EpidZeroMemory(&ctx->precomp, sizeof(ctx->precomp));
+ ctx->precomp_ready = false;
+ }
+
+ ctx->pub_key = *pub_key;
+ ctx->is_provisioned = true;
+
+ ctx->credential.A = credential.A;
+ ctx->credential.x = credential.x;
+ ctx->credential.gid = credential.gid;
+ }
+ return sts;
+}
diff --git a/epid/member/src/provision_compressed.c b/epid/member/src/provision_compressed.c
new file mode 100644
index 0000000..b582e53
--- /dev/null
+++ b/epid/member/src/provision_compressed.c
@@ -0,0 +1,41 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// EpidProvisionCompressed implementation.
+/*!
+ * \file
+ */
+
+#include <epid/member/api.h>
+
+#include <string.h>
+#include "epid/common/types.h"
+#include "epid/member/src/context.h"
+
+EpidStatus EpidProvisionCompressed(MemberCtx* ctx, GroupPubKey const* pub_key,
+ CompressedPrivKey const* compressed_privkey,
+ MemberPrecomp const* precomp_str) {
+ EpidStatus sts = kEpidErr;
+ PrivKey priv_key;
+ if (!pub_key || !compressed_privkey || !ctx) {
+ return kEpidBadArgErr;
+ }
+ sts = EpidDecompressPrivKey(pub_key, compressed_privkey, &priv_key);
+ if (sts != kEpidNoErr) {
+ return sts;
+ }
+ sts = EpidProvisionKey(ctx, pub_key, &priv_key, precomp_str);
+ return sts;
+}
diff --git a/epid/member/src/provision_join.c b/epid/member/src/provision_join.c
new file mode 100644
index 0000000..49bc96e
--- /dev/null
+++ b/epid/member/src/provision_join.c
@@ -0,0 +1,85 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// EpidProvisionCredential implementation.
+/*!
+ * \file
+ */
+
+#include <epid/member/api.h>
+
+#include <string.h>
+#include "epid/common/src/memory.h"
+#include "epid/common/types.h"
+#include "epid/member/src/context.h"
+#include "epid/member/src/storage.h"
+#include "epid/member/src/validatekey.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/createprimary.h"
+
+EpidStatus EpidProvisionCredential(MemberCtx* ctx, GroupPubKey const* pub_key,
+ MembershipCredential const* credential,
+ MemberPrecomp const* precomp_str) {
+ EpidStatus sts = kEpidErr;
+ uint32_t const nv_index = 0x01c10100;
+ G1ElemStr f_str;
+
+ if (!pub_key || !credential || !ctx) {
+ return kEpidBadArgErr;
+ }
+
+ if (memcmp(&pub_key->gid, &credential->gid, sizeof(GroupId))) {
+ return kEpidBadArgErr;
+ }
+
+ if (!ctx->is_provisioned && !ctx->is_initially_provisioned) {
+ sts = EpidMemberInitialProvision(ctx);
+ if (kEpidNoErr != sts) return sts;
+ }
+
+ if (!EpidMemberIsKeyValid(ctx, &credential->A, &credential->x, &pub_key->h1,
+ &pub_key->w)) {
+ return kEpidBadArgErr;
+ }
+
+ sts = EpidNvWriteMembershipCredential(ctx->tpm2_ctx, pub_key, credential,
+ nv_index);
+
+ if (ctx->primary_key_set) {
+ Tpm2ResetContext(&ctx->tpm2_ctx);
+ ctx->primary_key_set = false;
+ }
+ sts = Tpm2CreatePrimary(ctx->tpm2_ctx, &f_str);
+ if (kEpidNoErr != sts) {
+ return sts;
+ }
+ ctx->primary_key_set = true;
+ if (kEpidNoErr == sts) {
+ if (precomp_str) {
+ ctx->precomp = *precomp_str;
+ ctx->precomp_ready = true;
+ } else {
+ EpidZeroMemory(&ctx->precomp, sizeof(ctx->precomp));
+ ctx->precomp_ready = false;
+ }
+
+ ctx->credential.A = credential->A;
+ ctx->credential.x = credential->x;
+ ctx->credential.gid = credential->gid;
+ ctx->pub_key = *pub_key;
+ ctx->is_provisioned = true;
+ }
+ return sts;
+}
diff --git a/epid/member/src/resize.c b/epid/member/src/resize.c
new file mode 100644
index 0000000..fb4a168
--- /dev/null
+++ b/epid/member/src/resize.c
@@ -0,0 +1,40 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Implements ResizeOctStr
+/*! \file */
+
+#include "epid/member/src/resize.h"
+
+#include <stdint.h>
+#include "epid/common/src/memory.h"
+
+EpidStatus ResizeOctStr(ConstOctStr a, size_t a_size, OctStr r, size_t r_size) {
+ if (!a || !a_size || !r || !r_size) return kEpidBadArgErr;
+ if (a_size <= r_size) {
+ memset(r, 0, r_size - a_size);
+ if (memcpy_S((uint8_t*)r + (r_size - a_size), a_size, a, a_size))
+ return kEpidErr;
+ } else {
+ size_t i;
+ for (i = 0; i < a_size - r_size; i++) {
+ if (((uint8_t*)a)[i])
+ return kEpidBadArgErr; // a does not fit into r_size
+ }
+ if (memcpy_S(r, r_size, (uint8_t*)a + (a_size - r_size), r_size))
+ return kEpidErr;
+ }
+ return kEpidNoErr;
+}
diff --git a/epid/member/src/resize.h b/epid/member/src/resize.h
new file mode 100644
index 0000000..ee4b9f1
--- /dev/null
+++ b/epid/member/src/resize.h
@@ -0,0 +1,45 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Declares ResizeOctStr
+/*! \file */
+
+#ifndef EPID_MEMBER_SRC_RESIZE_H_
+#define EPID_MEMBER_SRC_RESIZE_H_
+
+#include <string.h>
+#include "epid/common/errors.h"
+#include "epid/common/types.h"
+
+/// Resizes octet string number
+/*!
+Prepends input number with zeros when increasing the size.
+Removes leading zeros when decreasing the size.
+Return error if input number does not fit the new size.
+
+\param[in] a
+Octet string to resize
+\param[in] a_size
+Size of the a
+\param[out] r
+Result octet string
+\param[in] r_size
+New size
+
+\returns ::EpidStatus
+*/
+EpidStatus ResizeOctStr(ConstOctStr a, size_t a_size, OctStr r, size_t r_size);
+
+#endif // EPID_MEMBER_SRC_RESIZE_H_
diff --git a/epid/member/src/sign.c b/epid/member/src/sign.c
index d9ba323..3ce964b 100644
--- a/epid/member/src/sign.c
+++ b/epid/member/src/sign.c
@@ -13,12 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-
-/*!
- * \file
- * \brief EpidSign implementation.
- */
-
+/// EpidSign implementation.
+/*! \file */
#include <epid/member/api.h>
#include <string.h>
@@ -26,6 +22,8 @@
#include "epid/common/src/memory.h"
#include "epid/common/src/sigrlvalid.h"
#include "epid/member/src/context.h"
+#include "epid/member/src/nrprove.h"
+#include "epid/member/src/signbasic.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -39,6 +37,7 @@ EpidStatus EpidSign(MemberCtx const* ctx, void const* msg, size_t msg_len,
EpidStatus sts = kEpidErr;
uint32_t num_sig_rl = 0;
OctStr32 octstr32_0 = {{0x00, 0x00, 0x00, 0x00}};
+ BigNumStr rnd_bsn = {0};
if (!ctx || !sig) {
return kEpidBadArgErr;
}
@@ -55,7 +54,8 @@ EpidStatus EpidSign(MemberCtx const* ctx, void const* msg, size_t msg_len,
}
// 11. The member sets sigma0 = (B, K, T, c, sx, sf, sa, sb).
- sts = EpidSignBasic(ctx, msg, msg_len, basename, basename_len, &sig->sigma0);
+ sts = EpidSignBasic(ctx, msg, msg_len, basename, basename_len, &sig->sigma0,
+ &rnd_bsn);
if (kEpidNoErr != sts) {
return sts;
}
@@ -84,8 +84,13 @@ EpidStatus EpidSign(MemberCtx const* ctx, void const* msg, size_t msg_len,
// will be given in the next subsection.
num_sig_rl = ntohl(ctx->sig_rl->n2);
for (i = 0; i < num_sig_rl; i++) {
- sts = EpidNrProve(ctx, msg, msg_len, &sig->sigma0, &ctx->sig_rl->bk[i],
- &sig->sigma[i]);
+ if (basename) {
+ sts = EpidNrProve(ctx, msg, msg_len, basename, basename_len,
+ &sig->sigma0, &ctx->sig_rl->bk[i], &sig->sigma[i]);
+ } else {
+ sts = EpidNrProve(ctx, msg, msg_len, &rnd_bsn, sizeof(rnd_bsn),
+ &sig->sigma0, &ctx->sig_rl->bk[i], &sig->sigma[i]);
+ }
if (kEpidNoErr != sts) {
nr_prove_status = sts;
}
diff --git a/epid/member/src/sign_commitment.c b/epid/member/src/sign_commitment.c
index 47d1425..f317cb6 100644
--- a/epid/member/src/sign_commitment.c
+++ b/epid/member/src/sign_commitment.c
@@ -20,7 +20,6 @@
#include "epid/common/math/ecgroup.h"
#include "epid/common/src/commitment.h"
-#include "epid/member/tpm/sign.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
diff --git a/epid/member/src/sign_commitment.h b/epid/member/src/sign_commitment.h
index 4a7d731..45b0b20 100644
--- a/epid/member/src/sign_commitment.h
+++ b/epid/member/src/sign_commitment.h
@@ -22,10 +22,22 @@
#include "epid/common/errors.h"
#include "epid/common/types.h" // HashAlg
+#pragma pack(1)
+/// Result of Sign Commit
+typedef struct SignCommitOutput {
+ G1ElemStr B; ///< B value for signature
+ G1ElemStr K; ///< K value for signature
+ G1ElemStr T; ///< T value for signature
+ G1ElemStr R1; ///< Serialized G1 element
+ GtElemStr R2; ///< Serialized GT element
+} SignCommitOutput;
+#pragma pack()
+
+typedef struct SignCommitOutput SignCommitOutput;
+
/// \cond
typedef struct FiniteField FiniteField;
typedef struct FpElemStr FpElemStr;
-typedef struct SignCommitOutput SignCommitOutput;
/// \endcond
/// Calculates commitment hash of sign commit
@@ -51,9 +63,6 @@ typedef struct SignCommitOutput SignCommitOutput;
\returns ::EpidStatus
- \see TpmSignCommit
- \see TpmSign
-
*/
EpidStatus HashSignCommitment(FiniteField* Fp, HashAlg hash_alg,
GroupPubKey const* pub_key,
diff --git a/epid/member/src/signbasic.c b/epid/member/src/signbasic.c
index 62d63d7..1e4d76b 100644
--- a/epid/member/src/signbasic.c
+++ b/epid/member/src/signbasic.c
@@ -13,23 +13,26 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-
-/*!
- * \file
- * \brief EpidSignBasic implementation.
- */
+/// EpidSignBasic implementation.
+/*! \file */
+#include "epid/member/src/signbasic.h"
#include <string.h> // memset
-#include "epid/member/api.h"
-#include "epid/member/src/context.h"
-#include "epid/member/tpm/sign.h"
#include "epid/common/math/ecgroup.h"
#include "epid/common/math/finitefield.h"
+#include "epid/common/src/endian_convert.h"
#include "epid/common/src/epid2params.h"
+#include "epid/common/src/hashsize.h"
+#include "epid/common/src/memory.h"
+#include "epid/member/api.h"
+#include "epid/member/src/allowed_basenames.h"
+#include "epid/member/src/context.h"
#include "epid/member/src/hash_basename.h"
+#include "epid/member/src/presig-internal.h"
#include "epid/member/src/sign_commitment.h"
-#include "epid/member/src/allowed_basenames.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/sign.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -37,11 +40,40 @@
break; \
}
+/// Count of elements in array
+#define COUNT_OF(A) (sizeof(A) / sizeof((A)[0]))
+
EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
void const* basename, size_t basename_len,
- BasicSignature* sig) {
+ BasicSignature* sig, BigNumStr* rnd_bsn) {
EpidStatus sts = kEpidErr;
+ EcPoint* B = NULL;
+ EcPoint* t = NULL; // temp value in G1
+ EcPoint* k = NULL;
+ EcPoint* e = NULL;
+ FfElement* R2 = NULL;
+ FfElement* p2y = NULL;
+ FfElement* t1 = NULL;
+ FfElement* t2 = NULL;
+
+ FfElement* a = NULL;
+ FfElement* b = NULL;
+ FfElement* rx = NULL;
+ FfElement* ra = NULL;
+ FfElement* rb = NULL;
+
+ struct p2x_t {
+ uint32_t i;
+ uint8_t bsn[1];
+ }* p2x = NULL;
+
+ FfElement* t3 = NULL; // temporary for multiplication
+ FfElement* c = NULL;
+ uint8_t* digest = NULL;
+
+ PreComputedSignature curr_presig = {0};
+
if (!ctx || !sig) {
return kEpidBadArgErr;
}
@@ -59,29 +91,211 @@ EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
do {
FiniteField* Fp = ctx->epid2_params->Fp;
- EcGroup* G1 = ctx->epid2_params->G1;
- G1ElemStr B_str = {0};
SignCommitOutput commit_out = {0};
FpElemStr c_str = {0};
+ EcGroup* G1 = ctx->epid2_params->G1;
+ FiniteField* GT = ctx->epid2_params->GT;
+
+ FiniteField* Fq = ctx->epid2_params->Fq;
+ PairingState* ps_ctx = ctx->epid2_params->pairing_state;
+ const BigNumStr kOne = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+ BigNumStr t1_str = {0};
+ BigNumStr t2_str = {0};
+ size_t digest_size = 0;
+ uint16_t* rf_ctr = (uint16_t*)&ctx->rf_ctr;
+ FfElement const* x = ctx->x;
if (basename) {
if (!IsBasenameAllowed(ctx->allowed_basenames, basename, basename_len)) {
sts = kEpidBadArgErr;
BREAK_ON_EPID_ERROR(sts);
}
- sts = HashBaseName(G1, ctx->hash_alg, basename, basename_len, &B_str);
+ }
+
+ sts = NewEcPoint(G1, &B);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &k);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &t);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewEcPoint(G1, &e);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(GT, &R2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fq, &p2y);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &t1);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &t2);
+ BREAK_ON_EPID_ERROR(sts);
+ p2x = (struct p2x_t*)SAFE_ALLOC(sizeof(struct p2x_t) + basename_len - 1);
+ if (!p2x) {
+ sts = kEpidMemAllocErr;
+ break;
+ }
+
+ sts = NewFfElement(Fp, &a);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &b);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &rx);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &ra);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &rb);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = MemberGetPreSig((MemberCtx*)ctx, &curr_presig);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 3. If the pre-computed signature pre-sigma exists, the member
+ // loads (B, K, T, a, b, rx, rf, ra, rb, R1, R2) from
+ // pre-sigma. Refer to Section 4.4 for the computation of
+ // these values.
+ sts = ReadFfElement(Fp, &curr_presig.a, sizeof(curr_presig.a), a);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, &curr_presig.b, sizeof(curr_presig.b), b);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, &curr_presig.rx, sizeof(curr_presig.rx), rx);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, &curr_presig.ra, sizeof(curr_presig.ra), ra);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, &curr_presig.rb, sizeof(curr_presig.rb), rb);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // If the basename is provided, use it, otherwise use presig B
+ if (basename) {
+ // 3.a. The member computes (B, i2, y2) = G1.tpmHash(bsn).
+ sts = EcHash(G1, basename, basename_len, ctx->hash_alg, B, &p2x->i);
+ BREAK_ON_EPID_ERROR(sts);
+ p2x->i = htonl(p2x->i);
+ sts = WriteEcPoint(G1, B, &commit_out.B, sizeof(commit_out.B));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fq, &commit_out.B.y, sizeof(commit_out.B.y), p2y);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // b.i. (KTPM, LTPM, ETPM, counterTPM) = TPM2_Commit(P1=h1,(s2, y2) = (i2
+ // || bsn, y2)).
+ // b.ii.K = KTPM.
+ if (0 !=
+ memcpy_S((void*)p2x->bsn, basename_len, basename, basename_len)) {
+ sts = kEpidBadArgErr;
+ break;
+ }
+ sts =
+ Tpm2Commit(ctx->tpm2_ctx, ctx->h1, p2x, sizeof(p2x->i) + basename_len,
+ p2y, k, t, e, (uint16_t*)&ctx->rf_ctr);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteEcPoint(G1, k, &commit_out.K, sizeof(commit_out.K));
+ BREAK_ON_EPID_ERROR(sts);
+ // c.i. The member computes R1 = LTPM.
+ sts = WriteEcPoint(G1, t, &commit_out.R1, sizeof(commit_out.R1));
+ BREAK_ON_EPID_ERROR(sts);
+ // c.ii. e12rf = pairing(ETPM, g2)
+ sts = Pairing(ps_ctx, e, ctx->epid2_params->g2, R2);
+ BREAK_ON_EPID_ERROR(sts);
+ // c.iii. R2 = GT.sscmMultiExp(ea2, t1, e12rf, 1, e22, t2, e2w,ra).
+ // 4.i. The member computes t1 = (- rx) mod p.
+ sts = FfNeg(Fp, rx, t1);
+ BREAK_ON_EPID_ERROR(sts);
+ // 4.j. The member computes t2 = (rb - a * rx) mod p.
+ sts = FfMul(Fp, a, rx, t2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfNeg(Fp, t2, t2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfAdd(Fp, rb, t2, t2);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = WriteFfElement(Fp, t1, &t1_str, sizeof(t1_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, t2, &t2_str, sizeof(t2_str));
+ BREAK_ON_EPID_ERROR(sts);
+ {
+ FfElement const* points[4];
+ BigNumStr const* exponents[4];
+ points[0] = ctx->ea2;
+ points[1] = R2;
+ points[2] = ctx->e22;
+ points[3] = ctx->e2w;
+ exponents[0] = &t1_str;
+ exponents[1] = &kOne;
+ exponents[2] = &t2_str;
+ exponents[3] = (BigNumStr*)&curr_presig.ra;
+ sts = FfMultiExp(GT, points, exponents, COUNT_OF(points), R2);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+
+ sts = WriteFfElement(GT, R2, &commit_out.R2, sizeof(commit_out.R2));
BREAK_ON_EPID_ERROR(sts);
- sts = TpmSignCommit(ctx->tpm_ctx, &B_str, &commit_out);
+ // d. The member over-writes the counterTPM, B, K, R1 and R2 values.
} else {
- sts = TpmSignCommit(ctx->tpm_ctx, NULL, &commit_out);
+ if (!rnd_bsn) {
+ sts = kEpidBadArgErr;
+ break;
+ }
+ sts = ReadEcPoint(G1, &curr_presig.B, sizeof(curr_presig.B), B);
+ BREAK_ON_EPID_ERROR(sts);
+ commit_out.B = curr_presig.B;
+ commit_out.K = curr_presig.K;
+ commit_out.R1 = curr_presig.R1;
+ ((MemberCtx*)ctx)->rf_ctr = curr_presig.rf_ctr;
+ commit_out.R2 = curr_presig.R2;
+ *rnd_bsn = curr_presig.rnd_bsn;
}
- BREAK_ON_EPID_ERROR(sts);
+
+ commit_out.T = curr_presig.T;
sts = HashSignCommitment(Fp, ctx->hash_alg, &ctx->pub_key, &commit_out, msg,
msg_len, &c_str);
BREAK_ON_EPID_ERROR(sts);
- sts = TpmSign(ctx->tpm_ctx, &c_str, &sig->sx, &sig->sf, &sig->sa, &sig->sb);
+ digest_size = EpidGetHashSize(ctx->hash_alg);
+ digest = (uint8_t*)SAFE_ALLOC(digest_size);
+ if (!digest) {
+ sts = kEpidNoMemErr;
+ break;
+ }
+ memcpy_S(digest + digest_size - sizeof(c_str), sizeof(c_str), &c_str,
+ sizeof(c_str));
+
+ sts = NewFfElement(Fp, &t3);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = NewFfElement(Fp, &c);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = ReadFfElement(Fp, &c_str, sizeof(c_str), c);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 7. The member computes sx = (rx + c * x) mod p.
+ sts = FfMul(Fp, c, x, t3);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfAdd(Fp, rx, t3, t3);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, t3, &sig->sx, sizeof(sig->sx));
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 8. The member computes sf = (rf + c * f) mod p.
+ sts = Tpm2Sign(ctx->tpm2_ctx, digest, digest_size, *rf_ctr, NULL, t3);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, t3, &sig->sf, sizeof(sig->sf));
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 9. The member computes sa = (ra + c * a) mod p.
+ sts = FfMul(Fp, c, a, t3);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfAdd(Fp, ra, t3, t3);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, t3, &sig->sa, sizeof(sig->sa));
+ BREAK_ON_EPID_ERROR(sts);
+
+ // 10. The member computes sb = (rb + c * b) mod p.
+ sts = FfMul(Fp, c, b, t3);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfAdd(Fp, rb, t3, t3);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, t3, &sig->sb, sizeof(sig->sb));
BREAK_ON_EPID_ERROR(sts);
sig->B = commit_out.B;
@@ -92,5 +306,35 @@ EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
sts = kEpidNoErr;
} while (0);
+ if (sts != kEpidNoErr) {
+ (void)Tpm2ReleaseCounter(ctx->tpm2_ctx, (uint16_t)ctx->rf_ctr);
+ (void)Tpm2ReleaseCounter(ctx->tpm2_ctx, curr_presig.rf_ctr);
+ } else if (basename) {
+ (void)Tpm2ReleaseCounter(ctx->tpm2_ctx, curr_presig.rf_ctr);
+ }
+
+ EpidZeroMemory(&curr_presig, sizeof(curr_presig));
+
+ DeleteEcPoint(&B);
+ DeleteEcPoint(&k);
+ DeleteEcPoint(&t);
+ DeleteEcPoint(&e);
+ DeleteFfElement(&R2);
+ DeleteFfElement(&p2y);
+ DeleteFfElement(&t1);
+ DeleteFfElement(&t2);
+
+ DeleteFfElement(&a);
+ DeleteFfElement(&b);
+ DeleteFfElement(&rx);
+ DeleteFfElement(&ra);
+ DeleteFfElement(&rb);
+
+ SAFE_FREE(p2x);
+
+ DeleteFfElement(&t3);
+ DeleteFfElement(&c);
+ SAFE_FREE(digest);
+
return sts;
}
diff --git a/epid/member/src/signbasic.h b/epid/member/src/signbasic.h
new file mode 100644
index 0000000..53359e0
--- /dev/null
+++ b/epid/member/src/signbasic.h
@@ -0,0 +1,70 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// EpidSignBasic interface.
+/*! \file */
+#ifndef EPID_MEMBER_SRC_SIGNBASIC_H_
+#define EPID_MEMBER_SRC_SIGNBASIC_H_
+
+#include <stddef.h>
+#include "epid/common/errors.h"
+
+/// \cond
+typedef struct MemberCtx MemberCtx;
+typedef struct BasicSignature BasicSignature;
+typedef struct BigNumStr BigNumStr;
+/// \endcond
+
+/// Creates a basic signature for use in constrained environment.
+/*!
+ Used in constrained environments where, due to limited memory, it may not
+ be possible to process through a large and potentially unbounded revocation
+ list.
+
+ \param[in] ctx
+ The member context.
+ \param[in] msg
+ The message.
+ \param[in] msg_len
+ The length of message in bytes.
+ \param[in] basename
+ Optional basename. If basename is NULL a random basename is used.
+ Signatures generated using random basenames are anonymous. Signatures
+ generated using the same basename are linkable by the verifier. If a
+ basename is provided it must already be registered or
+ ::kEpidBadArgErr is returned.
+ \param[in] basename_len
+ The size of basename in bytes. Must be 0 if basename is NULL.
+ \param[out] sig
+ The generated basic signature
+ \param[out] rnd_bsn
+ Random basename, can be NULL if basename is provided.
+
+ \returns ::EpidStatus
+
+ \note
+ This function should be used in conjunction with EpidNrProve()
+
+ \note
+ If the result is not ::kEpidNoErr the content of sig, is undefined.
+
+ \see EpidMemberCreate
+ \see EpidNrProve
+ */
+EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
+ void const* basename, size_t basename_len,
+ BasicSignature* sig, BigNumStr* rnd_bsn);
+
+#endif // EPID_MEMBER_SRC_SIGNBASIC_H_
diff --git a/epid/member/tpm/src/init.c b/epid/member/src/startup.c
index a17bdc5..ba310c5 100644
--- a/epid/member/tpm/src/init.c
+++ b/epid/member/src/startup.c
@@ -13,37 +13,35 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-/// Non-sensitive member context implementation
-/*! \file */
+/// EpidMemberStartup implementation.
+/*!
+ * \file
+ */
-#include "epid/member/tpm/init.h"
+#include <epid/member/api.h>
-#include <stddef.h>
-
-#include "epid/member/tpm/src/types.h"
+#include <string.h>
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/finitefield.h"
#include "epid/common/src/epid2params.h"
#include "epid/common/types.h" // MemberPrecomp
-#include "epid/common/math/finitefield.h"
-#include "epid/common/math/ecgroup.h"
-#include "epid/common/math/pairing.h"
-#include "epid/common/src/memory.h"
+#include "epid/member/src/context.h"
+#include "epid/member/src/precomp.h"
+#include "epid/member/src/storage.h"
-/// Handle Intel(R) EPID Error with Break
+/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
if (kEpidNoErr != (ret)) { \
break; \
}
-static EpidStatus TpmReadMemberPrecomputation(TpmCtx* ctx,
- MemberPrecomp const* precomp);
+static EpidStatus MemberReadPrecomputation(MemberCtx* ctx,
+ MemberPrecomp const* precomp);
-EpidStatus TpmInit(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
- G1ElemStr const* h1_str, G1ElemStr const* h2_str,
- G2ElemStr const* w_str, MemberPrecomp const* precomp_str) {
+EpidStatus EpidMemberStartup(MemberCtx* ctx) {
EpidStatus sts = kEpidErr;
-
- if (!ctx || !A_str || !x_str || !h1_str || !h2_str || !w_str ||
- !ctx->epid2_params) {
+ uint32_t const nv_index = 0x01c10100;
+ if (!ctx) {
return kEpidBadArgErr;
}
@@ -56,23 +54,37 @@ EpidStatus TpmInit(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
EcPoint* h1 = (EcPoint*)ctx->h1;
EcPoint* h2 = (EcPoint*)ctx->h2;
EcPoint* w = (EcPoint*)ctx->w;
-
- sts = ReadEcPoint(G1, A_str, sizeof(*A_str), A);
+ sts = EpidNvReadMembershipCredential(ctx->tpm2_ctx, nv_index, &ctx->pub_key,
+ &ctx->credential);
+ BREAK_ON_EPID_ERROR(sts);
+ if (!ctx->precomp_ready) {
+ sts = PrecomputeMemberPairing(ctx->epid2_params, &ctx->pub_key,
+ &ctx->credential.A, &ctx->precomp);
+ BREAK_ON_EPID_ERROR(sts);
+ ctx->precomp_ready = true;
+ }
+
+ if (!ctx->is_provisioned && !ctx->is_initially_provisioned) {
+ sts = EpidMemberInitialProvision(ctx);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+
+ sts = ReadEcPoint(G1, &ctx->credential.A, sizeof(ctx->credential.A), A);
BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(Fp, x_str, sizeof(*x_str), x);
+ sts = ReadFfElement(Fp, &ctx->credential.x, sizeof(ctx->credential.x), x);
BREAK_ON_EPID_ERROR(sts);
- sts = ReadEcPoint(G1, h1_str, sizeof(*h1_str), h1);
+ sts = ReadEcPoint(G1, &ctx->pub_key.h1, sizeof(ctx->pub_key.h1), h1);
BREAK_ON_EPID_ERROR(sts);
- sts = ReadEcPoint(G1, h2_str, sizeof(*h2_str), h2);
+ sts = ReadEcPoint(G1, &ctx->pub_key.h2, sizeof(ctx->pub_key.h2), h2);
BREAK_ON_EPID_ERROR(sts);
- sts = ReadEcPoint(G2, w_str, sizeof(*w_str), w);
+ sts = ReadEcPoint(G2, &ctx->pub_key.w, sizeof(ctx->pub_key.w), w);
BREAK_ON_EPID_ERROR(sts);
- sts = TpmReadMemberPrecomputation(ctx, precomp_str);
+ sts = MemberReadPrecomputation(ctx, &ctx->precomp);
BREAK_ON_EPID_ERROR(sts);
sts = kEpidNoErr;
@@ -81,11 +93,11 @@ EpidStatus TpmInit(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
return sts;
}
-static EpidStatus TpmReadMemberPrecomputation(TpmCtx* ctx,
- MemberPrecomp const* precomp) {
+static EpidStatus MemberReadPrecomputation(MemberCtx* ctx,
+ MemberPrecomp const* precomp) {
EpidStatus sts = kEpidErr;
- if (!ctx || !precomp || !ctx->epid2_params) {
+ if (!ctx || !precomp || !ctx->epid2_params || !ctx) {
return kEpidBadArgErr;
}
diff --git a/epid/member/src/storage.c b/epid/member/src/storage.c
new file mode 100644
index 0000000..618faef
--- /dev/null
+++ b/epid/member/src/storage.c
@@ -0,0 +1,71 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief Member credentials storage helper API implementation.
+ */
+
+#include "epid/member/src/storage.h"
+
+#include "epid/common/src/memory.h"
+#include "epid/common/types.h"
+#include "epid/member/tpm2/nv.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+EpidStatus EpidNvWriteMembershipCredential(
+ Tpm2Ctx* ctx, GroupPubKey const* pub_key,
+ MembershipCredential const* credential, uint32_t nv_index) {
+ EpidStatus sts = kEpidErr;
+ uint8_t tmp;
+ if (!ctx || !pub_key || !credential) return kEpidBadArgErr;
+
+ do {
+ if (kEpidNoErr != Tpm2NvRead(ctx, nv_index, 1, 0, &tmp)) {
+ sts = Tpm2NvDefineSpace(ctx, nv_index,
+ sizeof(*pub_key) + sizeof(*credential));
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ sts = Tpm2NvWrite(ctx, nv_index, sizeof(*pub_key), 0, pub_key);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = Tpm2NvWrite(ctx, nv_index, sizeof(*credential), sizeof(*pub_key),
+ credential);
+ BREAK_ON_EPID_ERROR(sts);
+ } while (0);
+ if (kEpidNoErr != sts) Tpm2NvUndefineSpace(ctx, nv_index);
+ EpidZeroMemory(&tmp, sizeof(tmp));
+ return sts;
+}
+
+EpidStatus EpidNvReadMembershipCredential(Tpm2Ctx* ctx, uint32_t nv_index,
+ GroupPubKey* pub_key,
+ MembershipCredential* credential) {
+ EpidStatus sts = kEpidErr;
+ if (!ctx || !pub_key || !credential) return kEpidBadArgErr;
+ do {
+ sts = Tpm2NvRead(ctx, nv_index, sizeof(*pub_key), 0, pub_key);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = Tpm2NvRead(ctx, nv_index, sizeof(*credential), sizeof(*pub_key),
+ credential);
+ BREAK_ON_EPID_ERROR(sts);
+ } while (0);
+ return sts;
+}
diff --git a/epid/member/src/storage.h b/epid/member/src/storage.h
new file mode 100644
index 0000000..2db7a5c
--- /dev/null
+++ b/epid/member/src/storage.h
@@ -0,0 +1,72 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Member credentials storage helper API
+/*! \file */
+#ifndef EPID_MEMBER_SRC_STORAGE_H_
+#define EPID_MEMBER_SRC_STORAGE_H_
+
+#include <stdint.h>
+#include "epid/common/errors.h"
+
+/// \cond
+typedef struct Tpm2Ctx Tpm2Ctx;
+typedef struct GroupPubKey GroupPubKey;
+typedef struct MembershipCredential MembershipCredential;
+/// \endcond
+
+/// Write membership credential to TPM non-volatile memory.
+/*!
+Allocates TPM non volatile memory for nv_index for membership credentials.
+Write group public key and member private key parameters A and x into
+space allocated.
+
+\param[in] ctx
+The TPM context.
+\param[in] pub_key
+Group public key.
+\param[in] credential
+Membership credential.
+\param[in] nv_index
+Handle of the data area to be defined.
+
+\returns ::EpidStatus
+
+\see EpidNvReadMembershipCredential
+*/
+EpidStatus EpidNvWriteMembershipCredential(
+ Tpm2Ctx* ctx, GroupPubKey const* pub_key,
+ MembershipCredential const* credential, uint32_t nv_index);
+
+/// Read membership credential from TPM non-volatile memory.
+/*!
+\param[in] ctx
+The TPM context.
+\param[in] nv_index
+Handle of the data area.
+\param[out] pub_key
+Group public key.
+\param[out] credential
+Membership credential.
+
+\returns ::EpidStatus
+
+\see EpidNvWriteMembershipCredential
+*/
+EpidStatus EpidNvReadMembershipCredential(Tpm2Ctx* ctx, uint32_t nv_index,
+ GroupPubKey* pub_key,
+ MembershipCredential* credential);
+
+#endif // EPID_MEMBER_SRC_STORAGE_H_
diff --git a/epid/member/tpm/src/validatekey.c b/epid/member/src/validatekey.c
index 0374436..d7c5bd2 100644
--- a/epid/member/tpm/src/validatekey.c
+++ b/epid/member/src/validatekey.c
@@ -16,17 +16,18 @@
/// Non-sensitive member context implementation
/*! \file */
-#include "epid/member/tpm/validatekey.h"
+#include "epid/member/src/validatekey.h"
#include <stddef.h>
-#include "epid/member/tpm/src/types.h"
-#include "epid/common/src/epid2params.h"
-#include "epid/common/types.h" // MemberPrecomp
-#include "epid/common/math/finitefield.h"
#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/finitefield.h"
#include "epid/common/math/pairing.h"
+#include "epid/common/src/epid2params.h"
#include "epid/common/src/memory.h"
+#include "epid/common/types.h" // MemberPrecomp
+#include "epid/member/src/context.h"
+#include "epid/member/src/privateexp.h"
/// Handle Intel(R) EPID Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -34,8 +35,9 @@
break; \
}
-bool TpmIsKeyValid(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
- G1ElemStr const* h1_str, G2ElemStr const* w_str) {
+bool EpidMemberIsKeyValid(MemberCtx* ctx, G1ElemStr const* A_str,
+ FpElemStr const* x_str, G1ElemStr const* h1_str,
+ G2ElemStr const* w_str) {
bool key_is_valid = false;
EcPoint* t1 = NULL;
EcPoint* t2 = NULL;
@@ -44,7 +46,6 @@ bool TpmIsKeyValid(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
EcPoint* A = NULL;
EcPoint* h1 = NULL;
EcPoint* w = NULL;
- BigNumStr f_str = {0};
if (!ctx || !A_str || !x_str || !h1_str || !w_str || !ctx->epid2_params) {
return false;
@@ -52,14 +53,17 @@ bool TpmIsKeyValid(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
do {
EpidStatus sts = kEpidErr;
- FiniteField* Fp = ctx->epid2_params->Fp;
EcGroup* G1 = ctx->epid2_params->G1;
EcGroup* G2 = ctx->epid2_params->G2;
FiniteField* GT = ctx->epid2_params->GT;
EcPoint* g1 = ctx->epid2_params->g1;
EcPoint* g2 = ctx->epid2_params->g2;
PairingState* ps_ctx = ctx->epid2_params->pairing_state;
- FfElement const* f = ctx->secret.f;
+
+ if (!ctx->is_provisioned && !ctx->is_initially_provisioned) {
+ sts = EpidMemberInitialProvision(ctx);
+ BREAK_ON_EPID_ERROR(sts);
+ }
// 2. The member computes t1 = G2.sscmExp(g2, x).
sts = NewEcPoint(G2, &t1);
@@ -93,9 +97,7 @@ bool TpmIsKeyValid(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
BREAK_ON_EPID_ERROR(sts);
sts = ReadEcPoint(G1, h1_str, sizeof(*h1_str), h1);
BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, f, &f_str, sizeof(f_str));
- BREAK_ON_EPID_ERROR(sts);
- sts = EcSscmExp(G1, h1, &f_str, t2);
+ sts = EpidPrivateExp(ctx, h1, t2);
BREAK_ON_EPID_ERROR(sts);
// 6. The member computes t2 = G1.mul(t2, g1).
@@ -116,8 +118,6 @@ bool TpmIsKeyValid(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
}
} while (0);
- EpidZeroMemory(&f_str, sizeof(f_str));
-
DeleteEcPoint(&t1);
DeleteEcPoint(&t2);
DeleteFfElement(&t3);
diff --git a/epid/member/tpm/validatekey.h b/epid/member/src/validatekey.h
index c4331b0..b7ff66e 100644
--- a/epid/member/tpm/validatekey.h
+++ b/epid/member/src/validatekey.h
@@ -16,31 +16,25 @@
/// Non-sensitive member context APIs
/*! \file */
-#ifndef EPID_MEMBER_TPM_VALIDATEKEY_H_
-#define EPID_MEMBER_TPM_VALIDATEKEY_H_
+#ifndef EPID_MEMBER_SRC_VALIDATEKEY_H_
+#define EPID_MEMBER_SRC_VALIDATEKEY_H_
-#include "epid/common/stdtypes.h"
#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
/// \cond
-typedef struct TpmCtx TpmCtx;
+typedef struct MemberCtx MemberCtx;
typedef struct G1ElemStr G1ElemStr;
typedef struct G2ElemStr G2ElemStr;
typedef struct FpElemStr FpElemStr;
/// \endcond
-/*!
- \addtogroup TpmModule tpm
- \ingroup EpidMemberModule
- @{
-*/
-
/// Checks if provided parameters result in a valid key
/*!
\param[in,out] ctx
- The TPM context.
+ The member context.
\param[in] A_str
The A value of the member private key.
@@ -60,14 +54,11 @@ typedef struct FpElemStr FpElemStr;
\retval false
if the input values would result in an invalid member private key
- \see TpmCreate
- \see TpmInit
- \see TpmProvision
+ \see MemberCreate
*/
-bool TpmIsKeyValid(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
- G1ElemStr const* h1_str, G2ElemStr const* w_str);
-
-/*! @} */
+bool EpidMemberIsKeyValid(MemberCtx* ctx, G1ElemStr const* A_str,
+ FpElemStr const* x_str, G1ElemStr const* h1_str,
+ G2ElemStr const* w_str);
-#endif // EPID_MEMBER_TPM_VALIDATEKEY_H_
+#endif // EPID_MEMBER_SRC_VALIDATEKEY_H_
diff --git a/epid/member/src/write_precomp.c b/epid/member/src/write_precomp.c
new file mode 100644
index 0000000..bd36983
--- /dev/null
+++ b/epid/member/src/write_precomp.c
@@ -0,0 +1,36 @@
+/*############################################################################
+ # Copyright 2016-2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// EpidMemberWritePrecomp implementation.
+/*! \file */
+#include "epid/member/src/write_precomp.h"
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "epid/member/src/context.h"
+
+EpidStatus EpidMemberWritePrecomp(MemberCtx const* ctx,
+ MemberPrecomp* precomp) {
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+ if (!precomp) {
+ return kEpidBadArgErr;
+ }
+
+ *precomp = ctx->precomp;
+ return kEpidNoErr;
+}
diff --git a/epid/member/tpm/presig.h b/epid/member/src/write_precomp.h
index 281b204..9cf2b5b 100644
--- a/epid/member/tpm/presig.h
+++ b/epid/member/src/write_precomp.h
@@ -13,53 +13,34 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-/// Sensitive pre-computed signature APIs
+/// EpidMemberWritePrecomp interface.
/*! \file */
-
-#ifndef EPID_MEMBER_TPM_PRESIG_H_
-#define EPID_MEMBER_TPM_PRESIG_H_
-
-#include <stddef.h>
+#ifndef EPID_MEMBER_SRC_WRITE_PRECOMP_H_
+#define EPID_MEMBER_SRC_WRITE_PRECOMP_H_
#include "epid/common/errors.h"
/// \cond
-typedef struct TpmCtx TpmCtx;
+typedef struct MemberCtx MemberCtx;
+typedef struct MemberPrecomp MemberPrecomp;
/// \endcond
+/// Serializes the pre-computed member settings.
/*!
- \addtogroup TpmModule tpm
- \ingroup EpidMemberModule
- @{
-*/
-
-/// Extends the TPM's pool of pre-computed signatures.
-/*!
-
- \param[in,out] ctx
- The TPM context.
+\param[in] ctx
+The member context.
+\param[out] precomp
+The Serialized pre-computed member settings.
- \param[in] number_presigs
- The number of pre-computed signatures to add to the pool.
+\returns ::EpidStatus
- \returns ::EpidStatus
+\note
+If the result is not ::kEpidNoErr, the content of precomp is undefined.
- \see TpmGetNumPreSigs
- */
-EpidStatus TpmAddPreSigs(TpmCtx* ctx, size_t number_presigs);
+\b Example
-/// Gets the number of pre-computed signatures in the TPM's pool.
-/*!
-
- \param[in,out] ctx
- The TPM context.
-
- \returns
- Number of pre-computed signatures in TPM's pool
-
- \see TpmAddPreSigs
- */
-size_t TpmGetNumPreSigs(TpmCtx const* ctx);
+\ref UserManual_GeneratingAnIntelEpidSignature
+*/
+EpidStatus EpidMemberWritePrecomp(MemberCtx const* ctx, MemberPrecomp* precomp);
-/*! @} */
-#endif // EPID_MEMBER_TPM_PRESIG_H_
+#endif // EPID_MEMBER_SRC_WRITE_PRECOMP_H_
diff --git a/epid/member/tpm/context.h b/epid/member/tpm/context.h
deleted file mode 100644
index dbea8c1..0000000
--- a/epid/member/tpm/context.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// Sensitive member context APIs
-/*! \file */
-
-#ifndef EPID_MEMBER_TPM_CONTEXT_H_
-#define EPID_MEMBER_TPM_CONTEXT_H_
-
-#include "epid/common/errors.h"
-#include "epid/common/bitsupplier.h"
-
-/// \cond
-typedef struct TpmCtx TpmCtx;
-typedef struct FpElemStr FpElemStr;
-typedef struct Epid2Params_ Epid2Params_;
-typedef struct OctStr256 OctStr256;
-/// \endcond
-
-/*!
- \addtogroup TpmModule tpm
- \ingroup EpidMemberModule
- @{
-*/
-
-/// Creates a new Tpm context
-/*!
-
- Must be called to create the TPM context that is used by other TPM
- APIs.
-
- ::TpmDelete must be called to safely release the TPM context.
-
- You need to use a cryptographically secure random number generator
- to create a TPM context using ::TpmCreate. The ::BitSupplier is
- provided as a function prototype for your own implementation of the
- random number generator.
-
- \param[in] rnd_func
- Random number generator.
-
- \param[in] rnd_param
- Pass through user data that will be passed to the user_data
- parameter of the random number generator.
-
- \param[in] epid2_params
- The field and group parameters.
-
- \param[out] ctx
- Newly constructed TPM context.
-
- \returns ::EpidStatus
-
- \see TpmDelete
- \see TpmProvision
-
- */
-EpidStatus TpmCreate(BitSupplier rnd_func, void* rnd_param,
- Epid2Params_ const* epid2_params, TpmCtx** ctx);
-
-/// Deletes an existing Tpm context.
-/*!
-
- Must be called to safely release a TPM context created using
- ::TpmCreate.
-
- De-initializes the context, frees memory used by the context, and
- sets the context pointer to NULL.
-
- \param[in,out] ctx
- The TPM context. Can be NULL.
-
- \see TpmCreate
- */
-void TpmDelete(TpmCtx** ctx);
-
-/// Provisions Tpm with sensitive parameters
-/*!
-
- \param[in,out] ctx
- The TPM context.
-
- \param f_str
- The f value of the member private key.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmInit
-
- */
-EpidStatus TpmProvision(TpmCtx* ctx, FpElemStr const* f_str);
-
-/// Provisions Tpm with compressed key seed
-/*!
-
- You must call ::TpmDecompressKey before performing any other
- operations that use the TPM context.
-
- \param[in,out] ctx
- The TPM context.
-
- \param[in] seed
- The seed value of the compressed key.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmInit
- \see TpmDecompressKey
-
- */
-EpidStatus TpmProvisionCompressed(TpmCtx* ctx, OctStr256 const* seed);
-
-/*! @} */
-
-#endif // EPID_MEMBER_TPM_CONTEXT_H_
diff --git a/epid/member/tpm/decompress.h b/epid/member/tpm/decompress.h
deleted file mode 100644
index ee78d45..0000000
--- a/epid/member/tpm/decompress.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM key decompression APIs
-/*! \file */
-
-#ifndef EPID_MEMBER_TPM_DECOMPRESS_H_
-#define EPID_MEMBER_TPM_DECOMPRESS_H_
-
-#include "epid/common/errors.h"
-
-/// \cond
-typedef struct TpmCtx TpmCtx;
-typedef struct G1ElemStr G1ElemStr;
-typedef struct G2ElemStr G2ElemStr;
-typedef struct FpElemStr FpElemStr;
-typedef struct FqElemStr FqElemStr;
-/// \endcond
-
-/*!
- \addtogroup TpmModule tpm
- \ingroup EpidMemberModule
- @{
-*/
-
-/// Decompresses provisioned key
-/*!
-
- If you provision a compressed key using ::TpmProvisionCompressed,
- you must call ::TpmDecompressKey before performing any other
- operations that use the TPM context. Once decompressed, the context
- will maintain the decompressed key for the lifetime of the context.
-
- \note
- If the compressed private key has not been provisioned, the result
- of the decompression is undefined.
-
- \param[in,out] ctx
- The TPM context.
-
- \param[in] h1_str
- The h1 value of the group public key.
-
- \param[in] w_str
- The w value of the group public key.
-
- \param[in] Ax_str
- The Ax value of the compressed member private key.
-
- \param[out] A_str
- The A value of the member private key.
-
- \param[out] x_str
- The x value of the member private key.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmProvisionCompressed
- */
-EpidStatus TpmDecompressKey(TpmCtx* ctx, G1ElemStr const* h1_str,
- G2ElemStr const* w_str, FqElemStr const* Ax_str,
- G1ElemStr* A_str, FpElemStr* x_str);
-
-/*! @} */
-#endif // EPID_MEMBER_TPM_DECOMPRESS_H_
diff --git a/epid/member/tpm/init.h b/epid/member/tpm/init.h
deleted file mode 100644
index 84de1d3..0000000
--- a/epid/member/tpm/init.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// Non-sensitive member context APIs
-/*! \file */
-
-#ifndef EPID_MEMBER_TPM_INIT_H_
-#define EPID_MEMBER_TPM_INIT_H_
-
-#include "epid/common/errors.h"
-
-/// \cond
-typedef struct TpmCtx TpmCtx;
-typedef struct G1ElemStr G1ElemStr;
-typedef struct G2ElemStr G2ElemStr;
-typedef struct FpElemStr FpElemStr;
-typedef struct MemberPrecomp MemberPrecomp;
-/// \endcond
-
-/*!
- \addtogroup TpmModule tpm
- \ingroup EpidMemberModule
- @{
-*/
-
-/// Initializes Tpm with non-sensitive parameters
-/*!
-
- \note Does not check consistency with the provisioned f value. Use
- ::TpmIsKeyValid to check that the parameters will result in a valid
- key pair.
-
- \param[in,out] ctx
- The TPM context.
-
- \param[in] A_str
- The A value of the member private key.
-
- \param[in] x_str
- The x value of the member private key.
-
- \param[in] h1_str
- The h1 value of the group public key.
-
- \param[in] h2_str
- The h2 value of the group public key.
-
- \param[in] w_str
- The w value of the group public key.
-
- \param[in] precomp_str
- The member pre-computed data.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmIsKeyValid
- */
-EpidStatus TpmInit(TpmCtx* ctx, G1ElemStr const* A_str, FpElemStr const* x_str,
- G1ElemStr const* h1_str, G1ElemStr const* h2_str,
- G2ElemStr const* w_str, MemberPrecomp const* precomp_str);
-
-/*! @} */
-
-#endif // EPID_MEMBER_TPM_INIT_H_
diff --git a/epid/member/tpm/join.h b/epid/member/tpm/join.h
deleted file mode 100644
index 564ec37..0000000
--- a/epid/member/tpm/join.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM join APIs
-/*! \file */
-
-#ifndef EPID_MEMBER_TPM_JOIN_H_
-#define EPID_MEMBER_TPM_JOIN_H_
-
-#include "epid/common/errors.h"
-
-/// \cond
-typedef struct TpmCtx TpmCtx;
-typedef struct G1ElemStr G1ElemStr;
-typedef struct FpElemStr FpElemStr;
-/// \endcond
-
-/*!
- \addtogroup TpmModule tpm
- \ingroup EpidMemberModule
- @{
-*/
-
-/// Performs the first part of the join operation
-/*!
-
- \param[in,out] ctx
- The TPM context.
-
- \param[out] F_str
- The F value of the join commit.
-
- \param[out] R_str
- The R value of the join commit.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmProvision
- \see TpmJoin
-*/
-EpidStatus TpmJoinCommit(TpmCtx* ctx, G1ElemStr* F_str, G1ElemStr* R_str);
-
-/// Performs the last part of the join operation
-/*!
-
- \note
- ::TpmJoin must be preceded by a call to ::TpmJoinCommit. Two
- sequential calls to ::TpmJoin will fail with
- ::kEpidOutOfSequenceError.
-
- \param[in] ctx
- The TPM context.
-
- \param[in] c_str
- The join commitment hash.
-
- \param[out] s_str
- The s value of the join request.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmProvision
- \see TpmJoinCommit
- */
-EpidStatus TpmJoin(TpmCtx* ctx, FpElemStr const* c_str, FpElemStr* s_str);
-
-/*! @} */
-#endif // EPID_MEMBER_TPM_JOIN_H_
diff --git a/epid/member/tpm/nrprove.h b/epid/member/tpm/nrprove.h
deleted file mode 100644
index 4aa57e7..0000000
--- a/epid/member/tpm/nrprove.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM NrProve APIs
-/*! \file */
-
-#ifndef EPID_MEMBER_TPM_NRPROVE_H_
-#define EPID_MEMBER_TPM_NRPROVE_H_
-
-#include "epid/common/errors.h"
-#include "epid/common/types.h"
-
-/// \cond
-typedef struct TpmCtx TpmCtx;
-/// \endcond
-
-/*!
- \addtogroup TpmModule tpm
- \ingroup EpidMemberModule
- @{
-*/
-
-#pragma pack(1)
-/// Result of NrProve Commit
-typedef struct NrProveCommitOutput {
- G1ElemStr T; ///< T value for NrProof
- G1ElemStr R1; ///< Serialized G1 element
- G1ElemStr R2; ///< Serialized G1 element
-} NrProveCommitOutput;
-#pragma pack()
-
-/// Performs the first part of the NrProve operation
-/*!
-
- \param[in,out] ctx
- The TPM context.
-
- \param[in] B_str
- The B value from the ::BasicSignature.
-
- \param[in] K_str
- The K value from the ::BasicSignature.
-
- \param[in] sigrl_entry
- The signature based revocation list entry corresponding to this
- proof.
-
- \param[out] commit_out
- The resulting commitment value.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmProvision
- \see TpmInit
- \see TpmNrProve
-*/
-EpidStatus TpmNrProveCommit(TpmCtx* ctx, G1ElemStr const* B_str,
- G1ElemStr const* K_str,
- SigRlEntry const* sigrl_entry,
- NrProveCommitOutput* commit_out);
-
-/// Performs the last part of the NrProve operation
-/*!
-
- \note
- ::TpmNrProve must be preceded by a call to ::TpmNrProveCommit. Two
- sequential calls to ::TpmNrProve will fail with
- ::kEpidOutOfSequenceError.
-
- \param[in,out] ctx
- The TPM context.
-
- \param[in] c_str
- The non-revoked proof commitment hash.
-
- \param[out] smu_str
- The smu value in the non-revoked proof.
-
- \param[out] snu_str
- The snu value in the non-revoked proof.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmProvision
- \see TpmInit
- \see TpmNrProveCommit
- */
-EpidStatus TpmNrProve(TpmCtx* ctx, FpElemStr const* c_str, FpElemStr* smu_str,
- FpElemStr* snu_str);
-
-/*! @} */
-#endif // EPID_MEMBER_TPM_NRPROVE_H_
diff --git a/epid/member/tpm/sign.h b/epid/member/tpm/sign.h
deleted file mode 100644
index 3700d17..0000000
--- a/epid/member/tpm/sign.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM signing APIs
-/*! \file */
-
-#ifndef EPID_MEMBER_TPM_SIGN_H_
-#define EPID_MEMBER_TPM_SIGN_H_
-
-#include "epid/common/errors.h"
-#include "epid/common/types.h"
-
-/// \cond
-typedef struct TpmCtx TpmCtx;
-/// \endcond
-
-/*!
- \addtogroup TpmModule tpm
- \ingroup EpidMemberModule
- @{
-*/
-
-#pragma pack(1)
-/// Result of Sign Commit
-typedef struct SignCommitOutput {
- G1ElemStr B; ///< B value for signature
- G1ElemStr K; ///< K value for signature
- G1ElemStr T; ///< T value for signature
- G1ElemStr R1; ///< Serialized G1 element
- GtElemStr R2; ///< Serialized GT element
-} SignCommitOutput;
-#pragma pack()
-
-/// Performs the first part of the sign operation
-/*!
-
- \param[in,out] ctx
- The TPM context.
-
- \param[in] B_in_str
- An optional serialized hash of basename. If NULL a random basename
- is used.
-
- \param[out] commit_out
- The resulting commitment value.
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmProvision
- \see TpmInit
- \see TpmSign
-*/
-EpidStatus TpmSignCommit(TpmCtx* ctx, G1ElemStr const* B_in_str,
- SignCommitOutput* commit_out);
-
-/// Performs the last part of the sign operation
-/*!
-
- \note
- ::TpmSign must be preceded by a call to ::TpmSignCommit. Two
- sequential calls to ::TpmSign will fail with
- ::kEpidOutOfSequenceError.
-
- \param[in] ctx
- The TPM context.
-
- \param[in] c_str
- The sign commitment hash.
-
- \param[out] sx_str
- The ::BasicSignature sx value.
-
- \param[out] sf_str
- The ::BasicSignature sf value.
-
- \param[out] sa_str
- The ::BasicSignature sa value.
-
- \param[out] sb_str
- The ::BasicSignature sb value.
-
-
- \returns ::EpidStatus
-
- \see TpmCreate
- \see TpmProvision
- \see TpmInit
- \see TpmSignCommit
- */
-EpidStatus TpmSign(TpmCtx* ctx, FpElemStr const* c_str, FpElemStr* sx_str,
- FpElemStr* sf_str, FpElemStr* sa_str, FpElemStr* sb_str);
-
-/*! @} */
-#endif // EPID_MEMBER_TPM_SIGN_H_
diff --git a/epid/member/tpm/src/context.c b/epid/member/tpm/src/context.c
deleted file mode 100644
index d968d13..0000000
--- a/epid/member/tpm/src/context.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// Sensitive member context implementation
-/*! \file */
-
-#include "epid/member/tpm/context.h"
-
-#include <stddef.h>
-
-#include "epid/member/tpm/src/types.h"
-#include "epid/common/src/memory.h"
-#include "epid/common/src/epid2params.h"
-#include "epid/common/src/stack.h"
-#include "epid/common/types.h" // MemberPrecomp
-#include "epid/common/math/finitefield.h"
-#include "epid/common/math/ecgroup.h"
-
-/// Handle Intel(R) EPID Error with Break
-#define BREAK_ON_EPID_ERROR(ret) \
- if (kEpidNoErr != (ret)) { \
- break; \
- }
-
-EpidStatus TpmCreate(BitSupplier rnd_func, void* rnd_param,
- Epid2Params_ const* epid2_params, TpmCtx** ctx) {
- EpidStatus sts = kEpidErr;
- TpmCtx* tpm_ctx = NULL;
-
- if (!epid2_params || !ctx) {
- return kEpidBadArgErr;
- }
-
- tpm_ctx = SAFE_ALLOC(sizeof(TpmCtx));
- if (!tpm_ctx) {
- return kEpidMemAllocErr;
- }
-
- do {
- FiniteField* Fp = epid2_params->Fp;
-
- if (!CreateStack(sizeof(PreComputedSignature), &tpm_ctx->secret.presigs)) {
- sts = kEpidMemAllocErr;
- BREAK_ON_EPID_ERROR(sts);
- }
-
- tpm_ctx->epid2_params = epid2_params;
- tpm_ctx->rnd_func = rnd_func;
- tpm_ctx->secret.rnd_param = rnd_param;
- tpm_ctx->secret.sign_pending = false;
- tpm_ctx->secret.nrprove_pending = false;
- tpm_ctx->secret.join_pending = false;
-
- sts = NewFfElement(Fp, &tpm_ctx->secret.a);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.b);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.rx);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.rf);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.ra);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.rb);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.mu);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.nu);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.rmu);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.rnu);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, &tpm_ctx->secret.r);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = NewFfElement(Fp, (FfElement**)&tpm_ctx->secret.f);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = NewEcPoint(tpm_ctx->epid2_params->G1, (EcPoint**)&tpm_ctx->A);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(Fp, (FfElement**)&tpm_ctx->x);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = NewEcPoint(tpm_ctx->epid2_params->G1, (EcPoint**)&tpm_ctx->h1);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(tpm_ctx->epid2_params->G1, (EcPoint**)&tpm_ctx->h2);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(tpm_ctx->epid2_params->G2, (EcPoint**)&tpm_ctx->w);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = NewFfElement(tpm_ctx->epid2_params->GT, (FfElement**)&tpm_ctx->e12);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(tpm_ctx->epid2_params->GT, (FfElement**)&tpm_ctx->e22);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(tpm_ctx->epid2_params->GT, (FfElement**)&tpm_ctx->e2w);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(tpm_ctx->epid2_params->GT, (FfElement**)&tpm_ctx->ea2);
- BREAK_ON_EPID_ERROR(sts);
-
- *ctx = tpm_ctx;
-
- sts = kEpidNoErr;
- } while (0);
-
- if (kEpidNoErr != sts) {
- TpmDelete(&tpm_ctx);
- }
-
- return sts;
-}
-
-void TpmDelete(TpmCtx** ctx) {
- if (ctx && *ctx) {
- (*ctx)->secret.rnd_param = NULL;
- DeleteStack(&(*ctx)->secret.presigs);
- DeleteFfElement((FfElement**)&(*ctx)->secret.f);
- DeleteFfElement((FfElement**)&(*ctx)->secret.a);
- DeleteFfElement((FfElement**)&(*ctx)->secret.b);
- DeleteFfElement((FfElement**)&(*ctx)->secret.rx);
- DeleteFfElement((FfElement**)&(*ctx)->secret.rf);
- DeleteFfElement((FfElement**)&(*ctx)->secret.ra);
- DeleteFfElement((FfElement**)&(*ctx)->secret.rb);
- DeleteFfElement((FfElement**)&(*ctx)->secret.mu);
- DeleteFfElement((FfElement**)&(*ctx)->secret.nu);
- DeleteFfElement((FfElement**)&(*ctx)->secret.rmu);
- DeleteFfElement((FfElement**)&(*ctx)->secret.rnu);
- DeleteFfElement((FfElement**)&(*ctx)->secret.r);
- DeleteEcPoint((EcPoint**)&((*ctx)->h1));
- DeleteEcPoint((EcPoint**)&((*ctx)->h2));
- DeleteEcPoint((EcPoint**)&((*ctx)->A));
- DeleteFfElement((FfElement**)&(*ctx)->x);
- DeleteEcPoint((EcPoint**)&((*ctx)->w));
- DeleteFfElement((FfElement**)&(*ctx)->e12);
- DeleteFfElement((FfElement**)&(*ctx)->e22);
- DeleteFfElement((FfElement**)&(*ctx)->e2w);
- DeleteFfElement((FfElement**)&(*ctx)->ea2);
- SAFE_FREE(*ctx);
- }
-}
-
-EpidStatus TpmProvision(TpmCtx* ctx, FpElemStr const* f_str) {
- EpidStatus sts = kEpidErr;
- if (!ctx || !ctx->epid2_params) {
- return kEpidBadArgErr;
- }
-
- do {
- FiniteField* Fp = ctx->epid2_params->Fp;
- FfElement* f = (FfElement*)ctx->secret.f;
-
- sts = ReadFfElement(Fp, f_str, sizeof(*f_str), f);
- BREAK_ON_EPID_ERROR(sts);
- sts = kEpidNoErr;
- } while (0);
-
- return sts;
-}
-
-EpidStatus TpmProvisionCompressed(TpmCtx* ctx, OctStr256 const* seed) {
- if (!ctx || !seed) {
- return kEpidBadArgErr;
- } else {
- OctStr256* ctx_seed = (OctStr256*)&ctx->secret.seed;
- *ctx_seed = *seed;
- }
- return kEpidNoErr;
-}
diff --git a/epid/member/tpm/src/decompress.c b/epid/member/tpm/src/decompress.c
deleted file mode 100644
index ccd234b..0000000
--- a/epid/member/tpm/src/decompress.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM key decompression implementation
-/*! \file */
-
-#include "epid/member/tpm/decompress.h"
-
-#include "epid/member/tpm/src/types.h"
-#include "epid/common/src/epid2params.h"
-#include "epid/common/math/bignum.h"
-#include "epid/common/math/ecgroup.h"
-#include "epid/common/math/finitefield.h"
-#include "epid/common/math/pairing.h"
-#include "epid/common/math/hash.h"
-#include "epid/common/src/memory.h"
-
-/// Handle Intel(R) EPID Error with Break
-#define BREAK_ON_EPID_ERROR(ret) \
- if (kEpidNoErr != (ret)) { \
- break; \
- }
-
-/// Implements the derivation method used by private key decompression
-/// Derives two integers x, f between [1, p-1] from the seed value
-static EpidStatus DeriveXF(Seed const* seed, FpElemStr const* p, FpElemStr* x,
- FpElemStr* f);
-
-EpidStatus TpmDecompressKey(TpmCtx* ctx, G1ElemStr const* h1_str,
- G2ElemStr const* w_str, FqElemStr const* Ax_str,
- G1ElemStr* A_str, FpElemStr* x_str) {
- EpidStatus sts = kEpidErr;
-
- FfElement* Ax = NULL;
- EcPoint* A = NULL;
- EcPoint* t1 = NULL;
- EcPoint* w = NULL;
- FfElement* t3 = NULL;
- EcPoint* h1 = NULL;
- EcPoint* t2 = NULL;
- FfElement* t4 = NULL;
- BigNum* bn_pminus1 = NULL;
- FpElemStr f_str = {0};
-
- if (!ctx || !h1_str || !w_str || !Ax_str || !A_str || !x_str ||
- !ctx->epid2_params) {
- return kEpidBadArgErr;
- }
-
- do {
- EcGroup* G1 = ctx->epid2_params->G1;
- EcGroup* G2 = ctx->epid2_params->G2;
- FiniteField* GT = ctx->epid2_params->GT;
- FiniteField* Fp = ctx->epid2_params->Fp;
- FiniteField* Fq = ctx->epid2_params->Fq;
- EcPoint const* g1 = ctx->epid2_params->g1;
- EcPoint const* g2 = ctx->epid2_params->g2;
- BigNum const* p = ctx->epid2_params->p;
- PairingState* ps_ctx = ctx->epid2_params->pairing_state;
- Seed const* seed = &ctx->secret.seed;
- FfElement* f = (FfElement*)ctx->secret.f;
-
- FpElemStr p_str = {0};
- FpElemStr temp_x_str = {0};
- uint8_t bn_one_str = 1;
- bool is_valid = false;
-
- // 1. The member derives x and f from seed. The derivation
- // function must be the same as the one used in the key
- // generation above.
- sts = WriteBigNum(p, sizeof(p_str), &p_str);
- BREAK_ON_EPID_ERROR(sts);
- sts = DeriveXF(seed, &p_str, &temp_x_str, &f_str);
- BREAK_ON_EPID_ERROR(sts);
- // 2. The member computes A = G1.makePoint(A.x).
- sts = NewFfElement(Fq, &Ax);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(Fq, Ax_str, sizeof(*Ax_str), Ax);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(G1, &A);
- BREAK_ON_EPID_ERROR(sts);
- sts = EcMakePoint(G1, Ax, A);
- BREAK_ON_EPID_ERROR(sts);
- // 3. The member tests whether (A, x, f) is a valid Intel(R) EPID
- // private key as follows:
- // a. It computes t1 = G2.sscmExp(g2, x).
- sts = NewEcPoint(G2, &t1);
- BREAK_ON_EPID_ERROR(sts);
- sts = EcSscmExp(G2, g2, (BigNumStr const*)&temp_x_str, t1);
- BREAK_ON_EPID_ERROR(sts);
- // b. It computes t1 = G2.mul(t1, w).
- sts = NewEcPoint(G2, &w);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadEcPoint(G2, w_str, sizeof(*w_str), w);
- BREAK_ON_EPID_ERROR(sts);
- sts = EcMul(G2, t1, w, t1);
- BREAK_ON_EPID_ERROR(sts);
- // c. It computes t3 = pairing(A, t1).
- sts = NewFfElement(GT, &t3);
- BREAK_ON_EPID_ERROR(sts);
- sts = Pairing(ps_ctx, A, t1, t3);
- BREAK_ON_EPID_ERROR(sts);
- // d. It computes t2 = G1.sscmExp(h1, f).
- sts = NewEcPoint(G1, &h1);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadEcPoint(G1, h1_str, sizeof(*h1_str), h1);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(G1, &t2);
- BREAK_ON_EPID_ERROR(sts);
- sts = EcSscmExp(G1, h1, (BigNumStr const*)&f_str, t2);
- BREAK_ON_EPID_ERROR(sts);
- // e. It computes t2 = G1.mul(t2, g1).
- sts = EcMul(G1, t2, g1, t2);
- BREAK_ON_EPID_ERROR(sts);
- // f. It computes t4 = pairing(t2, g2).
- sts = NewFfElement(GT, &t4);
- BREAK_ON_EPID_ERROR(sts);
- sts = Pairing(ps_ctx, t2, g2, t4);
- BREAK_ON_EPID_ERROR(sts);
- // g. If GT.isEqual(t3, t4) = false
- sts = FfIsEqual(GT, t3, t4, &is_valid);
- BREAK_ON_EPID_ERROR(sts);
- if (!is_valid) {
- // i. It computes t3 = GT.exp(t3, p-1).
- sts = NewBigNum(sizeof(BigNumStr), &bn_pminus1);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadBigNum(&bn_one_str, sizeof(bn_one_str), bn_pminus1);
- BREAK_ON_EPID_ERROR(sts);
- sts = BigNumSub(p, bn_pminus1, bn_pminus1);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfExp(GT, t3, bn_pminus1, t3);
- BREAK_ON_EPID_ERROR(sts);
- // ii. If GT.isEqual(t3, t4) = false again, it reports bad
- // Intel(R) EPID private key and exits.
- sts = FfIsEqual(GT, t3, t4, &is_valid);
- BREAK_ON_EPID_ERROR(sts);
- if (!is_valid) {
- sts = kEpidBadArgErr; // Invalid Member key
- BREAK_ON_EPID_ERROR(sts);
- }
- // iii. It sets A = G1.inverse(A).
- sts = EcInverse(G1, A, A);
- BREAK_ON_EPID_ERROR(sts);
- }
- // 4. The decompressed Intel(R) EPID private key is (gid, A, x, f).
- sts = WriteEcPoint(G1, A, A_str, sizeof(*A_str));
- BREAK_ON_EPID_ERROR(sts);
- *x_str = temp_x_str;
- sts = ReadFfElement(Fp, &f_str, sizeof(f_str), f);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = kEpidNoErr;
- } while (0);
-
- EpidZeroMemory(&f_str, sizeof(f_str));
- DeleteFfElement(&Ax);
- DeleteEcPoint(&A);
- DeleteEcPoint(&t1);
- DeleteEcPoint(&w);
- DeleteFfElement(&t3);
- DeleteEcPoint(&h1);
- DeleteEcPoint(&t2);
- DeleteFfElement(&t4);
- DeleteBigNum(&bn_pminus1);
-
- return sts;
-}
-
-/// Hash message buffer
-typedef struct HashMsg {
- /// Message to be hashed
- char data[11];
-} HashMsg;
-
-static EpidStatus DeriveXF(Seed const* seed, FpElemStr const* p, FpElemStr* x,
- FpElemStr* f) {
- EpidStatus sts = kEpidErr;
-
- BigNum* bn_x = 0;
- BigNum* bn_f = 0;
- BigNum* bn_p = 0;
-
-#pragma pack(1)
- struct {
- Seed seed;
- HashMsg msg;
- } hashbuf;
-#pragma pack()
-
- do {
- HashMsg msgstr = {{
- 0x00, 0x45, 0x43, 0x43, 0x2d, 0x53, 0x61, 0x66, 0x65, 0x49, 0x44,
- }};
-
- Sha256Digest digest[2] = {0};
- uint8_t str512[512 / 8] = {0};
-
- sts = NewBigNum(sizeof(*p), &bn_p);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadBigNum(p, sizeof(*p), bn_p);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = NewBigNum(sizeof(digest), &bn_x);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewBigNum(sizeof(digest), &bn_f);
- BREAK_ON_EPID_ERROR(sts);
-
- // compute x
- hashbuf.seed = *seed;
- hashbuf.msg = msgstr;
- hashbuf.msg.data[0] = 0x06;
- sts = Sha256MessageDigest(&hashbuf, sizeof(hashbuf), &digest[0]);
- BREAK_ON_EPID_ERROR(sts);
- hashbuf.msg.data[0] = 0x07;
- sts = Sha256MessageDigest(&hashbuf, sizeof(hashbuf), &digest[1]);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = ReadBigNum(&digest, sizeof(digest), bn_x);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = BigNumMod(bn_x, bn_p, bn_x);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = WriteBigNum(bn_x, sizeof(str512), str512);
- BREAK_ON_EPID_ERROR(sts);
-
- *x = *(FpElemStr*)&str512[sizeof(str512) / 2];
-
- // compute f
- hashbuf.seed = *seed;
- hashbuf.msg = msgstr;
- hashbuf.msg.data[0] = 0x08;
- sts = Sha256MessageDigest(&hashbuf, sizeof(hashbuf), &digest[0]);
- BREAK_ON_EPID_ERROR(sts);
- hashbuf.msg.data[0] = 0x09;
- sts = Sha256MessageDigest(&hashbuf, sizeof(hashbuf), &digest[1]);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = ReadBigNum(&digest, sizeof(digest), bn_f);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = BigNumMod(bn_f, bn_p, bn_f);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = WriteBigNum(bn_f, sizeof(str512), str512);
- BREAK_ON_EPID_ERROR(sts);
-
- *f = *(FpElemStr*)&str512[sizeof(str512) / 2];
-
- sts = kEpidNoErr;
- } while (0);
-
- EpidZeroMemory(&hashbuf.seed, sizeof(hashbuf.seed));
- DeleteBigNum(&bn_x);
- DeleteBigNum(&bn_f);
- DeleteBigNum(&bn_p);
-
- return sts;
-}
diff --git a/epid/member/tpm/src/join.c b/epid/member/tpm/src/join.c
deleted file mode 100644
index 48db2bc..0000000
--- a/epid/member/tpm/src/join.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM join implementation
-/*! \file */
-
-#include "epid/member/tpm/join.h"
-
-#include "epid/member/tpm/src/types.h"
-#include "epid/common/src/epid2params.h"
-#include "epid/common/math/bignum.h"
-#include "epid/common/math/ecgroup.h"
-#include "epid/common/math/finitefield.h"
-
-/// Handle Intel(R) EPID Error with Break
-#define BREAK_ON_EPID_ERROR(ret) \
- if (kEpidNoErr != (ret)) { \
- break; \
- }
-
-EpidStatus TpmJoinCommit(TpmCtx* ctx, G1ElemStr* F_str, G1ElemStr* R_str) {
- EpidStatus sts = kEpidErr;
-
- EcPoint* t = NULL; // temporary used for F and R
-
- if (!ctx || !F_str || !R_str || !ctx->epid2_params) {
- return kEpidBadArgErr;
- }
-
- do {
- FiniteField* Fp = ctx->epid2_params->Fp;
- EcGroup* G1 = ctx->epid2_params->G1;
- FfElement const* f = ctx->secret.f;
- FfElement* r = ctx->secret.r;
- EcPoint const* h1 = ctx->h1;
- const BigNumStr one = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}};
- BigNumStr exp_str = {0};
-
- sts = NewEcPoint(G1, &t);
- BREAK_ON_EPID_ERROR(sts);
-
- // 2. The member computes F = G1.sscmExp(h1, f).
- sts = WriteFfElement(Fp, f, &exp_str, sizeof(exp_str));
- BREAK_ON_EPID_ERROR(sts);
- sts = EcExp(G1, h1, (BigNumStr const*)&exp_str, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteEcPoint(G1, t, F_str, sizeof(F_str));
- BREAK_ON_EPID_ERROR(sts);
-
- // 1. The member chooses a random integer r from [1, p-1].
- sts = FfGetRandom(Fp, &one, ctx->rnd_func, ctx->secret.rnd_param, r);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, r, &exp_str, sizeof(exp_str));
- BREAK_ON_EPID_ERROR(sts);
-
- // 3. The member computes R = G1.sscmExp(h1, r).
- sts = EcExp(G1, h1, (BigNumStr const*)&exp_str, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteEcPoint(G1, t, R_str, sizeof(R_str));
- BREAK_ON_EPID_ERROR(sts);
-
- ctx->secret.join_pending = true;
-
- sts = kEpidNoErr;
- } while (0);
-
- DeleteEcPoint(&t);
-
- return sts;
-}
-
-/// Performs the last part of the join operation
-EpidStatus TpmJoin(TpmCtx* ctx, FpElemStr const* c_str, FpElemStr* s_str) {
- EpidStatus sts = kEpidErr;
-
- FfElement* t = NULL; // temporary multiplication sts
-
- if (!ctx || !c_str || !s_str || !ctx->epid2_params) {
- return kEpidBadArgErr;
- }
-
- if (!ctx->secret.join_pending) {
- return kEpidOutOfSequenceError;
- }
-
- do {
- FiniteField* Fp = ctx->epid2_params->Fp;
- FfElement const* f = ctx->secret.f;
- FfElement* r = ctx->secret.r;
-
- // Step 5. The member computes s = (r + c * f) mod p.
- sts = NewFfElement(Fp, &t);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(Fp, c_str, sizeof(*c_str), t);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfMul(Fp, t, f, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfAdd(Fp, r, t, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, t, s_str, sizeof(*s_str));
- BREAK_ON_EPID_ERROR(sts);
-
- ctx->secret.join_pending = false;
-
- sts = kEpidNoErr;
- } while (0);
-
- DeleteFfElement(&t);
-
- return sts;
-}
diff --git a/epid/member/tpm/src/nrprove.c b/epid/member/tpm/src/nrprove.c
deleted file mode 100644
index db9ee64..0000000
--- a/epid/member/tpm/src/nrprove.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM NrProve implementation
-/*! \file */
-
-#include "epid/member/tpm/nrprove.h"
-
-#include "epid/common/math/ecgroup.h"
-#include "epid/common/math/finitefield.h"
-#include "epid/member/tpm/src/types.h"
-#include "epid/common/src/epid2params.h"
-#include "epid/common/src/memory.h"
-
-/// Handle Intel(R) EPID Error with Break
-#define BREAK_ON_EPID_ERROR(ret) \
- if (kEpidNoErr != (ret)) { \
- break; \
- }
-
-/// Count of elements in array
-#define COUNT_OF(A) (sizeof(A) / sizeof((A)[0]))
-
-EpidStatus TpmNrProveCommit(TpmCtx* ctx, G1ElemStr const* B_str,
- G1ElemStr const* K_str,
- SigRlEntry const* sigrl_entry,
- NrProveCommitOutput* commit_out) {
- EpidStatus sts = kEpidErr;
-
- EcPoint* B = NULL; // Also reused for B'
- EcPoint* K = NULL; // Also reused for K'
- EcPoint* t = NULL; // temp value in G1 either T, R1, R2
-
- BigNumStr mu_str = {0};
- BigNumStr nu_str = {0};
- BigNumStr rmu_str = {0};
- BigNumStr rnu_str = {0};
-
- if (!ctx || !sigrl_entry || !commit_out || !ctx->epid2_params) {
- return kEpidBadArgErr;
- }
-
- do {
- FiniteField* Fp = ctx->epid2_params->Fp;
- EcGroup* G1 = ctx->epid2_params->G1;
- BitSupplier rnd_func = ctx->rnd_func;
- void* rnd_param = ctx->secret.rnd_param;
- FfElement const* f = ctx->secret.f;
- FfElement* mu = ctx->secret.mu;
- FfElement* nu = ctx->secret.nu;
- FfElement* rmu = ctx->secret.rmu;
- FfElement* rnu = ctx->secret.rnu;
- const BigNumStr one = {{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}}};
-
- sts = NewEcPoint(G1, &B);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(G1, &K);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(G1, &t);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = ReadEcPoint(G1, B_str, sizeof(*B_str), B);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadEcPoint(G1, K_str, sizeof(*K_str), K);
- BREAK_ON_EPID_ERROR(sts);
-
- // 1. The member chooses random mu from [1, p-1].
- sts = FfGetRandom(Fp, &one, rnd_func, rnd_param, mu);
- BREAK_ON_EPID_ERROR(sts);
- // 2. The member computes nu = (- f * mu) mod p.
- sts = FfMul(Fp, mu, f, nu);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfNeg(Fp, nu, nu);
- BREAK_ON_EPID_ERROR(sts);
- // 4. The member chooses rmu, rnu randomly from [1, p-1].
- sts = FfGetRandom(Fp, &one, rnd_func, rnd_param, rmu);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfGetRandom(Fp, &one, rnd_func, rnd_param, rnu);
- BREAK_ON_EPID_ERROR(sts);
-
- // 5. The member computes R1 = G1.sscmMultiExp(K, rmu, B, rnu).
- sts = WriteFfElement(Fp, rmu, &rmu_str, sizeof(rmu_str));
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, rnu, &rnu_str, sizeof(rnu_str));
- BREAK_ON_EPID_ERROR(sts);
- {
- EcPoint const* points[2];
- BigNumStr const* exponents[2];
- points[0] = K;
- points[1] = B;
- exponents[0] = &rmu_str;
- exponents[1] = &rnu_str;
- sts = EcSscmMultiExp(G1, points, exponents, COUNT_OF(points), t);
- BREAK_ON_EPID_ERROR(sts);
- }
- sts = WriteEcPoint(G1, t, &commit_out->R1, sizeof(commit_out->R1));
- BREAK_ON_EPID_ERROR(sts);
-
- // re-using B for B' and K for K'
- sts = ReadEcPoint(G1, &(sigrl_entry->b), sizeof(sigrl_entry->b), B);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadEcPoint(G1, &(sigrl_entry->k), sizeof(sigrl_entry->k), K);
- BREAK_ON_EPID_ERROR(sts);
-
- // 3. The member computes T = G1.sscmMultiExp(K', mu, B', nu).
- sts = WriteFfElement(Fp, mu, &mu_str, sizeof(mu_str));
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, nu, &nu_str, sizeof(nu_str));
- BREAK_ON_EPID_ERROR(sts);
- {
- EcPoint const* points[2];
- BigNumStr const* exponents[2];
- points[0] = K;
- points[1] = B;
- exponents[0] = &mu_str;
- exponents[1] = &nu_str;
- sts = EcSscmMultiExp(G1, points, exponents, COUNT_OF(points), t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteEcPoint(G1, t, &commit_out->T, sizeof(commit_out->T));
- BREAK_ON_EPID_ERROR(sts);
- }
-
- // 6. The member computes R2 = G1.sscmMultiExp(K', rmu, B', rnu).
- {
- EcPoint const* points[2];
- BigNumStr const* exponents[2];
- points[0] = K;
- points[1] = B;
- exponents[0] = &rmu_str;
- exponents[1] = &rnu_str;
- sts = EcSscmMultiExp(G1, points, exponents, COUNT_OF(points), t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteEcPoint(G1, t, &commit_out->R2, sizeof(commit_out->R2));
- BREAK_ON_EPID_ERROR(sts);
- }
-
- ctx->secret.nrprove_pending = true;
-
- sts = kEpidNoErr;
- } while (0);
-
- EpidZeroMemory(&mu_str, sizeof(mu_str));
- EpidZeroMemory(&nu_str, sizeof(nu_str));
- EpidZeroMemory(&rmu_str, sizeof(rmu_str));
- EpidZeroMemory(&rnu_str, sizeof(rnu_str));
- DeleteEcPoint(&B);
- DeleteEcPoint(&K);
- DeleteEcPoint(&t);
-
- return sts;
-}
-
-EpidStatus TpmNrProve(TpmCtx* ctx, FpElemStr const* c_str, FpElemStr* smu_str,
- FpElemStr* snu_str) {
- EpidStatus sts = kEpidErr;
-
- FfElement* t = NULL; // temporary multiplication sts
- FfElement* c = NULL;
-
- if (!ctx || !c_str || !smu_str || !snu_str || !ctx->epid2_params) {
- return kEpidBadArgErr;
- }
-
- if (!ctx->secret.nrprove_pending) {
- return kEpidOutOfSequenceError;
- }
-
- do {
- FiniteField* Fp = ctx->epid2_params->Fp;
- FfElement const* mu = ctx->secret.mu;
- FfElement const* nu = ctx->secret.nu;
- FfElement const* rmu = ctx->secret.rmu;
- FfElement const* rnu = ctx->secret.rnu;
-
- sts = NewFfElement(Fp, &t);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = NewFfElement(Fp, &c);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = ReadFfElement(Fp, c_str, sizeof(*c_str), c);
- BREAK_ON_EPID_ERROR(sts);
-
- // 8. The member computes smu = (rmu + c * mu) mod p.
- sts = FfMul(Fp, c, mu, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfAdd(Fp, rmu, t, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, t, smu_str, sizeof(*smu_str));
- BREAK_ON_EPID_ERROR(sts);
-
- // 9. The member computes snu = (rnu + c * nu) mod p.
- sts = FfMul(Fp, c, nu, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfAdd(Fp, rnu, t, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, t, snu_str, sizeof(*snu_str));
- BREAK_ON_EPID_ERROR(sts);
-
- ctx->secret.nrprove_pending = false;
-
- sts = kEpidNoErr;
- } while (0);
-
- DeleteFfElement(&t);
- DeleteFfElement(&c);
-
- return sts;
-}
diff --git a/epid/member/tpm/src/sign.c b/epid/member/tpm/src/sign.c
deleted file mode 100644
index 23d2e83..0000000
--- a/epid/member/tpm/src/sign.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM signing implementation
-/*! \file */
-
-#include "epid/member/tpm/sign.h"
-
-#include "epid/common/src/epid2params.h"
-#include "epid/common/math/finitefield.h"
-#include "epid/common/math/ecgroup.h"
-#include "epid/member/tpm/src/types.h"
-#include "epid/member/tpm/src/presig-internal.h"
-#include "epid/common/src/memory.h"
-
-/// Handle Intel(R) EPID Error with Break
-#define BREAK_ON_EPID_ERROR(ret) \
- if (kEpidNoErr != (ret)) { \
- break; \
- }
-
-EpidStatus TpmSignCommit(TpmCtx* ctx, G1ElemStr const* B_in_str,
- SignCommitOutput* commit_out) {
- EpidStatus sts = kEpidErr;
-
- EcPoint* B = NULL;
- EcPoint* t = NULL; // temp value in G1
- BigNumStr f_str = {0};
- PreComputedSignature curr_presig = {0};
-
- if (!ctx || !commit_out || !ctx->epid2_params) {
- return kEpidBadArgErr;
- }
-
- do {
- FiniteField* Fp = ctx->epid2_params->Fp;
- EcGroup* G1 = ctx->epid2_params->G1;
- FfElement const* f = ctx->secret.f;
- FfElement* a = ctx->secret.a;
- FfElement* b = ctx->secret.b;
- FfElement* rx = ctx->secret.rx;
- FfElement* rf = ctx->secret.rf;
- FfElement* ra = ctx->secret.ra;
- FfElement* rb = ctx->secret.rb;
-
- sts = NewEcPoint(G1, &B);
- BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(G1, &t);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = TpmGetPreSig(ctx, &curr_presig);
- BREAK_ON_EPID_ERROR(sts);
-
- // 3. If the pre-computed signature pre-sigma exists, the member
- // loads (B, K, T, a, b, rx, rf, ra, rb, R1, R2) from
- // pre-sigma. Refer to Section 4.4 for the computation of
- // these values.
- sts = ReadFfElement(Fp, &curr_presig.a, sizeof(curr_presig.a), a);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(Fp, &curr_presig.b, sizeof(curr_presig.b), b);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(Fp, &curr_presig.rx, sizeof(curr_presig.rx), rx);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(Fp, &curr_presig.rf, sizeof(curr_presig.rf), rf);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(Fp, &curr_presig.ra, sizeof(curr_presig.ra), ra);
- BREAK_ON_EPID_ERROR(sts);
- sts = ReadFfElement(Fp, &curr_presig.rb, sizeof(curr_presig.rb), rb);
- BREAK_ON_EPID_ERROR(sts);
-
- // If the basename is provided, use it, otherwise use presig B
- if (B_in_str) {
- sts = ReadEcPoint(G1, B_in_str, sizeof(*B_in_str), B);
- BREAK_ON_EPID_ERROR(sts);
- commit_out->B = *B_in_str;
- } else {
- sts = ReadEcPoint(G1, &curr_presig.B, sizeof(curr_presig.B), B);
- BREAK_ON_EPID_ERROR(sts);
- commit_out->B = curr_presig.B;
- }
-
- // b. The member computes K = G1.sscmExp(B, f), where B comes
- // from step a.
- sts = WriteFfElement(Fp, f, &f_str, sizeof(f_str));
- BREAK_ON_EPID_ERROR(sts);
- sts = EcSscmExp(G1, B, &f_str, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteEcPoint(G1, t, &commit_out->K, sizeof(commit_out->K));
- BREAK_ON_EPID_ERROR(sts);
-
- // c. The member computes R1 = G1.sscmExp(B, rf), where B comes
- // from step a.
- sts = EcSscmExp(G1, B, (const BigNumStr*)&curr_presig.rf, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteEcPoint(G1, t, &commit_out->R1, sizeof(commit_out->R1));
- BREAK_ON_EPID_ERROR(sts);
-
- commit_out->T = curr_presig.T;
- commit_out->R2 = curr_presig.R2;
- ctx->secret.sign_pending = true;
-
- sts = kEpidNoErr;
- } while (0);
-
- EpidZeroMemory(&f_str, sizeof(f_str));
- EpidZeroMemory(&curr_presig, sizeof(curr_presig));
-
- DeleteEcPoint(&B);
- DeleteEcPoint(&t);
-
- return sts;
-}
-
-EpidStatus TpmSign(TpmCtx* ctx, FpElemStr const* c_str, FpElemStr* sx_str,
- FpElemStr* sf_str, FpElemStr* sa_str, FpElemStr* sb_str) {
- EpidStatus sts = kEpidErr;
-
- FfElement* t = NULL; // temporary multiplication sts
- FfElement* c = NULL;
-
- if (!ctx || !c_str || !sx_str || !sf_str || !sa_str || !sb_str ||
- !ctx->epid2_params) {
- return kEpidBadArgErr;
- }
-
- if (!ctx->secret.sign_pending) {
- return kEpidOutOfSequenceError;
- }
-
- do {
- FiniteField* Fp = ctx->epid2_params->Fp;
- FfElement const* a = ctx->secret.a;
- FfElement const* b = ctx->secret.b;
- FfElement const* rx = ctx->secret.rx;
- FfElement const* rf = ctx->secret.rf;
- FfElement const* ra = ctx->secret.ra;
- FfElement const* rb = ctx->secret.rb;
-
- FfElement const* x = ctx->x;
- FfElement const* f = ctx->secret.f;
-
- sts = NewFfElement(Fp, &t);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = NewFfElement(Fp, &c);
- BREAK_ON_EPID_ERROR(sts);
-
- sts = ReadFfElement(Fp, c_str, sizeof(*c_str), c);
- BREAK_ON_EPID_ERROR(sts);
-
- // 7. The member computes sx = (rx + c * x) mod p.
- sts = FfMul(Fp, c, x, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfAdd(Fp, rx, t, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, t, sx_str, sizeof(*sx_str));
- BREAK_ON_EPID_ERROR(sts);
-
- // 8. The member computes sf = (rf + c * f) mod p.
- sts = FfMul(Fp, c, f, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfAdd(Fp, rf, t, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, t, sf_str, sizeof(*sf_str));
- BREAK_ON_EPID_ERROR(sts);
-
- // 9. The member computes sa = (ra + c * a) mod p.
- sts = FfMul(Fp, c, a, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfAdd(Fp, ra, t, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, t, sa_str, sizeof(*sa_str));
- BREAK_ON_EPID_ERROR(sts);
-
- // 10. The member computes sb = (rb + c * b) mod p.
- sts = FfMul(Fp, c, b, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = FfAdd(Fp, rb, t, t);
- BREAK_ON_EPID_ERROR(sts);
- sts = WriteFfElement(Fp, t, sb_str, sizeof(*sb_str));
- BREAK_ON_EPID_ERROR(sts);
-
- ctx->secret.sign_pending = false;
-
- sts = kEpidNoErr;
- } while (0);
-
- DeleteFfElement(&t);
- DeleteFfElement(&c);
-
- return sts;
-}
diff --git a/epid/member/tpm/src/types.h b/epid/member/tpm/src/types.h
deleted file mode 100644
index d22995c..0000000
--- a/epid/member/tpm/src/types.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// TPM context structures
-/*! \file */
-
-#ifndef EPID_MEMBER_TPM_SRC_TYPES_H_
-#define EPID_MEMBER_TPM_SRC_TYPES_H_
-
-#include "epid/common/stdtypes.h"
-#include "epid/common/bitsupplier.h"
-#include "epid/common/types.h"
-
-/// \cond
-typedef struct EcPoint EcPoint;
-typedef struct FfElement FfElement;
-typedef struct Stack Stack;
-typedef struct Epid2Params_ Epid2Params_;
-/// \endcond
-
-/// Sensitive Tpm values
-typedef struct TpmSecrets {
- Seed const seed; ///< Provisioned seed for compressed key
- FfElement const* f; ///< Member private key f value
- Stack* presigs; ///< Pre-computed signature pool
- void* rnd_param; ///< Pointer to user context for rnd_func
- FfElement* a; ///< Sign related random value
- FfElement* b; ///< Sign related intermediate value
- FfElement* rx; ///< Sign related random value
- FfElement* rf; ///< Sign related random value
- FfElement* ra; ///< Sign related random value
- FfElement* rb; ///< Sign related random value
- FfElement* mu; ///< Nr Proof related random value
- FfElement* nu; ///< Nr Proof related random value
- FfElement* rmu; ///< Nr Proof related random value
- FfElement* rnu; ///< Nr Proof related random value
- FfElement* r; ///< Join related random value
- bool sign_pending; ///< split sign in progress
- bool nrprove_pending; ///< split Nr Proof in progress
- bool join_pending; ///< split Nr Proof in progress
-} TpmSecrets;
-
-/// TPM State
-typedef struct TpmCtx {
- Epid2Params_ const* epid2_params; ///< Intel(R) EPID 2.0 params
- TpmSecrets secret; ///< Tpm information that must be stored securely
- BitSupplier rnd_func; ///< Pseudo random number generation function
- EcPoint const* h1; ///< Group public key h1 value
- EcPoint const* h2; ///< Group group public key h2 value
- EcPoint const* A; ///< Membership Credential A value
- FfElement const* x; ///< Membership Credential x value
- EcPoint const* w; ///< Group group public key w value
- FfElement const* e12; ///< an element in GT, = pairing (h1, g2)
- FfElement const* e22; ///< an element in GT, = pairing (h2, g2)
- FfElement const* e2w; ///< an element in GT, = pairing (h2, w)
- FfElement const* ea2; ///< an element in GT, = pairing (g1, g2)
-} TpmCtx;
-
-/// Pre-computed signature.
-/*!
- Serialized form of an intermediate signature that does not depend on
- basename or message. This can be used to time-shift compute time needed to
- sign a message.
- */
-#pragma pack(1)
-typedef struct PreComputedSignature {
- G1ElemStr B; ///< an element in G1
- G1ElemStr K; ///< an element in G1
- G1ElemStr T; ///< an element in G1
- G1ElemStr R1; ///< an element in G1
- GtElemStr R2; ///< an element in G1
- FpElemStr a; ///< an integer between [0, p-1]
- FpElemStr b; ///< an integer between [0, p-1]
- FpElemStr rx; ///< an integer between [0, p-1]
- FpElemStr rf; ///< an integer between [0, p-1]
- FpElemStr ra; ///< an integer between [0, p-1]
- FpElemStr rb; ///< an integer between [0, p-1]
-} PreComputedSignature;
-#pragma pack()
-
-#endif // EPID_MEMBER_TPM_SRC_TYPES_H_
diff --git a/epid/member/tpm/unittests/tpm-test.cc b/epid/member/tpm/unittests/tpm-test.cc
deleted file mode 100644
index 41fa371..0000000
--- a/epid/member/tpm/unittests/tpm-test.cc
+++ /dev/null
@@ -1,212 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// Tpm unit tests.
-/*!
- * \file
- */
-#include <cstring>
-
-#include "gtest/gtest.h"
-
-#include "epid/member/tpm/unittests/tpm-testhelper.h"
-#include "epid/common-testhelper/prng-testhelper.h"
-#include "epid/common-testhelper/errors-testhelper.h"
-#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
-
-extern "C" {
-#include "epid/member/tpm/context.h"
-#include "epid/member/tpm/init.h"
-#include "epid/member/tpm/validatekey.h"
-#include "epid/member/tpm/sign.h"
-#include "epid/common/types.h"
-#include "epid/member/tpm/join.h"
-#include "epid/member/tpm/nrprove.h"
-
-#include "epid/member/src/sign_commitment.h"
-#include "epid/member/src/hash_basename.h"
-#include "epid/member/src/nrprove_commitment.h"
-#include "epid/member/src/precomp.h"
-
-#include "epid/verifier/api.h"
-}
-
-#if !defined(ntohl)
-/// Macro to transform oct str 32 into uint_32
-#define ntohl(u32) \
- ((uint32_t)(((((unsigned char*)&(u32))[0]) << 24) + \
- ((((unsigned char*)&(u32))[1]) << 16) + \
- ((((unsigned char*)&(u32))[2]) << 8) + \
- (((unsigned char*)&(u32))[3])))
-#endif
-
-namespace {
-//////////////////////////////////////////////////////////////////////////
-// Test showing how to do host signing
-
-// SignsMessageUsingBasenameWithSigRl
-TEST_F(EpidTpmTest, SignsMessageUsingBasenameWithSigRl) {
- // create TPM
- Prng my_prng;
- Epid2ParamsObj epid2params;
- TpmCtxObj tpm(&Prng::Generate, &my_prng, epid2params);
-
- // provision TPM
- const GroupPubKey pub_key = this->kGroupPublicKey;
- const PrivKey priv_key = this->kMemberPrivateKey;
- MemberPrecomp precomp = {0};
- EXPECT_EQ(kEpidNoErr, PrecomputeMemberPairing(epid2params, &pub_key,
- &priv_key.A, &precomp));
-
- EXPECT_EQ(kEpidNoErr, TpmProvision(tpm, &priv_key.f));
- // optional validity check. May not be needed if validity is ensured
- // by other means
- EXPECT_TRUE(
- TpmIsKeyValid(tpm, &priv_key.A, &priv_key.x, &pub_key.h1, &pub_key.w));
- EXPECT_EQ(kEpidNoErr, TpmInit(tpm, &priv_key.A, &priv_key.x, &pub_key.h1,
- &pub_key.h2, &pub_key.w, &precomp));
-
- HashAlg hash_alg = kSha512;
- auto& bsn = this->kBsn0;
-
- // In actual implementation check the basename is allowed before
- // hashing
-
- G1ElemStr B = {0};
- EXPECT_EQ(kEpidNoErr, HashBaseName(epid2params.G1(), hash_alg, bsn.data(),
- bsn.size(), &B));
-
- // Begin Basic signing
- SignCommitOutput commit_out = {0};
- EXPECT_EQ(kEpidNoErr, TpmSignCommit(tpm, &B, &commit_out));
-
- std::vector<uint8_t> sig_data(sizeof(EpidSignature) - sizeof(NrProof));
- EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
- sig->sigma0.B = commit_out.B;
- sig->sigma0.K = commit_out.K;
- sig->sigma0.T = commit_out.T;
-
- auto& msg = this->kMsg0;
- EXPECT_EQ(kEpidNoErr, HashSignCommitment(epid2params.Fp(), hash_alg, &pub_key,
- &commit_out, msg.data(), msg.size(),
- &sig->sigma0.c));
-
- EXPECT_EQ(kEpidNoErr,
- TpmSign(tpm, &sig->sigma0.c, &sig->sigma0.sx, &sig->sigma0.sf,
- &sig->sigma0.sa, &sig->sigma0.sb));
-
- // Compute non-revoked proofs
- SigRl const* sigrl =
- reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
- const size_t sigrl_len = this->kSigRl5EntryData.size();
-
- const uint32_t n2 = ntohl(sigrl->n2);
- sig_data.resize(sig_data.size() + n2 * sizeof(NrProof));
- sig = reinterpret_cast<EpidSignature*>(sig_data.data()); // after resize!
- sig->rl_ver = sigrl->version;
- sig->n2 = sigrl->n2;
-
- for (uint32_t i = 0; i < n2; i++) {
- NrProveCommitOutput nrp_commit_out = {0};
- EXPECT_EQ(kEpidNoErr, TpmNrProveCommit(tpm, &sig->sigma0.B, &sig->sigma0.K,
- &sigrl->bk[i], &nrp_commit_out));
- NrProof* nr_proof = &sig->sigma[i];
- nr_proof->T = nrp_commit_out.T;
- EXPECT_EQ(kEpidNoErr, HashNrProveCommitment(
- epid2params.Fp(), hash_alg, &sig->sigma0.B,
- &sig->sigma0.K, &sigrl->bk[i], &nrp_commit_out,
- msg.data(), msg.size(), &nr_proof->c));
- EXPECT_EQ(kEpidNoErr,
- TpmNrProve(tpm, &nr_proof->c, &nr_proof->smu, &nr_proof->snu));
- }
-
- // verify
- VerifierCtxObj ctx(pub_key);
- THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
- THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, sigrl, sigrl_len));
- EXPECT_EQ(kEpidSigValid,
- EpidVerify(ctx, sig, sig_data.size(), msg.data(), msg.size()));
-}
-
-//////////////////////////////////////////////////////////////////////////
-// Split operation sequence Tests
-TEST_F(EpidTpmTest, TpmSignFollowedByTpmSignDisallowed) {
- Prng my_prng;
- Epid2ParamsObj epid2params;
- TpmCtxObj tpm(&Prng::Generate, &my_prng, epid2params);
- // auto& msg = this->kMsg0;
- // auto& bsn = this->kBsn0;
- BasicSignature sigma0;
- THROW_ON_EPIDERR(TpmProvision(tpm, &this->kMemberPrivateKey.f));
- THROW_ON_EPIDERR(TpmInit(tpm, &this->kMemberPrivateKey.A,
- &this->kMemberPrivateKey.x,
- &this->kGroupPublicKey.h1, &this->kGroupPublicKey.h2,
- &this->kGroupPublicKey.w, &this->kMemberPrecomp));
- SignCommitOutput commit_out = {0};
-
- THROW_ON_EPIDERR(TpmSignCommit(tpm, nullptr, &commit_out));
-
- EXPECT_EQ(kEpidNoErr, TpmSign(tpm, &sigma0.c, &sigma0.sx, &sigma0.sf,
- &sigma0.sa, &sigma0.sb));
- EXPECT_EQ(
- kEpidOutOfSequenceError,
- TpmSign(tpm, &sigma0.c, &sigma0.sx, &sigma0.sf, &sigma0.sa, &sigma0.sb));
-
- EXPECT_EQ(kEpidNoErr, TpmSignCommit(tpm, nullptr, &commit_out));
-}
-
-TEST_F(EpidTpmTest, TpmJoinFollowedByTpmJoinDisallowed) {
- Prng my_prng;
- Epid2ParamsObj epid2params;
- TpmCtxObj tpm(&Prng::Generate, &my_prng, epid2params);
- THROW_ON_EPIDERR(TpmProvision(tpm, &this->kMemberPrivateKey.f));
-
- JoinRequest join_request;
- G1ElemStr R_str = {0};
- THROW_ON_EPIDERR(TpmJoinCommit(tpm, &join_request.F, &R_str));
-
- EXPECT_EQ(kEpidNoErr, TpmJoin(tpm, &join_request.c, &join_request.s));
- EXPECT_EQ(kEpidOutOfSequenceError,
- TpmJoin(tpm, &join_request.c, &join_request.s));
-
- EXPECT_EQ(kEpidNoErr, TpmJoinCommit(tpm, &join_request.F, &R_str));
-}
-
-TEST_F(EpidTpmTest, TpmNrProveFollowedByTpmNrProveDisallowed) {
- Prng my_prng;
- Epid2ParamsObj epid2params;
- TpmCtxObj tpm(&Prng::Generate, &my_prng, epid2params);
- THROW_ON_EPIDERR(TpmProvision(tpm, &this->kMemberPrivateKey.f));
-
- G1ElemStr B_str = {0};
- G1ElemStr K_str = {0};
- SigRlEntry sigrl_entry = {0};
- NrProveCommitOutput commit_out;
- THROW_ON_EPIDERR(
- TpmNrProveCommit(tpm, &B_str, &K_str, &sigrl_entry, &commit_out));
-
- NrProof nr_proof;
- nr_proof.T = commit_out.T;
-
- EXPECT_EQ(kEpidNoErr,
- TpmNrProve(tpm, &nr_proof.c, &nr_proof.smu, &nr_proof.snu));
- EXPECT_EQ(kEpidOutOfSequenceError,
- TpmNrProve(tpm, &nr_proof.c, &nr_proof.smu, &nr_proof.snu));
-
- EXPECT_EQ(kEpidNoErr,
- TpmNrProveCommit(tpm, &B_str, &K_str, &sigrl_entry, &commit_out));
-}
-
-} // namespace
diff --git a/epid/member/tpm/unittests/tpm-testhelper.cc b/epid/member/tpm/unittests/tpm-testhelper.cc
deleted file mode 100644
index abc4325..0000000
--- a/epid/member/tpm/unittests/tpm-testhelper.cc
+++ /dev/null
@@ -1,326 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// Tpm C++ wrapper implementation.
-/*!
- * \file
- */
-
-#include "epid/member/tpm/unittests/tpm-testhelper.h"
-
-#include <cstdio>
-#include <stdexcept>
-#include <string>
-
-extern "C" {
-#include "epid/member/tpm/context.h"
-#include "epid/common/src/epid2params.h"
-}
-
-Epid2ParamsObj::Epid2ParamsObj() : params_(nullptr) {
- EpidStatus sts = kEpidNoErr;
- sts = CreateEpid2Params(&params_);
- if (kEpidNoErr != sts) {
- printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
- throw std::logic_error(std::string("Failed to call: ") + "TpmCreate()");
- }
-}
-
-Epid2ParamsObj::~Epid2ParamsObj() { DeleteEpid2Params(&params_); }
-
-Epid2Params_* Epid2ParamsObj::ctx() const { return params_; }
-
-Epid2ParamsObj::operator Epid2Params_*() const { return params_; }
-
-Epid2ParamsObj::operator const Epid2Params_*() const { return params_; }
-
-FiniteField* Epid2ParamsObj::Fp() const { return params_->Fp; }
-
-EcGroup* Epid2ParamsObj::G1() const { return params_->G1; }
-
-TpmCtxObj::TpmCtxObj(BitSupplier rnd_func, void* rnd_param,
- Epid2ParamsObj const& params)
- : ctx_(nullptr), params_(params) {
- EpidStatus sts = kEpidNoErr;
- sts = TpmCreate(rnd_func, rnd_param, params_, &ctx_);
- if (kEpidNoErr != sts) {
- printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
- throw std::logic_error(std::string("Failed to call: ") + "TpmCreate()");
- }
-}
-
-TpmCtxObj::~TpmCtxObj() { TpmDelete(&ctx_); }
-
-TpmCtx* TpmCtxObj::ctx() const { return ctx_; }
-
-TpmCtxObj::operator TpmCtx*() const { return ctx_; }
-
-TpmCtxObj::operator const TpmCtx*() const { return ctx_; }
-
-/// Arbitrary test data were generated based on Intel(R) EPID 2.0 parameters
-const GroupPubKey EpidTpmTest::kGroupPublicKey = {
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01}, // group id
- {{{{0xb3, 0x6f, 0xff, 0x81, 0xe2, 0x1b, 0x17, 0xeb, 0x3d, 0x75, 0x3d, 0x61,
- 0x7e, 0x27, 0xb0, 0xcb, 0xd0, 0x6d, 0x8f, 0x9d, 0x64, 0xce, 0xe3, 0xce,
- 0x43, 0x4c, 0x62, 0xfd, 0xb5, 0x80, 0xe0, 0x99}}},
- {{{0x3a, 0x07, 0x56, 0x80, 0xe0, 0x88, 0x59, 0xa4, 0xfd, 0xb5, 0xb7, 0x9d,
- 0xe9, 0x4d, 0xae, 0x9c, 0xee, 0x3d, 0x66, 0x42, 0x82, 0x45, 0x7e, 0x7f,
- 0xd8, 0x69, 0x3e, 0xa1, 0x74, 0xf4, 0x59, 0xee}}}}, // h1
- {{{{0xd2, 0x74, 0x2e, 0x9f, 0x63, 0xc2, 0x51, 0x8e, 0xd5, 0xdb, 0xca, 0x1c,
- 0x54, 0x74, 0x10, 0x7b, 0xdc, 0x99, 0xed, 0x42, 0xd5, 0x5b, 0xa7, 0x04,
- 0x29, 0x66, 0x61, 0x63, 0xbc, 0xdd, 0x7f, 0xe1}}},
- {{{0x76, 0x5d, 0xc0, 0x6e, 0xe3, 0x14, 0xac, 0x72, 0x48, 0x12, 0x0a, 0xa6,
- 0xe8, 0x5b, 0x08, 0x7b, 0xda, 0x3f, 0x51, 0x7d, 0xde, 0x4c, 0xea, 0xcb,
- 0x93, 0xa5, 0x6e, 0xcc, 0xe7, 0x8e, 0x10, 0x84}}}}, // h2
- {{{{{0xbd, 0x19, 0x5a, 0x95, 0xe2, 0x0f, 0xca, 0x1c, 0x50, 0x71, 0x94, 0x51,
- 0x40, 0x1b, 0xa5, 0xb6, 0x78, 0x87, 0x53, 0xf6, 0x6a, 0x95, 0xca, 0xc6,
- 0x8d, 0xcd, 0x36, 0x88, 0x7, 0x28, 0xe8, 0x96}}},
- {{{0xca, 0x78, 0x11, 0x5b, 0xb8, 0x6a, 0xe7, 0xe5, 0xa6, 0x65, 0x7a, 0x68,
- 0x15, 0xd7, 0x75, 0xf8, 0x24, 0x14, 0xcf, 0xd1, 0x0f, 0x6c, 0x56, 0xf5,
- 0x22, 0xd9, 0xfd, 0xe0, 0xe2, 0xf4, 0xb3, 0xa1}}}},
- {{{{0x90, 0x21, 0xa7, 0xe0, 0xe8, 0xb3, 0xc7, 0x25, 0xbc, 0x07, 0x72, 0x30,
- 0x5d, 0xee, 0xf5, 0x6a, 0x89, 0x88, 0x46, 0xdd, 0x89, 0xc2, 0x39, 0x9c,
- 0x0a, 0x3b, 0x58, 0x96, 0x57, 0xe4, 0xf3, 0x3c}}},
- {{{0x79, 0x51, 0x69, 0x36, 0x1b, 0xb6, 0xf7, 0x05, 0x5d, 0x0a, 0x88, 0xdb,
- 0x1f, 0x3d, 0xea, 0xa2, 0xba, 0x6b, 0xf0, 0xda, 0x8e, 0x25, 0xc6, 0xad,
- 0x83, 0x7d, 0x3e, 0x31, 0xee, 0x11, 0x40, 0xa9}}}}} // w
-};
-
-const PrivKey EpidTpmTest::kMemberPrivateKey = {
- {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01}, // group id
- {{{{0x46, 0xc9, 0x69, 0xee, 0xf4, 0x68, 0xe1, 0x5f, 0xac, 0xbf, 0xdd, 0x77,
- 0xeb, 0x4c, 0xaf, 0x8a, 0x87, 0x68, 0x3f, 0x4e, 0xda, 0xf2, 0x96, 0xec,
- 0x57, 0x08, 0x90, 0xe8, 0x19, 0x62, 0x54, 0xdb}}},
- {{{0x1e, 0x52, 0x23, 0x16, 0x91, 0xe4, 0xa8, 0x1d, 0x9a, 0x1b, 0x8a, 0xad,
- 0x0a, 0xcf, 0x36, 0x4f, 0xae, 0x43, 0xde, 0x62, 0xff, 0xa6, 0x4b, 0xa8,
- 0x16, 0x24, 0x98, 0x80, 0x82, 0x80, 0x37, 0x77}}}}, // A
- {0x0a, 0x30, 0xae, 0x43, 0xa1, 0xe0, 0xd7, 0xdf, 0x10, 0x5e, 0xaf, 0xd8,
- 0x5a, 0x61, 0x10, 0x86, 0xd0, 0x9d, 0xb9, 0xe4, 0x46, 0xdd, 0xb7, 0x1b,
- 0x00, 0x14, 0x7c, 0x6b, 0x13, 0x72, 0xc3, 0x77}, // x
- {0x48, 0x40, 0xb5, 0x6c, 0x6d, 0x47, 0x09, 0x0b, 0x05, 0xd6, 0x43, 0x56,
- 0xe0, 0x7c, 0xc6, 0x8e, 0xa1, 0x65, 0x67, 0xfd, 0xa7, 0x07, 0x87, 0x9b,
- 0x36, 0x2d, 0x41, 0x35, 0x63, 0x61, 0x31, 0xc7} // f
-};
-
-const MemberPrecomp EpidTpmTest::kMemberPrecomp = {
- {0xd8, 0x14, 0xba, 0x4b, 0x44, 0x03, 0x55, 0x6c, 0xf6, 0x42, 0xe8, 0xf0,
- 0x4c, 0xb5, 0xe7, 0xd4, 0xa2, 0xa3, 0x69, 0x47, 0xf5, 0xd4, 0xc8, 0xe9,
- 0xc5, 0x5a, 0x39, 0xb5, 0x55, 0xa5, 0xd3, 0xfb, 0xf3, 0x85, 0x5a, 0x0d,
- 0xd5, 0xee, 0xde, 0xf4, 0xa8, 0xb1, 0x8b, 0xcf, 0xa9, 0x0d, 0x29, 0xbf,
- 0x86, 0x27, 0x9c, 0x1f, 0x96, 0xed, 0xd8, 0x44, 0x01, 0x35, 0x1a, 0xce,
- 0xfd, 0x4e, 0x6f, 0xa1, 0x66, 0x0d, 0x59, 0x08, 0x6d, 0xa2, 0xe4, 0x99,
- 0x83, 0xdc, 0x39, 0x28, 0xb7, 0x1c, 0x1a, 0x33, 0xad, 0xca, 0x5c, 0x35,
- 0x26, 0x1f, 0xab, 0xba, 0x0d, 0x53, 0xaf, 0xe0, 0x72, 0x14, 0xc5, 0xa7,
- 0x2e, 0x58, 0x26, 0xc9, 0x8e, 0xfa, 0x6f, 0x62, 0xfc, 0xf0, 0x08, 0x3e,
- 0xa3, 0x11, 0x3a, 0xf0, 0xb8, 0x3b, 0x2d, 0x3e, 0xec, 0xd5, 0xbc, 0xf2,
- 0x05, 0x68, 0xf4, 0x40, 0xce, 0x2c, 0x8f, 0xdd, 0xa4, 0xe5, 0xe1, 0xb5,
- 0xbe, 0xbd, 0x3e, 0xd4, 0xf6, 0x9a, 0xb3, 0x37, 0x24, 0x0d, 0xea, 0x13,
- 0xd7, 0x1f, 0xa2, 0x75, 0x68, 0xa1, 0xbe, 0x2c, 0x01, 0x42, 0x2a, 0xae,
- 0x6f, 0xae, 0x7a, 0x72, 0x3a, 0x11, 0x03, 0x58, 0x02, 0x0d, 0xf0, 0xb0,
- 0xd9, 0x6f, 0xb1, 0xe4, 0xf2, 0x70, 0xb8, 0xff, 0x22, 0x56, 0x7c, 0xb3,
- 0x80, 0xfd, 0xdf, 0xe5, 0xab, 0xcc, 0x18, 0x7a, 0xfd, 0x91, 0xd0, 0xb0,
- 0x63, 0x40, 0xd4, 0x71, 0xfa, 0x03, 0xf5, 0xf1, 0x26, 0xe1, 0xa5, 0x5a,
- 0xd9, 0x6d, 0xf5, 0x5a, 0x7b, 0x2a, 0x3a, 0xfe, 0x94, 0x9e, 0x74, 0x41,
- 0x79, 0x49, 0x7e, 0x48, 0x1d, 0x58, 0x5e, 0xf6, 0x98, 0xa3, 0x6e, 0x61,
- 0x8e, 0x9f, 0x1f, 0xcd, 0x15, 0x01, 0x16, 0xa5, 0xe0, 0xab, 0xd6, 0xd6,
- 0x1f, 0x1c, 0xf5, 0x81, 0x76, 0xc1, 0xec, 0x10, 0xc2, 0xcc, 0x68, 0x59,
- 0x4d, 0x47, 0xef, 0x4b, 0x7f, 0xd8, 0x78, 0x9c, 0xfe, 0x9a, 0x86, 0x7e,
- 0x0c, 0xfd, 0x3e, 0x0a, 0x7a, 0x72, 0x8b, 0x14, 0x5f, 0xe6, 0x5f, 0x19,
- 0xa3, 0x0a, 0x1b, 0x71, 0xdc, 0xd2, 0xae, 0x35, 0xc3, 0x11, 0xa5, 0xd3,
- 0xea, 0xe1, 0xa9, 0xe7, 0x70, 0x0c, 0x7a, 0x39, 0x56, 0x3c, 0xe4, 0xe7,
- 0xf9, 0xb6, 0xf1, 0x15, 0x40, 0xab, 0xb6, 0xc4, 0xad, 0xbd, 0xf4, 0xcc,
- 0x13, 0xb7, 0xa8, 0xb6, 0x92, 0x1e, 0x72, 0x27, 0xa7, 0xff, 0xd9, 0xea,
- 0x2f, 0x91, 0x96, 0x22, 0xd2, 0xc4, 0x4d, 0x80, 0xdc, 0x47, 0x66, 0x87,
- 0xcc, 0xcf, 0xc5, 0x64, 0xf7, 0xb2, 0x34, 0xed, 0xd5, 0x44, 0x44, 0xcc,
- 0x57, 0x41, 0xc7, 0x92, 0xb7, 0x5c, 0x12, 0xf7, 0x81, 0xf2, 0x92, 0x35,
- 0x3e, 0x4b, 0xdf, 0xf8, 0xda, 0x68, 0xac, 0x30, 0xe3, 0xdd, 0x9e, 0x22,
- 0xaa, 0x6d, 0x77, 0xdd, 0xac, 0xd9, 0x11, 0x6e, 0xfb, 0x1a, 0x88,
- 0xb3}, // e12
- {
- 0x07, 0x3f, 0x9d, 0x47, 0x82, 0xb8, 0x3d, 0x6a, 0xe0, 0x36, 0xab, 0xa6,
- 0xfa, 0xe6, 0xd2, 0x1c, 0xc8, 0xb2, 0xd0, 0x01, 0xd4, 0x96, 0xdc, 0x2e,
- 0xf8, 0x19, 0xdc, 0x70, 0x1b, 0xf9, 0x73, 0x0c, 0x2b, 0xc2, 0xe2, 0x1d,
- 0x85, 0x53, 0x81, 0x51, 0xfb, 0xca, 0x16, 0x86, 0xd4, 0x4e, 0xfd, 0x1a,
- 0x59, 0xe3, 0x97, 0xc4, 0x7f, 0x99, 0xd8, 0x66, 0x08, 0xa1, 0xe4, 0x9f,
- 0xbb, 0x3a, 0xce, 0xa5, 0x23, 0x9c, 0x83, 0x13, 0xc5, 0xc8, 0xf2, 0x16,
- 0x1e, 0xe8, 0xe6, 0xc5, 0x36, 0x57, 0x2c, 0xdf, 0x73, 0xb4, 0xe2, 0xb2,
- 0xcb, 0xeb, 0xbb, 0xf7, 0x45, 0xd1, 0x44, 0xbd, 0x6e, 0x92, 0x95, 0x00,
- 0xe5, 0x89, 0xb5, 0x91, 0x78, 0xc7, 0x44, 0xb1, 0x2f, 0x37, 0xdf, 0xfb,
- 0xe7, 0x8a, 0x44, 0x3f, 0x3d, 0x06, 0x5f, 0x5b, 0x1c, 0x5f, 0xce, 0x11,
- 0x05, 0x35, 0x3c, 0xad, 0x92, 0x7e, 0x79, 0xb8, 0xff, 0x28, 0x05, 0xe4,
- 0x04, 0x2c, 0xb6, 0x1d, 0x22, 0xab, 0x36, 0x00, 0x5f, 0x74, 0xf1, 0xe3,
- 0xf6, 0xa6, 0x68, 0xe6, 0x7b, 0x25, 0xb8, 0xcf, 0x19, 0xb0, 0x1a, 0xdd,
- 0x0f, 0xad, 0x63, 0x73, 0x62, 0x1b, 0xe7, 0x94, 0x5d, 0xbf, 0x3d, 0xf1,
- 0xf9, 0x8e, 0xab, 0x59, 0xe5, 0xd1, 0x7c, 0x62, 0xdd, 0xbc, 0x40, 0x07,
- 0x70, 0x5b, 0x13, 0xf6, 0x12, 0x09, 0xb4, 0x0d, 0x3e, 0xab, 0x8b, 0x70,
- 0x60, 0x1d, 0xd4, 0x61, 0x37, 0x28, 0x98, 0x3e, 0x7e, 0xdc, 0xfd, 0xd2,
- 0xc0, 0x2f, 0x4b, 0x71, 0x31, 0x34, 0xd7, 0x69, 0x41, 0x5e, 0xaa, 0x72,
- 0xe4, 0xdf, 0xeb, 0xfe, 0x8d, 0xcd, 0x68, 0xfc, 0x68, 0x55, 0xbe, 0x32,
- 0x7d, 0x24, 0xc5, 0x07, 0x0f, 0xa8, 0xbd, 0x5a, 0xfe, 0xe7, 0xec, 0xdb,
- 0xfd, 0x19, 0xc8, 0xa9, 0x20, 0xa2, 0x7f, 0x6c, 0xa6, 0x62, 0xec, 0xed,
- 0x9b, 0x79, 0xbf, 0x9c, 0x0e, 0x31, 0x0b, 0x25, 0x2f, 0xd3, 0xcc, 0xa0,
- 0xdd, 0xb2, 0xf2, 0x69, 0x26, 0x85, 0x21, 0x06, 0x94, 0x56, 0x5f, 0x59,
- 0x5c, 0xf5, 0xb7, 0x82, 0xce, 0x0f, 0xdd, 0x40, 0xdb, 0x83, 0xac, 0x3c,
- 0x41, 0xa0, 0x1b, 0xb1, 0xaf, 0xda, 0x55, 0xbf, 0x6b, 0x1a, 0xef, 0xe6,
- 0x90, 0xe7, 0xaa, 0x0f, 0x04, 0x3c, 0x9f, 0x5b, 0xb7, 0xcd, 0x98, 0xa8,
- 0x9e, 0xff, 0x54, 0x26, 0xc8, 0xd5, 0x5c, 0x30, 0x5e, 0xa2, 0x99, 0x8e,
- 0x34, 0xd5, 0x98, 0x9f, 0xcd, 0x57, 0xd1, 0x4d, 0x1d, 0xee, 0x01, 0x5d,
- 0x5a, 0x6d, 0xb2, 0xf1, 0xcf, 0x4b, 0xc0, 0x21, 0x23, 0x96, 0x05, 0xf9,
- 0xc9, 0x66, 0xe5, 0x25, 0x9d, 0xa3, 0x8e, 0x78, 0x43, 0x19, 0xc1, 0x7f,
- 0x7b, 0xef, 0xf5, 0xed, 0x00, 0xb7, 0x45, 0x1f, 0x4e, 0xa9, 0xfa, 0xe3,
- 0xff, 0x54, 0xf2, 0x21, 0x73, 0xf8, 0x6b, 0xa1, 0xc7, 0x31, 0x4d, 0x6a,
- }, // e22
- {
- 0x49, 0x0d, 0x0f, 0x2a, 0x5c, 0x6a, 0x3b, 0xad, 0x71, 0xc9, 0x22, 0x49,
- 0xe8, 0x08, 0xdd, 0xba, 0x79, 0x57, 0xb7, 0xc7, 0x61, 0xe4, 0xdb, 0x84,
- 0x68, 0x57, 0xb9, 0x30, 0x83, 0xa4, 0xdc, 0xef, 0x70, 0x93, 0x28, 0xe2,
- 0x6f, 0xb9, 0xbc, 0x15, 0x28, 0x3a, 0x30, 0xbd, 0x96, 0x83, 0xdb, 0xf2,
- 0x9d, 0x1e, 0xc7, 0x64, 0x6d, 0x2e, 0x7c, 0xa2, 0xf3, 0xaa, 0x2f, 0x4b,
- 0x6d, 0x86, 0x9e, 0x48, 0x20, 0x29, 0x4b, 0x1f, 0x8d, 0xc2, 0x93, 0xc3,
- 0x55, 0x25, 0x8e, 0xb0, 0x8a, 0x7e, 0x64, 0x45, 0x3f, 0xf4, 0x1d, 0x16,
- 0x4c, 0x88, 0x2d, 0x54, 0xbe, 0xa8, 0x67, 0x70, 0x81, 0xc5, 0xb9, 0x5c,
- 0x16, 0x00, 0xef, 0x78, 0xf6, 0x4d, 0x6a, 0xeb, 0xfd, 0xa2, 0x0d, 0x52,
- 0x86, 0xf3, 0x04, 0x4b, 0xd8, 0xf0, 0x7d, 0x50, 0x8b, 0xad, 0xc0, 0x37,
- 0xdb, 0x38, 0xf2, 0x7d, 0x1f, 0x8b, 0x13, 0x83, 0x7b, 0xcc, 0xe8, 0x25,
- 0xfe, 0xfa, 0x0c, 0x02, 0x05, 0x2e, 0x75, 0x12, 0xa1, 0x0a, 0x89, 0xab,
- 0xf1, 0xb2, 0x08, 0x47, 0x9a, 0xea, 0xef, 0x1d, 0xa4, 0x9f, 0xde, 0x89,
- 0x47, 0x3e, 0x7c, 0x5e, 0x4a, 0x40, 0xdc, 0xec, 0xc5, 0x1b, 0x7e, 0x33,
- 0x0a, 0x19, 0x69, 0x27, 0xa6, 0xcc, 0x25, 0xfc, 0xf9, 0xeb, 0xbd, 0xb7,
- 0x8a, 0xdb, 0x45, 0x5f, 0x9d, 0x9e, 0x01, 0xde, 0x3d, 0x91, 0x10, 0x99,
- 0x13, 0xbf, 0xc0, 0xfa, 0x9d, 0xd4, 0x0f, 0xb3, 0x09, 0xf3, 0xa1, 0xae,
- 0x68, 0xe1, 0x1b, 0x48, 0x85, 0x9f, 0x81, 0x66, 0x91, 0xe2, 0xf0, 0x7b,
- 0x29, 0xdb, 0x8f, 0x5d, 0x99, 0xa9, 0xd3, 0x39, 0x30, 0xd9, 0x1b, 0x94,
- 0x2a, 0x1c, 0x5c, 0xe9, 0xc0, 0x3f, 0x6e, 0xb2, 0x27, 0xbe, 0x74, 0x7a,
- 0xca, 0xe1, 0x0f, 0x6a, 0x43, 0x2e, 0x98, 0x65, 0xaf, 0x7f, 0x6e, 0x5a,
- 0x55, 0x98, 0xc1, 0x58, 0x29, 0xb3, 0x86, 0x54, 0x0f, 0x57, 0x91, 0x89,
- 0x29, 0xb1, 0x98, 0x79, 0xcc, 0x95, 0x39, 0xd0, 0xab, 0xe0, 0x9f, 0xf3,
- 0xda, 0xf9, 0x5e, 0xd9, 0x34, 0xbb, 0x72, 0xda, 0xe5, 0x72, 0xd3, 0xf8,
- 0x9b, 0xf9, 0x14, 0x84, 0x48, 0x81, 0x54, 0x4f, 0xe6, 0x2b, 0x80, 0xc8,
- 0xc1, 0x79, 0xfe, 0x83, 0xff, 0x76, 0xa3, 0x6d, 0xfe, 0x37, 0x78, 0xc5,
- 0x30, 0x7a, 0x50, 0xe2, 0x5d, 0x12, 0xdc, 0x72, 0xe9, 0x58, 0x7c, 0x07,
- 0x4f, 0xff, 0x15, 0x8a, 0x97, 0x3b, 0xcb, 0x60, 0xfa, 0x4e, 0xde, 0x8c,
- 0x80, 0x3a, 0x8b, 0x0b, 0xc6, 0x1d, 0xa3, 0xce, 0x6a, 0xb3, 0x50, 0x69,
- 0x03, 0x96, 0xca, 0xc0, 0xb6, 0x94, 0x6f, 0x8f, 0xab, 0x6f, 0x5b, 0x00,
- 0x2a, 0x1d, 0x90, 0xa7, 0x81, 0xc6, 0x15, 0x77, 0x79, 0xf3, 0x36, 0x23,
- 0xd1, 0x46, 0x25, 0x58, 0x6f, 0x7b, 0x22, 0xac, 0x4c, 0x7a, 0xf3, 0x9f,
- }, // e2w
- {
- 0x8d, 0x71, 0xe2, 0xb0, 0x73, 0x2f, 0x4a, 0xba, 0x64, 0xe8, 0x7a, 0x12,
- 0xaf, 0xe4, 0x4f, 0xdb, 0x6b, 0x3e, 0x38, 0x07, 0x0c, 0x79, 0x22, 0x48,
- 0x1b, 0x9d, 0x33, 0x53, 0x5c, 0x75, 0x3b, 0x40, 0x5e, 0x18, 0xd1, 0x92,
- 0x4a, 0xd1, 0x82, 0x1c, 0xc7, 0x3a, 0xf7, 0x7e, 0x32, 0x19, 0x99, 0x5d,
- 0x01, 0x0e, 0xb0, 0xf2, 0x8f, 0x80, 0xc6, 0xb9, 0xeb, 0x1f, 0x9e, 0xae,
- 0x9e, 0xe0, 0x99, 0xfd, 0xe8, 0x93, 0x11, 0x61, 0x7d, 0xc2, 0x49, 0xdb,
- 0xa8, 0x73, 0xa4, 0xa9, 0x33, 0xe2, 0x04, 0xd1, 0x7d, 0x8b, 0xe1, 0xd6,
- 0x2b, 0x10, 0x6c, 0x79, 0x02, 0xbf, 0xfc, 0x53, 0x03, 0xa9, 0xbc, 0x30,
- 0x4d, 0x4d, 0xf4, 0x32, 0xce, 0x9a, 0x4a, 0xfa, 0xd6, 0x7f, 0x26, 0x17,
- 0xc5, 0xf6, 0xed, 0xe4, 0xcc, 0xb9, 0x79, 0xe2, 0xa8, 0x86, 0xbb, 0xd7,
- 0xfb, 0x05, 0xd2, 0x81, 0xbe, 0x07, 0x1c, 0x47, 0x48, 0x4f, 0x6d, 0x6b,
- 0x52, 0x42, 0xe4, 0xc6, 0x20, 0x46, 0xa3, 0xae, 0x5b, 0x55, 0x55, 0xfe,
- 0x4a, 0xad, 0xf2, 0x32, 0x07, 0x0f, 0x91, 0xa9, 0xe5, 0xd3, 0x86, 0x08,
- 0x73, 0x93, 0xc7, 0x1e, 0x6b, 0xcd, 0x69, 0xd0, 0xfb, 0xc1, 0x74, 0xc2,
- 0xb8, 0x90, 0xc8, 0xf8, 0x93, 0xbf, 0x08, 0x0f, 0x15, 0x19, 0x26, 0x71,
- 0x4a, 0x9e, 0xdf, 0xdf, 0xca, 0x6f, 0xca, 0xfd, 0x67, 0xec, 0x4d, 0x21,
- 0x5b, 0x99, 0xbd, 0x4b, 0x79, 0x22, 0x2d, 0xe4, 0x24, 0x72, 0x88, 0x93,
- 0xce, 0xe6, 0x7f, 0xef, 0x35, 0x83, 0x67, 0x39, 0xb9, 0x34, 0x80, 0x64,
- 0x0a, 0xf4, 0xff, 0x42, 0x9d, 0xee, 0xda, 0xb8, 0xd3, 0xdc, 0x1d, 0x0d,
- 0x9f, 0x45, 0xe9, 0xbe, 0xf4, 0x3e, 0xa6, 0x58, 0x8b, 0xf0, 0xfd, 0x01,
- 0x73, 0x63, 0xd0, 0xc6, 0x9d, 0xb9, 0x32, 0xd1, 0x91, 0xfe, 0xb1, 0xf5,
- 0x4b, 0x48, 0xb4, 0x46, 0xae, 0x61, 0xd7, 0x90, 0xfe, 0x86, 0x74, 0x68,
- 0xee, 0x78, 0x86, 0x65, 0x99, 0x6d, 0x7b, 0xf0, 0x17, 0x1a, 0x4c, 0xb0,
- 0x37, 0x73, 0xdc, 0x38, 0x41, 0xfa, 0x02, 0xd2, 0x13, 0x8f, 0x71, 0xb4,
- 0x0a, 0x72, 0x70, 0x0f, 0xe1, 0x2c, 0x9a, 0xa9, 0x51, 0xfa, 0xb2, 0xbf,
- 0x84, 0xf2, 0xa6, 0xfb, 0xc3, 0x83, 0x16, 0x7e, 0x27, 0xec, 0x06, 0x5d,
- 0x64, 0x79, 0xe7, 0x42, 0x30, 0xf8, 0x2d, 0xbc, 0x0f, 0x07, 0x8b, 0xf2,
- 0x99, 0xda, 0x91, 0x4c, 0x65, 0xcf, 0x7f, 0x57, 0x2d, 0x2f, 0x67, 0xe7,
- 0xfb, 0x75, 0xe9, 0xb2, 0xa3, 0x72, 0x60, 0x88, 0x2b, 0x14, 0x31, 0x62,
- 0xbc, 0x45, 0x59, 0x5c, 0x58, 0x39, 0xb3, 0x4a, 0xeb, 0xb9, 0x18, 0x24,
- 0x05, 0xcb, 0xda, 0xd3, 0x5e, 0x54, 0xba, 0xda, 0xfd, 0xfc, 0xa0, 0x02,
- 0xb3, 0xde, 0x52, 0x3e, 0xc0, 0xd0, 0xb8, 0x19, 0x85, 0x1b, 0x7b, 0xe3,
- } // ea2
-};
-
-const std::vector<uint8_t> EpidTpmTest::kMsg0 = {'m', 's', 'g', '0'};
-const std::vector<uint8_t> EpidTpmTest::kBsn0 = {'b', 's', 'n', '0'};
-
-std::vector<uint8_t> EpidTpmTest::kSigRl5EntryData = {
- // gid
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01,
- // version
- 0x00, 0x00, 0x00, 0x00,
- // n2
- 0x00, 0x00, 0x00, 0x05,
- // bk's
- 0x9c, 0xa5, 0xe5, 0xae, 0x5f, 0xae, 0x51, 0x59, 0x33, 0x35, 0x27, 0xd, 0x8,
- 0xb1, 0xbe, 0x5d, 0x69, 0x50, 0x84, 0xc5, 0xfe, 0xe2, 0x87, 0xea, 0x2e,
- 0xef, 0xfa, 0xee, 0x67, 0xf2, 0xd8, 0x28, 0x56, 0x43, 0xc6, 0x94, 0x67,
- 0xa6, 0x72, 0xf6, 0x41, 0x15, 0x4, 0x58, 0x42, 0x16, 0x88, 0x57, 0x9d, 0xc7,
- 0x71, 0xd1, 0xc, 0x84, 0x13, 0xa, 0x90, 0x23, 0x18, 0x8, 0xad, 0x7d, 0xfe,
- 0xf5, 0xc8, 0xae, 0xfc, 0x51, 0x40, 0xa7, 0xd1, 0x28, 0xc2, 0x89, 0xb2,
- 0x6b, 0x4e, 0xb4, 0xc1, 0x55, 0x87, 0x98, 0xbd, 0x72, 0xf9, 0xcf, 0xd, 0x40,
- 0x15, 0xee, 0x32, 0xc, 0xf3, 0x56, 0xc5, 0xc, 0x61, 0x9d, 0x4f, 0x7a, 0xb5,
- 0x2b, 0x16, 0xa9, 0xa3, 0x97, 0x38, 0xe2, 0xdd, 0x3a, 0x33, 0xad, 0xf6,
- 0x7b, 0x68, 0x8b, 0x68, 0xcf, 0xa3, 0xd3, 0x98, 0x37, 0xce, 0xec, 0xd1,
- 0xa8, 0xc, 0x8b,
-
- 0x71, 0x8a, 0xb5, 0x1, 0x7f, 0x7c, 0x92, 0x9a, 0xa2, 0xc9, 0x81, 0x10, 0xfe,
- 0xbf, 0xc, 0x53, 0xa4, 0x43, 0xaf, 0x31, 0x74, 0x12, 0x25, 0x60, 0x3e, 0xc0,
- 0x21, 0xe6, 0x63, 0x9a, 0xd2, 0x67, 0x2d, 0xb5, 0xd5, 0x82, 0xc4, 0x49,
- 0x29, 0x51, 0x42, 0x8f, 0xe0, 0xe, 0xd1, 0x73, 0x27, 0xf5, 0x77, 0x16, 0x4,
- 0x40, 0x8a, 0x0, 0xe, 0x3a, 0x5d, 0x37, 0x42, 0xd3, 0x8, 0x40, 0xbd, 0x69,
- 0xf7, 0x5f, 0x74, 0x21, 0x50, 0xf4, 0xce, 0xfe, 0xd9, 0xdd, 0x97, 0x6c,
- 0xa8, 0xa5, 0x60, 0x6b, 0xf8, 0x1b, 0xba, 0x2, 0xb2, 0xca, 0x5, 0x44, 0x9b,
- 0xb1, 0x5e, 0x3a, 0xa4, 0x35, 0x7a, 0x51, 0xfa, 0xcf, 0xa4, 0x4, 0xe9, 0xf3,
- 0xbf, 0x38, 0xd4, 0x24, 0x9, 0x52, 0xf3, 0x58, 0x3d, 0x9d, 0x4b, 0xb3, 0x37,
- 0x4b, 0xec, 0x87, 0xe1, 0x64, 0x60, 0x3c, 0xb6, 0xf7, 0x7b, 0xff, 0x40,
- 0x11,
-
- 0x6e, 0x22, 0xaa, 0x10, 0x84, 0x58, 0x8b, 0xff, 0xd8, 0x37, 0x8, 0xa9, 0xe9,
- 0xdb, 0xf6, 0x1f, 0x69, 0x10, 0x95, 0x6c, 0xbf, 0xd, 0x11, 0x48, 0x6f, 0x1b,
- 0x3c, 0x62, 0x46, 0x13, 0x89, 0x13, 0x5f, 0xa1, 0x3, 0x62, 0xed, 0x62, 0xdf,
- 0x3d, 0xbf, 0xcd, 0xb7, 0x41, 0x48, 0x81, 0x3, 0x9f, 0x54, 0xa, 0xe, 0xb3,
- 0x35, 0xf9, 0xde, 0x24, 0xba, 0x6d, 0x4c, 0x7f, 0xfc, 0xc1, 0xb4, 0xce,
- 0x6d, 0xa1, 0x73, 0x7c, 0xaa, 0xb, 0xad, 0x2, 0xd6, 0x37, 0x85, 0xe, 0xbb,
- 0x48, 0x11, 0x38, 0xc4, 0xaa, 0x1b, 0xf, 0xcf, 0xc1, 0x9c, 0x26, 0xcc, 0x95,
- 0xc2, 0x5b, 0x49, 0x9, 0x3d, 0xe9, 0x7d, 0xce, 0xc7, 0xa6, 0x4, 0x3e, 0x7c,
- 0x9e, 0x28, 0xde, 0x8, 0x11, 0xe, 0x61, 0x3b, 0xc0, 0x9c, 0x6b, 0x58, 0x23,
- 0xe6, 0x40, 0x7b, 0xbd, 0xb8, 0x72, 0xf, 0xe0, 0xee, 0xcf, 0xba, 0xb4,
-
- 0xc4, 0xff, 0xaf, 0x48, 0x15, 0xda, 0x60, 0x40, 0xcc, 0xd7, 0xf2, 0x68,
- 0xf7, 0xe2, 0x70, 0x12, 0x8d, 0x15, 0xa5, 0xb7, 0xe6, 0x4c, 0x23, 0xea,
- 0x4d, 0x8a, 0x51, 0x6, 0x67, 0x3, 0x4c, 0x83, 0x6f, 0x28, 0x67, 0xcf, 0x63,
- 0x46, 0x3e, 0x8a, 0x45, 0x9f, 0xed, 0x1a, 0xde, 0xa7, 0xad, 0xb2, 0x2b, 0xf,
- 0x8b, 0xab, 0x7c, 0x70, 0xff, 0xc3, 0xa8, 0x6e, 0x8c, 0xaa, 0xb1, 0xf6,
- 0x20, 0xe3, 0xb9, 0xf1, 0xc3, 0x3d, 0x5, 0x6a, 0x1e, 0x26, 0x2d, 0xf4, 0xd,
- 0xe4, 0x53, 0x63, 0x67, 0x23, 0x48, 0xa8, 0x1, 0xa8, 0xee, 0xe1, 0x5f, 0x64,
- 0xe3, 0x2c, 0x71, 0xe2, 0x10, 0x82, 0x0, 0x52, 0xd7, 0x74, 0x87, 0xff, 0x1c,
- 0x0, 0x19, 0xe6, 0x4d, 0x15, 0x91, 0x6d, 0xf3, 0x38, 0x3b, 0xee, 0xf3, 0xd5,
- 0xd1, 0xc7, 0x6d, 0xd9, 0x8e, 0x55, 0x70, 0x90, 0xb0, 0xb, 0x3c, 0x4a, 0x67,
- 0x19,
-
- 0x4f, 0x98, 0x92, 0xf9, 0x18, 0x38, 0xf5, 0xb4, 0xf7, 0x2f, 0xa7, 0x21,
- 0x71, 0x52, 0x27, 0xd0, 0x57, 0x4f, 0x9c, 0x30, 0xe, 0xb2, 0x27, 0xce, 0xd7,
- 0xb2, 0x9f, 0xc0, 0xf6, 0xc3, 0xb0, 0x7c, 0x40, 0x18, 0x75, 0x4a, 0xde,
- 0xb0, 0x9f, 0x46, 0x8a, 0x5a, 0xeb, 0x4f, 0xcb, 0x5e, 0x60, 0xf5, 0xca,
- 0xf4, 0x98, 0xaf, 0x62, 0x9b, 0x7e, 0x10, 0xda, 0xba, 0x2f, 0x47, 0x64,
- 0xf2, 0xc0, 0x84, 0x19, 0x75, 0xe0, 0xe4, 0xff, 0x20, 0xda, 0x7d, 0xe5, 0xd,
- 0xc8, 0xf8, 0xe3, 0x83, 0x61, 0x19, 0x17, 0xf1, 0xa9, 0x1b, 0xff, 0x39,
- 0x79, 0x88, 0x1, 0xfb, 0xe7, 0x23, 0xd2, 0xac, 0xe0, 0x49, 0x12, 0x2a, 0x38,
- 0xb4, 0x7c, 0xc2, 0x1b, 0x88, 0x5f, 0x68, 0x32, 0x11, 0xd9, 0xfd, 0xdc,
- 0x65, 0x2, 0xb3, 0x74, 0x2c, 0x13, 0xf2, 0xd8, 0xf1, 0x45, 0xc5, 0xd1, 0xf4,
- 0xa3, 0x38, 0x81, 0x92};
diff --git a/epid/member/tpm/unittests/tpm-testhelper.h b/epid/member/tpm/unittests/tpm-testhelper.h
deleted file mode 100644
index 5645dbe..0000000
--- a/epid/member/tpm/unittests/tpm-testhelper.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*############################################################################
- # Copyright 2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-/// Tpm C++ wrapper interface.
-/*!
- * \file
- */
-#ifndef EPID_MEMBER_TPM_UNITTESTS_TPM_TESTHELPER_H_
-#define EPID_MEMBER_TPM_UNITTESTS_TPM_TESTHELPER_H_
-
-#include <cstdint>
-#include <vector>
-
-#include "gtest/gtest.h"
-extern "C" {
-#include "epid/common/bitsupplier.h"
-#include "epid/common/types.h"
-#include "epid/member/api.h" // for MemberPrecomp
-}
-
-typedef struct TpmCtx TpmCtx;
-typedef struct Epid2Params_ Epid2Params_;
-typedef struct FiniteField FiniteField;
-typedef struct EcGroup EcGroup;
-
-/// Test fixture class for Tpm
-class EpidTpmTest : public ::testing::Test {
- public:
- /// test data
- static const GroupPubKey kGroupPublicKey;
- /// test data
- static const PrivKey kMemberPrivateKey;
- /// test data
- static const MemberPrecomp kMemberPrecomp;
- /// signature based revocation list with 5 entries
- static std::vector<uint8_t> kSigRl5EntryData;
- /// a message
- static const std::vector<uint8_t> kMsg0;
- /// a basename
- static const std::vector<uint8_t> kBsn0;
-
- /// setup called before each TEST_F starts
- virtual void SetUp() {}
- /// teardown called after each TEST_F finishes
- virtual void TearDown() {}
-};
-
-/// C++ Wrapper to manage memory for Epid2Params via RAII
-class Epid2ParamsObj {
- public:
- /// Create a Epid2Params
- Epid2ParamsObj();
-
- // This class instances are not meant to be copied.
- // Explicitly delete copy constructor and assignment operator.
- Epid2ParamsObj(const Epid2ParamsObj&) = delete;
- Epid2ParamsObj& operator=(const Epid2ParamsObj&) = delete;
-
- /// Destroy the Epid2Params
- ~Epid2ParamsObj();
- /// get a pointer to the stored Epid2Params
- Epid2Params_* ctx() const;
- /// cast operator to get the pointer to the stored Epid2Params
- operator Epid2Params_*() const;
- /// const cast operator to get the pointer to the stored Epid2Params
- operator const Epid2Params_*() const;
- /// get a pointer to the prime field Fp
- FiniteField* Fp() const;
- /// get a pointer to elliptic curve group G1
- EcGroup* G1() const;
-
- private:
- /// The stored parameters
- Epid2Params_* params_;
-};
-
-/// C++ Wrapper to manage memory for TpmCtx via RAII
-class TpmCtxObj {
- public:
- /// Create a TpmCtx
- TpmCtxObj(BitSupplier rnd_func, void* rnd_param,
- Epid2ParamsObj const& params);
-
- // This class instances are not meant to be copied.
- // Explicitly delete copy constructor and assignment operator.
- TpmCtxObj(const TpmCtxObj&) = delete;
- TpmCtxObj& operator=(const TpmCtxObj&) = delete;
-
- /// Destroy the TpmCtx
- ~TpmCtxObj();
- /// get a pointer to the stored TpmCtx
- TpmCtx* ctx() const;
- /// cast operator to get the pointer to the stored TpmCtx
- operator TpmCtx*() const;
- /// const cast operator to get the pointer to the stored TpmCtx
- operator const TpmCtx*() const;
-
- private:
- /// The stored TpmCtx
- TpmCtx* ctx_;
- Epid2ParamsObj const& params_;
-};
-
-#endif // EPID_MEMBER_TPM_UNITTESTS_TPM_TESTHELPER_H_
diff --git a/epid/member/tpm2/commit.h b/epid/member/tpm2/commit.h
new file mode 100644
index 0000000..145e50f
--- /dev/null
+++ b/epid/member/tpm2/commit.h
@@ -0,0 +1,72 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// SDK TPM Commit API.
+/*! \file */
+
+#ifndef EPID_MEMBER_TPM2_COMMIT_H_
+#define EPID_MEMBER_TPM2_COMMIT_H_
+
+#include <stddef.h>
+
+#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
+
+/// \cond
+typedef struct Tpm2Ctx Tpm2Ctx;
+typedef struct FfElement FfElement;
+typedef struct EcPoint EcPoint;
+/// \endcond
+
+/*!
+\addtogroup Tpm2Module tpm2
+\ingroup EpidMemberModule
+@{
+*/
+
+/// Performs TPM2_Commit TPM operation.
+/*!
+Generates random r and compute K, L and E points.
+
+\param[in] ctx
+The TPM context.
+\param[in] p1
+A point P1 on G1 curve.
+\param[in] s2
+Octet array used to derive x-coordinate of a point P2.
+\param[in] s2_len
+Length of s2 buffer.
+\param[in] y2
+y coordinate of the point associated with s2.
+\param[out] k
+Result of G1.exp(P2, private key f).
+\param[out] l
+Result of G1.exp(P2, random r).
+\param[out] e
+Result of G1.exp(P1, random r).
+\param[out] counter
+A value associated with the random r. Should be initialized with zero.
+
+\returns ::EpidStatus
+
+\see Tpm2CreateContext
+*/
+EpidStatus Tpm2Commit(Tpm2Ctx* ctx, EcPoint const* p1, void const* s2,
+ size_t s2_len, FfElement const* y2, EcPoint* k,
+ EcPoint* l, EcPoint* e, uint16_t* counter);
+
+/*! @} */
+
+#endif // EPID_MEMBER_TPM2_COMMIT_H_
diff --git a/epid/member/tpm2/context.h b/epid/member/tpm2/context.h
new file mode 100644
index 0000000..83e9f92
--- /dev/null
+++ b/epid/member/tpm2/context.h
@@ -0,0 +1,123 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// SDK TPM API.
+/*! \file */
+
+#ifndef EPID_MEMBER_TPM2_CONTEXT_H_
+#define EPID_MEMBER_TPM2_CONTEXT_H_
+
+#include "epid/common/bitsupplier.h"
+#include "epid/common/errors.h"
+#include "epid/common/types.h"
+
+/// \cond
+typedef struct Tpm2Ctx Tpm2Ctx;
+typedef struct FpElemStr FpElemStr;
+typedef struct Epid2Params_ Epid2Params_;
+typedef struct MemberParams MemberParams;
+/// \endcond
+
+/*!
+ \addtogroup Tpm2Module tpm2
+ \ingroup EpidMemberModule
+ @{
+*/
+
+/// Creates a new Tpm context
+/*!
+
+ Must be called to create the TPM context that is used by other TPM
+ APIs.
+
+ You need to use a cryptographically secure random number generator
+ to create a TPM context. The ::BitSupplier is provided as a function
+ prototype for your own implementation of the random number generator.
+
+ ::Tpm2DeleteContext must be called to safely release the TPM context.
+
+ \param[in] params
+ member parameters to initialize rnd_func, rnd_param, ff_elem, ctx.
+
+ \param[in] epid2_params
+ The field and group parameters.
+
+ \param[out] rnd_func
+ random function if exists in MemberParms
+
+ \param[out] rnd_param
+ random parameters if exists in MemberParms
+
+ \param[out] f
+ seed f if exists in MemberParams
+
+ \param[out] ctx
+ Newly constructed TPM context.
+
+ \returns ::EpidStatus
+
+ \see Tpm2DeleteContext
+*/
+EpidStatus Tpm2CreateContext(MemberParams const* params,
+ Epid2Params_ const* epid2_params,
+ BitSupplier* rnd_func, void** rnd_param,
+ const FpElemStr** f, Tpm2Ctx** ctx);
+
+/// Deletes an existing Tpm context.
+/*!
+
+ Must be called to safely release a TPM context created using
+ ::Tpm2CreateContext.
+
+ De-initializes the context, frees memory used by the context, and
+ sets the context pointer to NULL.
+
+ \param[in,out] ctx
+ The TPM context. Can be NULL.
+
+ \see Tpm2CreateContext
+*/
+void Tpm2DeleteContext(Tpm2Ctx** ctx);
+
+/// Sets the hash algorithm to be used by a TPM2.
+/*!
+
+ \param[in] ctx
+ The TPM2 context.
+ \param[in] hash_alg
+ The hash algorithm to use.
+
+ \returns ::EpidStatus
+*/
+EpidStatus Tpm2SetHashAlg(Tpm2Ctx* ctx, HashAlg hash_alg);
+
+/// Reset an existing Tpm context.
+/*!
+
+Must be called to reset a TPM context created using
+::Tpm2CreateContext.
+
+Re-initializes the context, reset memory used for primary key.
+
+\param[in,out] ctx
+The TPM context. Can be NULL.
+
+\see Tpm2CreateContext
+*/
+void Tpm2ResetContext(Tpm2Ctx** ctx);
+
+/*! @} */
+
+#endif // EPID_MEMBER_TPM2_CONTEXT_H_
diff --git a/parts-site/configurations/instr_size_optimized_release/intelc_posix-any.py b/epid/member/tpm2/createprimary.h
index ed8b94a..16bd582 100644
--- a/parts-site/configurations/instr_size_optimized_release/intelc_posix-any.py
+++ b/epid/member/tpm2/createprimary.h
@@ -1,4 +1,4 @@
-############################################################################
+/*############################################################################
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,22 +12,28 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
+############################################################################*/
+/// TPM2_CreatePrimary command interface.
+/*! \file */
+#ifndef EPID_MEMBER_TPM2_CREATEPRIMARY_H_
+#define EPID_MEMBER_TPM2_CREATEPRIMARY_H_
-"""Intel posix compiler configuration for release
-"""
+#include "epid/common/errors.h"
-from parts.config import ConfigValues, configuration
+/// \cond
+typedef struct Tpm2Ctx Tpm2Ctx;
+typedef struct G1ElemStr G1ElemStr;
+/// \endcond
-def map_default_version(env):
- return env['INTELC_VERSION']
+/// Creates Primary key
+/*!
+\param[in,out] ctx
+TPM context.
+\param[out] p_str
+Primary key: g1^f
+\returns ::EpidStatus
+*/
+EpidStatus Tpm2CreatePrimary(Tpm2Ctx* ctx, G1ElemStr* p_str);
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- append=ConfigValues(
- CCFLAGS=['-finstrument-functions'],
- )
- )
+#endif // EPID_MEMBER_TPM2_CREATEPRIMARY_H_
diff --git a/epid/member/tpm2/getrandom.h b/epid/member/tpm2/getrandom.h
new file mode 100644
index 0000000..b7f7980
--- /dev/null
+++ b/epid/member/tpm2/getrandom.h
@@ -0,0 +1,57 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+#ifndef EPID_MEMBER_TPM2_GETRANDOM_H_
+#define EPID_MEMBER_TPM2_GETRANDOM_H_
+
+/*!
+ * \file
+ * \brief SDK TPM API.
+ */
+
+#include "epid/common/errors.h"
+
+/// \cond
+typedef struct Tpm2Ctx Tpm2Ctx;
+/// \endcond
+
+/*!
+\addtogroup Tpm2Module tpm2
+\ingroup EpidMemberModule
+@{
+*/
+
+/// Get random data
+/*!
+This command returns the next num_bits from the random number generator (RNG).
+
+\param[in,out] ctx
+TPM context.
+
+\param[in] num_bits
+Number of bits to return.
+
+\param[out] random_data
+Output random bits.
+
+\returns ::EpidStatus
+
+\see Tpm2CreateContext
+*/
+EpidStatus Tpm2GetRandom(Tpm2Ctx* ctx, int const num_bits, void* random_data);
+
+/*! @} */
+
+#endif // EPID_MEMBER_TPM2_GETRANDOM_H_
diff --git a/epid/member/tpm2/ibm_tss/commit.c b/epid/member/tpm2/ibm_tss/commit.c
new file mode 100644
index 0000000..6e00cdd
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/commit.c
@@ -0,0 +1,147 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2Commit implementation.
+/*! \file */
+
+#include "epid/member/tpm2/commit.h"
+#include <tss2/TPM_Types.h>
+#include <tss2/tss.h>
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/ibm_tss/conversion.h"
+#include "epid/member/tpm2/ibm_tss/printtss.h"
+#include "epid/member/tpm2/ibm_tss/state.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+/// Bit 7 binary mask
+#define BIT7 0x080
+/// Binary 00011111
+#define BITS0500 0x3f
+
+EpidStatus Tpm2Commit(Tpm2Ctx* ctx, EcPoint const* p1, void const* s2,
+ size_t s2_len, FfElement const* y2, EcPoint* k,
+ EcPoint* l, EcPoint* e, uint16_t* counter) {
+ EpidStatus sts = kEpidErr;
+ TPM_RC rc = TPM_RC_SUCCESS;
+
+ if (!ctx || !ctx->epid2_params || !ctx->key_handle) {
+ return kEpidBadArgErr;
+ }
+
+ if (s2 && s2_len <= 0) {
+ return kEpidBadArgErr;
+ }
+
+ if ((!s2 && y2) || (s2 && !y2)) {
+ return kEpidBadArgErr;
+ }
+
+ if (s2 && (!k || !l)) {
+ return kEpidBadArgErr;
+ }
+
+ if (!e || !counter) {
+ return kEpidBadArgErr;
+ }
+
+ if (s2_len > UINT16_MAX) {
+ return kEpidBadArgErr;
+ }
+
+ do {
+ FiniteField* Fq = ctx->epid2_params->Fq;
+ EcGroup* G1 = ctx->epid2_params->G1;
+ Commit_In in = {0};
+ Commit_Out out;
+ TPMI_SH_AUTH_SESSION sessionHandle0 = TPM_RS_PW;
+ unsigned int sessionAttributes0 = 0;
+
+ in.signHandle = ctx->key_handle;
+ if (p1) {
+ G1ElemStr p1_str = {0};
+ sts = WriteEcPoint(G1, p1, &p1_str, sizeof(p1_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadTpm2EcPoint(&p1_str, &in.P1);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ if (s2) {
+ FqElemStr y2_str = {0};
+ sts = WriteFfElement(Fq, y2, &y2_str, sizeof(y2_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadTpm2FfElement(&y2_str.data, &in.y2);
+ BREAK_ON_EPID_ERROR(sts);
+ in.s2.t.size = (UINT16)s2_len;
+ if (0 != memcpy_S(&in.s2.t.buffer, sizeof(in.s2.t.buffer), s2, s2_len)) {
+ sts = kEpidBadArgErr;
+ break;
+ }
+ }
+ rc = TSS_Execute(ctx->tss, (RESPONSE_PARAMETERS*)&out,
+ (COMMAND_PARAMETERS*)&in, NULL, TPM_CC_Commit,
+ sessionHandle0, NULL, sessionAttributes0, TPM_RH_NULL,
+ NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_Commit", rc);
+ // workaround based on Table 2:15 to filter response code format defining
+ // handle, session, or parameter number modifier if bit 7 is 1 error is
+ // RC_FMT1
+ if ((rc & BIT7) != 0) {
+ rc = rc & (BITS0500 | RC_FMT1);
+ if (TPM_RC_ATTRIBUTES == rc || TPM_RC_ECC_POINT == rc ||
+ TPM_RC_HASH == rc || TPM_RC_KEY == rc || TPM_RC_SCHEME == rc ||
+ TPM_RC_SIZE == rc)
+ sts = kEpidBadArgErr;
+ else
+ sts = kEpidErr;
+ } else {
+ if (TPM_RC_NO_RESULT == rc)
+ sts = kEpidBadArgErr;
+ else
+ sts = kEpidErr;
+ }
+ break;
+ }
+ if (out.E.size > 0) {
+ G1ElemStr e_str = {0};
+ sts = WriteTpm2EcPoint(&out.E, &e_str);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadEcPoint(G1, &e_str, sizeof(e_str), e);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ if (out.K.size > 0 && k) {
+ G1ElemStr k_str = {0};
+ sts = WriteTpm2EcPoint(&out.K, &k_str);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadEcPoint(G1, &k_str, sizeof(k_str), k);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ if (out.L.size > 0 && l) {
+ G1ElemStr l_str = {0};
+ sts = WriteTpm2EcPoint(&out.L, &l_str);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadEcPoint(G1, &l_str, sizeof(l_str), l);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ *counter = out.counter;
+ } while (0);
+ return sts;
+}
diff --git a/epid/member/tpm2/ibm_tss/context.c b/epid/member/tpm2/ibm_tss/context.c
new file mode 100644
index 0000000..b0d6421
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/context.c
@@ -0,0 +1,150 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM context implementation.
+/*! \file */
+
+#include "epid/member/tpm2/context.h"
+
+#include <tss2/TPM_Types.h>
+#include <tss2/tss.h>
+
+#include "epid/common/math/finitefield.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/getrandom.h"
+#include "epid/member/tpm2/ibm_tss/printtss.h"
+#include "epid/member/tpm2/ibm_tss/state.h"
+#include "epid/member/tpm_member.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+/// Deletes key from TPM
+/*!
+\param[in,out] ctx
+TPM context.
+
+\returns ::EpidStatus
+*/
+void Tpm2FlushKey(Tpm2Ctx* ctx);
+
+/// Flag that indicates that context was already created
+bool is_context_already_created = false;
+
+/// Internal Random function as a BitSupplier
+static int __STDCALL tpm2_rnd_func(unsigned int* rand_data, int num_bits,
+ void* user_data) {
+ return Tpm2GetRandom((Tpm2Ctx*)user_data, num_bits, rand_data);
+}
+
+EpidStatus Tpm2CreateContext(MemberParams const* params,
+ Epid2Params_ const* epid2_params,
+ BitSupplier* rnd_func, void** rnd_param,
+ const FpElemStr** f, Tpm2Ctx** ctx) {
+ EpidStatus sts = kEpidNoErr;
+ TPM_RC rc = TPM_RC_FAILURE;
+ Tpm2Ctx* tpm_ctx = NULL;
+ FfElement* ff_elem = NULL;
+ if (!params || !epid2_params || !rnd_func || !rnd_param || !f || !ctx) {
+ return kEpidBadArgErr;
+ }
+
+ if (is_context_already_created) {
+ return kEpidBadArgErr;
+ }
+ is_context_already_created = true;
+
+ tpm_ctx = SAFE_ALLOC(sizeof(Tpm2Ctx));
+ if (!tpm_ctx) {
+ return kEpidMemAllocErr;
+ }
+
+ do {
+ if (params->f) {
+ FiniteField* Fp = epid2_params->Fp;
+ // Validate f
+ sts = NewFfElement(Fp, &ff_elem);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, params->f, sizeof(*params->f), ff_elem);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+
+ tpm_ctx->epid2_params = epid2_params;
+ tpm_ctx->key_handle = 0;
+ tpm_ctx->hash_alg = kInvalidHashAlg;
+
+ rc = TSS_Create(&tpm_ctx->tss);
+ if (rc != TPM_RC_SUCCESS) {
+ sts = kEpidErr;
+ break;
+ }
+
+ *ctx = tpm_ctx;
+ *rnd_func = tpm2_rnd_func;
+ *rnd_param = *ctx;
+ *f = params->f;
+ sts = kEpidNoErr;
+ } while (0);
+ DeleteFfElement(&ff_elem);
+ if (kEpidNoErr != sts) {
+ Tpm2DeleteContext(&tpm_ctx);
+ *ctx = NULL;
+ }
+ return sts;
+}
+
+void Tpm2DeleteContext(Tpm2Ctx** ctx) {
+ is_context_already_created = false;
+ if (ctx && *ctx) {
+ Tpm2FlushKey(*ctx);
+ TSS_Delete((*ctx)->tss);
+ SAFE_FREE(*ctx);
+ }
+}
+
+EpidStatus Tpm2SetHashAlg(Tpm2Ctx* ctx, HashAlg hash_alg) {
+ if (!ctx) return kEpidBadArgErr;
+ if (kSha256 != hash_alg && kSha384 != hash_alg && kSha512 != hash_alg &&
+ kSha512_256 != hash_alg)
+ return kEpidHashAlgorithmNotSupported;
+ // can not change hash alg of existing TPM2 key object
+ if (ctx->key_handle) return kEpidOutOfSequenceError;
+ ctx->hash_alg = hash_alg;
+ return kEpidNoErr;
+}
+
+void Tpm2ResetContext(Tpm2Ctx** ctx) {
+ if (ctx && *ctx) {
+ Tpm2FlushKey(*ctx);
+ }
+}
+
+void Tpm2FlushKey(Tpm2Ctx* ctx) {
+ if (ctx->key_handle) {
+ TPM_RC rc;
+ FlushContext_In in;
+ in.flushHandle = ctx->key_handle;
+ rc = TSS_Execute(ctx->tss, NULL, (COMMAND_PARAMETERS*)&in, NULL,
+ TPM_CC_FlushContext, TPM_RH_NULL, NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_FlushContext", rc);
+ }
+ ctx->key_handle = 0;
+ }
+}
diff --git a/epid/member/tpm2/ibm_tss/conversion.c b/epid/member/tpm2/ibm_tss/conversion.c
new file mode 100644
index 0000000..e453107
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/conversion.c
@@ -0,0 +1,134 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM-SDK data conversion implementation.
+/*! \file */
+
+#include "epid/member/tpm2/ibm_tss/conversion.h"
+#include <string.h>
+#include <tss2/TPM_Types.h>
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/src/memory.h"
+#include "epid/common/types.h"
+
+TPMI_ALG_HASH EpidtoTpm2HashAlg(HashAlg hash_alg) {
+ switch (hash_alg) {
+ case kSha256:
+ return TPM_ALG_SHA256;
+ case kSha384:
+ return TPM_ALG_SHA384;
+ case kSha512:
+ return TPM_ALG_SHA512;
+ default:
+ return TPM_ALG_NULL;
+ }
+}
+
+HashAlg Tpm2toEpidHashAlg(TPMI_ALG_HASH tpm_hash_alg) {
+ switch (tpm_hash_alg) {
+ case TPM_ALG_SHA256:
+ return kSha256;
+ case TPM_ALG_SHA384:
+ return kSha384;
+ case TPM_ALG_SHA512:
+ return kSha512;
+ default:
+ return kInvalidHashAlg;
+ }
+}
+
+EpidStatus ReadTpm2FfElement(OctStr256 const* str,
+ TPM2B_ECC_PARAMETER* tpm_data) {
+ if (!str || !tpm_data) {
+ return kEpidBadArgErr;
+ }
+ if (0 !=
+ memcpy_S(tpm_data->b.buffer, MAX_ECC_KEY_BYTES, str, sizeof(OctStr256))) {
+ return kEpidBadArgErr;
+ }
+ tpm_data->b.size = (UINT16)sizeof(OctStr256);
+ return kEpidNoErr;
+}
+
+EpidStatus WriteTpm2FfElement(TPM2B_ECC_PARAMETER const* tpm_data,
+ OctStr256* str) {
+ if (!tpm_data || !str || tpm_data->b.size > (UINT16)sizeof(OctStr256)) {
+ return kEpidBadArgErr;
+ }
+ uint8_t* buf = (uint8_t*)str;
+ size_t real_size = sizeof(OctStr256);
+ if (tpm_data->b.size < real_size) {
+ memset(buf, 0x00, real_size - tpm_data->b.size);
+ buf += real_size - tpm_data->b.size;
+ real_size = tpm_data->b.size;
+ }
+ if (0 != memcpy_S(buf, real_size, tpm_data->b.buffer, tpm_data->b.size)) {
+ return kEpidBadArgErr;
+ }
+ return kEpidNoErr;
+}
+
+EpidStatus ReadTpm2EcPoint(G1ElemStr const* p_str, TPM2B_ECC_POINT* tpm_point) {
+ if (!p_str || !tpm_point) {
+ return kEpidBadArgErr;
+ }
+
+ // copy X
+ if (0 != memcpy_S(tpm_point->point.x.t.buffer, MAX_ECC_KEY_BYTES, &p_str->x,
+ sizeof(G1ElemStr) / 2)) {
+ return kEpidErr;
+ }
+ tpm_point->point.x.t.size = sizeof(G1ElemStr) / 2;
+
+ // copy Y
+ if (0 != memcpy_S(tpm_point->point.y.t.buffer, MAX_ECC_KEY_BYTES, &p_str->y,
+ sizeof(G1ElemStr) / 2)) {
+ return kEpidErr;
+ }
+ tpm_point->point.y.t.size = sizeof(G1ElemStr) / 2;
+
+ tpm_point->size = sizeof(tpm_point->point);
+ return kEpidNoErr;
+}
+
+EpidStatus WriteTpm2EcPoint(TPM2B_ECC_POINT const* tpm_point,
+ G1ElemStr* p_str) {
+ if (!p_str || !tpm_point) {
+ return kEpidBadArgErr;
+ }
+
+ if (tpm_point->point.x.t.size > sizeof(G1ElemStr) / 2 ||
+ tpm_point->point.y.t.size > sizeof(G1ElemStr) / 2) {
+ return kEpidBadArgErr;
+ }
+
+ memset(p_str, '\0', sizeof(G1ElemStr));
+
+ // copy X
+ if (0 !=
+ memcpy_S(&p_str->x + (sizeof(G1ElemStr) / 2 - tpm_point->point.x.t.size),
+ tpm_point->point.x.t.size, tpm_point->point.x.t.buffer,
+ tpm_point->point.x.t.size)) {
+ return kEpidErr;
+ }
+ // copy Y
+ if (0 !=
+ memcpy_S(&p_str->y + (sizeof(G1ElemStr) / 2 - tpm_point->point.y.t.size),
+ tpm_point->point.y.t.size, tpm_point->point.y.t.buffer,
+ tpm_point->point.y.t.size)) {
+ return kEpidErr;
+ }
+ return kEpidNoErr;
+}
diff --git a/epid/member/tpm2/ibm_tss/conversion.h b/epid/member/tpm2/ibm_tss/conversion.h
new file mode 100644
index 0000000..8e6ba2e
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/conversion.h
@@ -0,0 +1,117 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM-SDK data conversion interface.
+/*! \file */
+#ifndef EPID_MEMBER_TPM2_IBM_TSS_CONVERSION_H_
+#define EPID_MEMBER_TPM2_IBM_TSS_CONVERSION_H_
+
+#include <tss2/TPM_Types.h>
+#include "epid/common/errors.h"
+#include "epid/common/types.h"
+
+#ifndef TPM_ALG_SHA256
+/// TPM code of SHA 256 algorithm
+#define TPM_ALG_SHA256 (TPM_ALG_ID)(0x000B)
+#endif
+#ifndef TPM_ALG_SHA384
+/// TPM code of SHA 384 algorithm
+#define TPM_ALG_SHA384 (TPM_ALG_ID)(0x000C)
+#endif
+#ifndef TPM_ALG_SHA512
+/// TPM code of SHA 512 algorithm
+#define TPM_ALG_SHA512 (TPM_ALG_ID)(0x000D)
+#endif
+#ifndef TPM_ALG_NULL
+/// TPM code of Null algorithm
+#define TPM_ALG_NULL (TPM_ALG_ID)(0x0010)
+#endif
+
+/// \cond
+typedef struct G1ElemStr G1ElemStr;
+/// \endcond
+
+/// Maps HashAlg to TPM type
+/*!
+Maps Intel(R) EPID SDK HashAlg into TPMI_ALG_HASH.
+
+\param[in] hash_alg
+Code of the hash algorithm
+\returns TPMI_ALG_HASH
+*/
+TPMI_ALG_HASH EpidtoTpm2HashAlg(HashAlg hash_alg);
+
+/// Maps TPMI_ALG_HASH to HashAlg
+/*!
+Maps TPM hash code TPMI_ALG_HASH into HashAlg.
+
+\param[in] tpm_hash_alg
+Code of the hash algorithm in TPM
+
+\returns HashAlg
+*/
+HashAlg Tpm2toEpidHashAlg(TPMI_ALG_HASH tpm_hash_alg);
+
+/// Converts serialized FfElement into TPM type
+/*!
+
+\param[in] str
+Serialized Intel(R) EPID SDK FfElement
+\param[out] tpm_data
+tpm type data.
+\returns ::EpidStatus
+*/
+EpidStatus ReadTpm2FfElement(OctStr256 const* str,
+ TPM2B_ECC_PARAMETER* tpm_data);
+
+/// Converts TPM finite field element types into serialized FfElement
+/*!
+
+\param[in] tpm_data
+The TPM finite field data, typically TPM2B_DIGEST or
+TPM2B_ECC_PARAMETER.
+\param[out] str
+The target buffer.
+
+\returns ::EpidStatus
+*/
+EpidStatus WriteTpm2FfElement(TPM2B_ECC_PARAMETER const* tpm_data,
+ OctStr256* str);
+
+/// Converts ECPoint string to TMP ECPoint structure.
+/*!
+
+ \param[in] p_str
+ The serialized EcPoint to convert.
+ \param[out] tpm_point
+ The TPM EC point representation.
+
+ \returns ::EpidStatus
+*/
+EpidStatus ReadTpm2EcPoint(G1ElemStr const* p_str, TPM2B_ECC_POINT* tpm_point);
+
+/// Serializes TMP ECPoint to ECPoint string.
+/*!
+
+ \param[in] tpm_point
+ The TPM EC point to convert.
+ \param[in] p_str
+ The target string.
+
+\returns ::EpidStatus
+*/
+EpidStatus WriteTpm2EcPoint(TPM2B_ECC_POINT const* tpm_point, G1ElemStr* p_str);
+
+#endif // EPID_MEMBER_TPM2_IBM_TSS_CONVERSION_H_
diff --git a/epid/member/tpm2/ibm_tss/createprimary.c b/epid/member/tpm2/ibm_tss/createprimary.c
new file mode 100644
index 0000000..dc52b1f
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/createprimary.c
@@ -0,0 +1,100 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \brief TPM2_CreatePrimary command implementation.
+ * \file
+ */
+#include "epid/member/tpm2/createprimary.h"
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/ibm_tss/conversion.h"
+#include "epid/member/tpm2/ibm_tss/printtss.h"
+#include "epid/member/tpm2/ibm_tss/state.h"
+#include "tss2/TPM_Types.h"
+#include "tss2/tss.h"
+
+EpidStatus Tpm2CreatePrimary(Tpm2Ctx* ctx, G1ElemStr* p_str) {
+ if (!ctx || !ctx->epid2_params || !p_str) {
+ return kEpidBadArgErr;
+ }
+ CreatePrimary_In in = {0};
+ CreatePrimary_Out out;
+ TPM_RC rc = TPM_RC_SUCCESS;
+ TPMI_ALG_PUBLIC algPublic = TPM_ALG_ECC;
+ TPMI_ECC_CURVE curveID = TPM_ECC_BN_P256;
+ TPMI_ALG_HASH halg = TPM_ALG_NULL;
+ TPMI_ALG_HASH nalg = TPM_ALG_NULL;
+ TPMI_SH_AUTH_SESSION sessionHandle0 = TPM_RS_PW;
+ TPM2B_ECC_POINT public_area;
+ unsigned int sessionAttributes0 = 0;
+ const char* parentPasswordPtr = NULL;
+
+ in.primaryHandle = TPM_RH_ENDORSEMENT;
+ halg = EpidtoTpm2HashAlg(ctx->hash_alg);
+ if (halg == TPM_ALG_NULL) {
+ return kEpidHashAlgorithmNotSupported;
+ }
+ nalg = halg;
+ /* Table 185 - TPM2B_PUBLIC inPublic */
+ /* Table 184 - TPMT_PUBLIC in.inPublic.publicArea */
+ in.inPublic.publicArea.type = algPublic;
+ in.inPublic.publicArea.nameAlg = nalg;
+
+ /* Table 32 - TPMA_OBJECT objectAttributes */
+ in.inPublic.publicArea.objectAttributes.val |= TPMA_OBJECT_NODA;
+ in.inPublic.publicArea.objectAttributes.val |= TPMA_OBJECT_FIXEDTPM;
+ in.inPublic.publicArea.objectAttributes.val |= TPMA_OBJECT_FIXEDPARENT;
+ in.inPublic.publicArea.objectAttributes.val |=
+ TPMA_OBJECT_SENSITIVEDATAORIGIN;
+ in.inPublic.publicArea.parameters.eccDetail.symmetric.algorithm =
+ TPM_ALG_NULL;
+ in.inPublic.publicArea.parameters.eccDetail.scheme.scheme = TPM_ALG_ECDAA;
+ in.inPublic.publicArea.parameters.eccDetail.scheme.details.ecdaa.hashAlg =
+ halg;
+ in.inPublic.publicArea.parameters.eccDetail.scheme.details.ecdaa.count = 1;
+ in.inPublic.publicArea.parameters.eccDetail.curveID = curveID;
+ in.inPublic.publicArea.parameters.eccDetail.kdf.scheme = TPM_ALG_NULL;
+ in.inSensitive.sensitive.userAuth.t.size = 0;
+ in.inSensitive.sensitive.data.t.size = 0;
+ in.inPublic.publicArea.objectAttributes.val |=
+ TPMA_OBJECT_SENSITIVEDATAORIGIN;
+ in.inPublic.publicArea.objectAttributes.val |= TPMA_OBJECT_USERWITHAUTH;
+ in.inPublic.publicArea.objectAttributes.val &= ~TPMA_OBJECT_ADMINWITHPOLICY;
+ in.inPublic.publicArea.objectAttributes.val |= TPMA_OBJECT_SIGN;
+ in.inPublic.publicArea.objectAttributes.val &= ~TPMA_OBJECT_DECRYPT;
+ in.inPublic.publicArea.objectAttributes.val &= ~TPMA_OBJECT_RESTRICTED;
+ in.inPublic.publicArea.unique.ecc.y.t.size = 0;
+ in.inPublic.publicArea.unique.ecc.x.t.size = 0;
+ in.inPublic.publicArea.authPolicy.t.size = 0;
+ in.inPublic.publicArea.unique.rsa.t.size = 0;
+ in.outsideInfo.t.size = 0;
+ in.creationPCR.count = 0;
+ rc = TSS_Execute(ctx->tss, (RESPONSE_PARAMETERS*)&out,
+ (COMMAND_PARAMETERS*)&in, NULL, TPM_CC_CreatePrimary,
+ sessionHandle0, parentPasswordPtr, sessionAttributes0,
+ TPM_RH_NULL, NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_CreatePrimary", rc);
+ if (TPM_RC_ATTRIBUTES == rc || TPM_RC_KDF == rc || TPM_RC_SYMMETRIC == rc ||
+ TPM_RC_TYPE == rc || TPM_RC_SCHEME == rc || TPM_RC_SIZE == rc ||
+ TPM_RC_KEY == rc)
+ return kEpidBadArgErr;
+ return kEpidErr;
+ }
+ ctx->key_handle = out.objectHandle;
+ public_area.point = out.outPublic.publicArea.unique.ecc;
+ return WriteTpm2EcPoint(&public_area, p_str);
+}
diff --git a/epid/member/tpm2/ibm_tss/getrandom.c b/epid/member/tpm2/ibm_tss/getrandom.c
new file mode 100644
index 0000000..1487750
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/getrandom.c
@@ -0,0 +1,78 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief TPM2_GetRandom command implementation.
+ */
+#include <limits.h>
+
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/getrandom.h"
+#include "epid/member/tpm2/ibm_tss/printtss.h"
+#include "epid/member/tpm2/ibm_tss/state.h"
+
+#include "tss2/TPM_Types.h"
+#include "tss2/tss.h"
+
+EpidStatus Tpm2GetRandom(Tpm2Ctx* ctx, int const num_bits, void* random_data) {
+ EpidStatus sts = kEpidNoErr;
+ TPM_RC rc = TPM_RC_FAILURE;
+ int num_bytes = (num_bits + CHAR_BIT - 1) / CHAR_BIT;
+ BYTE* buf = (BYTE*)random_data;
+
+ if (!ctx || !random_data) {
+ return kEpidBadArgErr;
+ }
+
+ if (num_bits <= 0) {
+ return kEpidBadArgErr;
+ }
+
+ do {
+ GetRandom_In in;
+ GetRandom_Out out;
+ size_t max_digest_size = sizeof(((TPM2B_DIGEST*)0)->t.buffer);
+ UINT16 bytes_to_reqest = ((size_t)num_bytes > max_digest_size)
+ ? (UINT16)max_digest_size
+ : (UINT16)num_bytes;
+ in.bytesRequested = bytes_to_reqest;
+
+ rc = TSS_Execute(ctx->tss, (RESPONSE_PARAMETERS*)&out,
+ (COMMAND_PARAMETERS*)&in, NULL, TPM_CC_GetRandom,
+ TPM_RH_NULL, NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_GetRandom", rc);
+ sts = kEpidErr;
+ break;
+ }
+ if (!out.randomBytes.t.size || out.randomBytes.t.size > bytes_to_reqest) {
+ sts = kEpidErr;
+ break;
+ }
+
+ if (0 != memcpy_S(buf, (size_t)num_bytes, out.randomBytes.t.buffer,
+ out.randomBytes.t.size)) {
+ sts = kEpidErr;
+ break;
+ }
+
+ num_bytes -= out.randomBytes.t.size;
+ buf += out.randomBytes.t.size;
+ } while (num_bytes > 0);
+
+ return sts;
+}
diff --git a/epid/member/tpm2/ibm_tss/load_external.c b/epid/member/tpm2/ibm_tss/load_external.c
new file mode 100644
index 0000000..dd0c67a
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/load_external.c
@@ -0,0 +1,137 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief TPM2_LoadExternal command implementation.
+ */
+
+#include "epid/member/tpm2/load_external.h"
+
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/ibm_tss/conversion.h"
+#include "epid/member/tpm2/ibm_tss/printtss.h"
+#include "epid/member/tpm2/ibm_tss/state.h"
+#include "tss2/TPM_Types.h"
+#include "tss2/tss.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+EpidStatus Tpm2LoadExternal(Tpm2Ctx* ctx, FpElemStr const* f_str) {
+ EpidStatus sts = kEpidErr;
+ TPM_RC rc = TPM_RC_SUCCESS;
+ EcPoint* pub = NULL;
+ FfElement* f = NULL;
+ TPMI_ALG_HASH tpm_hash_alg = TPM_ALG_NULL;
+
+ if (!ctx || !ctx->epid2_params || !f_str) {
+ return kEpidBadArgErr;
+ }
+
+ do {
+ LoadExternal_In in = {0};
+ LoadExternal_Out out;
+ G1ElemStr pub_str = {0};
+ TPMS_ECC_PARMS* ecc_details = &in.inPublic.publicArea.parameters.eccDetail;
+ EcGroup* G1 = ctx->epid2_params->G1;
+ EcPoint* g1 = ctx->epid2_params->g1;
+
+ sts = NewFfElement(ctx->epid2_params->Fp, &f);
+ BREAK_ON_EPID_ERROR(sts);
+ // verify that f is valid
+ sts = ReadFfElement(ctx->epid2_params->Fp, f_str, sizeof(*f_str), f);
+ BREAK_ON_EPID_ERROR(sts);
+ if (ctx->key_handle) {
+ FlushContext_In in_fc;
+ in_fc.flushHandle = ctx->key_handle;
+ TSS_Execute(ctx->tss, NULL, (COMMAND_PARAMETERS*)&in_fc, NULL,
+ TPM_CC_FlushContext, TPM_RH_NULL, NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_FlushContext", rc);
+ }
+ ctx->key_handle = 0;
+ }
+
+ sts = NewEcPoint(G1, &pub);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = EcExp(G1, g1, (BigNumStr const*)f_str, pub);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = WriteEcPoint(G1, pub, &pub_str, sizeof(pub_str));
+ BREAK_ON_EPID_ERROR(sts);
+
+ tpm_hash_alg = EpidtoTpm2HashAlg(ctx->hash_alg);
+ if (tpm_hash_alg == TPM_ALG_NULL) {
+ sts = kEpidHashAlgorithmNotSupported;
+ break;
+ }
+
+ in.hierarchy = TPM_RH_NULL;
+ in.inPublic.size = sizeof(TPM2B_PUBLIC);
+ in.inPublic.publicArea.type = TPM_ALG_ECC;
+ in.inPublic.publicArea.nameAlg = tpm_hash_alg;
+ in.inPublic.publicArea.objectAttributes.val =
+ TPMA_OBJECT_NODA | TPMA_OBJECT_USERWITHAUTH | TPMA_OBJECT_SIGN;
+ in.inPublic.publicArea.authPolicy.t.size = 0;
+
+ ecc_details->symmetric.algorithm = TPM_ALG_NULL;
+ ecc_details->scheme.scheme = TPM_ALG_ECDAA;
+ ecc_details->scheme.details.ecdaa.hashAlg = tpm_hash_alg;
+ ecc_details->scheme.details.ecdaa.count = 0;
+ ecc_details->curveID = TPM_ECC_BN_P256;
+ ecc_details->kdf.scheme = TPM_ALG_NULL;
+
+ sts = ReadTpm2FfElement(&pub_str.x.data,
+ &in.inPublic.publicArea.unique.ecc.x);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadTpm2FfElement(&pub_str.y.data,
+ &in.inPublic.publicArea.unique.ecc.y);
+ BREAK_ON_EPID_ERROR(sts);
+
+ in.inPrivate.t.size = sizeof(in.inPrivate.t.sensitiveArea);
+ in.inPrivate.t.sensitiveArea.sensitiveType = TPM_ALG_ECC;
+ sts = ReadTpm2FfElement(&f_str->data,
+ &in.inPrivate.t.sensitiveArea.sensitive.ecc);
+ BREAK_ON_EPID_ERROR(sts);
+
+ rc = TSS_Execute(ctx->tss, (RESPONSE_PARAMETERS*)&out,
+ (COMMAND_PARAMETERS*)&in, NULL, TPM_CC_LoadExternal,
+ TPM_RH_NULL, NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_LoadExternal", rc);
+ if (TPM_RC_BINDING == rc || TPM_RC_ECC_POINT == rc ||
+ TPM_RC_KEY_SIZE == rc)
+ sts = kEpidBadArgErr;
+ else
+ sts = kEpidErr;
+ break;
+ }
+
+ ctx->key_handle = out.objectHandle;
+ } while (0);
+
+ DeleteEcPoint(&pub);
+ DeleteFfElement(&f);
+
+ return sts;
+}
diff --git a/epid/member/tpm2/ibm_tss/nv.c b/epid/member/tpm2/ibm_tss/nv.c
new file mode 100644
index 0000000..15a9254
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/nv.c
@@ -0,0 +1,166 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief TSS NV API implementation.
+ */
+
+#include "epid/member/tpm2/nv.h"
+#include <tss2/tss.h>
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/ibm_tss/printtss.h"
+#include "epid/member/tpm2/ibm_tss/state.h"
+
+EpidStatus Tpm2NvUndefineSpace(Tpm2Ctx* ctx, uint32_t nv_index) {
+ TPM_RC rc = 0;
+ NV_UndefineSpace_In in;
+ TPMI_SH_AUTH_SESSION sessionHandle0 = TPM_RS_PW;
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+ if ((nv_index >> 24) != TPM_HT_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+
+ in.authHandle = TPM_RH_OWNER;
+ // the NV Index to remove from NV space
+ in.nvIndex = nv_index;
+ rc = TSS_Execute(ctx->tss, NULL, (COMMAND_PARAMETERS*)&in, NULL,
+ TPM_CC_NV_UndefineSpace, sessionHandle0, NULL, 0,
+ TPM_RH_NULL, NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_NV_UndefineSpace", rc);
+ return kEpidBadArgErr;
+ }
+ return kEpidNoErr;
+}
+
+EpidStatus Tpm2NvDefineSpace(Tpm2Ctx* ctx, uint32_t nv_index, size_t size) {
+ TPM_RC rc = 0;
+ NV_DefineSpace_In in = {0};
+ TPMI_SH_AUTH_SESSION sessionHandle0 = TPM_RS_PW;
+ if (!ctx || size == 0 || size > MAX_NV_BUFFER_SIZE) {
+ return kEpidBadArgErr;
+ }
+ if ((nv_index >> 24) != TPM_HT_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+
+ in.authHandle = TPM_RH_OWNER;
+ // the handle of the data area
+ in.publicInfo.nvPublic.nvIndex = nv_index;
+ // hash algorithm used to compute the name of the Index and used for the
+ // authPolicy
+ in.publicInfo.nvPublic.nameAlg = TPM_ALG_SHA256;
+ in.publicInfo.nvPublic.attributes.val = TPMA_NVA_NO_DA | TPMA_NVA_AUTHWRITE |
+ TPMA_NVA_AUTHREAD | TPMA_NVA_ORDINARY;
+ // the size of the data area
+ in.publicInfo.nvPublic.dataSize = (uint16_t)size;
+ rc = TSS_Execute(ctx->tss, NULL, (COMMAND_PARAMETERS*)&in, NULL,
+ TPM_CC_NV_DefineSpace, sessionHandle0, NULL, 0, TPM_RH_NULL,
+ NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_NV_DefineSpace", rc);
+ if (rc == TPM_RC_NV_DEFINED) {
+ return kEpidDuplicateErr;
+ }
+ return kEpidBadArgErr;
+ }
+ return kEpidNoErr;
+}
+
+EpidStatus Tpm2NvRead(Tpm2Ctx* ctx, uint32_t nv_index, size_t size,
+ uint16_t offset, void* data) {
+ TPM_RC rc = 0;
+ NV_Read_In in;
+ NV_Read_Out out;
+ TPMI_SH_AUTH_SESSION sessionHandle0 = TPM_RS_PW;
+ int done = FALSE;
+ // bytes read so far
+ uint16_t bytes_read_so_far = 0;
+
+ if (!ctx || !data || size == 0 || size > MAX_NV_BUFFER_SIZE) {
+ return kEpidBadArgErr;
+ }
+ if ((nv_index >> 24) != TPM_HT_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+
+ if ((nv_index >> 24) != TPM_HT_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+ // Authorization handle
+ in.authHandle = nv_index;
+ in.nvIndex = nv_index;
+ in.offset = offset;
+ while ((rc == TPM_RC_SUCCESS) && !done) {
+ in.offset = offset + bytes_read_so_far;
+ if ((uint32_t)(size - bytes_read_so_far) < MAX_NV_BUFFER_SIZE) {
+ // last chunk
+ in.size = (uint16_t)size - bytes_read_so_far;
+ } else {
+ // next chunk
+ in.size = MAX_NV_BUFFER_SIZE;
+ }
+ rc = TSS_Execute(ctx->tss, (RESPONSE_PARAMETERS*)&out,
+ (COMMAND_PARAMETERS*)&in, NULL, TPM_CC_NV_Read,
+ sessionHandle0, NULL, 0, TPM_RH_NULL, NULL, 0);
+ if (rc == TPM_RC_SUCCESS) {
+ // copy the results to the read buffer
+ memcpy_S((uint8_t*)data + bytes_read_so_far, size - bytes_read_so_far,
+ out.data.b.buffer, out.data.b.size);
+ bytes_read_so_far += out.data.b.size;
+ if (bytes_read_so_far == size) {
+ done = TRUE;
+ }
+ } else {
+ print_tpm2_response_code("TPM2_NV_Read", rc);
+ }
+ }
+ if (rc != TPM_RC_SUCCESS) {
+ return kEpidBadArgErr;
+ }
+ return kEpidNoErr;
+}
+
+EpidStatus Tpm2NvWrite(Tpm2Ctx* ctx, uint32_t nv_index, size_t size,
+ uint16_t offset, void const* data) {
+ TPM_RC rc = TPM_RC_SUCCESS;
+ NV_Write_In in = {0};
+ TPMI_SH_AUTH_SESSION sessionHandle0 = TPM_RS_PW;
+ if (!ctx || !data || size == 0 || size > MAX_NV_BUFFER_SIZE) {
+ return kEpidBadArgErr;
+ }
+ if ((nv_index >> 24) != TPM_HT_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+
+ in.authHandle = nv_index;
+ in.data.b.size = (uint16_t)size;
+ memcpy(in.data.b.buffer, data, size);
+ in.nvIndex = nv_index;
+ // beginning offset
+ in.offset = offset;
+ rc = TSS_Execute(ctx->tss, NULL, (COMMAND_PARAMETERS*)&in, NULL,
+ TPM_CC_NV_Write, sessionHandle0, NULL, 0, TPM_RH_NULL, NULL,
+ 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_NV_Write", rc);
+ return kEpidBadArgErr;
+ }
+ return kEpidNoErr;
+}
diff --git a/epid/member/tpm2/ibm_tss/printtss.c b/epid/member/tpm2/ibm_tss/printtss.c
new file mode 100644
index 0000000..90ae9af
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/printtss.c
@@ -0,0 +1,37 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM context implementation.
+/*! \file */
+#ifndef EPID_ENABLE_DEBUG_PRINT
+#define EPID_ENABLE_DEBUG_PRINT
+#endif
+
+#include "epid/member/tpm2/ibm_tss/printtss.h"
+#include <tss2/TPM_Types.h>
+#include <tss2/tss.h>
+#include <tss2/tssresponsecode.h>
+
+void print_tpm2_response_code(char const* operation, TPM_RC rc) {
+ const char* msg;
+ const char* submsg;
+ const char* num;
+ TSS_ResponseCode_toString(&msg, &submsg, &num, rc);
+ printf("%s: %s%s%s\n", operation, msg, submsg, num);
+}
+
+#ifdef EPID_ENABLE_DEBUG_PRINT
+#undef EPID_ENABLE_DEBUG_PRINT
+#endif
diff --git a/epid/member/tpm2/ibm_tss/printtss.h b/epid/member/tpm2/ibm_tss/printtss.h
new file mode 100644
index 0000000..83269a2
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/printtss.h
@@ -0,0 +1,36 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM log error prints
+/*! \file */
+
+#ifndef EPID_MEMBER_TPM2_IBM_TSS_PRINTTSS_H_
+#define EPID_MEMBER_TPM2_IBM_TSS_PRINTTSS_H_
+
+#if !defined(EPID_ENABLE_DEBUG_PRINT)
+/// Do not print tpm2 response error if EPID_ENABLE_DEBUG_PRINT is undefined
+#define print_tpm2_response_code(...)
+#else
+#include <tss2/TPM_Types.h>
+#include <tss2/tss.h>
+/// Print TPM 2.0 response code as human readable message
+/*!
+ * \param[in] operation The operation that returned the code
+ * \param[in] rc The response code
+ */
+void print_tpm2_response_code(char const* operation, TPM_RC rc);
+#endif
+
+#endif // EPID_MEMBER_TPM2_IBM_TSS_PRINTTSS_H_
diff --git a/epid/member/tpm2/ibm_tss/sign.c b/epid/member/tpm2/ibm_tss/sign.c
new file mode 100644
index 0000000..fb6eb39
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/sign.c
@@ -0,0 +1,155 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2Sign implementation.
+/*! \file */
+
+#include "epid/member/tpm2/sign.h"
+#include <stddef.h>
+#include <string.h>
+#include <tss2/tss.h>
+#include "epid/common/math/finitefield.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/hashsize.h"
+#include "epid/common/src/memory.h"
+#include "epid/common/types.h"
+#include "epid/member/tpm2/getrandom.h"
+#include "epid/member/tpm2/ibm_tss/conversion.h"
+#include "epid/member/tpm2/ibm_tss/printtss.h"
+#include "epid/member/tpm2/ibm_tss/state.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+/// Bit 7 binary mask
+#define BIT7 0x080
+/// Binary 00011111
+#define BITS0500 0x3f
+
+EpidStatus Tpm2Sign(Tpm2Ctx* ctx, void const* digest, size_t digest_len,
+ uint16_t counter, FfElement* k, FfElement* s) {
+ EpidStatus sts = kEpidErr;
+ TPM_RC rc = TPM_RC_SUCCESS;
+
+ if (!ctx || !ctx->epid2_params || !digest || !s) {
+ return kEpidBadArgErr;
+ }
+ if (0 == digest_len || EpidGetHashSize(ctx->hash_alg) != digest_len) {
+ return kEpidBadArgErr;
+ }
+ if (ctx->key_handle == 0) {
+ return kEpidBadArgErr;
+ }
+
+ do {
+ TPMI_SH_AUTH_SESSION sessionHandle0 = TPM_RS_PW;
+ unsigned int sessionAttributes0 = 0;
+ Sign_In in = {0};
+ Sign_Out out;
+ FiniteField* Fp = ctx->epid2_params->Fp;
+ FpElemStr k_str;
+ FpElemStr s_str;
+ in.keyHandle = ctx->key_handle;
+ if (0 != memcpy_S(in.digest.t.buffer, sizeof(in.digest.t.buffer), digest,
+ digest_len)) {
+ sts = kEpidErr;
+ break;
+ }
+ in.digest.t.size = (uint16_t)digest_len;
+ in.inScheme.scheme = TPM_ALG_ECDAA;
+ in.inScheme.details.ecdaa.hashAlg = EpidtoTpm2HashAlg(ctx->hash_alg);
+ in.inScheme.details.ecdaa.count = counter;
+ /* proof that digest was created by the TPM (NULL ticket) */
+ /* Table 91 - Definition of TPMT_TK_HASHCHECK Structure */
+ in.validation.tag = TPM_ST_HASHCHECK;
+ in.validation.hierarchy = TPM_RH_NULL;
+ in.validation.digest.t.size = 0;
+ rc =
+ TSS_Execute(ctx->tss, (RESPONSE_PARAMETERS*)&out,
+ (COMMAND_PARAMETERS*)&in, NULL, TPM_CC_Sign, sessionHandle0,
+ NULL, sessionAttributes0, TPM_RH_NULL, NULL, 0);
+ if (rc != TPM_RC_SUCCESS) {
+ print_tpm2_response_code("TPM2_Sign", rc);
+ // workaround based on Table 2:15 to filter response code format defining
+ // handle, session, or parameter number modifier if bit 7 is 1 error is
+ // RC_FMT1
+ if ((rc & BIT7) != 0) {
+ rc = rc & (BITS0500 | RC_FMT1);
+ if (TPM_RC_VALUE == rc) {
+ sts = kEpidBadArgErr;
+ }
+ } else {
+ sts = kEpidErr;
+ }
+ break;
+ }
+
+ if (k) {
+ sts = WriteTpm2FfElement(&out.signature.signature.ecdaa.signatureR,
+ (OctStr256*)&k_str);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, &k_str, sizeof(k_str), k);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+
+ sts = WriteTpm2FfElement(&out.signature.signature.ecdaa.signatureS,
+ (OctStr256*)&s_str);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, &s_str, sizeof(s_str), s);
+ BREAK_ON_EPID_ERROR(sts);
+ } while (0);
+ return sts;
+}
+
+EpidStatus Tpm2ReleaseCounter(Tpm2Ctx* ctx, uint16_t counter) {
+ EpidStatus sts = kEpidErr;
+
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+
+ do {
+ TPM_RC rc = TPM_RC_SUCCESS;
+ TPMI_SH_AUTH_SESSION sessionHandle0 = TPM_RS_PW;
+ unsigned int sessionAttributes0 = 0;
+ Sign_In in = {0};
+ Sign_Out out;
+ in.keyHandle = ctx->key_handle;
+
+ in.digest.t.size = (uint16_t)EpidGetHashSize(ctx->hash_alg);
+ memset(in.digest.t.buffer, 0x1, (size_t)in.digest.t.size);
+ in.inScheme.scheme = TPM_ALG_ECDAA;
+ in.inScheme.details.ecdaa.hashAlg = EpidtoTpm2HashAlg(ctx->hash_alg);
+ in.inScheme.details.ecdaa.count = counter;
+ in.validation.tag = TPM_ST_HASHCHECK;
+ in.validation.hierarchy = TPM_RH_NULL;
+ in.validation.digest.t.size = 0;
+ rc =
+ TSS_Execute(ctx->tss, (RESPONSE_PARAMETERS*)&out,
+ (COMMAND_PARAMETERS*)&in, NULL, TPM_CC_Sign, sessionHandle0,
+ NULL, sessionAttributes0, TPM_RH_NULL, NULL, 0);
+ if (rc != TPM_RC_SUCCESS && (rc & (BITS0500 | RC_FMT1)) != TPM_RC_VALUE) {
+ print_tpm2_response_code("Tpm2ReleaseCounter: TPM2_Sign", rc);
+ sts = kEpidErr;
+ break;
+ }
+ sts = kEpidNoErr;
+ } while (0);
+
+ return sts;
+}
diff --git a/epid/member/tpm2/ibm_tss/state.h b/epid/member/tpm2/ibm_tss/state.h
new file mode 100644
index 0000000..5f570bb
--- /dev/null
+++ b/epid/member/tpm2/ibm_tss/state.h
@@ -0,0 +1,39 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM internal state.
+/*! \file */
+
+#ifndef EPID_MEMBER_TPM2_IBM_TSS_STATE_H_
+#define EPID_MEMBER_TPM2_IBM_TSS_STATE_H_
+
+#include "epid/common/types.h"
+#include "tss2/TPM_Types.h"
+
+/// \cond
+typedef struct Epid2Params_ Epid2Params_;
+typedef struct FfElement FfElement;
+typedef struct TSS_CONTEXT TSS_CONTEXT;
+/// \endcond
+
+/// TPM TSS context definition
+typedef struct Tpm2Ctx {
+ TSS_CONTEXT* tss; ///< TSS context
+ Epid2Params_ const* epid2_params; ///< Intel(R) EPID 2.0 params
+ TPM_HANDLE key_handle; ///< Handle to f value of private key
+ HashAlg hash_alg; ///< Hash algorithm to use
+} Tpm2Ctx;
+
+#endif // EPID_MEMBER_TPM2_IBM_TSS_STATE_H_
diff --git a/epid/member/tpm2/load_external.h b/epid/member/tpm2/load_external.h
new file mode 100644
index 0000000..64e8199
--- /dev/null
+++ b/epid/member/tpm2/load_external.h
@@ -0,0 +1,54 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// SDK TPM API.
+/*! \file */
+
+#ifndef EPID_MEMBER_TPM2_LOAD_EXTERNAL_H_
+#define EPID_MEMBER_TPM2_LOAD_EXTERNAL_H_
+
+#include "epid/common/errors.h"
+#include "epid/common/types.h" // HashAlg
+
+/// \cond
+typedef struct Tpm2Ctx Tpm2Ctx;
+typedef struct FpElemStr FpElemStr;
+/// \endcond
+
+/*!
+ \addtogroup Tpm2Module tpm2
+ \ingroup EpidMemberModule
+ @{
+*/
+
+/// Invokes TPM2_LoadExternal command
+/*!
+ This command is used to load an object that is not a Protected Object into the
+ TPM. The command allows loading of a public area or both a public and sensitive
+ area.
+
+ \param[in,out] ctx
+ TPM context.
+
+ \param[in] f_str
+ The f value of the member private key.
+
+ \returns ::EpidStatus
+*/
+EpidStatus Tpm2LoadExternal(Tpm2Ctx* ctx, FpElemStr const* f_str);
+
+/*! @} */
+
+#endif // EPID_MEMBER_TPM2_LOAD_EXTERNAL_H_
diff --git a/epid/member/tpm2/nv.h b/epid/member/tpm2/nv.h
new file mode 100644
index 0000000..4b70fdb
--- /dev/null
+++ b/epid/member/tpm2/nv.h
@@ -0,0 +1,110 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// SDK TPM non volatile memory API.
+/*! \file */
+
+#ifndef EPID_MEMBER_TPM2_NV_H_
+#define EPID_MEMBER_TPM2_NV_H_
+
+#include <stddef.h>
+
+#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
+
+/// \cond
+typedef struct Tpm2Ctx Tpm2Ctx;
+/// \endcond
+
+/*!
+ \addtogroup Tpm2Module tpm2
+ \ingroup EpidMemberModule
+ @{
+*/
+
+/// Performs TPM2_NV_DefineSpace TPM command.
+/*!
+ \param[in] ctx
+ The TPM context.
+ \param[in] nv_index
+ Handle of the data area.
+ \param[in] size
+ Size of the data area.
+
+ \returns ::EpidStatus
+
+ \see Tpm2NvRead
+ \see Tpm2NvWrite
+*/
+EpidStatus Tpm2NvDefineSpace(Tpm2Ctx* ctx, uint32_t nv_index, size_t size);
+
+/// Performs TPM2_NV_UndefineSpace TPM command.
+/*!
+ \param[in] ctx
+ The TPM context.
+ \param[in] nv_index
+ Handle of the data area to undefine.
+
+ \returns ::EpidStatus
+
+ \see Tpm2NvDefineSpace
+*/
+EpidStatus Tpm2NvUndefineSpace(Tpm2Ctx* ctx, uint32_t nv_index);
+
+/// Performs TPM2_NV_Write TPM command.
+/*!
+ An area in NV memory must be defined prior writing.
+
+ \param[in] ctx
+ The TPM context.
+ \param[in] nv_index
+ NV Index to be write.
+ \param[in] size
+ Number of bytes to write.
+ \param[in] offset
+ Offset into the area.
+ \param[in] data
+ Data to write.
+
+ \returns ::EpidStatus
+
+ \see Tpm2NvDefineSpace
+*/
+EpidStatus Tpm2NvWrite(Tpm2Ctx* ctx, uint32_t nv_index, size_t size,
+ uint16_t offset, void const* data);
+
+/// Performs TPM2_NV_Read TPM command.
+/*!
+ \param[in] ctx
+ The TPM context.
+ \param[in] nv_index
+ NV Index to be read.
+ \param[in] size
+ Number of bytes to read.
+ \param[in] offset
+ Offset into the area.
+ \param[out] data
+ Data read.
+
+ \returns ::EpidStatus
+
+ \see Tpm2NvWrite
+*/
+EpidStatus Tpm2NvRead(Tpm2Ctx* ctx, uint32_t nv_index, size_t size,
+ uint16_t offset, void* data);
+
+/*! @} */
+
+#endif // EPID_MEMBER_TPM2_NV_H_
diff --git a/epid/member/tpm2/sign.h b/epid/member/tpm2/sign.h
new file mode 100644
index 0000000..ddbc2ce
--- /dev/null
+++ b/epid/member/tpm2/sign.h
@@ -0,0 +1,85 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// SDK TPM Sign API.
+/*! \file */
+
+#ifndef EPID_MEMBER_TPM2_SIGN_H_
+#define EPID_MEMBER_TPM2_SIGN_H_
+
+#include <stddef.h>
+
+#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
+
+/// \cond
+typedef struct Tpm2Ctx Tpm2Ctx;
+typedef struct FfElement FfElement;
+/// \endcond
+
+/*!
+\addtogroup Tpm2Module tpm2
+\ingroup EpidMemberModule
+@{
+*/
+
+/// Performs TPM2_Sign TPM command.
+/*!
+Calculate a pair (k, s) an ECDAA signature.
+
+Private key f must exist in the TPM context.
+
+\param[in] ctx
+The TPM context.
+\param[in] digest
+Digest to be signed.
+\param[in] digest_len
+The size of digest in bytes.
+\param[in] counter
+A value associated with the random r generated during TPM2_Commit.
+\param[out] k
+The ECDAA signature k value. Nonce produced by the TPM during signing.
+\param[out] s
+The ECDAA signature s value.
+
+\returns ::EpidStatus
+
+\see Tpm2CreateContext
+\see Tpm2Commit
+*/
+EpidStatus Tpm2Sign(Tpm2Ctx* ctx, void const* digest, size_t digest_len,
+ uint16_t counter, FfElement* k, FfElement* s);
+
+/// Erases random r value assosiated with counter.
+/*!
+
+\param[in] ctx
+The TPM context.
+\param[in] counter
+To be released value associated with the random r generated during TPM2_Commit.
+
+\note
+This function should be used if Tpm2Sign wasn't called after Tpm2Commit
+which created counter.
+
+\returns ::EpidStatus
+
+\see Tpm2Commit
+*/
+EpidStatus Tpm2ReleaseCounter(Tpm2Ctx* ctx, uint16_t counter);
+
+/*! @} */
+
+#endif // EPID_MEMBER_TPM2_SIGN_H_
diff --git a/epid/member/tpm2/src/commit.c b/epid/member/tpm2/src/commit.c
new file mode 100644
index 0000000..5715082
--- /dev/null
+++ b/epid/member/tpm2/src/commit.c
@@ -0,0 +1,188 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2Commit implementation.
+/*! \file */
+
+#include "epid/member/tpm2/commit.h"
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/finitefield.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/src/state.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+static EpidStatus InsertR(Tpm2Ctx* ctx, FfElement* r, uint16_t* counter) {
+ uint16_t index = 0;
+ if (!ctx || !r || !counter) {
+ return kEpidBadArgErr;
+ }
+ for (index = 0; index < MAX_COMMIT_COUNT; ++index) {
+ if (!ctx->commit_data[index]) {
+ ctx->commit_data[index] = r;
+ break;
+ }
+ }
+ if (index == MAX_COMMIT_COUNT) {
+ return kEpidMemAllocErr;
+ }
+ *counter = index + 1; // counter == 0 should be invalid
+ return kEpidNoErr;
+}
+
+static void DeleteR(Tpm2Ctx* ctx, uint16_t* counter) {
+ if (counter && *counter != 0 && *counter <= MAX_COMMIT_COUNT) {
+ DeleteFfElement(&ctx->commit_data[*counter - 1]);
+ *counter = 0;
+ }
+}
+
+EpidStatus Tpm2Commit(Tpm2Ctx* ctx, EcPoint const* p1, void const* s2,
+ size_t s2_len, FfElement const* y2, EcPoint* k,
+ EcPoint* l, EcPoint* e, uint16_t* counter) {
+ EpidStatus sts = kEpidErr;
+ FiniteField* Fp = NULL;
+ FiniteField* Fq = NULL;
+ EcGroup* G1 = NULL;
+ FfElement* x2 = NULL;
+ FfElement* r = NULL;
+ EcPoint* point = NULL;
+ EcPoint* infinity = NULL;
+ uint16_t ctr = 0;
+
+ if (!ctx || !ctx->epid2_params || !ctx->f) {
+ return kEpidBadArgErr;
+ }
+
+ if (s2 && s2_len <= 0) {
+ return kEpidBadArgErr;
+ }
+
+ if ((!s2 && y2) || (s2 && !y2)) {
+ return kEpidBadArgErr;
+ }
+
+ if (s2 && (!k || !l)) {
+ return kEpidBadArgErr;
+ }
+
+ if (!e || !counter) {
+ return kEpidBadArgErr;
+ }
+
+ do {
+ G1ElemStr point_str = {0};
+ BigNumStr r_str = {0};
+ const BigNumStr kOne = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+ bool is_equal = false;
+ Fp = ctx->epid2_params->Fp;
+ Fq = ctx->epid2_params->Fq;
+ G1 = ctx->epid2_params->G1;
+
+ sts = NewEcPoint(G1, &infinity);
+ BREAK_ON_EPID_ERROR(sts);
+ // step b
+ if (s2) {
+ // step c: compute x2 := HnameAlg(s2) mod p
+ sts = NewFfElement(Fq, &x2);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfHash(Fq, s2, s2_len, ctx->hash_alg, x2);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // step d: if (x2, y2) is not a point on the curve of signHandle, return
+ // TPM_RC_ECC_POINT
+ sts = NewEcPoint(G1, &point);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fq, x2, &point_str.x, sizeof(point_str.x));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fq, y2, &point_str.y, sizeof(point_str.y));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadEcPoint(G1, &point_str, sizeof(point_str), point);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+
+ // step e: if p1 is not an Empty Point and p1 is not a point on the curve of
+ // signHandle, return TPM_RC_ECC_POINT
+ // This step is guranteed by ReadEcPoint SDK function
+
+ // step g: generate or derive r (see C.2.2)
+ // step h: set r = r mod n
+ sts = NewFfElement(Fp, &r);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfGetRandom(Fp, &kOne, ctx->rnd_func, ctx->rnd_param, r);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = InsertR(ctx, r, &ctr);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, r, &r_str, sizeof(r_str));
+ BREAK_ON_EPID_ERROR(sts);
+ // step i: if s2 is not an Empty Buffer, set K = [ds](x2, y2) and L =
+ // [r](x2, y2)
+ if (s2) {
+ BigNumStr f_str = {0};
+ do {
+ sts = WriteFfElement(Fp, ctx->f, &f_str, sizeof(f_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = EcExp(G1, point, &f_str, k);
+ BREAK_ON_EPID_ERROR(sts);
+ } while (0);
+ EpidZeroMemory(&f_str, sizeof(f_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = EcExp(G1, point, &r_str, l);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = EcIsEqual(G1, k, infinity, &is_equal);
+ BREAK_ON_EPID_ERROR(sts);
+ if (is_equal) {
+ sts = kEpidBadArgErr;
+ break;
+ }
+ sts = EcIsEqual(G1, l, infinity, &is_equal);
+ BREAK_ON_EPID_ERROR(sts);
+ if (is_equal) {
+ sts = kEpidBadArgErr;
+ break;
+ }
+ }
+ // step j: if p1 is not an Empty Point, set E = [r](p1 )
+ if (p1) {
+ sts = EcExp(G1, p1, &r_str, e);
+ BREAK_ON_EPID_ERROR(sts);
+ } else {
+ // step k: if p1 is an Empty Point and s2 is an Empty Buffer, set E = [r]G
+ sts = EcExp(G1, ctx->epid2_params->g1, &r_str, e);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ sts = EcIsEqual(G1, e, infinity, &is_equal);
+ BREAK_ON_EPID_ERROR(sts);
+ if (is_equal) {
+ sts = kEpidBadArgErr;
+ break;
+ }
+ *counter = ctr;
+ } while (0);
+
+ if (sts != kEpidNoErr) {
+ DeleteR(ctx, &ctr);
+ }
+ DeleteEcPoint(&infinity);
+ DeleteEcPoint(&point);
+ DeleteFfElement(&x2);
+ return sts;
+}
diff --git a/epid/member/tpm2/src/context.c b/epid/member/tpm2/src/context.c
new file mode 100644
index 0000000..e6121a0
--- /dev/null
+++ b/epid/member/tpm2/src/context.c
@@ -0,0 +1,119 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM context implementation.
+/*! \file */
+
+#include <stddef.h>
+
+#include "epid/common/math/finitefield.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/memory.h"
+#include "epid/member/software_member.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/src/state.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+EpidStatus Tpm2CreateContext(MemberParams const* params,
+ Epid2Params_ const* epid2_params,
+ BitSupplier* rnd_func, void** rnd_param,
+ const FpElemStr** f, Tpm2Ctx** ctx) {
+ Tpm2Ctx* tpm_ctx = NULL;
+ EpidStatus sts = kEpidNoErr;
+ FfElement* ff_elem = NULL;
+
+ if (!params || !epid2_params || !rnd_func || !rnd_param || !f || !ctx) {
+ return kEpidBadArgErr;
+ }
+
+ tpm_ctx = SAFE_ALLOC(sizeof(Tpm2Ctx));
+ if (!tpm_ctx) {
+ return kEpidMemAllocErr;
+ }
+
+ do {
+ int i;
+
+ if (params->f) {
+ FiniteField* Fp = epid2_params->Fp;
+ // Validate f
+ sts = NewFfElement(Fp, &ff_elem);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, params->f, sizeof(*params->f), ff_elem);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ tpm_ctx->epid2_params = epid2_params;
+ tpm_ctx->rnd_func = params->rnd_func;
+ tpm_ctx->rnd_param = params->rnd_param;
+ tpm_ctx->f = NULL;
+ *rnd_func = params->rnd_func;
+ *rnd_param = params->rnd_param;
+ *f = params->f;
+
+ for (i = 0; i < MAX_NV_NUMBER; ++i) {
+ tpm_ctx->nv->nv_index = 0;
+ tpm_ctx->nv->data = NULL;
+ tpm_ctx->nv->data_size = 0;
+ }
+
+ memset(tpm_ctx->commit_data, 0, sizeof(tpm_ctx->commit_data));
+
+ *ctx = tpm_ctx;
+ sts = kEpidNoErr;
+ } while (0);
+ DeleteFfElement(&ff_elem);
+ if (kEpidNoErr != sts) {
+ Tpm2DeleteContext(&tpm_ctx);
+ *ctx = NULL;
+ }
+ return sts;
+}
+
+void Tpm2DeleteContext(Tpm2Ctx** ctx) {
+ if (ctx && *ctx) {
+ int i;
+ (*ctx)->rnd_param = NULL;
+ DeleteFfElement(&(*ctx)->f);
+ for (i = 0; i < MAX_COMMIT_COUNT; ++i) {
+ DeleteFfElement(&(*ctx)->commit_data[i]);
+ }
+ for (i = 0; i < MAX_NV_NUMBER; ++i) {
+ (*ctx)->nv->nv_index = 0;
+ SAFE_FREE((*ctx)->nv->data);
+ (*ctx)->nv->data_size = 0;
+ }
+ SAFE_FREE(*ctx);
+ }
+}
+
+EpidStatus Tpm2SetHashAlg(Tpm2Ctx* ctx, HashAlg hash_alg) {
+ if (!ctx) return kEpidBadArgErr;
+ if (kSha256 != hash_alg && kSha384 != hash_alg && kSha512 != hash_alg &&
+ kSha512_256 != hash_alg)
+ return kEpidHashAlgorithmNotSupported;
+ ctx->hash_alg = hash_alg;
+ return kEpidNoErr;
+}
+
+void Tpm2ResetContext(Tpm2Ctx** ctx) {
+ if (ctx && *ctx) {
+ DeleteFfElement(&(*ctx)->f);
+ }
+}
diff --git a/epid/member/tpm2/src/createprimary.c b/epid/member/tpm2/src/createprimary.c
new file mode 100644
index 0000000..6a893cb
--- /dev/null
+++ b/epid/member/tpm2/src/createprimary.c
@@ -0,0 +1,58 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \brief TPM2_CreatePrimary command implementation.
+ * \file
+ */
+#include "epid/member/tpm2/createprimary.h"
+#include "epid/common/math/finitefield.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/member/software_member.h"
+#include "epid/member/tpm2/load_external.h"
+#include "epid/member/tpm2/src/state.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+EpidStatus Tpm2CreatePrimary(Tpm2Ctx* ctx, G1ElemStr* p_str) {
+ EpidStatus sts = kEpidErr;
+ FfElement* ff_elem;
+ FpElemStr ff_elem_str;
+ if (!ctx || !ctx->epid2_params) {
+ return kEpidBadArgErr;
+ }
+ (void)p_str;
+ do {
+ const BigNumStr kOne = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+ FiniteField* Fp = ctx->epid2_params->Fp;
+ sts = NewFfElement(Fp, &ff_elem);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfGetRandom(Fp, &kOne, ctx->rnd_func, ctx->rnd_param, ff_elem);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = WriteFfElement(Fp, ff_elem, &ff_elem_str, sizeof(ff_elem_str));
+ BREAK_ON_EPID_ERROR(sts);
+ } while (0);
+ DeleteFfElement(&ff_elem);
+ if (kEpidNoErr == sts) {
+ sts = Tpm2LoadExternal(ctx, &ff_elem_str);
+ }
+ return sts;
+}
diff --git a/parts-site/configurations/instr_size_optimized_release/g++.py b/epid/member/tpm2/src/getrandom.c
index d208bd6..1ded2cf 100644
--- a/parts-site/configurations/instr_size_optimized_release/g++.py
+++ b/epid/member/tpm2/src/getrandom.c
@@ -1,4 +1,4 @@
-############################################################################
+/*############################################################################
# Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,20 +12,32 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
+############################################################################*/
-"""g++ compiler configuration for release
-"""
-from parts.config import ConfigValues, configuration
+/*!
+ * \file
+ * \brief TPM2_GetRandom command implementation.
+ */
-def map_default_version(env):
- return env['GCC_VERSION']
+#include "epid/member/tpm2/getrandom.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/src/state.h"
-config = configuration(map_default_version)
+EpidStatus Tpm2GetRandom(Tpm2Ctx* ctx, int const num_bits, void* random_data) {
+ int rand_ret = -1;
-config.VersionRange("3-*",
- append=ConfigValues(
- CCFLAGS=['-finstrument-functions'],
- )
- )
+ if (!ctx || !random_data) {
+ return kEpidBadArgErr;
+ }
+
+ if (num_bits <= 0) {
+ return kEpidBadArgErr;
+ }
+
+ rand_ret = ctx->rnd_func(random_data, num_bits, ctx->rnd_param);
+ if (rand_ret != 0) {
+ return kEpidErr;
+ }
+
+ return kEpidNoErr;
+}
diff --git a/epid/member/tpm2/src/load_external.c b/epid/member/tpm2/src/load_external.c
new file mode 100644
index 0000000..e294eae
--- /dev/null
+++ b/epid/member/tpm2/src/load_external.c
@@ -0,0 +1,54 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief TPM2_LoadExternal command implementation.
+ */
+
+#include "epid/member/tpm2/load_external.h"
+
+#include "epid/common/math/finitefield.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/member/tpm2/src/state.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+EpidStatus Tpm2LoadExternal(Tpm2Ctx* ctx, FpElemStr const* f_str) {
+ EpidStatus sts = kEpidErr;
+ if (!ctx || !ctx->epid2_params || !f_str) {
+ return kEpidBadArgErr;
+ }
+
+ do {
+ FiniteField* Fp = ctx->epid2_params->Fp;
+
+ if (ctx->f) {
+ DeleteFfElement(&ctx->f);
+ }
+
+ sts = NewFfElement(Fp, &ctx->f);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, f_str, sizeof(*f_str), ctx->f);
+ BREAK_ON_EPID_ERROR(sts);
+ } while (0);
+
+ return sts;
+}
diff --git a/epid/member/tpm2/src/nv.c b/epid/member/tpm2/src/nv.c
new file mode 100644
index 0000000..4d1e122
--- /dev/null
+++ b/epid/member/tpm2/src/nv.c
@@ -0,0 +1,134 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief TPM NV API implementation.
+ */
+
+#include "epid/member/tpm2/nv.h"
+
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/src/state.h"
+
+/// Find nv_index in nv array
+int EpidFindNvIndex(Tpm2Ctx* ctx, uint32_t nv_index) {
+ int i;
+ for (i = 0; i < MAX_NV_NUMBER; ++i) {
+ if (ctx->nv[i].nv_index == nv_index) return i;
+ }
+ return -1;
+}
+
+/// Find empty node in nv array
+int EpidFindFirstEmptyNvIndex(Tpm2Ctx* ctx) {
+ int i;
+ for (i = 0; i < MAX_NV_NUMBER; ++i) {
+ if (!ctx->nv[i].data_size) return i;
+ }
+ return -1;
+}
+
+EpidStatus Tpm2NvDefineSpace(Tpm2Ctx* ctx, uint32_t nv_index, size_t size) {
+ int index = 0;
+ if (!ctx || size <= 0) {
+ return kEpidBadArgErr;
+ }
+ if (nv_index < MIN_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+ if (EpidFindNvIndex(ctx, nv_index) != -1) {
+ return kEpidDuplicateErr;
+ }
+ index = EpidFindFirstEmptyNvIndex(ctx);
+ if (index == -1) {
+ return kEpidBadArgErr;
+ }
+ ctx->nv[index].nv_index = nv_index;
+ // memory will be allocated on first NvWrite call
+ ctx->nv[index].data_size = size;
+ return kEpidNoErr;
+}
+
+EpidStatus Tpm2NvUndefineSpace(Tpm2Ctx* ctx, uint32_t nv_index) {
+ int index = 0;
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+ if (nv_index < MIN_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+ index = EpidFindNvIndex(ctx, nv_index);
+ if (index == -1) {
+ return kEpidBadArgErr;
+ }
+ ctx->nv[index].nv_index = 0;
+ SAFE_FREE(ctx->nv[index].data);
+ ctx->nv[index].data_size = 0;
+ return kEpidNoErr;
+}
+
+EpidStatus Tpm2NvRead(Tpm2Ctx* ctx, uint32_t nv_index, size_t size,
+ uint16_t offset, void* data) {
+ uint8_t* buf = NULL;
+ int index = 0;
+ if (!ctx || !data || size <= 0) {
+ return kEpidBadArgErr;
+ }
+ if (nv_index < MIN_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+ index = EpidFindNvIndex(ctx, nv_index);
+ if (index == -1 || !ctx->nv[index].data) {
+ return kEpidBadArgErr;
+ }
+ if (offset + size > ctx->nv[index].data_size) {
+ return kEpidBadArgErr;
+ }
+ buf = (uint8_t*)ctx->nv[index].data + offset;
+ if (0 != memcpy_S(data, size, buf, size)) {
+ return kEpidErr;
+ }
+ return kEpidNoErr;
+}
+
+EpidStatus Tpm2NvWrite(Tpm2Ctx* ctx, uint32_t nv_index, size_t size,
+ uint16_t offset, void const* data) {
+ uint8_t* buf = NULL;
+ int index = 0;
+ if (!ctx || !data || size <= 0) {
+ return kEpidBadArgErr;
+ }
+ if (nv_index < MIN_NV_INDEX) {
+ return kEpidBadArgErr;
+ }
+ index = EpidFindNvIndex(ctx, nv_index);
+ if (index == -1) {
+ return kEpidBadArgErr;
+ }
+ if (offset + size > ctx->nv[index].data_size) {
+ return kEpidBadArgErr;
+ }
+ if (!ctx->nv[index].data) {
+ ctx->nv[index].data = SAFE_ALLOC(ctx->nv[index].data_size);
+ if (!ctx->nv[index].data) return kEpidMemAllocErr;
+ }
+ buf = (uint8_t*)ctx->nv[index].data + offset;
+ if (0 != memcpy_S(buf, size, data, size)) {
+ return kEpidErr;
+ }
+ return kEpidNoErr;
+}
diff --git a/epid/member/tpm2/src/sign.c b/epid/member/tpm2/src/sign.c
new file mode 100644
index 0000000..9d2ad6b
--- /dev/null
+++ b/epid/member/tpm2/src/sign.c
@@ -0,0 +1,127 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2Sign implementation.
+/*! \file */
+
+#include "epid/member/tpm2/sign.h"
+
+#include <string.h>
+
+#include "epid/common/math/finitefield.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/hashsize.h"
+#include "epid/common/src/memory.h"
+#include "epid/common/types.h"
+#include "epid/member/tpm2/src/state.h"
+
+/// Handle Intel(R) EPID Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+static EpidStatus GetCommitNonce(Tpm2Ctx* ctx, uint16_t counter,
+ FfElement** r) {
+ if (!ctx || counter == 0 || !r) {
+ return kEpidBadArgErr;
+ }
+ if (counter >= MAX_COMMIT_COUNT) {
+ return kEpidBadArgErr;
+ }
+ *r = ctx->commit_data[counter - 1];
+ return kEpidNoErr;
+}
+
+static void ClearCommitNonce(Tpm2Ctx* ctx, uint16_t counter) {
+ if (ctx && counter > 0 && counter < MAX_COMMIT_COUNT) {
+ DeleteFfElement(&ctx->commit_data[counter - 1]);
+ }
+}
+
+EpidStatus Tpm2Sign(Tpm2Ctx* ctx, void const* digest, size_t digest_len,
+ uint16_t counter, FfElement* k, FfElement* s) {
+ EpidStatus sts = kEpidErr;
+ FfElement* t = NULL;
+ BigNum* digest_bn = NULL;
+ FfElement* commit_nonce = NULL;
+
+ if (!ctx || !digest || !s || !ctx->epid2_params) {
+ return kEpidBadArgErr;
+ }
+ if (0 == digest_len || EpidGetHashSize(ctx->hash_alg) != digest_len) {
+ return kEpidBadArgErr;
+ }
+ if (!ctx->f) {
+ return kEpidBadArgErr;
+ }
+
+ do {
+ FpElemStr tmp_str;
+ FiniteField* Fp = ctx->epid2_params->Fp;
+ const FpElemStr zero = {0};
+
+ sts = GetCommitNonce(ctx, counter, &commit_nonce);
+ BREAK_ON_EPID_ERROR(sts);
+
+ sts = NewBigNum(digest_len, &digest_bn);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = NewFfElement(Fp, &t);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // a. set T = digest (mod p)
+ sts = ReadBigNum(digest, digest_len, digest_bn);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = InitFfElementFromBn(Fp, digest_bn, t);
+ BREAK_ON_EPID_ERROR(sts);
+ // b. compute integer s = (r + T*f)(mod p)
+ sts = FfMul(Fp, ctx->f, t, s);
+ BREAK_ON_EPID_ERROR(sts);
+ sts = FfAdd(Fp, commit_nonce, s, s);
+ BREAK_ON_EPID_ERROR(sts);
+
+ // d. if s = 0, output failure (negligible probability)
+ sts = WriteFfElement(Fp, s, &tmp_str, sizeof(tmp_str));
+ BREAK_ON_EPID_ERROR(sts);
+ if (0 == memcmp(&zero, &tmp_str, sizeof(tmp_str))) {
+ sts = kEpidBadArgErr;
+ break;
+ }
+
+ if (k) {
+ // k = T
+ sts = WriteFfElement(Fp, t, &tmp_str, sizeof(tmp_str));
+ BREAK_ON_EPID_ERROR(sts);
+ sts = ReadFfElement(Fp, &tmp_str, sizeof(tmp_str), k);
+ BREAK_ON_EPID_ERROR(sts);
+ }
+ ClearCommitNonce(ctx, counter);
+ sts = kEpidNoErr;
+ } while (0);
+
+ DeleteFfElement(&t);
+ DeleteBigNum(&digest_bn);
+
+ return sts;
+}
+
+EpidStatus Tpm2ReleaseCounter(Tpm2Ctx* ctx, uint16_t counter) {
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+
+ ClearCommitNonce(ctx, counter);
+ return kEpidNoErr;
+}
diff --git a/epid/member/tpm2/src/state.h b/epid/member/tpm2/src/state.h
new file mode 100644
index 0000000..660019a
--- /dev/null
+++ b/epid/member/tpm2/src/state.h
@@ -0,0 +1,63 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// TPM internal state
+/*! \file */
+
+#ifndef EPID_MEMBER_TPM2_SRC_STATE_H_
+#define EPID_MEMBER_TPM2_SRC_STATE_H_
+
+#include <stddef.h>
+#include "epid/common/bitsupplier.h"
+#include "epid/common/stdtypes.h"
+#include "epid/common/types.h" // HashAlg
+
+/// \cond
+typedef struct Epid2Params_ Epid2Params_;
+typedef struct FfElement FfElement;
+/// \endcond
+
+/// Maximum NV index
+#define MAX_NV_NUMBER 10
+/// Minimal possible NV index in TPM
+#define MIN_NV_INDEX 0x01000000
+/// Maximum number of Tpm2Commit random values that can exist in memory
+/// simultaneously
+#define MAX_COMMIT_COUNT 100
+
+#if (MAX_COMMIT_COUNT >= UINT16_MAX)
+#error "MAX_COMMIT_COUNT maximum commit count is restricted by uint16_t"
+#endif
+
+/// One NV entry
+typedef struct NvEntry {
+ uint32_t nv_index;
+ void* data;
+ size_t data_size;
+} NvEntry;
+
+/// TPM State
+typedef struct Tpm2Ctx {
+ Epid2Params_ const* epid2_params; ///< Intel(R) EPID 2.0 params
+ FfElement* f; ///< Member private key f value
+ BitSupplier rnd_func; ///< Pseudo random number generation function
+ void* rnd_param; ///< Pointer to user context for rnd_func
+ HashAlg hash_alg; ///< Hash algorithm to use
+ FfElement* commit_data[MAX_COMMIT_COUNT]; ///< Tpm2Commit random value
+ ///< corresponding to counter
+ NvEntry nv[MAX_NV_NUMBER]; ///< NV memory
+} Tpm2Ctx;
+
+#endif // EPID_MEMBER_TPM2_SRC_STATE_H_
diff --git a/epid/member/tpm2/tpm2.parts b/epid/member/tpm2/tpm2.parts
new file mode 100644
index 0000000..b6adb3a
--- /dev/null
+++ b/epid/member/tpm2/tpm2.parts
@@ -0,0 +1,123 @@
+############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################
+import os
+
+Import('*')
+
+env.PartName('tpm2')
+
+include_files = Pattern(src_dir='.',
+ includes=['*.h'],
+ recursive=False).files()
+
+install_files = Pattern(src_dir='.',
+ includes=[
+ '*.h',
+ '*.c',
+ '*-test.cc',
+ '*-testhelper.cc',
+ '*.parts'],
+ recursive=True)
+
+if 'install_package' in env['MODE']:
+ env.InstallTopLevel(install_files,
+ sub_dir='epid/member/${PART_SHORT_NAME}')
+else:
+ env.DependsOn([
+ Component('common'),
+ ])
+
+ env.Append(CPPPATH='#')
+
+ if 'use_tss' in env['MODE']:
+ src_files = Pattern(src_dir='ibm_tss',
+ includes=['*.c'],
+ recursive=False).files()
+ utest_files = Pattern(src_dir='unittests',
+ includes=['*-test.cc',
+ '*-testhelper.cc'],
+ excludes=['*-simulator-test.cc'],
+ recursive=False).files()
+ if env['TARGET_ARCH'] == 'x86_64' and env['TARGET_PLATFORM']['OS'] == 'win32':
+ PrintError("--use-tss is not compatiable with x86_64 target. "
+ "Try an x86 build.")
+ try:
+ TSSROOT = os.environ['TSSROOT']
+ except KeyError, e:
+ env.PrintError("Necessary environment variable not set: ",
+ e, show_stack=False)
+ env.Append(CPPPATH=TSSROOT)
+ env.Append(LIBPATH=TSSROOT)
+ if 'cl' in env['CC']:
+ env.Append(CCFLAGS=['/wd4201', # allow nameless struct
+ '/wd4200', # allow zero-sized array in struct
+ ])
+ env.Append(CPPDEFINES=['TPM_TSS'])
+
+ else:
+ src_files = Pattern(src_dir='src',
+ includes=['*.c'],
+ recursive=False).files()
+
+ utest_files = Pattern(src_dir='unittests',
+ includes=['*-test.cc',
+ '*-testhelper.cc'],
+ excludes=['*-tss-test.cc'],
+ recursive=False).files()
+
+ testenv = env.Clone()
+
+ outputs = env.Library('${PART_NAME}', src_files)
+ env.Sdk(outputs)
+ env.SdkInclude(include_files,
+ sub_dir='epid/member/${PART_SHORT_NAME}')
+
+ #unit tests
+ testenv['UNIT_TEST_TARGET_NAME'] = "${PART_NAME}-${UNIT_TEST_TARGET}"
+
+ utest = testenv.UnitTest("utest",
+ utest_files,
+ command_args=[
+ '--gtest_color=yes',
+ '--gtest_print_time=1',
+ '--gtest_output=xml',
+ '--gtest_filter=**',
+ ],
+ make_pdb=(env.isConfigBasedOn('debug') or
+ env.isConfigBasedOn('static_crt_debug')),
+ depends=[Component('gtest'),
+ Component('common-testhelper'),
+ Component('member.tpm2')],
+ INSTALL_BIN='${INSTALL_TEST_BIN}')
+
+ if 'use_tss' in env['MODE']:
+ if env['TARGET_PLATFORM']['OS'] == 'win32':
+ libpost = env['LIBSUFFIX']
+ shlibpost = env['SHLIBSUFFIX']
+ else:
+ libpost = env['SHLIBSUFFIX']
+ shlibpost = libpost
+
+ tss_libname = env['LIBPREFIX'] + 'tss' + libpost
+ env.SdkLib(os.path.join(TSSROOT, tss_libname))
+
+ if env['TARGET_PLATFORM']['OS'] != 'win32':
+ env.ExportLIBS(['crypto'])
+
+ tss_shlibname = env['SHLIBPREFIX'] + 'tss' + shlibpost
+ runtime_lib = testenv.CCopy("${INSTALL_TEST_BIN}",
+ os.path.join(TSSROOT, tss_shlibname))
+ Depends(utest, runtime_lib)
diff --git a/epid/member/tpm2/unittests/commit-simulator-test.cc b/epid/member/tpm2/unittests/commit-simulator-test.cc
new file mode 100644
index 0000000..c576427
--- /dev/null
+++ b/epid/member/tpm2/unittests/commit-simulator-test.cc
@@ -0,0 +1,292 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2Commit unit tests.
+/*! \file */
+
+#include <cstring>
+
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/common/src/epid2params.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/load_external.h"
+#include "epid/member/tpm2/sign.h"
+#include "epid/member/tpm2/src/state.h"
+}
+
+namespace {
+
+TEST_F(EpidTpm2Test, CommitComputeKLESha256) {
+ // Testing step i and j of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k, l, e, &counter));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+ EcPointObj p1_exp_r(&params.G1), p2_exp_r(&params.G1);
+ G1ElemStr p1_exp_r_str, p2_exp_r_str;
+ EcPointObj p2(&params.G1, this->kP2Sha256Str);
+ Prng the_same_prng;
+ FfElementObj r(&params.fp);
+ BigNumStr zero = {0};
+ FpElemStr r_str = {0};
+ THROW_ON_EPIDERR(
+ FfGetRandom(params.fp, &zero, &Prng::Generate, &the_same_prng, r));
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p1, (BigNumStr const*)&r_str, p1_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p1_exp_r, &p1_exp_r_str, sizeof(p1_exp_r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p2, (BigNumStr const*)&r_str, p2_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p2_exp_r, &p2_exp_r_str, sizeof(p2_exp_r_str)));
+
+ G1ElemStr k_str, l_str, e_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, k, &k_str, sizeof(k_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, l, &l_str, sizeof(l_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, e, &e_str, sizeof(e_str)));
+ EXPECT_EQ(this->kP2Sha256ExpF, k_str);
+ EXPECT_EQ(p2_exp_r_str, l_str);
+ EXPECT_EQ(p1_exp_r_str, e_str);
+}
+
+TEST_F(EpidTpm2Test, CommitComputeKLESha384) {
+ // Testing step i and j of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha384Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha384));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha384.data(), this->kS2Sha384.size(),
+ y2, k, l, e, &counter));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+
+ EcPointObj p1_exp_r(&params.G1), p2_exp_r(&params.G1);
+ G1ElemStr p1_exp_r_str, p2_exp_r_str;
+ EcPointObj p2(&params.G1, this->kP2Sha384Str);
+ Prng the_same_prng;
+ FfElementObj r(&params.fp);
+ BigNumStr zero = {0};
+ FpElemStr r_str = {0};
+ THROW_ON_EPIDERR(
+ FfGetRandom(params.fp, &zero, &Prng::Generate, &the_same_prng, r));
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p1, (BigNumStr const*)&r_str, p1_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p1_exp_r, &p1_exp_r_str, sizeof(p1_exp_r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p2, (BigNumStr const*)&r_str, p2_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p2_exp_r, &p2_exp_r_str, sizeof(p2_exp_r_str)));
+
+ G1ElemStr k_str, l_str, e_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, k, &k_str, sizeof(k_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, l, &l_str, sizeof(l_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, e, &e_str, sizeof(e_str)));
+ EXPECT_EQ(this->kP2Sha384ExpF, k_str);
+ EXPECT_EQ(p2_exp_r_str, l_str);
+ EXPECT_EQ(p1_exp_r_str, e_str);
+}
+
+TEST_F(EpidTpm2Test, CommitComputeKLESha512) {
+ // Testing step i and j of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha512Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha512));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha512.data(), this->kS2Sha512.size(),
+ y2, k, l, e, &counter));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+
+ EcPointObj p1_exp_r(&params.G1), p2_exp_r(&params.G1);
+ G1ElemStr p1_exp_r_str, p2_exp_r_str;
+ EcPointObj p2(&params.G1, this->kP2Sha512Str);
+ Prng the_same_prng;
+ FfElementObj r(&params.fp);
+ BigNumStr zero = {0};
+ FpElemStr r_str = {0};
+ THROW_ON_EPIDERR(
+ FfGetRandom(params.fp, &zero, &Prng::Generate, &the_same_prng, r));
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p1, (BigNumStr const*)&r_str, p1_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p1_exp_r, &p1_exp_r_str, sizeof(p1_exp_r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p2, (BigNumStr const*)&r_str, p2_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p2_exp_r, &p2_exp_r_str, sizeof(p2_exp_r_str)));
+
+ G1ElemStr k_str, l_str, e_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, k, &k_str, sizeof(k_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, l, &l_str, sizeof(l_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, e, &e_str, sizeof(e_str)));
+ EXPECT_EQ(this->kP2Sha512ExpF, k_str);
+ EXPECT_EQ(p2_exp_r_str, l_str);
+ EXPECT_EQ(p1_exp_r_str, e_str);
+}
+
+TEST_F(EpidTpm2Test, CommitComputeKLESha512256) {
+ // Testing step i and j of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha512256Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha512_256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha512256.data(),
+ this->kS2Sha512256.size(), y2, k, l, e, &counter));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+
+ EcPointObj p1_exp_r(&params.G1), p2_exp_r(&params.G1);
+ G1ElemStr p1_exp_r_str, p2_exp_r_str;
+ EcPointObj p2(&params.G1, this->kP2Sha512256Str);
+ Prng the_same_prng;
+ FfElementObj r(&params.fp);
+ BigNumStr zero = {0};
+ FpElemStr r_str = {0};
+ THROW_ON_EPIDERR(
+ FfGetRandom(params.fp, &zero, &Prng::Generate, &the_same_prng, r));
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p1, (BigNumStr const*)&r_str, p1_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p1_exp_r, &p1_exp_r_str, sizeof(p1_exp_r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p2, (BigNumStr const*)&r_str, p2_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p2_exp_r, &p2_exp_r_str, sizeof(p2_exp_r_str)));
+
+ G1ElemStr k_str, l_str, e_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, k, &k_str, sizeof(k_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, l, &l_str, sizeof(l_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, e, &e_str, sizeof(e_str)));
+ EXPECT_EQ(this->kP2Sha512256ExpF, k_str);
+ EXPECT_EQ(p2_exp_r_str, l_str);
+ EXPECT_EQ(p1_exp_r_str, e_str);
+}
+
+TEST_F(EpidTpm2Test, CommitComputeEOnly) {
+ // Testing step j excuding i of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha512Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha512));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p1, nullptr, 0, nullptr, k, l, e, &counter));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+
+ EcPointObj p1_exp_r(&params.G1);
+ G1ElemStr p1_exp_r_str;
+ Prng the_same_prng;
+ FfElementObj r(&params.fp);
+ BigNumStr zero = {0};
+ FpElemStr r_str = {0};
+ THROW_ON_EPIDERR(
+ FfGetRandom(params.fp, &zero, &Prng::Generate, &the_same_prng, r));
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, p1, (BigNumStr const*)&r_str, p1_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, p1_exp_r, &p1_exp_r_str, sizeof(p1_exp_r_str)));
+
+ G1ElemStr e_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, e, &e_str, sizeof(e_str)));
+ EXPECT_EQ(p1_exp_r_str, e_str);
+}
+
+TEST_F(EpidTpm2Test, CommitComputeEOnlyWithDefaultP1) {
+ // Testing step k excuding i of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha512Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha512));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidNoErr, Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, nullptr,
+ nullptr, e, &counter));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+
+ EcPointObj g1(&params.G1, this->kg1Str);
+ EcPointObj g1_exp_r(&params.G1);
+ G1ElemStr g1_exp_r_str;
+ Prng the_same_prng;
+ FfElementObj r(&params.fp);
+ BigNumStr zero = {0};
+ FpElemStr r_str = {0};
+ THROW_ON_EPIDERR(
+ FfGetRandom(params.fp, &zero, &Prng::Generate, &the_same_prng, r));
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(EcExp(params.G1, g1, (BigNumStr const*)&r_str, g1_exp_r));
+ THROW_ON_EPIDERR(
+ WriteEcPoint(params.G1, g1_exp_r, &g1_exp_r_str, sizeof(g1_exp_r_str)));
+
+ G1ElemStr e_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, e, &e_str, sizeof(e_str)));
+ EXPECT_EQ(g1_exp_r_str, e_str);
+}
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/commit-test.cc b/epid/member/tpm2/unittests/commit-test.cc
new file mode 100644
index 0000000..dca23f3
--- /dev/null
+++ b/epid/member/tpm2/unittests/commit-test.cc
@@ -0,0 +1,321 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2Commit unit tests.
+/*! \file */
+
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/common/src/endian_convert.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/load_external.h"
+#include "epid/member/tpm2/sign.h"
+}
+
+namespace {
+
+TEST_F(EpidTpm2Test, CommitFailsGivenNullParameters) {
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(nullptr, p1, this->kS2Sha256.data(),
+ this->kS2Sha256.size(), y2, k, l, e, &counter));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2Commit(tpm, p1, nullptr, this->kS2Sha256.size(),
+ y2, k, l, e, &counter));
+ // Testing step a of the "C.2.3 Tpm2Commit()"
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ nullptr, k, l, e, &counter));
+ // Testing step a of the "C.2.3 Tpm2Commit()"
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, nullptr, l, e, &counter));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k, nullptr, e, &counter));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k, l, nullptr, &counter));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k, l, e, nullptr));
+}
+
+TEST_F(EpidTpm2Test, CommitFailsGivenInvalidLength) {
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidBadArgErr, Tpm2Commit(tpm, p1, this->kS2Sha256.data(), 0, y2,
+ k, l, e, &counter));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), sizeof(uint16_t) - 1,
+ y2, k, l, e, &counter));
+}
+
+TEST_F(EpidTpm2Test, CommitFailsGivenPrivateKeyDoesNotExists) {
+ // Testing step d of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, NULL, epid2params);
+
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k, l, e, &counter));
+}
+
+TEST_F(EpidTpm2Test, CommitFailsGivenS2y2NotOnCurve) {
+ // Testing step d of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ EcPointObj p1(&params.G1, this->kP1Str);
+ FqElemStr invalid_kY2Sha256Str = this->kY2Sha256Str;
+ invalid_kY2Sha256Str.data.data[31]++; // make point not belong to the group
+ FfElementObj invalid_y2(&params.fq, invalid_kY2Sha256Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, p1, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ invalid_y2, k, l, e, &counter));
+}
+
+TEST_F(EpidTpm2Test, CommitFailsIfResultIsAtInfinity) {
+ // Testing step l of the "C.2.3 Tpm2Commit()"
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ G1ElemStr infinity_str = {0};
+ EcPointObj infinity(&params.G1, infinity_str);
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Commit(tpm, infinity, this->kS2Sha256.data(),
+ this->kS2Sha256.size(), y2, k, l, e, &counter));
+}
+
+TEST_F(EpidTpm2Test, CommitCanUseKeyLoadedByLoadExternal) {
+ Prng prng;
+ Epid2ParamsObj epid2params;
+ Epid20Params params;
+ FpElemStr f_str = this->kMemberFValue;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ uint16_t counter = 0;
+ Tpm2CtxObj tpm(&Prng::Generate, &prng, &f_str, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f_str));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, nullptr, this->kS2Sha256.data(),
+ this->kS2Sha256.size(), y2, k, l, e, &counter));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+
+ // k = (x2, y2) ^ f, where x2 = Hash(s2)
+ G1ElemStr k_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, k, &k_str, sizeof(k_str)));
+ EXPECT_EQ(this->kP2Sha256ExpF, k_str);
+}
+
+TEST_F(EpidTpm2Test, CommitReturnsSameLEForSameP1P2) {
+ Prng prng;
+ Epid2ParamsObj epid2params;
+ Epid20Params params;
+ FpElemStr f_str = this->kMemberFValue;
+ // create TPM context
+ Tpm2CtxObj tpm(&Prng::Generate, &prng, &f_str, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ // load f value
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f_str));
+
+ // commit(P1=p2, P2=p2) => k = p2^f, l = p2^r, e = p2^r
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ EcPointObj p2(&params.G1, kP2Sha256Str);
+ EcPointObj p2_exp_f(&params.G1, kP2Sha256ExpF);
+
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ uint16_t counter = 0;
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k, l, e, &counter));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+
+ G1ElemStr l_str, e_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, l, &l_str, sizeof(l_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, e, &e_str, sizeof(e_str)));
+ EXPECT_EQ(l_str, e_str);
+}
+
+TEST_F(EpidTpm2Test, CommitCanBeUsedTwice) {
+ Prng prng;
+ Epid2ParamsObj epid2params;
+ Epid20Params params;
+ FpElemStr f_str = this->kMemberFValue;
+ // create TPM context
+ Tpm2CtxObj tpm(&Prng::Generate, &prng, &f_str, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ // load f value
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f_str));
+
+ EcPointObj p1(&params.G1, this->kP1Str);
+ EcPointObj e(&params.G1);
+ uint16_t ctr1 = 0, ctr2 = 0;
+
+ EXPECT_EQ(kEpidNoErr, Tpm2Commit(tpm, p1, nullptr, 0, nullptr, nullptr,
+ nullptr, e, &ctr1));
+
+ EXPECT_EQ(kEpidNoErr, Tpm2Commit(tpm, p1, nullptr, 0, nullptr, nullptr,
+ nullptr, e, &ctr2));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, ctr1));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, ctr2));
+}
+TEST_F(EpidTpm2Test, CommitCanUseHashFromEcHashSha256) {
+ HashAlg halg = kSha256;
+ Prng prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj tpm(&Prng::Generate, &prng, &f_str, epid2params);
+ Epid20Params params;
+ EcPointObj R(&params.G1), k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj y(&params.fq);
+ uint32_t i = 0;
+ uint16_t counter = 0;
+ G1ElemStr R_str = {0};
+ std::vector<uint8_t> bsn = {'b', 's', 'n', '0'};
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, halg));
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f_str));
+
+ EXPECT_EQ(kEpidNoErr,
+ EcHash(epid2params.G1(), bsn.data(), bsn.size(), halg, R, &i));
+ i = ntohl(i);
+ THROW_ON_EPIDERR(WriteEcPoint(epid2params.G1(), R, &R_str, sizeof(R_str)));
+ THROW_ON_EPIDERR(
+ ReadFfElement(params.fq.get(), &R_str.y, sizeof(R_str.y), y));
+
+ std::vector<uint8_t> digest((uint8_t*)&i, (uint8_t*)&i + sizeof(i));
+ digest.reserve(digest.size() + bsn.size());
+ digest.insert(digest.end(), bsn.begin(), bsn.end());
+ EXPECT_EQ(kEpidNoErr, Tpm2Commit(tpm, nullptr, digest.data(), digest.size(),
+ y, k, l, e, &counter));
+ Tpm2ReleaseCounter(tpm, counter);
+}
+#ifndef TPM_TSS
+TEST_F(EpidTpm2Test, CommitCanUseHashFromEcHashSha384) {
+ HashAlg halg = kSha384;
+ Prng prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj tpm(&Prng::Generate, &prng, &f_str, epid2params);
+ Epid20Params params;
+ EcPointObj R(&params.G1), k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj y(&params.fq);
+ uint32_t i = 0;
+ uint16_t counter = 0;
+ G1ElemStr R_str = {0};
+ std::vector<uint8_t> bsn = {'b', 's', 'n', '0'};
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, halg));
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f_str));
+
+ EXPECT_EQ(kEpidNoErr,
+ EcHash(epid2params.G1(), bsn.data(), bsn.size(), halg, R, &i));
+ i = ntohl(i);
+ THROW_ON_EPIDERR(WriteEcPoint(epid2params.G1(), R, &R_str, sizeof(R_str)));
+ THROW_ON_EPIDERR(
+ ReadFfElement(params.fq.get(), &R_str.y, sizeof(R_str.y), y));
+
+ std::vector<uint8_t> digest((uint8_t*)&i, (uint8_t*)&i + sizeof(i));
+ digest.reserve(digest.size() + bsn.size());
+ digest.insert(digest.end(), bsn.begin(), bsn.end());
+ EXPECT_EQ(kEpidNoErr, Tpm2Commit(tpm, nullptr, digest.data(), digest.size(),
+ y, k, l, e, &counter));
+ Tpm2ReleaseCounter(tpm, counter);
+}
+TEST_F(EpidTpm2Test, CommitCanUseHashFromEcHashSha512) {
+ HashAlg halg = kSha512;
+ Prng prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj tpm(&Prng::Generate, &prng, &f_str, epid2params);
+ Epid20Params params;
+ EcPointObj R(&params.G1), k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj y(&params.fq);
+ uint32_t i = 0;
+ uint16_t counter = 0;
+ G1ElemStr R_str = {0};
+ std::vector<uint8_t> bsn = {'b', 's', 'n', '0'};
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, halg));
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f_str));
+
+ EXPECT_EQ(kEpidNoErr,
+ EcHash(epid2params.G1(), bsn.data(), bsn.size(), halg, R, &i));
+ i = ntohl(i);
+ THROW_ON_EPIDERR(WriteEcPoint(epid2params.G1(), R, &R_str, sizeof(R_str)));
+ THROW_ON_EPIDERR(
+ ReadFfElement(params.fq.get(), &R_str.y, sizeof(R_str.y), y));
+
+ std::vector<uint8_t> digest((uint8_t*)&i, (uint8_t*)&i + sizeof(i));
+ digest.reserve(digest.size() + bsn.size());
+ digest.insert(digest.end(), bsn.begin(), bsn.end());
+ EXPECT_EQ(kEpidNoErr, Tpm2Commit(tpm, nullptr, digest.data(), digest.size(),
+ y, k, l, e, &counter));
+ Tpm2ReleaseCounter(tpm, counter);
+}
+#endif // TPM_TSS
+} // namespace
diff --git a/epid/member/tpm2/unittests/context-test.cc b/epid/member/tpm2/unittests/context-test.cc
new file mode 100644
index 0000000..3b7d98a
--- /dev/null
+++ b/epid/member/tpm2/unittests/context-test.cc
@@ -0,0 +1,105 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// TPM Context unit tests.
+/*! \file */
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/mem_params-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/common/src/epid2params.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/load_external.h"
+}
+
+namespace {
+//////////////////////////////////////////////////////////////////////////
+// Tpm2CreateContext Tests
+TEST_F(EpidTpm2Test, CreateFailsGivenNullParameters) {
+ Tpm2Ctx* ctx = nullptr;
+ Prng my_prng;
+ BitSupplier rnd_func = NULL;
+ void* rnd_param = NULL;
+ const FpElemStr* f = NULL;
+ MemberParams mem_params = {0};
+ Epid2ParamsObj epid_params;
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &mem_params);
+
+ EXPECT_EQ(kEpidBadArgErr, Tpm2CreateContext(nullptr, epid_params, &rnd_func,
+ &rnd_param, &f, &ctx));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2CreateContext(&mem_params, nullptr, &rnd_func,
+ &rnd_param, &f, &ctx));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2CreateContext(&mem_params, epid_params, nullptr,
+ &rnd_param, &f, &ctx));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2CreateContext(&mem_params, epid_params,
+ &rnd_func, nullptr, &f, &ctx));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2CreateContext(&mem_params, epid_params, &rnd_func, &rnd_param,
+ nullptr, &ctx));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2CreateContext(&mem_params, epid_params, &rnd_func, &rnd_param,
+ &f, nullptr));
+}
+
+TEST_F(EpidTpm2Test, CreateSucceedsGivenValidParameters) {
+ Tpm2Ctx* ctx = nullptr;
+ Prng my_prng;
+ BitSupplier rnd_func = NULL;
+ void* rnd_param = NULL;
+ const FpElemStr* f = NULL;
+ MemberParams mem_params = {0};
+ Epid2ParamsObj epid_params;
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &mem_params);
+
+ EXPECT_EQ(kEpidNoErr, Tpm2CreateContext(&mem_params, epid_params, &rnd_func,
+ &rnd_param, &f, &ctx));
+ Tpm2DeleteContext(&ctx);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Tpm2DeleteContext Tests
+TEST_F(EpidTpm2Test, DeleteWorksGivenNullTpm2Ctx) {
+ Tpm2DeleteContext(nullptr);
+ Tpm2Ctx* ctx = nullptr;
+ Tpm2DeleteContext(&ctx);
+}
+
+TEST_F(EpidTpm2Test, DeleteNullsTpm2Ctx) {
+ Tpm2Ctx* ctx = nullptr;
+ Prng my_prng;
+ BitSupplier rnd_func = NULL;
+ void* rnd_param = NULL;
+ const FpElemStr* f = NULL;
+ MemberParams mem_params = {0};
+ Epid2ParamsObj epid_params;
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &mem_params);
+ Tpm2CreateContext(&mem_params, epid_params, &rnd_func, &rnd_param, &f, &ctx);
+ Tpm2DeleteContext(&ctx);
+ EXPECT_EQ(nullptr, ctx);
+}
+
+TEST_F(EpidTpm2Test, PROTECTED_SampleTest) { SUCCEED(); }
+
+TEST_F(EpidTpm2Test, PROTECTED_EPS1_SampleTest) { SUCCEED(); }
+
+TEST_F(EpidTpm2Test, PROTECTED_EPSOther_SampleTest) { SUCCEED(); }
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/conversion-tss-test.cc b/epid/member/tpm2/unittests/conversion-tss-test.cc
new file mode 100644
index 0000000..5279058
--- /dev/null
+++ b/epid/member/tpm2/unittests/conversion-tss-test.cc
@@ -0,0 +1,160 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM mapper unit tests.
+/*! \file */
+
+#include <cstring>
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+#include "gtest/gtest.h"
+extern "C" {
+#include "epid/member/tpm2/ibm_tss/conversion.h"
+}
+
+bool operator==(OctStr256 const& lhs, OctStr256 const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(OctStr256));
+}
+
+bool operator==(G1ElemStr const& epid_point, TPM2B_ECC_POINT const& tpm_point) {
+ if (std::memcmp(&epid_point.x, tpm_point.point.x.t.buffer,
+ sizeof(G1ElemStr) / 2) != 0)
+ return false;
+
+ return 0 == std::memcmp(&epid_point.y, tpm_point.point.y.t.buffer,
+ sizeof(G1ElemStr) / 2);
+}
+
+////////////////////////////////////////////////
+// EpidtoTpm2HashAlg
+TEST_F(EpidTpm2Test, EpidtoTpm2HashAlgWorksCorrectly) {
+ EXPECT_EQ(TPM_ALG_SHA256, EpidtoTpm2HashAlg(kSha256));
+ EXPECT_EQ(TPM_ALG_SHA384, EpidtoTpm2HashAlg(kSha384));
+ EXPECT_EQ(TPM_ALG_SHA512, EpidtoTpm2HashAlg(kSha512));
+ EXPECT_EQ(TPM_ALG_NULL, EpidtoTpm2HashAlg(kSha512_256));
+ EXPECT_EQ(TPM_ALG_NULL, EpidtoTpm2HashAlg(kInvalidHashAlg));
+ EXPECT_EQ(TPM_ALG_NULL, EpidtoTpm2HashAlg((HashAlg)10));
+}
+////////////////////////////////////////////////
+// Tpm2toEpidHashAlg
+TEST_F(EpidTpm2Test, Tpm2toEpidHashAlgWorksCorrectly) {
+ EXPECT_EQ(kSha256, Tpm2toEpidHashAlg(TPM_ALG_SHA256));
+ EXPECT_EQ(kSha384, Tpm2toEpidHashAlg(TPM_ALG_SHA384));
+ EXPECT_EQ(kSha512, Tpm2toEpidHashAlg(TPM_ALG_SHA512));
+ EXPECT_EQ(kInvalidHashAlg, Tpm2toEpidHashAlg(TPM_ALG_NULL));
+ EXPECT_EQ(kInvalidHashAlg, Tpm2toEpidHashAlg((TPMI_ALG_HASH)0x0020));
+}
+////////////////////////////////////////////////
+// ReadTpm2FfElement
+TEST_F(EpidTpm2Test, ReadTpm2FfElementFailsGivenNullPointer) {
+ TPM2B_ECC_PARAMETER ecc_parameter = {0};
+ OctStr256 stub = {0};
+ EXPECT_EQ(kEpidBadArgErr, ReadTpm2FfElement(nullptr, &ecc_parameter));
+ EXPECT_EQ(kEpidBadArgErr, ReadTpm2FfElement(&stub, nullptr));
+}
+
+TEST_F(EpidTpm2Test, ReadTpm2FfElementMapsGivenValidArguments) {
+ TPM2B_ECC_PARAMETER ecc_parameter = {0};
+ EXPECT_EQ(kEpidNoErr,
+ ReadTpm2FfElement((OctStr256*)this->kTpmFfElemStrData.data(),
+ &ecc_parameter));
+ EXPECT_EQ((uint16_t)this->kTpmFfElemStrData.size(), ecc_parameter.b.size);
+ EXPECT_EQ(*(OctStr256*)this->kTpmFfElemStrData.data(),
+ *(OctStr256*)ecc_parameter.b.buffer);
+}
+
+////////////////////////////////////////////////
+// WriteTpm2FfElement
+
+TEST_F(EpidTpm2Test, WriteTpm2FfElementFailsGivenNullPointer) {
+ TPM2B_ECC_PARAMETER ecc_parameter = {0};
+ OctStr256 result = {0};
+ EXPECT_EQ(kEpidBadArgErr, WriteTpm2FfElement(nullptr, &result));
+ EXPECT_EQ(kEpidBadArgErr, WriteTpm2FfElement(&ecc_parameter, nullptr));
+}
+
+TEST_F(EpidTpm2Test, WriteTpm2FfElementfailsGivenSmallBufSize) {
+ TPM2B_ECC_PARAMETER ecc_parameter = {0};
+ OctStr256 result = {0};
+ THROW_ON_EPIDERR(ReadTpm2FfElement((OctStr256*)this->kTpmFfElemStrData.data(),
+ &ecc_parameter));
+
+ ecc_parameter.b.size++;
+ EXPECT_EQ(kEpidBadArgErr, WriteTpm2FfElement(&ecc_parameter, &result));
+}
+
+TEST_F(EpidTpm2Test, WriteTpm2FfElementWorksGivenLargerBufSize) {
+ TPM2B_ECC_PARAMETER ecc_parameter = {0};
+ OctStr256 result = {0};
+ THROW_ON_EPIDERR(ReadTpm2FfElement((OctStr256*)this->kTpmFfElemStrData.data(),
+ &ecc_parameter));
+
+ std::vector<uint8_t> expected(ecc_parameter.b.size);
+ for (size_t i = 1; i < expected.size(); ++i) {
+ expected[i] = this->kTpmFfElemStrData[i - 1];
+ }
+ ecc_parameter.b.size--;
+ expected[0] = 0x00;
+ EXPECT_EQ(kEpidNoErr, WriteTpm2FfElement(&ecc_parameter, &result));
+
+ EXPECT_EQ(*(OctStr256*)expected.data(), result);
+}
+
+TEST_F(EpidTpm2Test, WriteTpm2FfElementWorksGivenValidArguments) {
+ TPM2B_ECC_PARAMETER ecc_parameter = {0};
+ OctStr256 result = {0};
+ THROW_ON_EPIDERR(ReadTpm2FfElement((OctStr256*)this->kTpmFfElemStrData.data(),
+ &ecc_parameter));
+
+ EXPECT_EQ(kEpidNoErr, WriteTpm2FfElement(&ecc_parameter, &result));
+ EXPECT_EQ(*(OctStr256*)this->kTpmFfElemStrData.data(), result);
+}
+
+////////////////////////////////////////////////
+// ReadTpmFromEcPoint
+TEST_F(EpidTpm2Test, ReadTpm2EcPointFailsGivenNullPointer) {
+ TPM2B_ECC_POINT tpm_point;
+
+ EXPECT_EQ(kEpidBadArgErr, ReadTpm2EcPoint(nullptr, &tpm_point));
+ EXPECT_EQ(kEpidBadArgErr, ReadTpm2EcPoint(&this->kEpidPointStr, nullptr));
+}
+
+TEST_F(EpidTpm2Test, ReadTpm2EcPointWorksGivenValidArguments) {
+ TPM2B_ECC_POINT tpm_point;
+
+ EXPECT_EQ(kEpidNoErr, ReadTpm2EcPoint(&this->kEpidPointStr, &tpm_point));
+
+ EXPECT_EQ(this->kEpidPointStr, tpm_point);
+}
+
+////////////////////////////////////////////////
+// WriteTpm2EcPoint
+TEST_F(EpidTpm2Test, WriteTpm2EcPointFailsGivenNullPointer) {
+ TPM2B_ECC_POINT tpm_point;
+ G1ElemStr str = {0};
+ EXPECT_EQ(kEpidBadArgErr, WriteTpm2EcPoint(nullptr, &str));
+ EXPECT_EQ(kEpidBadArgErr, WriteTpm2EcPoint(&tpm_point, nullptr));
+}
+
+TEST_F(EpidTpm2Test, WriteTpm2EcPointWorksGivenValidArguments) {
+ TPM2B_ECC_POINT tpm_point;
+ G1ElemStr str = {0};
+ EXPECT_EQ(kEpidNoErr, ReadTpm2EcPoint(&this->kEpidPointStr, &tpm_point));
+
+ EXPECT_EQ(kEpidNoErr, WriteTpm2EcPoint(&tpm_point, &str));
+
+ EXPECT_EQ(str, tpm_point);
+}
diff --git a/epid/member/tpm2/unittests/createprimary-tss-test.cc b/epid/member/tpm2/unittests/createprimary-tss-test.cc
new file mode 100644
index 0000000..5a69eda
--- /dev/null
+++ b/epid/member/tpm2/unittests/createprimary-tss-test.cc
@@ -0,0 +1,69 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// TPM2_CreatePrimary unit tests.
+/*! \file */
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/createprimary.h"
+#include "epid/member/tpm2/ibm_tss/state.h"
+}
+namespace {
+
+TEST_F(EpidTpm2Test, CreatePrimaryOnTssFailsGivenNullParameters) {
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tss(nullptr, nullptr, nullptr, epid2params);
+ G1ElemStr res = {0};
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tss, kSha256));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2CreatePrimary(tss, nullptr));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2CreatePrimary(nullptr, &res));
+}
+TEST_F(EpidTpm2Test, DISABLED_CreatePrimaryOnTssWorks) {
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tss(nullptr, nullptr, nullptr, epid2params);
+ G1ElemStr res = {0};
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tss, kSha256));
+ EXPECT_EQ(kEpidNoErr, Tpm2CreatePrimary(tss, &res));
+ G1ElemStr expected = {
+ // public x
+ 0x42, 0xd6, 0xff, 0xae, 0xd2, 0x4b, 0xda, 0x8d, 0xce, 0x78, 0x57, 0xd6,
+ 0xf2, 0x19, 0xa6, 0x2d, 0x04, 0x0c, 0xc6, 0xcc, 0x2d, 0x76, 0xde, 0x27,
+ 0x2f, 0x52, 0x59, 0xfb, 0xf3, 0x35, 0x0a, 0xc6,
+
+ // public y
+ 0x38, 0x71, 0x6c, 0x16, 0x6a, 0xea, 0x0e, 0xc8, 0x7e, 0x3d, 0x62, 0x79,
+ 0xc2, 0xf8, 0xe5, 0x2e, 0xf1, 0x76, 0x89, 0x05, 0xe7, 0x76, 0xd6, 0x6f,
+ 0x44, 0xc4, 0x36, 0x2a, 0x40, 0xb1, 0x14, 0x64,
+ };
+ Tpm2Ctx* tmp = tss;
+ EcPoint* point = NULL;
+ THROW_ON_EPIDERR(NewEcPoint(tmp->epid2_params->G1, &point));
+ EXPECT_EQ(kEpidNoErr,
+ ReadEcPoint(tmp->epid2_params->G1, &res, sizeof(res), point));
+ DeleteEcPoint(&point);
+ EXPECT_EQ(expected, res);
+}
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/getrandom-simulator-test.cc b/epid/member/tpm2/unittests/getrandom-simulator-test.cc
new file mode 100644
index 0000000..da6c274
--- /dev/null
+++ b/epid/member/tpm2/unittests/getrandom-simulator-test.cc
@@ -0,0 +1,53 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM GetRandom unit tests.
+/*! \file */
+#include <vector>
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/getrandom.h"
+}
+
+namespace {
+//////////////////////////////////////////////////////////////////////////
+// Tpm2GetRandom Tests
+
+// Test if GetRandom can get deterministic data for known seed
+TEST_F(EpidTpm2Test, GetRandomGetsExpectedDataForGivenSeed) {
+ std::vector<uint8_t> expected_digest = {
+ 0x76, 0x90, 0x2c, 0x3b, 0xa5, 0x25, 0xd7, 0x1e, 0x66, 0x67, 0xaa, 0xb9,
+ 0x80, 0x50, 0x9c, 0x17, 0x65, 0x19, 0x06, 0x2a, 0x53, 0x49, 0x7d, 0x1b,
+ 0xe5, 0xf4, 0xec, 0xf3, 0xf0, 0x69, 0x81, 0xdc, 0x0f, 0x5a, 0x6f, 0x1c,
+ 0xb3, 0x78, 0xa8, 0xea, 0x6b, 0xab, 0x1d, 0xc7, 0xd6, 0x1a, 0x10, 0x1a};
+ std::vector<uint8_t> output(48);
+ Prng my_prng;
+ my_prng.set_seed(0x1234);
+ Epid2ParamsObj epid2params;
+ int num_bits = (int)expected_digest.size() * 8;
+ Tpm2CtxObj tpm2(&Prng::Generate, &my_prng, NULL, epid2params);
+ my_prng.set_seed(0x1234);
+ EXPECT_EQ(kEpidNoErr, Tpm2GetRandom(tpm2, num_bits, output.data()));
+ EXPECT_EQ(expected_digest, output);
+}
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/getrandom-test.cc b/epid/member/tpm2/unittests/getrandom-test.cc
new file mode 100644
index 0000000..3bde88b
--- /dev/null
+++ b/epid/member/tpm2/unittests/getrandom-test.cc
@@ -0,0 +1,67 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// TPM GetRandom unit tests.
+/*! \file */
+#include <vector>
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/getrandom.h"
+}
+
+namespace {
+//////////////////////////////////////////////////////////////////////////
+// Tpm2GetRandom Tests
+TEST_F(EpidTpm2Test, GetRandomFailsGivenNullParameters) {
+ uint8_t output[48] = {0};
+ Prng my_prng;
+ my_prng.set_seed(0x1234);
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ EXPECT_EQ(kEpidBadArgErr, Tpm2GetRandom(nullptr, 48 * 8, output));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2GetRandom(tpm, 48 * 8, nullptr));
+}
+
+TEST_F(EpidTpm2Test, GetRandomReturnsDifferentBufs) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ int length = 10;
+ std::vector<uint8_t> buf1(length, (uint8_t)0);
+ std::vector<uint8_t> buf2(length, (uint8_t)0);
+ EXPECT_EQ(kEpidNoErr, Tpm2GetRandom(tpm, length * CHAR_BIT, buf1.data()));
+ EXPECT_EQ(kEpidNoErr, Tpm2GetRandom(tpm, length * CHAR_BIT, buf2.data()));
+ EXPECT_NE(buf1, buf2);
+}
+
+TEST_F(EpidTpm2Test, GetRandomCanGenerateLongStream) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ int length = 1000;
+ std::vector<uint8_t> zeros(length, (uint8_t)0);
+ std::vector<uint8_t> buf = zeros;
+ EXPECT_EQ(kEpidNoErr, Tpm2GetRandom(tpm, length * CHAR_BIT, buf.data()));
+ EXPECT_NE(buf, zeros);
+}
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/getrandom-tss-test.cc b/epid/member/tpm2/unittests/getrandom-tss-test.cc
new file mode 100644
index 0000000..021fce4
--- /dev/null
+++ b/epid/member/tpm2/unittests/getrandom-tss-test.cc
@@ -0,0 +1,44 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// TPM Context unit tests.
+/*! \file */
+
+#include <limits.h>
+#include <stdint.h>
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/getrandom.h"
+}
+
+namespace {
+
+TEST_F(EpidTpm2Test, GetRandomOnTssReturnsDifferentBufs) {
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tss(nullptr, nullptr, nullptr, epid2params);
+ size_t length = 10;
+ std::vector<uint8_t> buf1(length, (uint8_t)0);
+ std::vector<uint8_t> buf2(length, (uint8_t)0);
+ EXPECT_EQ(kEpidNoErr, Tpm2GetRandom(tss, length * CHAR_BIT, buf1.data()));
+ EXPECT_EQ(kEpidNoErr, Tpm2GetRandom(tss, length * CHAR_BIT, buf2.data()));
+ EXPECT_NE(buf1, buf2);
+}
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/load_external-simulator-test.cc b/epid/member/tpm2/unittests/load_external-simulator-test.cc
new file mode 100644
index 0000000..ec58080
--- /dev/null
+++ b/epid/member/tpm2/unittests/load_external-simulator-test.cc
@@ -0,0 +1,58 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2LoadExternal unit tests.
+/*! \file */
+
+#include <stdint.h>
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/tpm2/load_external.h"
+}
+
+namespace {
+//////////////////////////////////////////////////////////////////////////
+// Tpm2LoadExternal Tests
+TEST_F(EpidTpm2Test, LoadExternalCanLoadFValueSha384) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj ctx(&Prng::Generate, &my_prng, &f_str, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(ctx, kSha384));
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(ctx, &f_str));
+}
+TEST_F(EpidTpm2Test, LoadExternalCanLoadFValueSha512) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj ctx(&Prng::Generate, &my_prng, &f_str, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(ctx, kSha512));
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(ctx, &f_str));
+}
+TEST_F(EpidTpm2Test, LoadExternalCanLoadFValueSha512_256) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj ctx(&Prng::Generate, &my_prng, &f_str, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(ctx, kSha512_256));
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(ctx, &f_str));
+}
+} // namespace
diff --git a/epid/member/tpm2/unittests/load_external-test.cc b/epid/member/tpm2/unittests/load_external-test.cc
new file mode 100644
index 0000000..8405e27
--- /dev/null
+++ b/epid/member/tpm2/unittests/load_external-test.cc
@@ -0,0 +1,60 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2LoadExternal unit tests.
+/*! \file */
+
+#include <stdint.h>
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/tpm2/load_external.h"
+}
+
+namespace {
+TEST_F(EpidTpm2Test, SetHashAlgFailsIfHashAlgNotSupported) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj ctx(&Prng::Generate, &my_prng, &f_str, epid2params);
+ EXPECT_EQ(kEpidHashAlgorithmNotSupported, Tpm2SetHashAlg(ctx, kSha3_256));
+ EXPECT_EQ(kEpidHashAlgorithmNotSupported, Tpm2SetHashAlg(ctx, kSha3_384));
+ EXPECT_EQ(kEpidHashAlgorithmNotSupported, Tpm2SetHashAlg(ctx, kSha3_512));
+}
+//////////////////////////////////////////////////////////////////////////
+// Tpm2LoadExternal Tests
+TEST_F(EpidTpm2Test, LoadExternalFailsGivenNullParameters) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj ctx(&Prng::Generate, &my_prng, &f_str, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2LoadExternal(nullptr, &f_str));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2LoadExternal(ctx, nullptr));
+}
+TEST_F(EpidTpm2Test, LoadExternalCanLoadFValueSha256) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f_str = this->kMemberFValue;
+ Tpm2CtxObj ctx(&Prng::Generate, &my_prng, &f_str, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(ctx, &f_str));
+}
+} // namespace
diff --git a/epid/member/tpm2/unittests/main-testhelper.cc b/epid/member/tpm2/unittests/main-testhelper.cc
new file mode 100644
index 0000000..1d49165
--- /dev/null
+++ b/epid/member/tpm2/unittests/main-testhelper.cc
@@ -0,0 +1,64 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// Main entry point for unit tests.
+/*! \file */
+
+#include "epid/common-testhelper/testapp-testhelper.h"
+#include "gtest/gtest.h"
+
+int main(int argc, char** argv) {
+ std::vector<std::string> positive;
+ std::vector<std::string> negative;
+ std::vector<char*> argv_new;
+ argv_new.push_back(argv[0]);
+ bool include_protected = false;
+ bool print_help = false;
+ for (int i = 1; i < argc; i++) {
+ std::string arg(argv[i]);
+ if (arg == std::string("--also_run_protected_tests")) {
+ include_protected = true;
+ } else if (arg == std::string("--help")) {
+ print_help = true;
+ argv_new.push_back(argv[i]);
+ } else if (arg.compare(0, 15, "--gtest_filter=") == 0) {
+ split_filter(&positive, &negative, arg.substr(15));
+ } else {
+ argv_new.push_back(argv[i]);
+ }
+ }
+ if (!include_protected) {
+ negative.push_back("*.*_PROTECTED_*");
+ negative.push_back("*.PROTECTED_*");
+ }
+ std::string filter = join_filter(positive, negative);
+ if (filter != "") {
+ argv_new.push_back(&filter[0]);
+ }
+ int argc_new = (int)argv_new.size();
+ argv_new.push_back(nullptr);
+ testing::InitGoogleTest(&argc_new, argv_new.data());
+ if (print_help) {
+ printf("\n");
+ printf("Custom Options:\n");
+ printf(" --also_run_protected_tests\n");
+ printf(" similar to --gtest_also_run_disabled_tests, but for\n");
+ printf(" protected tests (PROTECTED_ instead of DISABLED_)\n");
+ printf("\n");
+ printf("Protected tests are tests where some data is protected\n");
+ printf("(i.e. hidden) from the code and can only be used indirectly.\n");
+ }
+ return RUN_ALL_TESTS();
+}
diff --git a/epid/member/tpm2/unittests/nv-test.cc b/epid/member/tpm2/unittests/nv-test.cc
new file mode 100644
index 0000000..5c30abf
--- /dev/null
+++ b/epid/member/tpm2/unittests/nv-test.cc
@@ -0,0 +1,326 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM non volatile memory API unit tests.
+/*! \file */
+#include <array>
+#include <cstring>
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/member/tpm2/nv.h"
+}
+
+bool operator==(MembershipCredential const& lhs,
+ MembershipCredential const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+namespace {
+
+TEST(NvTest, CanStoreMembershipCredential) {
+ // Demonstrate NV API usage
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+
+ MembershipCredential const credential = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0x46, 0xc9, 0x69, 0xee, 0xf4, 0x68, 0xe1, 0x5f, 0xac, 0xbf, 0xdd,
+ 0x77, 0xeb, 0x4c, 0xaf, 0x8a, 0x87, 0x68, 0x3f, 0x4e, 0xda, 0xf2,
+ 0x96, 0xec, 0x57, 0x08, 0x90, 0xe8, 0x19, 0x62, 0x54, 0xdb}}},
+ {{{0x1e, 0x52, 0x23, 0x16, 0x91, 0xe4, 0xa8, 0x1d, 0x9a, 0x1b, 0x8a,
+ 0xad, 0x0a, 0xcf, 0x36, 0x4f, 0xae, 0x43, 0xde, 0x62, 0xff, 0xa6,
+ 0x4b, 0xa8, 0x16, 0x24, 0x98, 0x80, 0x82, 0x80, 0x37, 0x77}}}}, // A
+ {{{0x0a, 0x30, 0xae, 0x43, 0xa1, 0xe0, 0xd7, 0xdf, 0x10, 0x5e, 0xaf,
+ 0xd8, 0x5a, 0x61, 0x10, 0x86, 0xd0, 0x9d, 0xb9, 0xe4, 0x46, 0xdd,
+ 0xb7, 0x1b, 0x00, 0x14, 0x7c, 0x6b, 0x13, 0x72, 0xc3, 0x77}}} // x
+ };
+ MembershipCredential data = {0};
+
+ // probe is nv_index is defined
+ if (kEpidNoErr != Tpm2NvRead(tpm, nv_index, sizeof(data), 0, &data)) {
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+ }
+ // write
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2NvWrite(tpm, nv_index, sizeof(credential), 0, &credential));
+
+ // read
+ EXPECT_EQ(kEpidNoErr, Tpm2NvRead(tpm, nv_index, sizeof(data), 0, &data));
+ EXPECT_EQ(credential, data);
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, CanUseOffset) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+
+ std::array<uint8_t, 3> const data1_src = {1, 2, 3};
+ std::array<uint8_t, 5> const data2_src = {4, 5, 6, 7, 8};
+ std::array<uint8_t, 3> data1_dst = {0};
+ std::array<uint8_t, 5> data2_dst = {0};
+
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, data1_src.size() + data2_src.size()));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2NvWrite(tpm, nv_index, data1_src.size(), 0, data1_src.data()));
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2NvWrite(tpm, nv_index, data2_src.size(),
+ (uint16_t)data1_src.size(), data2_src.data()));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2NvRead(tpm, nv_index, data1_dst.size(), 0, data1_dst.data()));
+ EXPECT_EQ(data1_src, data1_dst);
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2NvRead(tpm, nv_index, data2_dst.size(),
+ (uint16_t)data1_dst.size(), data2_dst.data()));
+ EXPECT_EQ(data2_src, data2_dst);
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Tpm2NvDefineSpace Tests
+TEST(NvTest, NvDefineSpaceFailsGivenNullParameters) {
+ uint32_t nv_index = 0x01000000;
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvDefineSpace(nullptr, nv_index, sizeof(MembershipCredential)));
+}
+
+TEST(NvTest, NvDefineSpaceCanAllocateSpace) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvDefineSpaceCatchReDefinition) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000002;
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+ EXPECT_EQ(kEpidDuplicateErr,
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Tpm2NvUndefineSpace Tests
+TEST(NvTest, NvUndefineSpaceFailsGivenNullParameters) {
+ uint32_t nv_index = 0x01000000;
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvUndefineSpace(nullptr, nv_index));
+}
+
+TEST(NvTest, NvUndefineSpaceCanDeallocateSpace) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ MembershipCredential data = {0};
+ THROW_ON_EPIDERR(Tpm2NvDefineSpace(tpm, nv_index, sizeof(data)));
+ EXPECT_EQ(kEpidNoErr, Tpm2NvUndefineSpace(tpm, nv_index));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvRead(tpm, nv_index, sizeof(data), 0, &data));
+}
+
+TEST(NvTest, NvUndefineSpaceCatchReDefinition) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ MembershipCredential const data = {0};
+ EXPECT_EQ(kEpidNoErr, Tpm2NvDefineSpace(tpm, nv_index, sizeof(data)));
+ EXPECT_EQ(kEpidNoErr, Tpm2NvUndefineSpace(tpm, nv_index));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Tpm2NvWrite Tests
+TEST(NvTest, NvWriteFailsGivenNullParameters) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+
+ MembershipCredential const data = {0};
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvWrite(nullptr, nv_index, sizeof(data), 0, &data));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvWrite(tpm, nv_index, sizeof(data), 0, nullptr));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvWriteCanWrite) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+
+ MembershipCredential const data = {0};
+ EXPECT_EQ(kEpidNoErr, Tpm2NvWrite(tpm, nv_index, sizeof(data), 0, &data));
+ EXPECT_EQ(kEpidNoErr, Tpm2NvWrite(tpm, nv_index, sizeof(data) - 1, 1, &data));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvWriteFailsGivenOverflow) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+
+ MembershipCredential const data = {0};
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvWrite(tpm, nv_index, sizeof(data), 1, &data));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvWrite(tpm, nv_index, sizeof(data) + 1, 1, &data));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvWrite(tpm, nv_index, 1, sizeof(MembershipCredential), &data));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvWriteFailsGivenInvalidLength) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+
+ MembershipCredential const data = {0};
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvWrite(tpm, nv_index, 0, 0, &data));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvWriteFailsGivenIndexUndefined) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000003;
+
+ MembershipCredential const data = {0};
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvWrite(tpm, nv_index, 1, 0, &data));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Tpm2NvRead Tests
+TEST(NvTest, NvReadFailsGivenNullParameters) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+
+ MembershipCredential data = {0};
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvRead(nullptr, nv_index, sizeof(data), 0, &data));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvRead(tpm, nv_index, sizeof(data), 0, nullptr));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvReadCanRead) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ std::vector<uint8_t> const data_src = {1, 2, 3, 4, 5, 6, 7, 8};
+ std::vector<uint8_t> data_dst(data_src.size());
+ THROW_ON_EPIDERR(Tpm2NvDefineSpace(tpm, nv_index, data_src.size()));
+ THROW_ON_EPIDERR(
+ Tpm2NvWrite(tpm, nv_index, data_src.size(), 0, data_src.data()));
+
+ EXPECT_EQ(kEpidNoErr, Tpm2NvRead(tpm, nv_index, 3, 0, data_dst.data()));
+ EXPECT_EQ(kEpidNoErr, Tpm2NvRead(tpm, nv_index, data_src.size() - 3, 3,
+ data_dst.data() + 3));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+ EXPECT_EQ(data_src, data_dst);
+}
+
+TEST(NvTest, NvReadFailIfWriteWasNotCalled) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+
+ MembershipCredential data = {0};
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvRead(tpm, nv_index, sizeof(data), 0, &data));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvReadFailsGivenOverflow) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+
+ MembershipCredential data = {0};
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvRead(tpm, nv_index, sizeof(data), 1, &data));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvRead(tpm, nv_index, sizeof(data) + 1, 0, &data));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2NvRead(tpm, nv_index, 1, sizeof(MembershipCredential), &data));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvReadFailsGivenInvalidLength) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000000;
+ THROW_ON_EPIDERR(
+ Tpm2NvDefineSpace(tpm, nv_index, sizeof(MembershipCredential)));
+
+ MembershipCredential data = {0};
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvRead(tpm, nv_index, 0, 0, &data));
+ THROW_ON_EPIDERR(Tpm2NvUndefineSpace(tpm, nv_index));
+}
+
+TEST(NvTest, NvReadFailsGivenIndexUndefined) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+ uint32_t nv_index = 0x01000003;
+
+ MembershipCredential data = {0};
+ EXPECT_EQ(kEpidBadArgErr, Tpm2NvRead(tpm, nv_index, 1, 0, &data));
+}
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/sign-simulator-test.cc b/epid/member/tpm2/unittests/sign-simulator-test.cc
new file mode 100644
index 0000000..d5876d1
--- /dev/null
+++ b/epid/member/tpm2/unittests/sign-simulator-test.cc
@@ -0,0 +1,75 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM Sign unit tests.
+/*! \file */
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/load_external.h"
+#include "epid/member/tpm2/sign.h"
+}
+
+namespace {
+//////////////////////////////////////////////////////////////////////////
+// Tpm2Sign Tests
+
+TEST_F(EpidTpm2Test, SignProducesKnownSignature) {
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj sig_k(&params.fp), sig_s(&params.fp);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+ THROW_ON_EPIDERR(
+ Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter, sig_k, sig_s));
+
+ Prng the_same_prng;
+ FfElementObj f(&params.fp, this->kMemberFValue);
+ FfElementObj t(&params.fp);
+ FfElementObj r1(&params.fp), s_expected(&params.fp);
+ BigNumStr zero = {0};
+ THROW_ON_EPIDERR(
+ FfGetRandom(params.fp, &zero, &Prng::Generate, &the_same_prng, r1));
+ THROW_ON_EPIDERR(ReadFfElement(params.fp, this->kDigestSha256,
+ sizeof(this->kDigestSha256), t));
+ THROW_ON_EPIDERR(FfMul(params.fp, f, t, s_expected));
+ THROW_ON_EPIDERR(FfAdd(params.fp, r1, s_expected, s_expected));
+ FpElemStr s_expected_str = {0};
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, s_expected, &s_expected_str,
+ sizeof(s_expected_str)));
+
+ FpElemStr s_str = {0};
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, sig_s, &s_str, sizeof(s_str)));
+ EXPECT_EQ(s_expected_str, s_str);
+}
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/sign-test.cc b/epid/member/tpm2/unittests/sign-test.cc
new file mode 100644
index 0000000..a04a444
--- /dev/null
+++ b/epid/member/tpm2/unittests/sign-test.cc
@@ -0,0 +1,320 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// TPM Sign unit tests.
+/*! \file */
+#include <climits>
+
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+extern "C" {
+#include "epid/common/src/hashsize.h"
+#include "epid/common/src/memory.h"
+#include "epid/member/tpm2/commit.h"
+#include "epid/member/tpm2/load_external.h"
+#include "epid/member/tpm2/sign.h"
+}
+
+namespace {
+//////////////////////////////////////////////////////////////////////////
+// Tpm2Sign Tests
+// Verify signature computed by TPM ECDAA scheme:
+// sign_k ?= digest mod p
+// point^sign_s ?= random_exp * private_exp^sign_k
+bool IsSignatureValid(void const* digest, size_t digest_len,
+ FfElement const* sign_k, FfElement const* sign_s,
+ EcPoint const* point, EcPoint const* private_exp,
+ EcPoint const* random_exp, HashAlg hash_alg) {
+ (void)hash_alg;
+
+ Epid20Params params;
+
+ BigNumObj digest_bn(digest_len);
+ THROW_ON_EPIDERR(ReadBigNum(digest, digest_len, digest_bn));
+ FfElementObj t(&params.fp);
+ THROW_ON_EPIDERR(InitFfElementFromBn(params.fp, digest_bn, t));
+ FpElemStr t_str, sign_k_str;
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, t, &t_str, sizeof(t_str)));
+ THROW_ON_EPIDERR(
+ WriteFfElement(params.fp, sign_k, &sign_k_str, sizeof(sign_k_str)));
+ if (!(t_str == sign_k_str)) return false;
+
+ BigNumStr exp;
+ // v1 = p2^s
+ EcPointObj v1(&params.G1);
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, sign_s, &exp, sizeof(exp)));
+ THROW_ON_EPIDERR(EcExp(params.G1, point, &exp, v1));
+ // v2 = k^sign_k
+ EcPointObj v2(&params.G1);
+ THROW_ON_EPIDERR(WriteFfElement(params.fp, sign_k, &exp, sizeof(exp)));
+ THROW_ON_EPIDERR(EcExp(params.G1, private_exp, &exp, v2));
+ // v2 = l * k^digest
+ THROW_ON_EPIDERR(EcMul(params.G1, random_exp, v2, v2));
+ // v1 ?= v2
+ G1ElemStr v1_str, v2_str;
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, v1, &v1_str, sizeof(v1_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, v2, &v2_str, sizeof(v2_str)));
+ return v1_str == v2_str;
+}
+
+TEST_F(EpidTpm2Test, SignProducesValidSignature) {
+ Epid20Params params;
+
+ // create TPM context
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f = this->kMemberFValue;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &f, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ // load f value
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f));
+
+ // commit(P1=p2, P2=p2) => k = p2^f, l = p2^r, e = p2^r
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ EcPointObj p2(&params.G1, kP2Sha256Str);
+ EcPointObj p2_exp_f(&params.G1, kP2Sha256ExpF);
+
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ uint16_t counter = 0;
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k, l, e, &counter));
+
+ // sign(digest) => sign_k = sign_k, sign_s = r + c * f,
+ // where c = H(sign_k||digest)
+ FfElementObj sign_k(&params.fp), sign_s(&params.fp);
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter, sign_k, sign_s));
+
+ EXPECT_TRUE(IsSignatureValid(this->kDigestSha256, sizeof(this->kDigestSha256),
+ sign_k, sign_s, p2, k, l, kSha256));
+}
+
+TEST_F(EpidTpm2Test, SignProducesValidSignatureTwoTimes) {
+ Epid20Params params;
+
+ // create TPM context
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f = this->kMemberFValue;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &f, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ // load f value
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f));
+
+ // commit(P1=p2, P2=p2) => k = p2^f, l = p2^r, e = p2^r
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ EcPointObj p2(&params.G1, kP2Sha256Str);
+ EcPointObj p2_exp_f(&params.G1, kP2Sha256ExpF);
+
+ EcPointObj k1(&params.G1), l1(&params.G1), e1(&params.G1);
+ EcPointObj k2(&params.G1), l2(&params.G1), e2(&params.G1);
+ uint16_t ctr1 = 0, ctr2 = 0;
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k1, l1, e1, &ctr1));
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k2, l2, e2, &ctr2));
+
+ // sign(digest) => sign_k = sign_k, sign_s = r + c * f,
+ // where c = H(sign_k||digest)
+ FfElementObj sign_k1(&params.fp), sign_s1(&params.fp);
+ FfElementObj sign_k2(&params.fp), sign_s2(&params.fp);
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ ctr1, sign_k1, sign_s1));
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ ctr2, sign_k2, sign_s2));
+
+ EXPECT_TRUE(IsSignatureValid(this->kDigestSha256, sizeof(this->kDigestSha256),
+ sign_k1, sign_s1, p2, k1, l1, kSha256));
+ EXPECT_TRUE(IsSignatureValid(this->kDigestSha256, sizeof(this->kDigestSha256),
+ sign_k2, sign_s2, p2, k2, l2, kSha256));
+}
+
+TEST_F(EpidTpm2Test, SignFailsGivenNullParameters) {
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj sig_k(&params.fp), sig_s(&params.fp);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+ THROW_ON_EPIDERR(
+ Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
+
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(nullptr, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter, sig_k, sig_s));
+ EXPECT_EQ(kEpidBadArgErr, Tpm2Sign(tpm, nullptr, sizeof(this->kDigestSha256),
+ counter, sig_k, sig_s));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter, sig_k, nullptr));
+}
+
+TEST_F(EpidTpm2Test, SignFailsGivenInvalidDigestLen) {
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj sig_k(&params.fp), sig_s(&params.fp);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+ THROW_ON_EPIDERR(
+ Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
+
+ uint8_t digest[EPID_SHA256_DIGEST_BITSIZE / CHAR_BIT + 1] = {0};
+ EXPECT_EQ(kEpidBadArgErr, Tpm2Sign(tpm, digest, 0, counter, sig_k, sig_s));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, digest, EPID_SHA256_DIGEST_BITSIZE / CHAR_BIT + 1,
+ counter, sig_k, sig_s));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, digest, EPID_SHA256_DIGEST_BITSIZE / CHAR_BIT - 1,
+ counter, sig_k, sig_s));
+}
+
+TEST_F(EpidTpm2Test, SignFailsGivenUnrecognizedCounter) {
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj sig_k(&params.fp), sig_s(&params.fp);
+ uint16_t counter = 0;
+ uint16_t zero = 0;
+ uint16_t one = 1;
+ uint16_t minus_one = (uint16_t)-1;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ zero, sig_k, sig_s));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256), one,
+ sig_k, sig_s));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ minus_one, sig_k, sig_s));
+
+ THROW_ON_EPIDERR(
+ Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
+
+ uint16_t counter_plus_1 = counter + 1;
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter_plus_1, sig_k, sig_s));
+ THROW_ON_EPIDERR(Tpm2ReleaseCounter(tpm, counter));
+}
+
+TEST_F(EpidTpm2Test, SignFailsGivenPreviouslyUsedCounter) {
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj sig_k(&params.fp), sig_s(&params.fp);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &this->kMemberFValue, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ THROW_ON_EPIDERR(Tpm2LoadExternal(tpm, &this->kMemberFValue));
+ THROW_ON_EPIDERR(
+ Tpm2Commit(tpm, nullptr, nullptr, 0, nullptr, k, l, e, &counter));
+
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter, sig_k, sig_s));
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter, sig_k, sig_s));
+}
+
+TEST_F(EpidTpm2Test, SignFailsIfKeyNotSet) {
+ Epid20Params params;
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ FfElementObj sig_k(&params.fp), sig_s(&params.fp);
+ uint16_t counter = 0;
+
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter, sig_k, sig_s));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Tpm2ReleaseCounter Tests
+TEST_F(EpidTpm2Test, ReleaseCounterFailsGivenNullPtr) {
+ // create TPM context
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f = this->kMemberFValue;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &f, epid2params);
+ uint16_t ctr = 0;
+
+ EXPECT_EQ(kEpidBadArgErr, Tpm2ReleaseCounter(nullptr, ctr));
+}
+TEST_F(EpidTpm2Test, ReleaseCounterSuccessfullyReleasesCounter) {
+ Epid20Params params;
+
+ // create TPM context
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ FpElemStr f = this->kMemberFValue;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, &f, epid2params);
+ THROW_ON_EPIDERR(Tpm2SetHashAlg(tpm, kSha256));
+ // load f value
+ EXPECT_EQ(kEpidNoErr, Tpm2LoadExternal(tpm, &f));
+
+ // commit(P1=p2, P2=p2) => k = p2^f, l = p2^r, e = p2^r
+ FfElementObj y2(&params.fq, this->kY2Sha256Str);
+ EcPointObj p2(&params.G1, kP2Sha256Str);
+ EcPointObj p2_exp_f(&params.G1, kP2Sha256ExpF);
+
+ EcPointObj k(&params.G1), l(&params.G1), e(&params.G1);
+ uint16_t counter = 0;
+ EXPECT_EQ(kEpidNoErr,
+ Tpm2Commit(tpm, p2, this->kS2Sha256.data(), this->kS2Sha256.size(),
+ y2, k, l, e, &counter));
+ EXPECT_EQ(kEpidNoErr, Tpm2ReleaseCounter(tpm, counter));
+
+ // sign(digest) => sign_k = sign_k, sign_s = r + c * f,
+ // where c = H(sign_k||digest)
+ FfElementObj sign_k(&params.fp), sign_s(&params.fp);
+ EXPECT_EQ(kEpidBadArgErr,
+ Tpm2Sign(tpm, this->kDigestSha256, sizeof(this->kDigestSha256),
+ counter, sign_k, sign_s));
+}
+
+} // namespace
diff --git a/epid/member/tpm2/unittests/tpm2-testhelper.cc b/epid/member/tpm2/unittests/tpm2-testhelper.cc
new file mode 100644
index 0000000..1190936
--- /dev/null
+++ b/epid/member/tpm2/unittests/tpm2-testhelper.cc
@@ -0,0 +1,157 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM fixture class implementation.
+/*! \file */
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+
+#include <climits>
+#include <cstring>
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+
+extern "C" {
+#include "epid/common/types.h"
+}
+
+bool operator==(FpElemStr const& lhs, FpElemStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+bool operator==(G1ElemStr const& lhs, G1ElemStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+const std::vector<uint8_t> EpidTpm2Test::kTpmFfElemStrData = {
+ 0x98, 0x34, 0x87, 0x6d, 0xcf, 0xb0, 0x5c, 0xb1, 0x67, 0xa5, 0xc2,
+ 0x49, 0x53, 0xeb, 0xa5, 0x8c, 0x4a, 0xc8, 0x9b, 0x1a, 0xdf, 0x57,
+ 0xf2, 0x8f, 0x2f, 0x9d, 0x09, 0xaf, 0x10, 0x7e, 0xe8, 0xf0};
+
+const G1ElemStr EpidTpm2Test::kEpidPointStr = {
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
+
+const uint8_t
+ EpidTpm2Test::kDigestSha256[EPID_SHA256_DIGEST_BITSIZE / CHAR_BIT] = {
+ 0x11, 0x40, 0xb5, 0x6c, 0x6d, 0x47, 0x09, 0x0b, 0x05, 0xd6, 0x43,
+ 0x56, 0xe0, 0x7c, 0xc6, 0x8e, 0xa1, 0x65, 0x67, 0xfd, 0xa7, 0x07,
+ 0x87, 0x9b, 0x36, 0x2d, 0x41, 0x35, 0x63, 0x61, 0x31, 0x22};
+
+const FpElemStr EpidTpm2Test::kMemberFValue = {
+ 0x48, 0x40, 0xb5, 0x6c, 0x6d, 0x47, 0x09, 0x0b, 0x05, 0xd6, 0x43,
+ 0x56, 0xe0, 0x7c, 0xc6, 0x8e, 0xa1, 0x65, 0x67, 0xfd, 0xa7, 0x07,
+ 0x87, 0x9b, 0x36, 0x2d, 0x41, 0x35, 0x63, 0x61, 0x31, 0xc7};
+const G1ElemStr EpidTpm2Test::kP1Str = {
+ {{{0x12, 0xA6, 0x5B, 0xD6, 0x91, 0x8D, 0x50, 0xA7, 0x66, 0xEB, 0x7D,
+ 0x52, 0xE3, 0x40, 0x17, 0x60, 0x7F, 0xDF, 0x6C, 0xA1, 0x2C, 0x1A,
+ 0x37, 0xE0, 0x92, 0xC0, 0xF7, 0xB9, 0x76, 0xAB, 0xB1, 0x8A}}},
+ {{{0x78, 0x65, 0x28, 0xCB, 0xAF, 0x07, 0x52, 0x50, 0x55, 0x7A, 0x5F,
+ 0x30, 0x0A, 0xC0, 0xB4, 0x6B, 0xEA, 0x6F, 0xE2, 0xF6, 0x6D, 0x96,
+ 0xF7, 0xCD, 0xC8, 0xD3, 0x12, 0x7F, 0x1F, 0x3A, 0x8B, 0x42}}}};
+const G1ElemStr EpidTpm2Test::kg1Str = {
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}};
+
+const std::vector<uint8_t> EpidTpm2Test::kS2Sha256 = {0, 0, 0, 4,
+ 'a', 'b', 'c'};
+const FqElemStr EpidTpm2Test::kY2Sha256Str = {
+ {{0x8A, 0x43, 0xA1, 0x04, 0xB1, 0x3F, 0x3C, 0xB4, 0xBD, 0x67, 0x38,
+ 0xB1, 0x07, 0xF0, 0x7A, 0x32, 0x7E, 0xCD, 0xF0, 0x2E, 0x62, 0x3E,
+ 0x2C, 0x1F, 0x48, 0xAA, 0x0D, 0x6C, 0xDC, 0x48, 0xF9, 0xF7}}};
+const G1ElemStr EpidTpm2Test::kP2Sha256Str = {
+ {{{0x2E, 0xBB, 0x50, 0x4D, 0x88, 0xFF, 0x25, 0x62, 0xF3, 0x71, 0x65,
+ 0x81, 0xAD, 0xBE, 0x83, 0x6E, 0x54, 0xF5, 0xA6, 0x2A, 0x70, 0xE6,
+ 0x18, 0x6B, 0xD5, 0x4A, 0x10, 0x3C, 0x80, 0x08, 0x95, 0x3D}}},
+ {{{0x8A, 0x43, 0xA1, 0x04, 0xB1, 0x3F, 0x3C, 0xB4, 0xBD, 0x67, 0x38,
+ 0xB1, 0x07, 0xF0, 0x7A, 0x32, 0x7E, 0xCD, 0xF0, 0x2E, 0x62, 0x3E,
+ 0x2C, 0x1F, 0x48, 0xAA, 0x0D, 0x6C, 0xDC, 0x48, 0xF9, 0xF7}}}};
+const G1ElemStr EpidTpm2Test::kP2Sha256ExpF = {
+ {{{0xd0, 0xf3, 0xd9, 0xea, 0x45, 0x24, 0x96, 0xb8, 0x3e, 0x2f, 0xf2,
+ 0x18, 0x12, 0xad, 0xa7, 0xab, 0xe3, 0x1e, 0xff, 0xe7, 0xf7, 0x61,
+ 0x28, 0xae, 0x0a, 0x7c, 0x0f, 0xd9, 0x74, 0x0f, 0x4a, 0x94}}},
+ {{{0xb7, 0xda, 0xd5, 0x97, 0x33, 0xab, 0xb6, 0x3c, 0xf7, 0x3b, 0xec,
+ 0xa4, 0x7f, 0xe6, 0x23, 0xd4, 0xf6, 0xe2, 0x9b, 0xdb, 0xa6, 0xbb,
+ 0xdf, 0xee, 0x62, 0x33, 0xcd, 0x88, 0x25, 0x52, 0xba, 0x99}}}};
+
+const std::vector<uint8_t> EpidTpm2Test::kS2Sha384 = {0, 0, 0, 0,
+ 'a', 'b', 'c'};
+const FqElemStr EpidTpm2Test::kY2Sha384Str = {
+ {{0x0E, 0x86, 0x11, 0x90, 0xAF, 0xEF, 0xEB, 0x79, 0x4B, 0x3E, 0x80,
+ 0x92, 0x94, 0x3B, 0x2F, 0x5E, 0x72, 0x21, 0xEF, 0xF8, 0xBC, 0xE3,
+ 0x48, 0xA9, 0xD0, 0x31, 0x19, 0xAC, 0xD1, 0xD7, 0x49, 0x87}}};
+const G1ElemStr EpidTpm2Test::kP2Sha384Str = {
+ {{{0xE1, 0xC8, 0x28, 0xB1, 0x9A, 0xDF, 0x5D, 0x4B, 0xC4, 0x25, 0x90,
+ 0xFB, 0x38, 0x20, 0xD4, 0x8B, 0x30, 0x8F, 0x95, 0x76, 0xC3, 0x7F,
+ 0x9D, 0xAD, 0x94, 0xC4, 0x31, 0x80, 0xD7, 0xDF, 0xD5, 0xFE}}},
+ {{{0x0E, 0x86, 0x11, 0x90, 0xAF, 0xEF, 0xEB, 0x79, 0x4B, 0x3E, 0x80,
+ 0x92, 0x94, 0x3B, 0x2F, 0x5E, 0x72, 0x21, 0xEF, 0xF8, 0xBC, 0xE3,
+ 0x48, 0xA9, 0xD0, 0x31, 0x19, 0xAC, 0xD1, 0xD7, 0x49, 0x87}}}};
+const G1ElemStr EpidTpm2Test::kP2Sha384ExpF = {
+ {{{0x97, 0x90, 0xaf, 0xe1, 0xc3, 0x7d, 0x6f, 0xf3, 0x71, 0x88, 0x6c,
+ 0x8b, 0x20, 0xc8, 0x50, 0x0d, 0x74, 0x31, 0x2a, 0x7e, 0x7c, 0x8c,
+ 0xba, 0xf1, 0xd9, 0xac, 0x2f, 0xb9, 0x7a, 0xbc, 0xbb, 0x58}}},
+ {{{0xad, 0x2b, 0xcf, 0x14, 0x2f, 0x60, 0xbb, 0xc8, 0xea, 0x9d, 0x8a,
+ 0x54, 0xa6, 0x3b, 0x3b, 0x46, 0x84, 0xdf, 0x72, 0xe2, 0xa9, 0x91,
+ 0x2b, 0x06, 0xe5, 0x7f, 0x63, 0x0e, 0x99, 0x7a, 0xe7, 0xd2}}}};
+
+const std::vector<uint8_t> EpidTpm2Test::kS2Sha512 = {0, 0, 0, 1,
+ 'a', 'b', 'c'};
+const FqElemStr EpidTpm2Test::kY2Sha512Str = {
+ {{0x4C, 0x0E, 0xA7, 0x62, 0x17, 0xB9, 0xFB, 0xE5, 0x21, 0x7D, 0x54,
+ 0x24, 0xE0, 0x2B, 0x87, 0xF7, 0x69, 0x54, 0x0C, 0xC6, 0xAD, 0xF2,
+ 0xF2, 0x7B, 0xE6, 0x91, 0xD8, 0xF3, 0x40, 0x6C, 0x8F, 0x03}}};
+const G1ElemStr EpidTpm2Test::kP2Sha512Str = {
+ {{{0x8C, 0x62, 0xA0, 0x2D, 0x55, 0x55, 0x55, 0x86, 0xBC, 0x82, 0xA6,
+ 0xA2, 0x21, 0x97, 0x9B, 0x9B, 0xB4, 0x03, 0x3D, 0x83, 0xF3, 0xBA,
+ 0xDA, 0x9C, 0x42, 0xF7, 0xB3, 0x94, 0x99, 0x2A, 0x96, 0xE4}}},
+ {{{0x4C, 0x0E, 0xA7, 0x62, 0x17, 0xB9, 0xFB, 0xE5, 0x21, 0x7D, 0x54,
+ 0x24, 0xE0, 0x2B, 0x87, 0xF7, 0x69, 0x54, 0x0C, 0xC6, 0xAD, 0xF2,
+ 0xF2, 0x7B, 0xE6, 0x91, 0xD8, 0xF3, 0x40, 0x6C, 0x8F, 0x03}}}};
+const G1ElemStr EpidTpm2Test::kP2Sha512ExpF = {
+ {{{0xb4, 0xbc, 0x3d, 0x8c, 0x7b, 0xc3, 0x08, 0x89, 0xa3, 0x0e, 0x66,
+ 0x7f, 0x6d, 0x89, 0xab, 0x9b, 0xc4, 0xda, 0x14, 0x93, 0x62, 0x32,
+ 0x0d, 0xe2, 0x95, 0xb5, 0x71, 0x2d, 0x75, 0xbe, 0x63, 0xd4}}},
+ {{{0xf6, 0x20, 0x85, 0x93, 0x3f, 0xfb, 0xf3, 0xad, 0xa9, 0x7e, 0xd3,
+ 0x93, 0x29, 0x22, 0x1b, 0x88, 0x56, 0xf0, 0xbd, 0x62, 0xbd, 0x63,
+ 0x8b, 0xcf, 0xe1, 0x62, 0x83, 0xb6, 0x1c, 0x56, 0x29, 0xc3}}}};
+
+const std::vector<uint8_t> EpidTpm2Test::kS2Sha512256 = {0, 0, 0, 0,
+ 'a', 'b', 'c'};
+const FqElemStr EpidTpm2Test::kY2Sha512256Str = {
+ {{0x30, 0xbe, 0x3f, 0x12, 0x00, 0x74, 0x48, 0xaa, 0x91, 0x90, 0x84,
+ 0x12, 0x4d, 0x58, 0x54, 0xe7, 0x04, 0x65, 0x37, 0x97, 0x88, 0xcf,
+ 0x67, 0xa0, 0x8c, 0x56, 0x93, 0xa7, 0x7f, 0xe8, 0x74, 0xfc}}};
+const G1ElemStr EpidTpm2Test::kP2Sha512256Str = {
+ {{{0x63, 0x28, 0x40, 0x14, 0x73, 0xd5, 0x91, 0xc4, 0xa2, 0xa4, 0xb6,
+ 0xd8, 0xa8, 0x75, 0x21, 0xd1, 0x26, 0x4e, 0x42, 0x13, 0x1f, 0xfa,
+ 0xed, 0x90, 0x8d, 0x56, 0x34, 0x57, 0x8a, 0x3a, 0x47, 0xa0}}},
+ {{{0x30, 0xbe, 0x3f, 0x12, 0x00, 0x74, 0x48, 0xaa, 0x91, 0x90, 0x84,
+ 0x12, 0x4d, 0x58, 0x54, 0xe7, 0x04, 0x65, 0x37, 0x97, 0x88, 0xcf,
+ 0x67, 0xa0, 0x8c, 0x56, 0x93, 0xa7, 0x7f, 0xe8, 0x74, 0xfc}}}};
+const G1ElemStr EpidTpm2Test::kP2Sha512256ExpF = {
+ {{{0xa7, 0xef, 0x09, 0x07, 0x5e, 0xf1, 0xce, 0x85, 0xe8, 0x85, 0x03,
+ 0xbe, 0xdd, 0x2e, 0x32, 0x25, 0xab, 0x58, 0x90, 0xc4, 0x59, 0x60,
+ 0x1c, 0x17, 0x3b, 0x8c, 0x62, 0x35, 0xd3, 0x9f, 0x77, 0x8f}}},
+ {{{0x38, 0xce, 0x8b, 0x36, 0xc1, 0xb1, 0xae, 0xc5, 0x61, 0x60, 0x12,
+ 0xf0, 0x5b, 0xc1, 0xb8, 0x5e, 0xf3, 0xb9, 0xa6, 0x26, 0x7f, 0x27,
+ 0x5b, 0x78, 0x61, 0x27, 0xe6, 0x0b, 0x38, 0x37, 0x89, 0x56}}}};
diff --git a/epid/member/tpm2/unittests/tpm2-testhelper.h b/epid/member/tpm2/unittests/tpm2-testhelper.h
new file mode 100644
index 0000000..208a343
--- /dev/null
+++ b/epid/member/tpm2/unittests/tpm2-testhelper.h
@@ -0,0 +1,78 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// TPM fixture class.
+/*! \file */
+#ifndef EPID_MEMBER_TPM2_UNITTESTS_TPM2_TESTHELPER_H_
+#define EPID_MEMBER_TPM2_UNITTESTS_TPM2_TESTHELPER_H_
+
+#include <stdint.h>
+#include <climits>
+#include <vector>
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2_wrapper-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/common/bitsupplier.h"
+#include "epid/common/src/hashsize.h"
+#include "epid/member/tpm2/context.h"
+}
+
+typedef struct FqElemStr FqElemStr;
+typedef struct FpElemStr FpElemStr;
+typedef struct G1ElemStr G1ElemStr;
+
+/// Test fixture class for Tpm
+class EpidTpm2Test : public ::testing::Test {
+ public:
+ // tpm digest
+ static const std::vector<uint8_t> kTpmFfElemStrData;
+ static const G1ElemStr kEpidPointStr;
+ static const uint8_t kDigestSha256[EPID_SHA256_DIGEST_BITSIZE / CHAR_BIT];
+
+ static const FpElemStr kMemberFValue;
+ static const G1ElemStr kP1Str;
+ static const G1ElemStr kg1Str;
+ static const std::vector<uint8_t> kS2Sha256;
+ static const FqElemStr kY2Sha256Str;
+ static const G1ElemStr kP2Sha256Str;
+ static const G1ElemStr kP2Sha256ExpF;
+ static const std::vector<uint8_t> kS2Sha384;
+ static const FqElemStr kY2Sha384Str;
+ static const G1ElemStr kP2Sha384Str;
+ static const G1ElemStr kP2Sha384ExpF;
+ static const std::vector<uint8_t> kS2Sha512;
+ static const FqElemStr kY2Sha512Str;
+ static const G1ElemStr kP2Sha512Str;
+ static const G1ElemStr kP2Sha512ExpF;
+ static const std::vector<uint8_t> kS2Sha512256;
+ static const FqElemStr kY2Sha512256Str;
+ static const G1ElemStr kP2Sha512256Str;
+ static const G1ElemStr kP2Sha512256ExpF;
+ /// setup called before each TEST_F starts
+ virtual void SetUp() {}
+ /// teardown called after each TEST_F finishes
+ virtual void TearDown() {}
+};
+
+/// compares FpElemStr values
+bool operator==(FpElemStr const& lhs, FpElemStr const& rhs);
+
+/// compares G1ElemStr values
+bool operator==(G1ElemStr const& lhs, G1ElemStr const& rhs);
+
+#endif // EPID_MEMBER_TPM2_UNITTESTS_TPM2_TESTHELPER_H_
diff --git a/epid/member/tpm2/unittests/tpm2_wrapper-testhelper.cc b/epid/member/tpm2/unittests/tpm2_wrapper-testhelper.cc
new file mode 100644
index 0000000..6090c47
--- /dev/null
+++ b/epid/member/tpm2/unittests/tpm2_wrapper-testhelper.cc
@@ -0,0 +1,61 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2Ctx wrapper class implementation.
+/*! \file */
+#include "epid/member/tpm2/unittests/tpm2_wrapper-testhelper.h"
+
+#include <cstring>
+#include <string>
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/mem_params-testhelper.h"
+
+extern "C" {
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/hashsize.h"
+#include "epid/common/stdtypes.h"
+#include "epid/common/types.h"
+#include "epid/member/tpm2/context.h"
+#include "epid/member/tpm2/sign.h"
+}
+
+Tpm2CtxObj::Tpm2CtxObj(BitSupplier rnd_func, void* rnd_param,
+ const FpElemStr* f, Epid2ParamsObj const& params)
+ : ctx_(nullptr) {
+ EpidStatus sts = kEpidNoErr;
+ BitSupplier rnd_func_ = NULL;
+ void* rnd_param_ = NULL;
+ const FpElemStr* f_ = NULL;
+ MemberParams mem_params = {0};
+ SetMemberParams(rnd_func, rnd_param, f, &mem_params);
+
+ sts = Tpm2CreateContext(&mem_params, params, &rnd_func_, &rnd_param_, &f_,
+ &ctx_);
+ if (kEpidNoErr != sts) {
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "Tpm2CreateContext()");
+ }
+}
+
+Tpm2CtxObj::~Tpm2CtxObj() { Tpm2DeleteContext(&ctx_); }
+
+Tpm2Ctx* Tpm2CtxObj::ctx() const { return ctx_; }
+
+Tpm2CtxObj::operator Tpm2Ctx*() const { return ctx_; }
+
+Tpm2CtxObj::operator const Tpm2Ctx*() const { return ctx_; }
diff --git a/epid/member/tpm2/unittests/tpm2_wrapper-testhelper.h b/epid/member/tpm2/unittests/tpm2_wrapper-testhelper.h
new file mode 100644
index 0000000..0e9904f
--- /dev/null
+++ b/epid/member/tpm2/unittests/tpm2_wrapper-testhelper.h
@@ -0,0 +1,58 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// Tpm2Ctx wrapper class.
+/*! \file */
+#ifndef EPID_MEMBER_TPM2_UNITTESTS_TPM2_WRAPPER_TESTHELPER_H_
+#define EPID_MEMBER_TPM2_UNITTESTS_TPM2_WRAPPER_TESTHELPER_H_
+
+#include <stdint.h>
+#include <vector>
+
+extern "C" {
+#include "epid/common/bitsupplier.h"
+#include "epid/common/types.h"
+}
+
+typedef struct Tpm2Ctx Tpm2Ctx;
+class Epid2ParamsObj;
+
+/// C++ Wrapper to manage memory for Tpm2Ctx via RAII
+class Tpm2CtxObj {
+ public:
+ /// Create a Tpm2Ctx
+ Tpm2CtxObj(BitSupplier rnd_func, void* rnd_param, const FpElemStr* f,
+ class Epid2ParamsObj const& params);
+
+ // This class instances are not meant to be copied.
+ // Explicitly delete copy constructor and assignment operator.
+ Tpm2CtxObj(const Tpm2CtxObj&) = delete;
+ Tpm2CtxObj& operator=(const Tpm2CtxObj&) = delete;
+
+ /// Destroy the Tpm2Ctx
+ ~Tpm2CtxObj();
+ /// get a pointer to the stored Tpm2Ctx
+ Tpm2Ctx* ctx() const;
+ /// cast operator to get the pointer to the stored Tpm2Ctx
+ operator Tpm2Ctx*() const;
+ /// const cast operator to get the pointer to the stored Tpm2Ctx
+ operator const Tpm2Ctx*() const;
+
+ private:
+ /// The stored Tpm2Ctx
+ Tpm2Ctx* ctx_;
+};
+
+#endif // EPID_MEMBER_TPM2_UNITTESTS_TPM2_WRAPPER_TESTHELPER_H_
diff --git a/epid/member/tpm_member.h b/epid/member/tpm_member.h
new file mode 100644
index 0000000..372377d
--- /dev/null
+++ b/epid/member/tpm_member.h
@@ -0,0 +1,48 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+/// Member creation parameters for TPM implementation.
+/*!
+ * \file
+ */
+#ifndef EPID_MEMBER_TPM_MEMBER_H_
+#define EPID_MEMBER_TPM_MEMBER_H_
+/*!
+* \cond
+*/
+
+#include "epid/common/bitsupplier.h"
+#include "epid/common/types.h"
+
+/*!
+\addtogroup EpidMemberModule member
+@{
+*/
+
+/// TPM specific member parameters
+/*!
+ \class TPMMemberParams
+*/
+typedef struct MemberParams {
+ FpElemStr const* f; ///< Secret part of the private key. If NULL an
+ /// EPS based primary will be used.
+} MemberParams;
+
+/*!
+ * @}
+ * \endcond
+ */
+
+#endif // EPID_MEMBER_TPM_MEMBER_H_
diff --git a/epid/member/unittests/context-test.cc b/epid/member/unittests/context-test.cc
index 5b6d561..fcdb39b 100644
--- a/epid/member/unittests/context-test.cc
+++ b/epid/member/unittests/context-test.cc
@@ -20,20 +20,33 @@
*/
#include <cstring>
#include <vector>
+
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
-#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/mem_params-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
#include "epid/member/unittests/member-testhelper.h"
extern "C" {
#include "epid/member/api.h"
#include "epid/member/src/context.h"
+#include "epid/member/src/storage.h"
+#include "epid/member/src/write_precomp.h"
+#include "epid/member/tpm2/nv.h"
}
bool operator==(MemberPrecomp const& lhs, MemberPrecomp const& rhs) {
return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
}
+/// compares GroupPubKey values
+bool operator==(GroupPubKey const& lhs, GroupPubKey const& rhs);
+
+/// compares MembershipCredential values
+bool operator==(MembershipCredential const& lhs,
+ MembershipCredential const& rhs);
namespace {
//////////////////////////////////////////////////////////////////////////
// EpidMemberDelete Tests
@@ -45,124 +58,76 @@ TEST_F(EpidMemberTest, DeleteWorksGivenNullMemberCtx) {
TEST_F(EpidMemberTest, DeleteNullsMemberCtx) {
MemberCtx* ctx = nullptr;
Prng my_prng;
- EpidMemberCreate(nullptr, &this->kMemberPrivateKey, &this->kMemberPrecomp,
- &Prng::Generate, &my_prng, &ctx);
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ THROW_ON_EPIDERR(EpidMemberCreate(&params, &ctx));
EpidMemberDelete(&ctx);
EXPECT_EQ(nullptr, ctx);
}
+
//////////////////////////////////////////////////////////////////////////
// EpidMemberCreate Tests
// test that create fails if any mandatory parameters are NULL
TEST_F(EpidMemberTest, CreateFailsGivenNullParameters) {
- MemberCtx* member_ctx = nullptr;
+ MemberCtx* ctx = nullptr;
Prng my_prng;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidMemberCreate(nullptr, &this->kMemberPrivateKey, &this->kMemberPrecomp,
- &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
+ MemberParams params = {0};
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberCreate(nullptr, &ctx));
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidMemberCreate(&this->kGroupPublicKey, nullptr, &this->kMemberPrecomp,
- &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberCreate(&params, nullptr));
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidMemberCreate(&this->kGroupPublicKey, &this->kMemberPrivateKey,
- &this->kMemberPrecomp, nullptr, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
-
- EXPECT_EQ(kEpidBadArgErr,
- EpidMemberCreate(&this->kGroupPublicKey, &this->kMemberPrivateKey,
- &this->kMemberPrecomp, &Prng::Generate, &my_prng,
- nullptr));
- EpidMemberDelete(nullptr);
+ SetMemberParams(nullptr, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberCreate(&params, nullptr));
}
-// test that create succeeds with valid parameters
-TEST_F(EpidMemberTest, CreateSucceedsGivenValidParameters) {
- MemberCtx* member_ctx = nullptr;
+TEST_F(EpidMemberTest, CreateFailsGivenInvalidParameters) {
+ MemberCtx* ctx = nullptr;
Prng my_prng;
-
- // pass the whole list of parameters
- EXPECT_EQ(kEpidNoErr,
- EpidMemberCreate(&this->kGroupPublicKey, &this->kMemberPrivateKey,
- &this->kMemberPrecomp, &Prng::Generate, &my_prng,
- &member_ctx));
- EpidMemberDelete(&member_ctx);
-
- // pass the whole list of parameters but member_precomp
- EXPECT_EQ(kEpidNoErr,
- EpidMemberCreate(&this->kGroupPublicKey, &this->kMemberPrivateKey,
- nullptr, &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
-}
-// test that create succeeds with valid IKGF given parameters
-TEST_F(EpidMemberTest, CreateSucceedsGivenValidParametersUsingIKGFData) {
- const GroupPubKey grp_public_key = {
-#include "epid/common-testhelper/testdata/ikgf/groupa/pubkey.inc"
- };
- const PrivKey mbr_private_key = {
-#include "epid/common-testhelper/testdata/ikgf/groupa/member0/mprivkey.inc"
- };
-
- const MemberPrecomp mbr_precomp = {
-#include "epid/common-testhelper/testdata/ikgf/groupa/member0/mprecomp.inc"
+ MemberParams params = {0};
+ FpElemStr f = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
};
+ SetMemberParams(&Prng::Generate, &my_prng, &f, &params);
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberCreate(&params, &ctx));
+ EpidMemberDelete(&ctx);
+}
- MemberCtx* member_ctx = nullptr;
+TEST_F(EpidMemberTest, CreateSucceedsGivenValidParameters) {
+ MemberCtx* ctx = nullptr;
Prng my_prng;
-
- // pass the whole list of parameters
- EXPECT_EQ(kEpidNoErr,
- EpidMemberCreate(&grp_public_key, &mbr_private_key, &mbr_precomp,
- &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
-
- // pass the whole list of parameters but member_precomp
- EXPECT_EQ(kEpidNoErr,
- EpidMemberCreate(&grp_public_key, &mbr_private_key, nullptr,
- &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &ctx));
+ EpidMemberDelete(&ctx);
}
-TEST_F(EpidMemberTest, CreateFailsForInvalidGroupPubKey) {
- MemberCtx* member_ctx = nullptr;
- Prng my_prng;
- GroupPubKey gpk_h1 = this->kGroupPublicKey;
- gpk_h1.h1.x.data.data[0]++;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidMemberCreate(&gpk_h1, &this->kMemberPrivateKey, &this->kMemberPrecomp,
- &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
- GroupPubKey gpk_h2 = this->kGroupPublicKey;
- gpk_h2.h2.x.data.data[0]++;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidMemberCreate(&gpk_h2, &this->kMemberPrivateKey, &this->kMemberPrecomp,
- &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
- GroupPubKey gpk_w = this->kGroupPublicKey;
- gpk_w.w.x[0].data.data[0]++;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidMemberCreate(&gpk_w, &this->kMemberPrivateKey, &this->kMemberPrecomp,
- &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberStartup
+TEST_F(EpidMemberTest, StartupFailsGivenNullParameters) {
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberStartup(nullptr));
}
-TEST_F(EpidMemberTest, CreateFailsForInvalidPrivateKey) {
- MemberCtx* member_ctx = nullptr;
- Prng my_prng;
- PrivKey pk_A = this->kMemberPrivateKey;
- pk_A.A.x.data.data[0]++;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidMemberCreate(&this->kGroupPublicKey, &pk_A, &this->kMemberPrecomp,
- &Prng::Generate, &my_prng, &member_ctx));
- EpidMemberDelete(&member_ctx);
+
+TEST_F(EpidMemberTest, StartupSucceedsGivenValidParameters) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr, EpidProvisionKey(member, &pub_key, &priv_key, nullptr));
+ MembershipCredential credential_expected = member->credential;
+ // reset member credential to test if startup reads them from NV memory
+ // correctly
+ member->pub_key = {0};
+ member->credential = {0};
+ EXPECT_EQ(kEpidNoErr, EpidMemberStartup(member));
+ EXPECT_EQ(pub_key, member->pub_key);
+ EXPECT_EQ(credential_expected, member->credential);
+ EpidMemberDelete(&member);
}
//////////////////////////////////////////////////////////////////////////
@@ -172,32 +137,27 @@ TEST_F(EpidMemberTest, SetHashAlgFailsGivenNullPtr) {
}
TEST_F(EpidMemberTest, CanSetHashAlgoToSHA256) {
Prng my_prng;
- MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
- &Prng::Generate, &my_prng);
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
EXPECT_EQ(kEpidNoErr, EpidMemberSetHashAlg(member_ctx, kSha256));
}
TEST_F(EpidMemberTest, CanSetHashAlgoToSHA384) {
Prng my_prng;
- MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
- &Prng::Generate, &my_prng);
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
EXPECT_EQ(kEpidNoErr, EpidMemberSetHashAlg(member_ctx, kSha384));
}
TEST_F(EpidMemberTest, CanSetHashAlgoToSHA512) {
Prng my_prng;
- MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
- &Prng::Generate, &my_prng);
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
EXPECT_EQ(kEpidNoErr, EpidMemberSetHashAlg(member_ctx, kSha512));
}
TEST_F(EpidMemberTest, CanSetHashAlgoToSHA512256) {
Prng my_prng;
- MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
- &Prng::Generate, &my_prng);
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
EXPECT_EQ(kEpidNoErr, EpidMemberSetHashAlg(member_ctx, kSha512_256));
}
TEST_F(EpidMemberTest, SetHashAlgFailsForNonSupportedAlgorithm) {
Prng my_prng;
- MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
- &Prng::Generate, &my_prng);
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
EXPECT_EQ(kEpidBadArgErr, EpidMemberSetHashAlg(member_ctx, kSha3_256));
EXPECT_EQ(kEpidBadArgErr, EpidMemberSetHashAlg(member_ctx, kSha3_384));
EXPECT_EQ(kEpidBadArgErr, EpidMemberSetHashAlg(member_ctx, kSha3_512));
@@ -306,7 +266,6 @@ TEST_F(EpidMemberTest, SetSigRlPreservesOldRlOnFailure) {
std::vector<uint8_t> sig_data(EpidGetSigSize(sig_rl));
EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
size_t sig_len = sig_data.size() * sizeof(uint8_t);
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member_ctx, kSha256));
// Check that sigrevoked member is still in SigRl
EXPECT_EQ(kEpidSigRevokedInSigRl, EpidSign(member_ctx, msg.data(), msg.size(),
nullptr, 0, sig, sig_len));
@@ -386,6 +345,35 @@ TEST_F(EpidMemberTest, RegisterBaseNameSucceedsGivenUniqueBaseName) {
EXPECT_EQ(kEpidNoErr,
EpidRegisterBaseName(member, basename.data(), basename.size()));
}
+TEST_F(EpidMemberTest, RegisterBaseNameSucceedsGivenMultipleUniqueBaseNames) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ std::vector<uint8_t> basename1 = {'b', 's', 'n', '0', '1'};
+ std::vector<uint8_t> basename2 = {'b', 's', 'n', '0', '2'};
+ std::vector<uint8_t> basename3 = {'b', 's', 'n', '0', '3'};
+ EXPECT_EQ(kEpidNoErr,
+ EpidRegisterBaseName(member, basename1.data(), basename1.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidRegisterBaseName(member, basename2.data(), basename2.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidRegisterBaseName(member, basename3.data(), basename3.size()));
+ // Verify that basenames registered succesfully
+ EXPECT_EQ(kEpidDuplicateErr,
+ EpidRegisterBaseName(member, basename1.data(), basename1.size()));
+ EXPECT_EQ(kEpidDuplicateErr,
+ EpidRegisterBaseName(member, basename2.data(), basename2.size()));
+ EXPECT_EQ(kEpidDuplicateErr,
+ EpidRegisterBaseName(member, basename3.data(), basename3.size()));
+}
+TEST_F(EpidMemberTest,
+ RegisterBaseNameSucceedsGivenBsnContainingAllPossibleBytes) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ EXPECT_EQ(kEpidNoErr, EpidRegisterBaseName(member, this->kData_0_255.data(),
+ this->kData_0_255.size()));
+}
//////////////////////////////////////////////////////////////////////////
// EpidMemberWritePrecomp
TEST_F(EpidMemberTest, MemberWritePrecompFailsGivenNullPointer) {
@@ -397,7 +385,8 @@ TEST_F(EpidMemberTest, MemberWritePrecompFailsGivenNullPointer) {
EXPECT_EQ(kEpidBadArgErr, EpidMemberWritePrecomp(nullptr, &precomp));
EXPECT_EQ(kEpidBadArgErr, EpidMemberWritePrecomp(ctx, nullptr));
}
-TEST_F(EpidMemberTest, MemberWritePrecompSucceedGivenValidArgument) {
+TEST_F(EpidMemberTest,
+ MemberWritePrecompSucceedGivenValidArgumentWithLoadedPrecomp) {
MemberPrecomp precomp;
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
@@ -406,11 +395,16 @@ TEST_F(EpidMemberTest, MemberWritePrecompSucceedGivenValidArgument) {
EXPECT_EQ(kEpidNoErr, EpidMemberWritePrecomp(ctx, &precomp));
MemberPrecomp expected_precomp = this->kMemberPrecomp;
EXPECT_EQ(expected_precomp, precomp);
-
- MemberCtxObj member2(this->kGroupPublicKey, this->kMemberPrivateKey,
- &Prng::Generate, &my_prng);
- MemberCtx* ctx2 = member2;
- EXPECT_EQ(kEpidNoErr, EpidMemberWritePrecomp(ctx2, &precomp));
+}
+TEST_F(EpidMemberTest,
+ MemberWritePrecompSucceedGivenValidArgumentWithCalcPrecomp) {
+ MemberPrecomp precomp;
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ MemberCtx* ctx = member;
+ EXPECT_EQ(kEpidNoErr, EpidMemberWritePrecomp(ctx, &precomp));
+ MemberPrecomp expected_precomp = this->kMemberPrecomp;
EXPECT_EQ(expected_precomp, precomp);
}
TEST_F(EpidMemberTest, DefaultHashAlgIsSha512) {
@@ -421,4 +415,39 @@ TEST_F(EpidMemberTest, DefaultHashAlgIsSha512) {
EXPECT_EQ(kSha512, ctx->hash_alg);
}
+//////////////////////////////////////////////////////////////////////////
+// MemberCanLoadMembershipCredentialFromTpm
+TEST_F(EpidMemberTest, DISABLED_MemberCanLoadMembershipCredentialFromTpm) {
+ // Not clear that this test is valid or in the right place.
+ Prng prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &prng, nullptr, epid2params);
+
+ uint32_t const nv_index = 0x01c10100;
+ MemberCtx* member = nullptr;
+ GroupPubKey pub_key_expected = this->kGrpXKey;
+ GroupPubKey pub_key;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+ MembershipCredential credential_expected = {this->kGrpXMember9PrivKey.gid,
+ this->kGrpXMember9PrivKey.A,
+ this->kGrpXMember9PrivKey.x};
+ MembershipCredential credential;
+ // write credentials
+ THROW_ON_EPIDERR(EpidNvWriteMembershipCredential(
+ tpm, &pub_key_expected, &credential_expected, nv_index));
+
+ // read credentials
+ EXPECT_EQ(kEpidNoErr, EpidNvReadMembershipCredential(tpm, nv_index, &pub_key,
+ &credential));
+ EXPECT_EQ(pub_key_expected, pub_key);
+ EXPECT_EQ(credential_expected, credential);
+
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionCredential(member, &pub_key, &credential, nullptr));
+ EpidMemberDelete(&member);
+ Tpm2NvUndefineSpace(tpm, nv_index);
+}
} // namespace
diff --git a/epid/member/unittests/iskeyvalid-test.cc b/epid/member/unittests/iskeyvalid-test.cc
new file mode 100644
index 0000000..87c8837
--- /dev/null
+++ b/epid/member/unittests/iskeyvalid-test.cc
@@ -0,0 +1,198 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// IsKeyValid unit tests.
+/*! \file */
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/src/validatekey.h"
+}
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
+
+namespace {
+
+////////////////////////////////////////////////
+// EpidMemberIsKeyValid
+TEST_F(EpidMemberTest, EpidMemberIsKeyValidFailsGivenNullPointer) {
+ // create
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+
+ // provision
+ HashAlg hash_alg = kSha256;
+ const GroupPubKey pub_key = this->kGroupPublicKey;
+ const PrivKey priv_key = this->kMemberPrivateKey;
+
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, hash_alg));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionKey(member, &this->kGroupPublicKey,
+ &this->kMemberPrivateKey, &this->kMemberPrecomp));
+
+ EXPECT_FALSE(EpidMemberIsKeyValid(nullptr, &priv_key.A, &priv_key.x,
+ &pub_key.h1, &pub_key.w));
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, nullptr, &priv_key.x, &pub_key.h1,
+ &pub_key.w));
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &priv_key.A, nullptr, &pub_key.h1,
+ &pub_key.w));
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &priv_key.A, &priv_key.x, nullptr,
+ &pub_key.w));
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &priv_key.A, &priv_key.x,
+ &pub_key.h1, nullptr));
+}
+
+TEST_F(EpidMemberTest, EpidMemberIsKeyValidSucceedsForSha256) {
+ // create
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+
+ // provision
+ HashAlg hash_alg = kSha256;
+ const GroupPubKey pub_key = this->kGroupPublicKey;
+ const PrivKey priv_key = this->kMemberPrivateKey;
+
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, hash_alg));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionKey(member, &this->kGroupPublicKey,
+ &this->kMemberPrivateKey, &this->kMemberPrecomp));
+ EXPECT_TRUE(EpidMemberIsKeyValid(member, &priv_key.A, &priv_key.x,
+ &pub_key.h1, &pub_key.w));
+}
+
+TEST_F(EpidMemberTest, EpidMemberIsKeyValidFailsGivenIncorrectKeys) {
+ // create
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+
+ // provision
+ HashAlg hash_alg = kSha256;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, hash_alg));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionKey(member, &this->kGroupPublicKey,
+ &this->kMemberPrivateKey, &this->kMemberPrecomp));
+
+ // check the key is valid
+ EXPECT_TRUE(EpidMemberIsKeyValid(member, &priv_key.A, &priv_key.x,
+ &pub_key.h1, &pub_key.w));
+
+ // check key is invalid with incorrect data
+ PrivKey tmp_priv_key = priv_key;
+ tmp_priv_key.A.x.data.data[31] -= 1;
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &tmp_priv_key.A, &priv_key.x,
+ &pub_key.h1, &pub_key.w));
+
+ tmp_priv_key = priv_key;
+ tmp_priv_key.A.y.data.data[31] -= 1;
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &tmp_priv_key.A, &tmp_priv_key.x,
+ &pub_key.h1, &pub_key.w));
+
+ tmp_priv_key = priv_key;
+ tmp_priv_key.x.data.data[31] -= 1;
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &tmp_priv_key.A, &tmp_priv_key.x,
+ &pub_key.h1, &pub_key.w));
+
+ GroupPubKey tmp_pub_key = pub_key;
+ tmp_pub_key.h1.x.data.data[31] -= 1;
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &tmp_priv_key.A, &priv_key.x,
+ &tmp_pub_key.h1, &tmp_pub_key.w));
+
+ tmp_pub_key = pub_key;
+ tmp_pub_key.h1.y.data.data[31] -= 1;
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &tmp_priv_key.A, &priv_key.x,
+ &tmp_pub_key.h1, &tmp_pub_key.w));
+
+ tmp_pub_key = pub_key;
+ tmp_pub_key.w.x->data.data[31] -= 1;
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &tmp_priv_key.A, &priv_key.x,
+ &tmp_pub_key.h1, &tmp_pub_key.w));
+
+ tmp_pub_key = pub_key;
+ tmp_pub_key.w.y->data.data[31] -= 1;
+ EXPECT_FALSE(EpidMemberIsKeyValid(member, &tmp_priv_key.A, &priv_key.x,
+ &tmp_pub_key.h1, &tmp_pub_key.w));
+}
+
+TEST_F(EpidMemberTest,
+ PROTECTED_EpidMemberIsKeyValidSucceedsByCredentialForSha256_EPS0) {
+ // create
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+
+ // provision
+ HashAlg hash_alg = kSha256;
+ const GroupPubKey eps0_pub_key = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb3, 0x6f, 0xff, 0x81, 0xe2, 0x1b, 0x17, 0xeb, 0x3d, 0x75, 0x3d,
+ 0x61, 0x7e, 0x27, 0xb0, 0xcb, 0xd0, 0x6d, 0x8f, 0x9d, 0x64, 0xce,
+ 0xe3, 0xce, 0x43, 0x4c, 0x62, 0xfd, 0xb5, 0x80, 0xe0, 0x99}}},
+ {{{0x3a, 0x07, 0x56, 0x80, 0xe0, 0x88, 0x59, 0xa4, 0xfd, 0xb5, 0xb7,
+ 0x9d, 0xe9, 0x4d, 0xae, 0x9c, 0xee, 0x3d, 0x66, 0x42, 0x82, 0x45,
+ 0x7e, 0x7f, 0xd8, 0x69, 0x3e, 0xa1, 0x74, 0xf4, 0x59, 0xee}}}}, // h1
+ {{{{0xd2, 0x74, 0x2e, 0x9f, 0x63, 0xc2, 0x51, 0x8e, 0xd5, 0xdb, 0xca,
+ 0x1c, 0x54, 0x74, 0x10, 0x7b, 0xdc, 0x99, 0xed, 0x42, 0xd5, 0x5b,
+ 0xa7, 0x04, 0x29, 0x66, 0x61, 0x63, 0xbc, 0xdd, 0x7f, 0xe1}}},
+ {{{0x76, 0x5d, 0xc0, 0x6e, 0xe3, 0x14, 0xac, 0x72, 0x48, 0x12, 0x0a,
+ 0xa6, 0xe8, 0x5b, 0x08, 0x7b, 0xda, 0x3f, 0x51, 0x7d, 0xde, 0x4c,
+ 0xea, 0xcb, 0x93, 0xa5, 0x6e, 0xcc, 0xe7, 0x8e, 0x10, 0x84}}}}, // h2
+ {{{{{0xbd, 0x19, 0x5a, 0x95, 0xe2, 0x0f, 0xca, 0x1c, 0x50, 0x71, 0x94,
+ 0x51, 0x40, 0x1b, 0xa5, 0xb6, 0x78, 0x87, 0x53, 0xf6, 0x6a, 0x95,
+ 0xca, 0xc6, 0x8d, 0xcd, 0x36, 0x88, 0x07, 0x28, 0xe8, 0x96}}},
+ {{{0xca, 0x78, 0x11, 0x5b, 0xb8, 0x6a, 0xe7, 0xe5, 0xa6, 0x65, 0x7a,
+ 0x68, 0x15, 0xd7, 0x75, 0xf8, 0x24, 0x14, 0xcf, 0xd1, 0x0f, 0x6c,
+ 0x56, 0xf5, 0x22, 0xd9, 0xfd, 0xe0, 0xe2, 0xf4, 0xb3, 0xa1}}}},
+ {{{{0x90, 0x21, 0xa7, 0xe0, 0xe8, 0xb3, 0xc7, 0x25, 0xbc, 0x07, 0x72,
+ 0x30, 0x5d, 0xee, 0xf5, 0x6a, 0x89, 0x88, 0x46, 0xdd, 0x89, 0xc2,
+ 0x39, 0x9c, 0x0a, 0x3b, 0x58, 0x96, 0x57, 0xe4, 0xf3, 0x3c}}},
+ {{{0x79, 0x51, 0x69, 0x36, 0x1b, 0xb6, 0xf7, 0x05, 0x5d, 0x0a, 0x88,
+ 0xdb, 0x1f, 0x3d, 0xea, 0xa2, 0xba, 0x6b, 0xf0, 0xda, 0x8e, 0x25,
+ 0xc6, 0xad, 0x83, 0x7d, 0x3e, 0x31, 0xee, 0x11, 0x40, 0xa9}}}}} // w
+ };
+
+ const PrivKey eps0_priv_key = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xae, 0x5a, 0x18, 0x8d, 0xc8, 0xa9, 0xe2, 0x5c, 0xdf, 0xef, 0x62,
+ 0x6b, 0x34, 0xdf, 0x0d, 0xf2, 0xf6, 0xcf, 0x6a, 0x4d, 0x68, 0x88,
+ 0xc8, 0x12, 0x08, 0xae, 0xb6, 0x30, 0x54, 0xdf, 0xa7, 0xdc}}},
+ {{{0xec, 0x39, 0x86, 0x7b, 0x5c, 0x5e, 0x28, 0x17, 0x5b, 0xfe, 0x93,
+ 0xa1, 0x31, 0x8a, 0x82, 0x99, 0xb0, 0x84, 0x8c, 0x90, 0xc5, 0x54,
+ 0x2c, 0x6d, 0xff, 0x75, 0xcf, 0x05, 0x6e, 0x2b, 0x6c, 0xf3}}}}, // A
+ {0x0a, 0x30, 0xae, 0x43, 0xa1, 0xe0, 0xd7, 0xdf, 0x10, 0x5e, 0xaf,
+ 0xd8, 0x5a, 0x61, 0x10, 0x86, 0xd0, 0x9d, 0xb9, 0xe4, 0x46, 0xdd,
+ 0xb7, 0x1b, 0x00, 0x14, 0x7c, 0x6b, 0x13, 0x72, 0xc3, 0x77}, // x
+ {0x7a, 0x57, 0x41, 0x5b, 0x85, 0x44, 0x0e, 0x2b, 0xb3, 0xcc, 0xa7,
+ 0x99, 0x6d, 0x19, 0x79, 0x45, 0x04, 0xb8, 0x94, 0x07, 0x47, 0x14,
+ 0xed, 0x8d, 0xf4, 0x1e, 0x7d, 0xa0, 0x17, 0xc5, 0xc4, 0x10} // f
+ };
+
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, hash_alg));
+ EXPECT_TRUE(EpidMemberIsKeyValid(member, &eps0_priv_key.A, &eps0_priv_key.x,
+ &eps0_pub_key.h1, &eps0_pub_key.w));
+}
+} // namespace
diff --git a/epid/member/unittests/join_request-test.cc b/epid/member/unittests/join_request-test.cc
new file mode 100644
index 0000000..60b5dbc
--- /dev/null
+++ b/epid/member/unittests/join_request-test.cc
@@ -0,0 +1,368 @@
+/*############################################################################
+ # Copyright 2016-2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+
+/*!
+ * \file
+ * \brief Join Request related unit tests.
+ */
+
+#include <cstring>
+#include <memory>
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/common/math/ecgroup.h"
+#include "epid/common/math/finitefield.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/member/api.h"
+}
+
+#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
+#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
+#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
+#include "epid/common-testhelper/mem_params-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/src/context.h"
+#include "epid/member/unittests/member-testhelper.h"
+
+/// compares FpElemStr values
+bool operator==(FpElemStr const& lhs, FpElemStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+/// compares JoinRequest values
+bool operator==(JoinRequest const& lhs, JoinRequest const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+/// compares JoinRequest values for inequality
+bool operator!=(JoinRequest const& lhs, JoinRequest const& rhs) {
+ return 0 != std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+namespace {
+
+// local constant for Join Request tests. This can be hoisted later if needed
+// avoids cpplint warning about multiple includes.
+const GroupPubKey kPubKey = {
+#include "epid/common-testhelper/testdata/grp01/gpubkey.inc"
+};
+
+const FpElemStr kFEps1 = {0x56, 0x57, 0xda, 0x39, 0x9f, 0x69, 0x17, 0x84,
+ 0xac, 0xf9, 0xf6, 0xdf, 0xfe, 0xd2, 0x41, 0xe8,
+ 0x02, 0x30, 0xf8, 0xd8, 0x72, 0x35, 0xd3, 0x0e,
+ 0x76, 0x2e, 0xda, 0x4b, 0xf4, 0xc5, 0x31, 0x0f};
+/// Validates join request.
+void ValidateJoinRequest(JoinRequest const& request, HashAlg hash_alg,
+ GroupPubKey const& grp_public_key, FpElemStr const& f,
+ IssuerNonce const& ni) {
+ Epid2Params params_values = {
+#include "epid/common/src/epid2params_ate.inc"
+ };
+
+ Epid20Params params;
+
+ // h1^f ?= F
+ EcPointObj F_expected(&params.G1, grp_public_key.h1);
+ THROW_ON_EPIDERR(EcExp(params.G1, F_expected, (BigNumStr*)&f, F_expected));
+ ASSERT_EQ(*(G1ElemStr*)(F_expected.data().data()), request.F);
+
+ // H(p|g1|g2|h1|h2|w|F|R|ni) ?= c, where R = h1^s * F^(-c)
+ FfElementObj nc(&params.fp, request.c);
+ THROW_ON_EPIDERR(FfNeg(params.fp, nc, nc));
+ EcPointObj a(&params.G1, grp_public_key.h1);
+ EcPointObj b(&params.G1, request.F);
+ THROW_ON_EPIDERR(EcExp(params.G1, a, (BigNumStr*)&request.s, a));
+ THROW_ON_EPIDERR(EcExp(params.G1, b, (BigNumStr*)nc.data().data(), b));
+ THROW_ON_EPIDERR(EcMul(params.G1, a, b, a));
+
+#pragma pack(1)
+ struct {
+ BigNumStr p; // Intel(R) EPID 2.0 parameter p
+ G1ElemStr g1; // Intel(R) EPID 2.0 parameter g1
+ G2ElemStr g2; // Intel(R) EPID 2.0 parameter g2
+ G1ElemStr h1; // Group public key value h1
+ G1ElemStr h2; // Group public key value h2
+ G2ElemStr w; // Group public key value w
+ G1ElemStr F; // Variable F computed in algorithm
+ G1ElemStr R; // Variable R computed in algorithm
+ IssuerNonce NI; // Issuer Nonce
+ } commitment_values = {params_values.p,
+ params_values.g1,
+ params_values.g2,
+ grp_public_key.h1,
+ grp_public_key.h2,
+ grp_public_key.w,
+ request.F,
+ *(G1ElemStr*)(a.data().data()),
+ ni};
+#pragma pack()
+
+ FfElementObj commitment(&params.fp);
+ THROW_ON_EPIDERR(FfHash(params.fp, &commitment_values,
+ sizeof commitment_values, hash_alg, commitment));
+ ASSERT_EQ(*(FpElemStr*)(commitment.data().data()), request.c);
+}
+
+TEST_F(EpidMemberTest, CreateJoinRequestFailsGivenNullParameters) {
+ GroupPubKey pub_key = kPubKey;
+ IssuerNonce ni;
+ MemberParams params;
+ Prng prng;
+ JoinRequest join_request;
+ SetMemberParams(Prng::Generate, &prng, nullptr, &params);
+ MemberCtxObj ctx(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidCreateJoinRequest(nullptr, &pub_key, &ni, &join_request));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidCreateJoinRequest(ctx, nullptr, &ni, &join_request));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidCreateJoinRequest(ctx, &pub_key, nullptr, &join_request));
+ EXPECT_EQ(kEpidBadArgErr, EpidCreateJoinRequest(ctx, &pub_key, &ni, nullptr));
+}
+
+TEST_F(EpidMemberTest, CreateJoinRequestFailsGivenInvalidGroupKey) {
+ Prng prng;
+ MemberParams params = {0};
+ GroupPubKey pub_key = kPubKey;
+ FpElemStr f = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ };
+ IssuerNonce ni = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
+ };
+ pub_key.h1.x.data.data[15] = 0xff;
+ Epid20Params epid_params;
+ EcPointObj pt(&epid_params.G1);
+ JoinRequest join_request;
+ SetMemberParams(Prng::Generate, &prng, &f, &params);
+ MemberCtxObj member(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ ASSERT_NE(kEpidNoErr, ReadEcPoint(epid_params.G1, (uint8_t*)&pub_key.h1,
+ sizeof(pub_key.h1), pt));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request));
+}
+
+TEST_F(EpidMemberTest, CreateJoinRequestFailsGivenInvalidFValue) {
+ Prng prng;
+ MemberCtx* member;
+ MemberParams params = {0};
+ GroupPubKey pub_key = kPubKey;
+ FpElemStr f = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+ };
+ IssuerNonce ni = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
+ };
+ JoinRequest join_request;
+ EpidStatus sts;
+ SetMemberParams(Prng::Generate, &prng, &f, &params);
+ // Either Create or CreateJoinRequest should return kEpidBadArgErr for a
+ // bad f.
+ sts = EpidMemberCreate(&params, &member);
+ if (kEpidNoErr == sts) {
+ sts = EpidCreateJoinRequest(member, &pub_key, &ni, &join_request);
+ EpidMemberDelete(&member);
+ }
+ EXPECT_EQ(kEpidBadArgErr, sts);
+}
+
+TEST_F(EpidMemberTest, CreateJoinRequestWorksGivenValidParameters) {
+ Prng prng;
+ MemberParams params = {0};
+ GroupPubKey pub_key = kPubKey;
+ FpElemStr f = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ };
+ IssuerNonce ni = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
+ };
+ JoinRequest join_request;
+ SetMemberParams(Prng::Generate, &prng, &f, &params);
+ MemberCtxObj member(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request, kSha256, pub_key, f, ni));
+}
+
+TEST_F(EpidMemberTest,
+ PROTECTED_EPS1_CreateJoinRequestUsingWorksGivenValidParameters) {
+ Prng prng;
+ MemberParams params = {0};
+ GroupPubKey pub_key = kPubKey;
+ IssuerNonce ni = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
+ };
+ JoinRequest join_request;
+ SetMemberParams(Prng::Generate, &prng, nullptr, &params);
+ MemberCtxObj member(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request, kSha256, pub_key, kFEps1, ni));
+}
+
+TEST_F(EpidMemberTest,
+ CreateJoinRequestGeneratesDiffJoinRequestsOnMultipleCalls) {
+ Prng prng;
+ MemberParams params = {0};
+ GroupPubKey pub_key = kPubKey;
+ FpElemStr f = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ };
+ IssuerNonce ni = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
+ };
+ JoinRequest join_request1;
+ JoinRequest join_request2;
+ SetMemberParams(Prng::Generate, &prng, &f, &params);
+ MemberCtxObj member(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request1));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request1, kSha256, pub_key, f, ni));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request2));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request2, kSha256, pub_key, f, ni));
+ EXPECT_NE(join_request1, join_request2);
+}
+
+TEST_F(
+ EpidMemberTest,
+ PROTECTED_EPS1_CreateJoinRequestGeneratesDiffJoinRequestsOnMultipleCalls) {
+ Prng prng;
+ MemberParams params = {0};
+ GroupPubKey pub_key = kPubKey;
+ IssuerNonce ni = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
+ };
+ JoinRequest join_request1;
+ JoinRequest join_request2;
+ SetMemberParams(Prng::Generate, &prng, nullptr, &params);
+ MemberCtxObj member(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request1));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request1, kSha256, pub_key, kFEps1, ni));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request2));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request2, kSha256, pub_key, kFEps1, ni));
+ EXPECT_NE(join_request1, join_request2);
+}
+
+TEST_F(EpidMemberTest,
+ CreateJoinRequestGeneratesDiffJoinRequestsGivenDiffHashAlgs) {
+ MemberParams params = {0};
+ GroupPubKey pub_key = kPubKey;
+ FpElemStr f = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ };
+ IssuerNonce ni = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
+ };
+ JoinRequest join_request1;
+ JoinRequest join_request2;
+ // Ensure that two members created with equal seed and do not
+ // interfere each other. Member1 is deleted by the time member2
+ // is created.
+ {
+ Prng prng;
+ SetMemberParams(Prng::Generate, &prng, &f, &params);
+ MemberCtxObj member1(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member1, kSha256));
+ prng.set_seed(0x1234);
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member1, &pub_key, &ni, &join_request1));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request1, kSha256, pub_key, f, ni));
+ }
+ {
+ Prng prng;
+ SetMemberParams(Prng::Generate, &prng, &f, &params);
+ MemberCtxObj member2(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member2, kSha384));
+ prng.set_seed(0x1234);
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member2, &pub_key, &ni, &join_request2));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request2, kSha384, pub_key, f, ni));
+ }
+ EXPECT_NE(join_request1, join_request2);
+}
+
+TEST_F(EpidMemberTest,
+ CreateJoinRequestWorksGivenValidParametersUsingIKGFData) {
+ Prng prng;
+ MemberParams params = {0};
+ const GroupPubKey* pub_key = reinterpret_cast<const GroupPubKey*>(
+ this->kGroupPublicKeyDataIkgf.data());
+ FpElemStr f = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
+ };
+ IssuerNonce ni = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
+ };
+ JoinRequest join_request;
+ SetMemberParams(Prng::Generate, &prng, &f, &params);
+ MemberCtxObj member(&params);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, pub_key, &ni, &join_request));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request, kSha256, *pub_key, f, ni));
+}
+} // namespace
diff --git a/epid/member/unittests/main-test.cc b/epid/member/unittests/main-test.cc
index a8bb2fa..eb29e33 100644
--- a/epid/member/unittests/main-test.cc
+++ b/epid/member/unittests/main-test.cc
@@ -18,10 +18,49 @@
* \brief Main entry point for unit tests.
*/
-#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/common-testhelper/testapp-testhelper.h"
#include "gtest/gtest.h"
int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
+ std::vector<std::string> positive;
+ std::vector<std::string> negative;
+ std::vector<char*> argv_new;
+ argv_new.push_back(argv[0]);
+ bool include_protected = false;
+ bool print_help = false;
+ for (int i = 1; i < argc; i++) {
+ std::string arg(argv[i]);
+ if (arg == std::string("--also_run_protected_tests")) {
+ include_protected = true;
+ } else if (arg == std::string("--help")) {
+ print_help = true;
+ argv_new.push_back(argv[i]);
+ } else if (arg.compare(0, 15, "--gtest_filter=") == 0) {
+ split_filter(&positive, &negative, arg.substr(15));
+ } else {
+ argv_new.push_back(argv[i]);
+ }
+ }
+ if (!include_protected) {
+ negative.push_back("*.*_PROTECTED_*");
+ negative.push_back("*.PROTECTED_*");
+ }
+ std::string filter = join_filter(positive, negative);
+ if (filter != "") {
+ argv_new.push_back(&filter[0]);
+ }
+ int argc_new = (int)argv_new.size();
+ argv_new.push_back(nullptr);
+ testing::InitGoogleTest(&argc_new, argv_new.data());
+ if (print_help) {
+ printf("\n");
+ printf("Custom Options:\n");
+ printf(" --also_run_protected_tests\n");
+ printf(" similar to --gtest_also_run_disabled_tests, but for\n");
+ printf(" protected tests (PROTECTED_ instead of DISABLED_)\n");
+ printf("\n");
+ printf("Protected tests are tests where some data is protected\n");
+ printf("(i.e. hidden) from the code and can only be used indirectly.\n");
+ }
return RUN_ALL_TESTS();
}
diff --git a/epid/member/unittests/member-testhelper.cc b/epid/member/unittests/member-testhelper.cc
index 00e907f..9189f65 100644
--- a/epid/member/unittests/member-testhelper.cc
+++ b/epid/member/unittests/member-testhelper.cc
@@ -22,31 +22,289 @@
#include "epid/member/unittests/member-testhelper.h"
#include <cstdio>
+#include <cstring>
#include <string>
+extern "C" {
+#include "epid/common/types.h"
+}
+
+#include "epid/common-testhelper/mem_params-testhelper.h"
+
+/// Handle SDK Error with Break
+#define BREAK_ON_EPID_ERROR(ret) \
+ if (kEpidNoErr != (ret)) { \
+ break; \
+ }
+
+/// compares G1ElemStr values
+bool operator==(G1ElemStr const& lhs, G1ElemStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(MembershipCredential const& lhs,
+ MembershipCredential const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(GroupPubKey const& lhs, GroupPubKey const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
MemberCtxObj::MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
BitSupplier rnd_func, void* rnd_param)
: ctx_(nullptr) {
- auto sts = EpidMemberCreate(&pub_key, &priv_key, nullptr, rnd_func, rnd_param,
- &ctx_);
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, &priv_key.f, &params);
+ sts = EpidMemberCreate(&params, &ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberCreate()");
+ }
+ sts = EpidProvisionKey(ctx_, &pub_key, &priv_key, nullptr);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionKey()");
+ }
+ sts = EpidMemberStartup(ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberStartup()");
+ }
+}
+
+MemberCtxObj::MemberCtxObj(GroupPubKey const& pub_key,
+ MembershipCredential const& cred,
+ BitSupplier rnd_func, void* rnd_param)
+ : ctx_(nullptr) {
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, nullptr, &params);
+ sts = EpidMemberCreate(&params, &ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberCreate()");
+ }
+ sts = EpidProvisionCredential(ctx_, &pub_key, &cred, nullptr);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionKey()");
+ }
+ sts = EpidMemberStartup(ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberStartup()");
+ }
+}
+
+MemberCtxObj::MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
+ HashAlg hash_alg, BitSupplier rnd_func,
+ void* rnd_param)
+ : ctx_(nullptr) {
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, &priv_key.f, &params);
+ sts = EpidMemberCreate(&params, &ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberCreate()");
+ }
+ sts = EpidMemberSetHashAlg(ctx_, hash_alg);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberSetHashAlg()");
+ }
+ sts = EpidProvisionKey(ctx_, &pub_key, &priv_key, nullptr);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionKey()");
+ }
+ sts = EpidMemberStartup(ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberStartup()");
+ }
+}
+
+MemberCtxObj::MemberCtxObj(BitSupplier rnd_func, void* rnd_param)
+ : ctx_(nullptr) {
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, nullptr, &params);
+ sts = EpidMemberCreate(&params, &ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberCreate()");
+ }
+}
+
+MemberCtxObj::MemberCtxObj(MemberParams const* params) : ctx_(nullptr) {
+ EpidStatus sts = kEpidErr;
+ sts = EpidMemberCreate(params, &ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberCreate()");
+ }
+}
+
+MemberCtxObj::MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
+ MemberPrecomp const& precomp, BitSupplier rnd_func,
+ void* rnd_param)
+ : ctx_(nullptr) {
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, &priv_key.f, &params);
+ sts = EpidMemberCreate(&params, &ctx_);
if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
throw std::logic_error(std::string("Failed to call: ") +
"EpidMemberCreate()");
}
+ sts = EpidProvisionKey(ctx_, &pub_key, &priv_key, &precomp);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionKey()");
+ }
+ sts = EpidMemberStartup(ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberStartup()");
+ }
}
MemberCtxObj::MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
+ HashAlg hash_alg, MemberPrecomp const& precomp,
+ BitSupplier rnd_func, void* rnd_param)
+ : ctx_(nullptr) {
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, &priv_key.f, &params);
+ sts = EpidMemberCreate(&params, &ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberCreate()");
+ }
+ sts = EpidMemberSetHashAlg(ctx_, hash_alg);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionKey()");
+ }
+ sts = EpidProvisionKey(ctx_, &pub_key, &priv_key, &precomp);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionKey()");
+ }
+ sts = EpidMemberStartup(ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberStartup()");
+ }
+}
+
+MemberCtxObj::MemberCtxObj(GroupPubKey const& pub_key,
+ MembershipCredential const& cred,
MemberPrecomp const& precomp, BitSupplier rnd_func,
void* rnd_param)
: ctx_(nullptr) {
- auto sts = EpidMemberCreate(&pub_key, &priv_key, &precomp, rnd_func,
- rnd_param, &ctx_);
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, nullptr, &params);
+ sts = EpidMemberCreate(&params, &ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberCreate()");
+ }
+ sts = EpidProvisionCredential(ctx_, &pub_key, &cred, &precomp);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionCredential()");
+ }
+ sts = EpidMemberStartup(ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberStartup()");
+ }
+}
+
+MemberCtxObj::MemberCtxObj(GroupPubKey const& pub_key,
+ MembershipCredential const& cred, HashAlg hash_alg,
+ BitSupplier rnd_func, void* rnd_param)
+ : ctx_(nullptr) {
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, nullptr, &params);
+ sts = EpidMemberCreate(&params, &ctx_);
if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
throw std::logic_error(std::string("Failed to call: ") +
"EpidMemberCreate()");
}
+ sts = EpidMemberSetHashAlg(ctx_, hash_alg);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionKey()");
+ }
+ sts = EpidProvisionCredential(ctx_, &pub_key, &cred, nullptr);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidProvisionCredential()");
+ }
+ sts = EpidMemberStartup(ctx_);
+ if (kEpidNoErr != sts) {
+ ctx_ = nullptr;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberStartup()");
+ }
}
MemberCtxObj::~MemberCtxObj() { EpidMemberDelete(&ctx_); }
@@ -61,83 +319,85 @@ MemberCtxObj::operator const MemberCtx*() const { return ctx_; }
const GroupPubKey EpidMemberTest::kGroupPublicKey = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01}, // group id
- {{{{0xb3, 0x6f, 0xff, 0x81, 0xe2, 0x1b, 0x17, 0xeb, 0x3d, 0x75, 0x3d, 0x61,
- 0x7e, 0x27, 0xb0, 0xcb, 0xd0, 0x6d, 0x8f, 0x9d, 0x64, 0xce, 0xe3, 0xce,
- 0x43, 0x4c, 0x62, 0xfd, 0xb5, 0x80, 0xe0, 0x99}}},
- {{{0x3a, 0x07, 0x56, 0x80, 0xe0, 0x88, 0x59, 0xa4, 0xfd, 0xb5, 0xb7, 0x9d,
- 0xe9, 0x4d, 0xae, 0x9c, 0xee, 0x3d, 0x66, 0x42, 0x82, 0x45, 0x7e, 0x7f,
- 0xd8, 0x69, 0x3e, 0xa1, 0x74, 0xf4, 0x59, 0xee}}}}, // h1
- {{{{0xd2, 0x74, 0x2e, 0x9f, 0x63, 0xc2, 0x51, 0x8e, 0xd5, 0xdb, 0xca, 0x1c,
- 0x54, 0x74, 0x10, 0x7b, 0xdc, 0x99, 0xed, 0x42, 0xd5, 0x5b, 0xa7, 0x04,
- 0x29, 0x66, 0x61, 0x63, 0xbc, 0xdd, 0x7f, 0xe1}}},
- {{{0x76, 0x5d, 0xc0, 0x6e, 0xe3, 0x14, 0xac, 0x72, 0x48, 0x12, 0x0a, 0xa6,
- 0xe8, 0x5b, 0x08, 0x7b, 0xda, 0x3f, 0x51, 0x7d, 0xde, 0x4c, 0xea, 0xcb,
- 0x93, 0xa5, 0x6e, 0xcc, 0xe7, 0x8e, 0x10, 0x84}}}}, // h2
- {{{{{0xbd, 0x19, 0x5a, 0x95, 0xe2, 0x0f, 0xca, 0x1c, 0x50, 0x71, 0x94, 0x51,
- 0x40, 0x1b, 0xa5, 0xb6, 0x78, 0x87, 0x53, 0xf6, 0x6a, 0x95, 0xca, 0xc6,
- 0x8d, 0xcd, 0x36, 0x88, 0x7, 0x28, 0xe8, 0x96}}},
- {{{0xca, 0x78, 0x11, 0x5b, 0xb8, 0x6a, 0xe7, 0xe5, 0xa6, 0x65, 0x7a, 0x68,
- 0x15, 0xd7, 0x75, 0xf8, 0x24, 0x14, 0xcf, 0xd1, 0x0f, 0x6c, 0x56, 0xf5,
- 0x22, 0xd9, 0xfd, 0xe0, 0xe2, 0xf4, 0xb3, 0xa1}}}},
- {{{{0x90, 0x21, 0xa7, 0xe0, 0xe8, 0xb3, 0xc7, 0x25, 0xbc, 0x07, 0x72, 0x30,
- 0x5d, 0xee, 0xf5, 0x6a, 0x89, 0x88, 0x46, 0xdd, 0x89, 0xc2, 0x39, 0x9c,
- 0x0a, 0x3b, 0x58, 0x96, 0x57, 0xe4, 0xf3, 0x3c}}},
- {{{0x79, 0x51, 0x69, 0x36, 0x1b, 0xb6, 0xf7, 0x05, 0x5d, 0x0a, 0x88, 0xdb,
- 0x1f, 0x3d, 0xea, 0xa2, 0xba, 0x6b, 0xf0, 0xda, 0x8e, 0x25, 0xc6, 0xad,
- 0x83, 0x7d, 0x3e, 0x31, 0xee, 0x11, 0x40, 0xa9}}}}} // w
+ {{{{0xb3, 0x6f, 0xff, 0x81, 0xe2, 0x1b, 0x17, 0xeb, 0x3d, 0x75, 0x3d,
+ 0x61, 0x7e, 0x27, 0xb0, 0xcb, 0xd0, 0x6d, 0x8f, 0x9d, 0x64, 0xce,
+ 0xe3, 0xce, 0x43, 0x4c, 0x62, 0xfd, 0xb5, 0x80, 0xe0, 0x99}}},
+ {{{0x3a, 0x07, 0x56, 0x80, 0xe0, 0x88, 0x59, 0xa4, 0xfd, 0xb5, 0xb7,
+ 0x9d, 0xe9, 0x4d, 0xae, 0x9c, 0xee, 0x3d, 0x66, 0x42, 0x82, 0x45,
+ 0x7e, 0x7f, 0xd8, 0x69, 0x3e, 0xa1, 0x74, 0xf4, 0x59, 0xee}}}}, // h1
+ {{{{0xd2, 0x74, 0x2e, 0x9f, 0x63, 0xc2, 0x51, 0x8e, 0xd5, 0xdb, 0xca,
+ 0x1c, 0x54, 0x74, 0x10, 0x7b, 0xdc, 0x99, 0xed, 0x42, 0xd5, 0x5b,
+ 0xa7, 0x04, 0x29, 0x66, 0x61, 0x63, 0xbc, 0xdd, 0x7f, 0xe1}}},
+ {{{0x76, 0x5d, 0xc0, 0x6e, 0xe3, 0x14, 0xac, 0x72, 0x48, 0x12, 0x0a,
+ 0xa6, 0xe8, 0x5b, 0x08, 0x7b, 0xda, 0x3f, 0x51, 0x7d, 0xde, 0x4c,
+ 0xea, 0xcb, 0x93, 0xa5, 0x6e, 0xcc, 0xe7, 0x8e, 0x10, 0x84}}}}, // h2
+ {{{{{0xbd, 0x19, 0x5a, 0x95, 0xe2, 0x0f, 0xca, 0x1c, 0x50, 0x71, 0x94,
+ 0x51, 0x40, 0x1b, 0xa5, 0xb6, 0x78, 0x87, 0x53, 0xf6, 0x6a, 0x95,
+ 0xca, 0xc6, 0x8d, 0xcd, 0x36, 0x88, 0x7, 0x28, 0xe8, 0x96}}},
+ {{{0xca, 0x78, 0x11, 0x5b, 0xb8, 0x6a, 0xe7, 0xe5, 0xa6, 0x65, 0x7a,
+ 0x68, 0x15, 0xd7, 0x75, 0xf8, 0x24, 0x14, 0xcf, 0xd1, 0x0f, 0x6c,
+ 0x56, 0xf5, 0x22, 0xd9, 0xfd, 0xe0, 0xe2, 0xf4, 0xb3, 0xa1}}}},
+ {{{{0x90, 0x21, 0xa7, 0xe0, 0xe8, 0xb3, 0xc7, 0x25, 0xbc, 0x07, 0x72,
+ 0x30, 0x5d, 0xee, 0xf5, 0x6a, 0x89, 0x88, 0x46, 0xdd, 0x89, 0xc2,
+ 0x39, 0x9c, 0x0a, 0x3b, 0x58, 0x96, 0x57, 0xe4, 0xf3, 0x3c}}},
+ {{{0x79, 0x51, 0x69, 0x36, 0x1b, 0xb6, 0xf7, 0x05, 0x5d, 0x0a, 0x88,
+ 0xdb, 0x1f, 0x3d, 0xea, 0xa2, 0xba, 0x6b, 0xf0, 0xda, 0x8e, 0x25,
+ 0xc6, 0xad, 0x83, 0x7d, 0x3e, 0x31, 0xee, 0x11, 0x40, 0xa9}}}}} // w
};
const PrivKey EpidMemberTest::kMemberPrivateKey = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01}, // group id
- {{{{0x46, 0xc9, 0x69, 0xee, 0xf4, 0x68, 0xe1, 0x5f, 0xac, 0xbf, 0xdd, 0x77,
- 0xeb, 0x4c, 0xaf, 0x8a, 0x87, 0x68, 0x3f, 0x4e, 0xda, 0xf2, 0x96, 0xec,
- 0x57, 0x08, 0x90, 0xe8, 0x19, 0x62, 0x54, 0xdb}}},
- {{{0x1e, 0x52, 0x23, 0x16, 0x91, 0xe4, 0xa8, 0x1d, 0x9a, 0x1b, 0x8a, 0xad,
- 0x0a, 0xcf, 0x36, 0x4f, 0xae, 0x43, 0xde, 0x62, 0xff, 0xa6, 0x4b, 0xa8,
- 0x16, 0x24, 0x98, 0x80, 0x82, 0x80, 0x37, 0x77}}}}, // A
- {0x0a, 0x30, 0xae, 0x43, 0xa1, 0xe0, 0xd7, 0xdf, 0x10, 0x5e, 0xaf, 0xd8,
- 0x5a, 0x61, 0x10, 0x86, 0xd0, 0x9d, 0xb9, 0xe4, 0x46, 0xdd, 0xb7, 0x1b,
- 0x00, 0x14, 0x7c, 0x6b, 0x13, 0x72, 0xc3, 0x77}, // x
- {0x48, 0x40, 0xb5, 0x6c, 0x6d, 0x47, 0x09, 0x0b, 0x05, 0xd6, 0x43, 0x56,
- 0xe0, 0x7c, 0xc6, 0x8e, 0xa1, 0x65, 0x67, 0xfd, 0xa7, 0x07, 0x87, 0x9b,
- 0x36, 0x2d, 0x41, 0x35, 0x63, 0x61, 0x31, 0xc7} // f
+ {{{{0x46, 0xc9, 0x69, 0xee, 0xf4, 0x68, 0xe1, 0x5f, 0xac, 0xbf, 0xdd,
+ 0x77, 0xeb, 0x4c, 0xaf, 0x8a, 0x87, 0x68, 0x3f, 0x4e, 0xda, 0xf2,
+ 0x96, 0xec, 0x57, 0x08, 0x90, 0xe8, 0x19, 0x62, 0x54, 0xdb}}},
+ {{{0x1e, 0x52, 0x23, 0x16, 0x91, 0xe4, 0xa8, 0x1d, 0x9a, 0x1b, 0x8a,
+ 0xad, 0x0a, 0xcf, 0x36, 0x4f, 0xae, 0x43, 0xde, 0x62, 0xff, 0xa6,
+ 0x4b, 0xa8, 0x16, 0x24, 0x98, 0x80, 0x82, 0x80, 0x37, 0x77}}}}, // A
+ {0x0a, 0x30, 0xae, 0x43, 0xa1, 0xe0, 0xd7, 0xdf, 0x10, 0x5e, 0xaf,
+ 0xd8, 0x5a, 0x61, 0x10, 0x86, 0xd0, 0x9d, 0xb9, 0xe4, 0x46, 0xdd,
+ 0xb7, 0x1b, 0x00, 0x14, 0x7c, 0x6b, 0x13, 0x72, 0xc3, 0x77}, // x
+ {0x48, 0x40, 0xb5, 0x6c, 0x6d, 0x47, 0x09, 0x0b, 0x05, 0xd6, 0x43,
+ 0x56, 0xe0, 0x7c, 0xc6, 0x8e, 0xa1, 0x65, 0x67, 0xfd, 0xa7, 0x07,
+ 0x87, 0x9b, 0x36, 0x2d, 0x41, 0x35, 0x63, 0x61, 0x31, 0xc7} // f
};
const MemberPrecomp EpidMemberTest::kMemberPrecomp = {
- {0xd8, 0x14, 0xba, 0x4b, 0x44, 0x03, 0x55, 0x6c, 0xf6, 0x42, 0xe8, 0xf0,
- 0x4c, 0xb5, 0xe7, 0xd4, 0xa2, 0xa3, 0x69, 0x47, 0xf5, 0xd4, 0xc8, 0xe9,
- 0xc5, 0x5a, 0x39, 0xb5, 0x55, 0xa5, 0xd3, 0xfb, 0xf3, 0x85, 0x5a, 0x0d,
- 0xd5, 0xee, 0xde, 0xf4, 0xa8, 0xb1, 0x8b, 0xcf, 0xa9, 0x0d, 0x29, 0xbf,
- 0x86, 0x27, 0x9c, 0x1f, 0x96, 0xed, 0xd8, 0x44, 0x01, 0x35, 0x1a, 0xce,
- 0xfd, 0x4e, 0x6f, 0xa1, 0x66, 0x0d, 0x59, 0x08, 0x6d, 0xa2, 0xe4, 0x99,
- 0x83, 0xdc, 0x39, 0x28, 0xb7, 0x1c, 0x1a, 0x33, 0xad, 0xca, 0x5c, 0x35,
- 0x26, 0x1f, 0xab, 0xba, 0x0d, 0x53, 0xaf, 0xe0, 0x72, 0x14, 0xc5, 0xa7,
- 0x2e, 0x58, 0x26, 0xc9, 0x8e, 0xfa, 0x6f, 0x62, 0xfc, 0xf0, 0x08, 0x3e,
- 0xa3, 0x11, 0x3a, 0xf0, 0xb8, 0x3b, 0x2d, 0x3e, 0xec, 0xd5, 0xbc, 0xf2,
- 0x05, 0x68, 0xf4, 0x40, 0xce, 0x2c, 0x8f, 0xdd, 0xa4, 0xe5, 0xe1, 0xb5,
- 0xbe, 0xbd, 0x3e, 0xd4, 0xf6, 0x9a, 0xb3, 0x37, 0x24, 0x0d, 0xea, 0x13,
- 0xd7, 0x1f, 0xa2, 0x75, 0x68, 0xa1, 0xbe, 0x2c, 0x01, 0x42, 0x2a, 0xae,
- 0x6f, 0xae, 0x7a, 0x72, 0x3a, 0x11, 0x03, 0x58, 0x02, 0x0d, 0xf0, 0xb0,
- 0xd9, 0x6f, 0xb1, 0xe4, 0xf2, 0x70, 0xb8, 0xff, 0x22, 0x56, 0x7c, 0xb3,
- 0x80, 0xfd, 0xdf, 0xe5, 0xab, 0xcc, 0x18, 0x7a, 0xfd, 0x91, 0xd0, 0xb0,
- 0x63, 0x40, 0xd4, 0x71, 0xfa, 0x03, 0xf5, 0xf1, 0x26, 0xe1, 0xa5, 0x5a,
- 0xd9, 0x6d, 0xf5, 0x5a, 0x7b, 0x2a, 0x3a, 0xfe, 0x94, 0x9e, 0x74, 0x41,
- 0x79, 0x49, 0x7e, 0x48, 0x1d, 0x58, 0x5e, 0xf6, 0x98, 0xa3, 0x6e, 0x61,
- 0x8e, 0x9f, 0x1f, 0xcd, 0x15, 0x01, 0x16, 0xa5, 0xe0, 0xab, 0xd6, 0xd6,
- 0x1f, 0x1c, 0xf5, 0x81, 0x76, 0xc1, 0xec, 0x10, 0xc2, 0xcc, 0x68, 0x59,
- 0x4d, 0x47, 0xef, 0x4b, 0x7f, 0xd8, 0x78, 0x9c, 0xfe, 0x9a, 0x86, 0x7e,
- 0x0c, 0xfd, 0x3e, 0x0a, 0x7a, 0x72, 0x8b, 0x14, 0x5f, 0xe6, 0x5f, 0x19,
- 0xa3, 0x0a, 0x1b, 0x71, 0xdc, 0xd2, 0xae, 0x35, 0xc3, 0x11, 0xa5, 0xd3,
- 0xea, 0xe1, 0xa9, 0xe7, 0x70, 0x0c, 0x7a, 0x39, 0x56, 0x3c, 0xe4, 0xe7,
- 0xf9, 0xb6, 0xf1, 0x15, 0x40, 0xab, 0xb6, 0xc4, 0xad, 0xbd, 0xf4, 0xcc,
- 0x13, 0xb7, 0xa8, 0xb6, 0x92, 0x1e, 0x72, 0x27, 0xa7, 0xff, 0xd9, 0xea,
- 0x2f, 0x91, 0x96, 0x22, 0xd2, 0xc4, 0x4d, 0x80, 0xdc, 0x47, 0x66, 0x87,
- 0xcc, 0xcf, 0xc5, 0x64, 0xf7, 0xb2, 0x34, 0xed, 0xd5, 0x44, 0x44, 0xcc,
- 0x57, 0x41, 0xc7, 0x92, 0xb7, 0x5c, 0x12, 0xf7, 0x81, 0xf2, 0x92, 0x35,
- 0x3e, 0x4b, 0xdf, 0xf8, 0xda, 0x68, 0xac, 0x30, 0xe3, 0xdd, 0x9e, 0x22,
- 0xaa, 0x6d, 0x77, 0xdd, 0xac, 0xd9, 0x11, 0x6e, 0xfb, 0x1a, 0x88,
- 0xb3}, // e12
+ {0xd8, 0x14, 0xba, 0x4b, 0x44, 0x03, 0x55, 0x6c, 0xf6, 0x42, 0xe8,
+ 0xf0, 0x4c, 0xb5, 0xe7, 0xd4, 0xa2, 0xa3, 0x69, 0x47, 0xf5, 0xd4,
+ 0xc8, 0xe9, 0xc5, 0x5a, 0x39, 0xb5, 0x55, 0xa5, 0xd3, 0xfb, 0xf3,
+ 0x85, 0x5a, 0x0d, 0xd5, 0xee, 0xde, 0xf4, 0xa8, 0xb1, 0x8b, 0xcf,
+ 0xa9, 0x0d, 0x29, 0xbf, 0x86, 0x27, 0x9c, 0x1f, 0x96, 0xed, 0xd8,
+ 0x44, 0x01, 0x35, 0x1a, 0xce, 0xfd, 0x4e, 0x6f, 0xa1, 0x66, 0x0d,
+ 0x59, 0x08, 0x6d, 0xa2, 0xe4, 0x99, 0x83, 0xdc, 0x39, 0x28, 0xb7,
+ 0x1c, 0x1a, 0x33, 0xad, 0xca, 0x5c, 0x35, 0x26, 0x1f, 0xab, 0xba,
+ 0x0d, 0x53, 0xaf, 0xe0, 0x72, 0x14, 0xc5, 0xa7, 0x2e, 0x58, 0x26,
+ 0xc9, 0x8e, 0xfa, 0x6f, 0x62, 0xfc, 0xf0, 0x08, 0x3e, 0xa3, 0x11,
+ 0x3a, 0xf0, 0xb8, 0x3b, 0x2d, 0x3e, 0xec, 0xd5, 0xbc, 0xf2, 0x05,
+ 0x68, 0xf4, 0x40, 0xce, 0x2c, 0x8f, 0xdd, 0xa4, 0xe5, 0xe1, 0xb5,
+ 0xbe, 0xbd, 0x3e, 0xd4, 0xf6, 0x9a, 0xb3, 0x37, 0x24, 0x0d, 0xea,
+ 0x13, 0xd7, 0x1f, 0xa2, 0x75, 0x68, 0xa1, 0xbe, 0x2c, 0x01, 0x42,
+ 0x2a, 0xae, 0x6f, 0xae, 0x7a, 0x72, 0x3a, 0x11, 0x03, 0x58, 0x02,
+ 0x0d, 0xf0, 0xb0, 0xd9, 0x6f, 0xb1, 0xe4, 0xf2, 0x70, 0xb8, 0xff,
+ 0x22, 0x56, 0x7c, 0xb3, 0x80, 0xfd, 0xdf, 0xe5, 0xab, 0xcc, 0x18,
+ 0x7a, 0xfd, 0x91, 0xd0, 0xb0, 0x63, 0x40, 0xd4, 0x71, 0xfa, 0x03,
+ 0xf5, 0xf1, 0x26, 0xe1, 0xa5, 0x5a, 0xd9, 0x6d, 0xf5, 0x5a, 0x7b,
+ 0x2a, 0x3a, 0xfe, 0x94, 0x9e, 0x74, 0x41, 0x79, 0x49, 0x7e, 0x48,
+ 0x1d, 0x58, 0x5e, 0xf6, 0x98, 0xa3, 0x6e, 0x61, 0x8e, 0x9f, 0x1f,
+ 0xcd, 0x15, 0x01, 0x16, 0xa5, 0xe0, 0xab, 0xd6, 0xd6, 0x1f, 0x1c,
+ 0xf5, 0x81, 0x76, 0xc1, 0xec, 0x10, 0xc2, 0xcc, 0x68, 0x59, 0x4d,
+ 0x47, 0xef, 0x4b, 0x7f, 0xd8, 0x78, 0x9c, 0xfe, 0x9a, 0x86, 0x7e,
+ 0x0c, 0xfd, 0x3e, 0x0a, 0x7a, 0x72, 0x8b, 0x14, 0x5f, 0xe6, 0x5f,
+ 0x19, 0xa3, 0x0a, 0x1b, 0x71, 0xdc, 0xd2, 0xae, 0x35, 0xc3, 0x11,
+ 0xa5, 0xd3, 0xea, 0xe1, 0xa9, 0xe7, 0x70, 0x0c, 0x7a, 0x39, 0x56,
+ 0x3c, 0xe4, 0xe7, 0xf9, 0xb6, 0xf1, 0x15, 0x40, 0xab, 0xb6, 0xc4,
+ 0xad, 0xbd, 0xf4, 0xcc, 0x13, 0xb7, 0xa8, 0xb6, 0x92, 0x1e, 0x72,
+ 0x27, 0xa7, 0xff, 0xd9, 0xea, 0x2f, 0x91, 0x96, 0x22, 0xd2, 0xc4,
+ 0x4d, 0x80, 0xdc, 0x47, 0x66, 0x87, 0xcc, 0xcf, 0xc5, 0x64, 0xf7,
+ 0xb2, 0x34, 0xed, 0xd5, 0x44, 0x44, 0xcc, 0x57, 0x41, 0xc7, 0x92,
+ 0xb7, 0x5c, 0x12, 0xf7, 0x81, 0xf2, 0x92, 0x35, 0x3e, 0x4b, 0xdf,
+ 0xf8, 0xda, 0x68, 0xac, 0x30, 0xe3, 0xdd, 0x9e, 0x22, 0xaa, 0x6d,
+ 0x77, 0xdd, 0xac, 0xd9, 0x11, 0x6e, 0xfb, 0x1a, 0x88, 0xb3}, // e12
{
0x07, 0x3f, 0x9d, 0x47, 0x82, 0xb8, 0x3d, 0x6a, 0xe0, 0x36, 0xab, 0xa6,
0xfa, 0xe6, 0xd2, 0x1c, 0xc8, 0xb2, 0xd0, 0x01, 0xd4, 0x96, 0xdc, 0x2e,
@@ -334,6 +594,30 @@ const std::vector<uint8_t> EpidMemberTest::kMsg0 = {'m', 's', 'g', '0'};
const std::vector<uint8_t> EpidMemberTest::kBsn0 = {'b', 's', 'n', '0'};
const std::vector<uint8_t> EpidMemberTest::kMsg1 = {'m', 's', 'g', '1'};
const std::vector<uint8_t> EpidMemberTest::kBsn1 = {'b', 's', 'n', '1'};
+const std::vector<uint8_t> EpidMemberTest::kData_0_255 = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
+ 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
+ 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
+ 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b,
+ 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83,
+ 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b,
+ 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3,
+ 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb,
+ 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3,
+ 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,
+ 0xfc, 0xfd, 0xfe, 0xff,
+};
const GroupPubKey EpidMemberTest::kGrpXKey = {
#include "epid/common-testhelper/testdata/grp_x/pubkey.inc"
@@ -367,3 +651,50 @@ const CompressedPrivKey EpidMemberTest::kGrpYMember9CompressedKey = {
};
const OctStr32 EpidMemberTest::kOctStr32_1 = {0x00, 0x00, 0x00, 0x01};
+
+/// Arbitrary test data were generated based on Intel(R) EPID 2.0 parameters
+const GroupPubKey EpidMemberTest::kEps0GroupPublicKey = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb3, 0x6f, 0xff, 0x81, 0xe2, 0x1b, 0x17, 0xeb, 0x3d, 0x75, 0x3d,
+ 0x61, 0x7e, 0x27, 0xb0, 0xcb, 0xd0, 0x6d, 0x8f, 0x9d, 0x64, 0xce,
+ 0xe3, 0xce, 0x43, 0x4c, 0x62, 0xfd, 0xb5, 0x80, 0xe0, 0x99}}},
+ {{{0x3a, 0x07, 0x56, 0x80, 0xe0, 0x88, 0x59, 0xa4, 0xfd, 0xb5, 0xb7,
+ 0x9d, 0xe9, 0x4d, 0xae, 0x9c, 0xee, 0x3d, 0x66, 0x42, 0x82, 0x45,
+ 0x7e, 0x7f, 0xd8, 0x69, 0x3e, 0xa1, 0x74, 0xf4, 0x59, 0xee}}}}, // h1
+ {{{{0xd2, 0x74, 0x2e, 0x9f, 0x63, 0xc2, 0x51, 0x8e, 0xd5, 0xdb, 0xca,
+ 0x1c, 0x54, 0x74, 0x10, 0x7b, 0xdc, 0x99, 0xed, 0x42, 0xd5, 0x5b,
+ 0xa7, 0x04, 0x29, 0x66, 0x61, 0x63, 0xbc, 0xdd, 0x7f, 0xe1}}},
+ {{{0x76, 0x5d, 0xc0, 0x6e, 0xe3, 0x14, 0xac, 0x72, 0x48, 0x12, 0x0a,
+ 0xa6, 0xe8, 0x5b, 0x08, 0x7b, 0xda, 0x3f, 0x51, 0x7d, 0xde, 0x4c,
+ 0xea, 0xcb, 0x93, 0xa5, 0x6e, 0xcc, 0xe7, 0x8e, 0x10, 0x84}}}}, // h2
+ {{{{{0xbd, 0x19, 0x5a, 0x95, 0xe2, 0x0f, 0xca, 0x1c, 0x50, 0x71, 0x94,
+ 0x51, 0x40, 0x1b, 0xa5, 0xb6, 0x78, 0x87, 0x53, 0xf6, 0x6a, 0x95,
+ 0xca, 0xc6, 0x8d, 0xcd, 0x36, 0x88, 0x07, 0x28, 0xe8, 0x96}}},
+ {{{0xca, 0x78, 0x11, 0x5b, 0xb8, 0x6a, 0xe7, 0xe5, 0xa6, 0x65, 0x7a,
+ 0x68, 0x15, 0xd7, 0x75, 0xf8, 0x24, 0x14, 0xcf, 0xd1, 0x0f, 0x6c,
+ 0x56, 0xf5, 0x22, 0xd9, 0xfd, 0xe0, 0xe2, 0xf4, 0xb3, 0xa1}}}},
+ {{{{0x90, 0x21, 0xa7, 0xe0, 0xe8, 0xb3, 0xc7, 0x25, 0xbc, 0x07, 0x72,
+ 0x30, 0x5d, 0xee, 0xf5, 0x6a, 0x89, 0x88, 0x46, 0xdd, 0x89, 0xc2,
+ 0x39, 0x9c, 0x0a, 0x3b, 0x58, 0x96, 0x57, 0xe4, 0xf3, 0x3c}}},
+ {{{0x79, 0x51, 0x69, 0x36, 0x1b, 0xb6, 0xf7, 0x05, 0x5d, 0x0a, 0x88,
+ 0xdb, 0x1f, 0x3d, 0xea, 0xa2, 0xba, 0x6b, 0xf0, 0xda, 0x8e, 0x25,
+ 0xc6, 0xad, 0x83, 0x7d, 0x3e, 0x31, 0xee, 0x11, 0x40, 0xa9}}}}} // w
+};
+
+const PrivKey EpidMemberTest::kEps0MemberPrivateKey = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xae, 0x5a, 0x18, 0x8d, 0xc8, 0xa9, 0xe2, 0x5c, 0xdf, 0xef, 0x62,
+ 0x6b, 0x34, 0xdf, 0x0d, 0xf2, 0xf6, 0xcf, 0x6a, 0x4d, 0x68, 0x88,
+ 0xc8, 0x12, 0x08, 0xae, 0xb6, 0x30, 0x54, 0xdf, 0xa7, 0xdc}}},
+ {{{0xec, 0x39, 0x86, 0x7b, 0x5c, 0x5e, 0x28, 0x17, 0x5b, 0xfe, 0x93,
+ 0xa1, 0x31, 0x8a, 0x82, 0x99, 0xb0, 0x84, 0x8c, 0x90, 0xc5, 0x54,
+ 0x2c, 0x6d, 0xff, 0x75, 0xcf, 0x05, 0x6e, 0x2b, 0x6c, 0xf3}}}}, // A
+ {0x0a, 0x30, 0xae, 0x43, 0xa1, 0xe0, 0xd7, 0xdf, 0x10, 0x5e, 0xaf,
+ 0xd8, 0x5a, 0x61, 0x10, 0x86, 0xd0, 0x9d, 0xb9, 0xe4, 0x46, 0xdd,
+ 0xb7, 0x1b, 0x00, 0x14, 0x7c, 0x6b, 0x13, 0x72, 0xc3, 0x77}, // x
+ {0x7a, 0x57, 0x41, 0x5b, 0x85, 0x44, 0x0e, 0x2b, 0xb3, 0xcc, 0xa7,
+ 0x99, 0x6d, 0x19, 0x79, 0x45, 0x04, 0xb8, 0x94, 0x07, 0x47, 0x14,
+ 0xed, 0x8d, 0xf4, 0x1e, 0x7d, 0xa0, 0x17, 0xc5, 0xc4, 0x10} // f
+};
diff --git a/epid/member/unittests/member-testhelper.h b/epid/member/unittests/member-testhelper.h
index 614b585..ea15488 100644
--- a/epid/member/unittests/member-testhelper.h
+++ b/epid/member/unittests/member-testhelper.h
@@ -21,6 +21,7 @@
#ifndef EPID_MEMBER_UNITTESTS_MEMBER_TESTHELPER_H_
#define EPID_MEMBER_UNITTESTS_MEMBER_TESTHELPER_H_
+#include <stdint.h>
#include <vector>
#include "epid/common-testhelper/epid_gtest-testhelper.h"
@@ -30,17 +31,50 @@ extern "C" {
#include "epid/member/api.h"
}
+typedef struct G1ElemStr G1ElemStr;
+/// compares G1ElemStr values
+bool operator==(G1ElemStr const& lhs, G1ElemStr const& rhs);
+
+/// compares MembershipCredential values
+bool operator==(MembershipCredential const& lhs,
+ MembershipCredential const& rhs);
+
+/// compares GroupPubKey values
+bool operator==(GroupPubKey const& lhs, GroupPubKey const& rhs);
+
/// C++ Wrapper to manage memory for MemberCtx via RAII
class MemberCtxObj {
public:
/// Create a MemberCtx
explicit MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
BitSupplier rnd_func, void* rnd_param);
+ /// Create a MemberCtx
+ explicit MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
+ HashAlg hash_alg, BitSupplier rnd_func,
+ void* rnd_param);
+ /// Create a MemberCtx
+ explicit MemberCtxObj(BitSupplier rnd_func, void* rnd_param);
+ /// Create a MemberCtx
+ explicit MemberCtxObj(MemberParams const* params);
+ /// Create a MemberCtx
+ explicit MemberCtxObj(GroupPubKey const& pub_key,
+ MembershipCredential const& cred, BitSupplier rnd_func,
+ void* rnd_param);
/// Create a MemberCtx given precomputation blob
MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
MemberPrecomp const& precomp, BitSupplier rnd_func,
void* rnd_param);
-
+ /// Create a MemberCtx given precomputation blob
+ MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
+ HashAlg hash_alg, MemberPrecomp const& precomp,
+ BitSupplier rnd_func, void* rnd_param);
+ /// Create a MemberCtx given precomputation blob
+ MemberCtxObj(GroupPubKey const& pub_key, MembershipCredential const& cred,
+ MemberPrecomp const& precomp, BitSupplier rnd_func,
+ void* rnd_param);
+ /// Create a MemberCtx given precomputation blob
+ MemberCtxObj(GroupPubKey const& pub_key, MembershipCredential const& cred,
+ HashAlg hash_alg, BitSupplier rnd_func, void* rnd_param);
// This class instances are not meant to be copied.
// Explicitly delete copy constructor and assignment operator.
MemberCtxObj(const MemberCtxObj&) = delete;
@@ -93,7 +127,8 @@ class EpidMemberTest : public ::testing::Test {
static const std::vector<uint8_t> kBsn0;
/// a basename
static const std::vector<uint8_t> kBsn1;
-
+ /// a data with bytes [0,255]
+ static const std::vector<uint8_t> kData_0_255;
/// a group key in group X
static const GroupPubKey kGrpXKey;
/// a member 0 private key in group X
@@ -117,6 +152,11 @@ class EpidMemberTest : public ::testing::Test {
/// value "1" represented as an octstr constant
static const OctStr32 kOctStr32_1;
+ /// EPS specific group public key
+ static const GroupPubKey kEps0GroupPublicKey;
+ /// EPS specific member private key
+ static const PrivKey kEps0MemberPrivateKey;
+
/// setup called before each TEST_F starts
virtual void SetUp() {}
/// teardown called after each TEST_F finishes
diff --git a/epid/member/unittests/nr_prove-test.cc b/epid/member/unittests/nr_prove-test.cc
index a77873c..271ced9 100644
--- a/epid/member/unittests/nr_prove-test.cc
+++ b/epid/member/unittests/nr_prove-test.cc
@@ -13,24 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
-
-/*!
- * \file
- * \brief NrProve unit tests.
- */
+/// NrProve unit tests.
+/*! \file */
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
extern "C" {
-#include "epid/member/api.h"
-#include "epid/verifier/api.h"
+#include "epid/member/src/nrprove.h"
+#include "epid/member/src/signbasic.h"
}
-#include "epid/member/unittests/member-testhelper.h"
-#include "epid/common-testhelper/prng-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
namespace {
@@ -43,21 +40,32 @@ TEST_F(EpidMemberTest, NrProveFailsGivenNullParameters) {
&reinterpret_cast<EpidSignature const*>(
this->kGrp01Member0SigTest1Sha256.data())
->sigma0;
- auto msg = this->kTest1Msg;
+ auto& msg = this->kTest1Msg;
+ auto& bsn = this->kBsn0;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
NrProof proof;
- EXPECT_EQ(kEpidBadArgErr, EpidNrProve(nullptr, msg.data(), msg.size(),
- basic_sig, &sig_rl->bk[0], &proof));
- EXPECT_EQ(kEpidBadArgErr, EpidNrProve(member, nullptr, msg.size(), basic_sig,
- &sig_rl->bk[0], &proof));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNrProve(nullptr, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ basic_sig, &sig_rl->bk[0], &proof));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNrProve(member, nullptr, msg.size(), bsn.data(), bsn.size(),
+ basic_sig, &sig_rl->bk[0], &proof));
EXPECT_EQ(kEpidBadArgErr, EpidNrProve(member, msg.data(), msg.size(), nullptr,
- &sig_rl->bk[0], &proof));
- EXPECT_EQ(kEpidBadArgErr, EpidNrProve(member, msg.data(), msg.size(),
- basic_sig, nullptr, &proof));
- EXPECT_EQ(kEpidBadArgErr, EpidNrProve(member, msg.data(), msg.size(),
- basic_sig, &sig_rl->bk[0], nullptr));
+ 0, basic_sig, &sig_rl->bk[0], &proof));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNrProve(member, msg.data(), msg.size(), bsn.data(), 0,
+ basic_sig, &sig_rl->bk[0], &proof));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNrProve(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ nullptr, &sig_rl->bk[0], &proof));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNrProve(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ basic_sig, nullptr, &proof));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNrProve(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ basic_sig, &sig_rl->bk[0], nullptr));
}
TEST_F(EpidMemberTest, NrProveFailsGivenInvalidSigRlEntry) {
@@ -65,26 +73,56 @@ TEST_F(EpidMemberTest, NrProveFailsGivenInvalidSigRlEntry) {
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
- BasicSignature const* basic_sig =
- &reinterpret_cast<EpidSignature const*>(
- this->kGrp01Member0SigTest1Sha256.data())
- ->sigma0;
+ BasicSignature basic_sig;
auto msg = this->kTest1Msg;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ NrProof proof;
+ BigNumStr rnd_bsn = {0};
+
+ THROW_ON_EPIDERR(EpidSignBasic(member, msg.data(), msg.size(), nullptr, 0,
+ &basic_sig, &rnd_bsn));
+
+ SigRlEntry sig_rl_enty_invalid_k = sig_rl->bk[0];
+ sig_rl_enty_invalid_k.k.x.data.data[31]++; // make it not in EC group
+ EXPECT_EQ(kEpidBadArgErr, EpidNrProve(member, msg.data(), msg.size(),
+ &rnd_bsn, sizeof(rnd_bsn), &basic_sig,
+ &sig_rl_enty_invalid_k, &proof));
+
+ SigRlEntry sig_rl_enty_invalid_b = sig_rl->bk[0];
+ sig_rl_enty_invalid_b.b.x.data.data[31]++; // make it not in EC group
+ EXPECT_EQ(kEpidBadArgErr, EpidNrProve(member, msg.data(), msg.size(),
+ &rnd_bsn, sizeof(rnd_bsn), &basic_sig,
+ &sig_rl_enty_invalid_b, &proof));
+}
+TEST_F(EpidMemberTest,
+ PROTECTED_NrProveFailsWithInvalidSigRlEntryAndCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+
+ BasicSignature basic_sig;
+ auto msg = this->kTest1Msg;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
NrProof proof;
+ BigNumStr rnd_bsn = {0};
+
+ THROW_ON_EPIDERR(EpidSignBasic(member, msg.data(), msg.size(), nullptr, 0,
+ &basic_sig, &rnd_bsn));
SigRlEntry sig_rl_enty_invalid_k = sig_rl->bk[0];
sig_rl_enty_invalid_k.k.x.data.data[31]++; // make it not in EC group
- EXPECT_EQ(kEpidBadArgErr,
- EpidNrProve(member, msg.data(), msg.size(), basic_sig,
- &sig_rl_enty_invalid_k, &proof));
+ EXPECT_EQ(kEpidBadArgErr, EpidNrProve(member, msg.data(), msg.size(),
+ &rnd_bsn, sizeof(rnd_bsn), &basic_sig,
+ &sig_rl_enty_invalid_k, &proof));
SigRlEntry sig_rl_enty_invalid_b = sig_rl->bk[0];
sig_rl_enty_invalid_b.b.x.data.data[31]++; // make it not in EC group
- EXPECT_EQ(kEpidBadArgErr,
- EpidNrProve(member, msg.data(), msg.size(), basic_sig,
- &sig_rl_enty_invalid_b, &proof));
+ EXPECT_EQ(kEpidBadArgErr, EpidNrProve(member, msg.data(), msg.size(),
+ &rnd_bsn, sizeof(rnd_bsn), &basic_sig,
+ &sig_rl_enty_invalid_b, &proof));
}
TEST_F(EpidMemberTest, NrProveFailsGivenInvalidBasicSig) {
@@ -92,44 +130,66 @@ TEST_F(EpidMemberTest, NrProveFailsGivenInvalidBasicSig) {
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
- BasicSignature const* basic_sig =
- &reinterpret_cast<EpidSignature const*>(
- this->kGrp01Member0SigTest1Sha256.data())
- ->sigma0;
+ BasicSignature basic_sig;
auto msg = this->kTest1Msg;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ NrProof proof;
+ BigNumStr rnd_bsn = {0};
+
+ THROW_ON_EPIDERR(EpidSignBasic(member, msg.data(), msg.size(), nullptr, 0,
+ &basic_sig, &rnd_bsn));
+ // invalid basic sig is only when K value is invalid!!
+ BasicSignature basic_sig_invalid_K = basic_sig;
+ basic_sig_invalid_K.K.x.data.data[31]++; // make it not in EC group
+ EXPECT_EQ(
+ kEpidBadArgErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn, sizeof(rnd_bsn),
+ &basic_sig_invalid_K, &sig_rl->bk[0], &proof));
+}
+
+TEST_F(EpidMemberTest,
+ PROTECTED_NrProveFailsGivenInvalidBasicSigAndCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+
+ BasicSignature basic_sig;
+ auto msg = this->kTest1Msg;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
NrProof proof;
+ BigNumStr rnd_bsn = {0};
- // invalid basic sig in this case is invalid B or K value only!!
- BasicSignature basic_sig_invalid_B = *basic_sig;
- basic_sig_invalid_B.B.x.data.data[31]++; // make it not in EC group;
- EXPECT_EQ(kEpidBadArgErr,
- EpidNrProve(member, msg.data(), msg.size(), &basic_sig_invalid_B,
- &sig_rl->bk[0], &proof));
+ THROW_ON_EPIDERR(EpidSignBasic(member, msg.data(), msg.size(), nullptr, 0,
+ &basic_sig, &rnd_bsn));
- BasicSignature basic_sig_invalid_K = *basic_sig;
+ // invalid basic sig is only when K value is invalid!!
+ BasicSignature basic_sig_invalid_K = basic_sig;
basic_sig_invalid_K.K.x.data.data[31]++; // make it not in EC group
- EXPECT_EQ(kEpidBadArgErr,
- EpidNrProve(member, msg.data(), msg.size(), &basic_sig_invalid_K,
- &sig_rl->bk[0], &proof));
+ EXPECT_EQ(
+ kEpidBadArgErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn, sizeof(rnd_bsn),
+ &basic_sig_invalid_K, &sig_rl->bk[0], &proof));
}
TEST_F(EpidMemberTest, GeneratesNrProofForEmptyMessage) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha256,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
BasicSignature basic_sig;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ BigNumStr rnd_bsn = {0};
NrProof proof;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
- ASSERT_EQ(kEpidNoErr,
- EpidSignBasic(member, nullptr, 0, nullptr, 0, &basic_sig));
- EXPECT_EQ(kEpidNoErr, EpidNrProve(member, nullptr, 0, &basic_sig,
- &sig_rl->bk[0], &proof));
+ ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, nullptr, 0, nullptr, 0,
+ &basic_sig, &rnd_bsn));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, nullptr, 0, &rnd_bsn, sizeof(rnd_bsn),
+ &basic_sig, &sig_rl->bk[0], &proof));
// Check proof by doing an NrVerify
VerifierCtxObj ctx(this->kGroupPublicKey);
@@ -138,7 +198,33 @@ TEST_F(EpidMemberTest, GeneratesNrProofForEmptyMessage) {
EpidNrVerify(ctx, &basic_sig, nullptr, 0, &sig_rl->bk[0], &proof));
}
-TEST_F(EpidMemberTest, GeneratesNrProofUsingDefaultHashAlg) {
+TEST_F(EpidMemberTest, GeneratesNrProofForMsgContainingAllPossibleBytes) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ BasicSignature basic_sig;
+ auto msg = this->kData_0_255;
+ auto& bsn = this->kBsn0;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+
+ NrProof proof;
+
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ ASSERT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ &basic_sig, &sig_rl->bk[0], &proof));
+
+ // Check proof by doing an NrVerify
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidNoErr, EpidNrVerify(ctx, &basic_sig, msg.data(), msg.size(),
+ &sig_rl->bk[0], &proof));
+}
+
+TEST_F(EpidMemberTest, GeneratesNrProof) {
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
@@ -146,13 +232,42 @@ TEST_F(EpidMemberTest, GeneratesNrProofUsingDefaultHashAlg) {
BasicSignature basic_sig;
auto msg = this->kTest1Msg;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ BigNumStr rnd_bsn = {0};
NrProof proof;
ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig));
- EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(), &basic_sig,
- &sig_rl->bk[0], &proof));
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn,
+ sizeof(rnd_bsn), &basic_sig, &sig_rl->bk[0], &proof));
+
+ // Check proof by doing an NrVerify
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+
+ EXPECT_EQ(kEpidNoErr, EpidNrVerify(ctx, &basic_sig, msg.data(), msg.size(),
+ &sig_rl->bk[0], &proof));
+}
+
+TEST_F(EpidMemberTest, PROTECTED_GeneratesNrProofWithCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+
+ BasicSignature basic_sig;
+ auto msg = this->kTest1Msg;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ BigNumStr rnd_bsn = {0};
+
+ NrProof proof;
+
+ ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn,
+ sizeof(rnd_bsn), &basic_sig, &sig_rl->bk[0], &proof));
// Check proof by doing an NrVerify
VerifierCtxObj ctx(this->kGroupPublicKey);
@@ -177,13 +292,15 @@ TEST_F(EpidMemberTest, GeneratesNrProofUsingDefaultHashAlgUsingIKGFData) {
BasicSignature basic_sig;
auto msg = this->kTest1Msg;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(sigrl_bin.data());
+ BigNumStr rnd_bsn = {0};
NrProof proof;
ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig));
- EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(), &basic_sig,
- &sig_rl->bk[0], &proof));
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn,
+ sizeof(rnd_bsn), &basic_sig, &sig_rl->bk[0], &proof));
// Check proof by doing an NrVerify
VerifierCtxObj ctx(grp_public_key);
@@ -194,20 +311,21 @@ TEST_F(EpidMemberTest, GeneratesNrProofUsingDefaultHashAlgUsingIKGFData) {
TEST_F(EpidMemberTest, GeneratesNrProofUsingSha256HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha256,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
BasicSignature basic_sig;
auto msg = this->kTest1Msg;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ BigNumStr rnd_bsn = {0};
NrProof proof;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig));
- EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(), &basic_sig,
- &sig_rl->bk[0], &proof));
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn,
+ sizeof(rnd_bsn), &basic_sig, &sig_rl->bk[0], &proof));
// Check proof by doing an NrVerify
VerifierCtxObj ctx(this->kGroupPublicKey);
@@ -218,20 +336,21 @@ TEST_F(EpidMemberTest, GeneratesNrProofUsingSha256HashAlg) {
TEST_F(EpidMemberTest, GeneratesNrProofUsingSha384HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha384,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
BasicSignature basic_sig;
auto msg = this->kTest1Msg;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ BigNumStr rnd_bsn = {0};
NrProof proof;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha384));
ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig));
- EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(), &basic_sig,
- &sig_rl->bk[0], &proof));
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn,
+ sizeof(rnd_bsn), &basic_sig, &sig_rl->bk[0], &proof));
// Check proof by doing an NrVerify
VerifierCtxObj ctx(this->kGroupPublicKey);
@@ -242,20 +361,21 @@ TEST_F(EpidMemberTest, GeneratesNrProofUsingSha384HashAlg) {
TEST_F(EpidMemberTest, GeneratesNrProofUsingSha512HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha512,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
BasicSignature basic_sig;
auto msg = this->kTest1Msg;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ BigNumStr rnd_bsn = {0};
NrProof proof;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512));
ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig));
- EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(), &basic_sig,
- &sig_rl->bk[0], &proof));
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn,
+ sizeof(rnd_bsn), &basic_sig, &sig_rl->bk[0], &proof));
// Check proof by doing an NrVerify
VerifierCtxObj ctx(this->kGroupPublicKey);
@@ -267,19 +387,21 @@ TEST_F(EpidMemberTest, GeneratesNrProofUsingSha512HashAlg) {
TEST_F(EpidMemberTest, GeneratesNrProofUsingSha512256HashAlg) {
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
- this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ kSha512_256, this->kMemberPrecomp, &Prng::Generate,
+ &my_prng);
BasicSignature basic_sig;
auto msg = this->kTest1Msg;
SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ BigNumStr rnd_bsn = {0};
NrProof proof;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512_256));
ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig));
- EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(), &basic_sig,
- &sig_rl->bk[0], &proof));
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrProve(member, msg.data(), msg.size(), &rnd_bsn,
+ sizeof(rnd_bsn), &basic_sig, &sig_rl->bk[0], &proof));
// Check proof by doing an NrVerify
VerifierCtxObj ctx(this->kGroupPublicKey);
diff --git a/epid/member/unittests/presig-test.cc b/epid/member/unittests/presig-test.cc
index 70c79a0..ca51762 100644
--- a/epid/member/unittests/presig-test.cc
+++ b/epid/member/unittests/presig-test.cc
@@ -18,9 +18,9 @@
* \file
* \brief ComputePreSig unit tests.
*/
+#include <algorithm>
#include <cstring>
#include <limits>
-#include <algorithm>
#include <vector>
#include "epid/common-testhelper/epid_gtest-testhelper.h"
@@ -30,9 +30,9 @@ extern "C" {
#include "epid/member/api.h"
}
-#include "epid/member/unittests/member-testhelper.h"
-#include "epid/common-testhelper/prng-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
/// Count of elements in array
#define COUNT_OF(A) (sizeof(A) / sizeof((A)[0]))
diff --git a/epid/member/unittests/privateexp-test.cc b/epid/member/unittests/privateexp-test.cc
new file mode 100644
index 0000000..5f413cb
--- /dev/null
+++ b/epid/member/unittests/privateexp-test.cc
@@ -0,0 +1,155 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// EpidPrivateExp unit tests.
+/*! \file */
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/src/privateexp.h"
+}
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/epid_params-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
+
+namespace {
+
+////////////////////////////////////////////////
+// EpidPrivateExp
+TEST_F(EpidMemberTest, EpidPrivateExpFailsGivenNullPointer) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ THROW_ON_EPIDERR(EpidProvisionKey(member, &this->kGroupPublicKey,
+ &this->kMemberPrivateKey,
+ &this->kMemberPrecomp));
+ THROW_ON_EPIDERR(EpidMemberStartup(member));
+
+ Epid20Params params;
+ EcPointObj a(&params.G1, this->kGroupPublicKey.h1), r(&params.G1);
+
+ EXPECT_EQ(kEpidBadArgErr, EpidPrivateExp(nullptr, a, r));
+ EXPECT_EQ(kEpidBadArgErr, EpidPrivateExp(member, nullptr, r));
+ EXPECT_EQ(kEpidBadArgErr, EpidPrivateExp(member, a, nullptr));
+}
+
+TEST_F(EpidMemberTest, EpidPrivateExpFailsArgumentsMismatch) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ THROW_ON_EPIDERR(EpidProvisionKey(member, &this->kGroupPublicKey,
+ &this->kMemberPrivateKey,
+ &this->kMemberPrecomp));
+ THROW_ON_EPIDERR(EpidMemberStartup(member));
+
+ Epid20Params params;
+ EcPointObj a(&params.G1, this->kGroupPublicKey.h1), r(&params.G1);
+ EcPointObj g2(&params.G2, this->kGroupPublicKey.w);
+
+ EXPECT_EQ(kEpidBadArgErr, EpidPrivateExp(member, g2, r));
+ EXPECT_EQ(kEpidBadArgErr, EpidPrivateExp(member, a, g2));
+ EXPECT_EQ(kEpidBadArgErr, EpidPrivateExp(member, g2, g2));
+}
+
+TEST_F(EpidMemberTest, EpidPrivateExpSucceedsGivenValidParametersForSha256) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ THROW_ON_EPIDERR(EpidProvisionKey(member, &this->kGroupPublicKey,
+ &this->kMemberPrivateKey,
+ &this->kMemberPrecomp));
+ THROW_ON_EPIDERR(EpidMemberStartup(member));
+
+ Epid20Params params;
+ EcPointObj a(&params.G1, this->kGroupPublicKey.h1), r(&params.G1),
+ r_expected(&params.G1);
+
+ G1ElemStr r_str, r_expected_str;
+
+ EXPECT_EQ(kEpidNoErr, EpidPrivateExp(member, a, r));
+
+ THROW_ON_EPIDERR(EcExp(
+ params.G1, a, (BigNumStr const*)&this->kMemberPrivateKey.f, r_expected));
+
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, r_expected, &r_expected_str,
+ sizeof(r_expected_str)));
+ EXPECT_EQ(r_expected_str, r_str);
+}
+
+#ifndef TPM_TSS
+TEST_F(EpidMemberTest, EpidPrivateExpSucceedsGivenValidParametersForSha384) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha384));
+ THROW_ON_EPIDERR(EpidProvisionKey(member, &this->kGroupPublicKey,
+ &this->kMemberPrivateKey,
+ &this->kMemberPrecomp));
+ THROW_ON_EPIDERR(EpidMemberStartup(member));
+
+ Epid20Params params;
+ EcPointObj a(&params.G1, this->kGroupPublicKey.h1), r(&params.G1),
+ r_expected(&params.G1);
+
+ G1ElemStr r_str, r_expected_str;
+
+ EXPECT_EQ(kEpidNoErr, EpidPrivateExp(member, a, r));
+
+ THROW_ON_EPIDERR(EcExp(
+ params.G1, a, (BigNumStr const*)&this->kMemberPrivateKey.f, r_expected));
+
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, r_expected, &r_expected_str,
+ sizeof(r_expected_str)));
+ EXPECT_EQ(r_expected_str, r_str);
+}
+#endif
+
+TEST_F(EpidMemberTest,
+ PROTECTED_EpidPrivateExpSucceedsByCredentialForSha256_EPS0) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ MemberCtxObj member(&Prng::Generate, &my_prng);
+ BigNumStr const f_str = {0x7a, 0x57, 0x41, 0x5b, 0x85, 0x44, 0x0e, 0x2b,
+ 0xb3, 0xcc, 0xa7, 0x99, 0x6d, 0x19, 0x79, 0x45,
+ 0x04, 0xb8, 0x94, 0x07, 0x47, 0x14, 0xed, 0x8d,
+ 0xf4, 0x1e, 0x7d, 0xa0, 0x17, 0xc5, 0xc4, 0x10};
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+
+ Epid20Params params;
+ EcPointObj a(&params.G1, this->kGroupPublicKey.h1), r(&params.G1),
+ r_expected(&params.G1);
+
+ G1ElemStr r_str, r_expected_str;
+
+ EXPECT_EQ(kEpidNoErr, EpidPrivateExp(member, a, r));
+
+ THROW_ON_EPIDERR(EcExp(params.G1, a, (BigNumStr const*)&f_str, r_expected));
+
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, r, &r_str, sizeof(r_str)));
+ THROW_ON_EPIDERR(WriteEcPoint(params.G1, r_expected, &r_expected_str,
+ sizeof(r_expected_str)));
+ EXPECT_EQ(r_expected_str, r_str);
+}
+
+} // namespace
diff --git a/epid/member/unittests/provision_compressed-test.cc b/epid/member/unittests/provision_compressed-test.cc
new file mode 100644
index 0000000..6d321eb
--- /dev/null
+++ b/epid/member/unittests/provision_compressed-test.cc
@@ -0,0 +1,186 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+
+/*!
+ * \file
+ * \brief Provision compressed unit tests.
+ */
+#include <cstring>
+#include <vector>
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/mem_params-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
+
+extern "C" {
+#include "epid/member/api.h"
+#include "epid/member/src/context.h"
+}
+
+namespace {
+
+EpidStatus ProvisionCompressedAndStart(
+ MemberCtx* ctx, GroupPubKey const* pub_key,
+ CompressedPrivKey const* compressed_privkey,
+ MemberPrecomp const* precomp_str) {
+ EpidStatus sts;
+ sts = EpidProvisionCompressed(ctx, pub_key, compressed_privkey, precomp_str);
+ if (sts != kEpidNoErr) {
+ return sts;
+ }
+ sts = EpidMemberStartup(ctx);
+ return sts;
+}
+
+TEST_F(EpidMemberTest, ProvisionCompressedFailsGivenNullParameters) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ CompressedPrivKey priv_key = this->kGrpXMember9CompressedKey;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCompressed(nullptr, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCompressed(member, nullptr, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCompressed(member, &pub_key, nullptr, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCompressed(nullptr, &pub_key, &priv_key, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCompressed(member, nullptr, &priv_key, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCompressed(member, &pub_key, nullptr, nullptr));
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionCompressedSucceedsGivenValidParameters) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ CompressedPrivKey priv_key = this->kGrpXMember9CompressedKey;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionCompressed(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionCompressed(member, &pub_key, &priv_key, nullptr));
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionCompressedFailsForInvalidGroupPubKey) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ CompressedPrivKey priv_key = this->kGrpXMember9CompressedKey;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+
+ pub_key = this->kGrpXKey;
+ pub_key.h1.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGrpXKey;
+ pub_key.h1.y.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGrpXKey;
+ pub_key.w.x[0].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGrpXKey;
+ pub_key.w.x[1].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGrpXKey;
+ pub_key.w.y[0].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGrpXKey;
+ pub_key.w.y[1].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, nullptr));
+
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionCompressedFailsForInvalidPrivateKey) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ CompressedPrivKey priv_key = this->kGrpXMember9CompressedKey;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+
+ priv_key = this->kGrpXMember9CompressedKey;
+ priv_key.ax.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, nullptr));
+
+ priv_key = this->kGrpXMember9CompressedKey;
+ priv_key.seed.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionCompressedAndStart(member, &pub_key, &priv_key, nullptr));
+
+ EpidMemberDelete(&member);
+}
+
+} // namespace
diff --git a/epid/member/unittests/provision_credential-test.cc b/epid/member/unittests/provision_credential-test.cc
new file mode 100644
index 0000000..b4faeac
--- /dev/null
+++ b/epid/member/unittests/provision_credential-test.cc
@@ -0,0 +1,337 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+* \file
+* \brief Provision credential unit tests.
+*/
+#include <cstring>
+#include <vector>
+
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/api.h"
+#include "epid/member/src/context.h"
+#include "epid/member/src/storage.h"
+}
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/mem_params-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
+
+namespace {
+
+EpidStatus ProvisionCredentialAndStart(MemberCtx* ctx,
+ GroupPubKey const* pub_key,
+ MembershipCredential const* credential,
+ MemberPrecomp const* precomp_str) {
+ EpidStatus sts;
+ sts = EpidProvisionCredential(ctx, pub_key, credential, precomp_str);
+ if (sts != kEpidNoErr) {
+ return sts;
+ }
+ sts = EpidMemberStartup(ctx);
+ return sts;
+}
+
+TEST_F(EpidMemberTest, ProvisionCredentialFailsGivenNullParameters) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+ MembershipCredential credential;
+ credential.A = this->kGrpXMember9PrivKey.A;
+ credential.gid = this->kGrpXMember9PrivKey.gid;
+ credential.x = this->kGrpXMember9PrivKey.x;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCredential(nullptr, &pub_key, &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCredential(member, nullptr, &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCredential(member, &pub_key, nullptr, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCredential(nullptr, &pub_key, &credential, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCredential(member, nullptr, &credential, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionCredential(member, &pub_key, nullptr, nullptr));
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionCredentialRejectsInvalidCredential) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+ MembershipCredential credential;
+ MembershipCredential base_credential;
+ base_credential.A = this->kGrpXMember9PrivKey.A;
+ base_credential.gid = this->kGrpXMember9PrivKey.gid;
+ base_credential.x = this->kGrpXMember9PrivKey.x;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+
+ credential = base_credential;
+ credential.A.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ credential = base_credential;
+ credential.A.y.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ credential = base_credential;
+ credential.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionCredentialRejectsInvalidGroupKey) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+ MembershipCredential credential;
+ credential.A = this->kGrpXMember9PrivKey.A;
+ credential.gid = this->kGrpXMember9PrivKey.gid;
+ credential.x = this->kGrpXMember9PrivKey.x;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.h1.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.h1.y.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.h2.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.h2.y.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.w.x[0].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.w.x[1].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.w.y[0].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.w.y[1].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionCredentialRejectsCredentialNotInGroup) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+ MembershipCredential credential;
+ MembershipCredential base_credential;
+ base_credential.A = this->kGrpXMember9PrivKey.A;
+ base_credential.gid = this->kGrpXMember9PrivKey.gid;
+ base_credential.x = this->kGrpXMember9PrivKey.x;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+
+ credential = base_credential;
+ credential.gid.data[0] = ~credential.gid.data[0];
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EXPECT_EQ(kEpidBadArgErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, CanProvisionUsingMembershipCredentialPrecomp) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+ MembershipCredential credential;
+ credential.A = this->kGrpXMember9PrivKey.A;
+ credential.gid = this->kGrpXMember9PrivKey.gid;
+ credential.x = this->kGrpXMember9PrivKey.x;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, CanProvisionUsingMembershipCredentialNoPrecomp) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGrpXKey;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+ MembershipCredential credential;
+ credential.A = this->kGrpXMember9PrivKey.A;
+ credential.gid = this->kGrpXMember9PrivKey.gid;
+ credential.x = this->kGrpXMember9PrivKey.x;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+ EpidMemberDelete(&member);
+}
+
+// test that create succeeds with valid IKGF given parameters
+TEST_F(EpidMemberTest, CanProvisionUsingIKGFMembershipCredentialPrecomp) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ const GroupPubKey* pub_key = reinterpret_cast<const GroupPubKey*>(
+ this->kGroupPublicKeyDataIkgf.data());
+ const PrivKey* priv_key =
+ reinterpret_cast<const PrivKey*>(this->kMemberPrivateKeyDataIkgf.data());
+ FpElemStr f = priv_key->f;
+ MembershipCredential credential;
+ credential.A = priv_key->A;
+ credential.gid = priv_key->gid;
+ credential.x = priv_key->x;
+ // Note: this MemberPrecomp is for the wrong group, however it should not
+ // be checked in Provision because doing so would negate the performance
+ // boost of using the precomp.
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, pub_key,
+ &credential, &precomp));
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, CanProvisionUsingIKGFMembershipCredentialNoPrecomp) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ const GroupPubKey* pub_key = reinterpret_cast<const GroupPubKey*>(
+ this->kGroupPublicKeyDataIkgf.data());
+ const PrivKey* priv_key =
+ reinterpret_cast<const PrivKey*>(this->kMemberPrivateKeyDataIkgf.data());
+ FpElemStr f = priv_key->f;
+ MembershipCredential credential;
+ credential.A = priv_key->A;
+ credential.gid = priv_key->gid;
+ credential.x = priv_key->x;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr,
+ ProvisionCredentialAndStart(member, pub_key, &credential, nullptr));
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest,
+ ProvisionCredentialCanStoreMembershipCredentialNoPrecomp) {
+ Prng prng;
+ uint32_t nv_index = 0x01c10100;
+ MemberCtx* member = nullptr;
+ MembershipCredential const orig_credential =
+ *(MembershipCredential*)&this->kGrpXMember9PrivKey;
+ MembershipCredential credential;
+
+ GroupPubKey pub_key = this->kGrpXKey;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, &pub_key,
+ &orig_credential, nullptr));
+
+ EXPECT_EQ(kEpidNoErr, EpidNvReadMembershipCredential(
+ member->tpm2_ctx, nv_index, &pub_key, &credential));
+ EXPECT_EQ(orig_credential, credential);
+ EpidMemberDelete(&member);
+}
+
+} // namespace
diff --git a/epid/member/unittests/provision_key-test.cc b/epid/member/unittests/provision_key-test.cc
new file mode 100644
index 0000000..cc3271e
--- /dev/null
+++ b/epid/member/unittests/provision_key-test.cc
@@ -0,0 +1,259 @@
+/*############################################################################
+ # Copyright 2017 Intel Corporation
+ #
+ # Licensed under the Apache License, Version 2.0 (the "License");
+ # you may not use this file except in compliance with the License.
+ # You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing, software
+ # distributed under the License is distributed on an "AS IS" BASIS,
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+ ############################################################################*/
+
+/*!
+ * \file
+ * \brief Provision key unit tests.
+ */
+#include <cstring>
+#include <vector>
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/mem_params-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
+
+extern "C" {
+#include "epid/member/api.h"
+#include "epid/member/src/context.h"
+#include "epid/member/src/storage.h"
+}
+
+namespace {
+
+EpidStatus ProvisionBulkAndStart(MemberCtx* ctx, GroupPubKey const* pub_key,
+ PrivKey const* priv_key,
+ MemberPrecomp const* precomp_str) {
+ EpidStatus sts;
+ sts = EpidProvisionKey(ctx, pub_key, priv_key, precomp_str);
+ if (sts != kEpidNoErr) {
+ return sts;
+ }
+ sts = EpidMemberStartup(ctx);
+ return sts;
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkFailsGivenNullParameters) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionKey(nullptr, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionKey(member, nullptr, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionKey(member, &pub_key, nullptr, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionKey(nullptr, &pub_key, &priv_key, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionKey(member, nullptr, &priv_key, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidProvisionKey(member, &pub_key, nullptr, nullptr));
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkSucceedsGivenValidParameters) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionKey(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidNoErr, EpidProvisionKey(member, &pub_key, &priv_key, nullptr));
+ EpidMemberDelete(&member);
+}
+
+// test that create succeeds with valid IKGF given parameters
+TEST_F(EpidMemberTest, ProvisionBulkSucceedsGivenValidParametersUsingIKGFData) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ const GroupPubKey pub_key = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/pubkey.inc"
+ };
+ const PrivKey priv_key = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/member0/mprivkey.inc"
+ };
+
+ const MemberPrecomp precomp = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/member0/mprecomp.inc"
+ };
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionKey(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidNoErr, EpidProvisionKey(member, &pub_key, &priv_key, nullptr));
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidGroupPubKey) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.h1.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.h1.y.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.h2.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.h2.y.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.w.x[0].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.w.x[1].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.w.y[0].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ pub_key = this->kGroupPublicKey;
+ pub_key.w.y[1].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidF) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+ FpElemStr f = {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
+ };
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+
+ priv_key = this->kMemberPrivateKey;
+ priv_key.f = f;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidPrivateKey) {
+ MemberCtx* member = nullptr;
+ Prng prng;
+
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MemberPrecomp precomp = this->kMemberPrecomp;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+
+ priv_key = this->kMemberPrivateKey;
+ priv_key.A.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ priv_key = this->kMemberPrivateKey;
+ priv_key.A.y.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidBadArgErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ EpidMemberDelete(&member);
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkCanStoreMembershipCredential) {
+ Prng prng;
+ uint32_t nv_index = 0x01c10100;
+ MemberCtx* member = nullptr;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MembershipCredential const orig_credential{priv_key.gid, priv_key.A,
+ priv_key.x};
+ MembershipCredential credential;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &priv_key.f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ EXPECT_EQ(kEpidNoErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ EXPECT_EQ(kEpidNoErr, EpidNvReadMembershipCredential(
+ member->tpm2_ctx, nv_index, &pub_key, &credential));
+ EXPECT_EQ(orig_credential, credential);
+ EpidMemberDelete(&member);
+}
+
+} // namespace
diff --git a/epid/member/unittests/request_join-test.cc b/epid/member/unittests/request_join-test.cc
deleted file mode 100644
index 3ddce19..0000000
--- a/epid/member/unittests/request_join-test.cc
+++ /dev/null
@@ -1,375 +0,0 @@
-/*############################################################################
- # Copyright 2016-2017 Intel Corporation
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ############################################################################*/
-
-/*!
- * \file
- * \brief RequestJoin unit tests.
- */
-
-#include <memory>
-#include "epid/common-testhelper/epid_gtest-testhelper.h"
-#include "gtest/gtest.h"
-
-extern "C" {
-#include "epid/member/api.h"
-#include "epid/common/math/ecgroup.h"
-#include "epid/common/math/finitefield.h"
-#include "epid/common/src/epid2params.h"
-}
-
-#include "epid/member/unittests/member-testhelper.h"
-#include "epid/common-testhelper/prng-testhelper.h"
-#include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
-#include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
-#include "epid/common-testhelper/epid_params-testhelper.h"
-#include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
-#include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
-
-namespace {
-
-// local constant for RequestJoin tests. This can be hoisted later if needed
-// avoids cpplint warning about multiple includes.
-const GroupPubKey kPubKey = {
-#include "epid/common-testhelper/testdata/grp01/gpubkey.inc"
-};
-
-TEST_F(EpidMemberTest, RequestJoinFailsGivenNullParameters) {
- GroupPubKey pub_key = kPubKey;
- IssuerNonce ni;
- FpElemStr f;
- Prng prng;
- BitSupplier rnd_func = Prng::Generate;
- void* rnd_param = &prng;
- JoinRequest join_request;
- EXPECT_EQ(kEpidBadArgErr, EpidRequestJoin(nullptr, &ni, &f, rnd_func,
- rnd_param, kSha256, &join_request));
- EXPECT_EQ(kEpidBadArgErr, EpidRequestJoin(&pub_key, nullptr, &f, rnd_func,
- rnd_param, kSha256, &join_request));
- EXPECT_EQ(kEpidBadArgErr, EpidRequestJoin(&pub_key, &ni, nullptr, rnd_func,
- rnd_param, kSha256, &join_request));
- EXPECT_EQ(kEpidBadArgErr, EpidRequestJoin(&pub_key, &ni, &f, rnd_func,
- rnd_param, kSha256, nullptr));
- EXPECT_EQ(kEpidBadArgErr, EpidRequestJoin(&pub_key, &ni, &f, nullptr,
- rnd_param, kSha256, &join_request));
-}
-
-TEST_F(EpidMemberTest, RequestJoinFailsGivenInvalidGroupKey) {
- Prng prng;
- BitSupplier rnd_func = Prng::Generate;
- void* rnd_param = &prng;
- JoinRequest join_request;
- GroupPubKey pub_key = kPubKey;
- FpElemStr f = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
- };
- IssuerNonce ni = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
- };
- pub_key.h1.x.data.data[15] = 0xff;
- Epid20Params params;
- EcPointObj pt(&params.G1);
- ASSERT_NE(kEpidNoErr, ReadEcPoint(params.G1, (uint8_t*)&pub_key.h1,
- sizeof(pub_key.h1), pt));
- EXPECT_EQ(kEpidBadArgErr, EpidRequestJoin(&pub_key, &ni, &f, rnd_func,
- rnd_param, kSha256, &join_request));
-}
-
-TEST_F(EpidMemberTest, RequestJoinFailsGivenInvalidFValue) {
- Prng prng;
- BitSupplier rnd_func = Prng::Generate;
- void* rnd_param = &prng;
- JoinRequest join_request;
- GroupPubKey pub_key = kPubKey;
- FpElemStr f = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
- };
- IssuerNonce ni = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
- };
-
- const BigNumStr p = {
- {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xCD, 0x46, 0xE5, 0xF2, 0x5E,
- 0xEE, 0x71, 0xA4, 0x9E, 0x0C, 0xDC, 0x65, 0xFB, 0x12, 0x99, 0x92, 0x1A,
- 0xF6, 0x2D, 0x53, 0x6C, 0xD1, 0x0B, 0x50, 0x0D}}};
- FiniteFieldObj Fp(p);
- FfElementObj el(&Fp);
- ASSERT_NE(kEpidNoErr, ReadFfElement(Fp, (uint8_t*)&f, sizeof(f), el));
- EXPECT_EQ(kEpidBadArgErr, EpidRequestJoin(&pub_key, &ni, &f, rnd_func,
- rnd_param, kSha256, &join_request));
-}
-
-TEST_F(EpidMemberTest,
- GeneratesValidJoinRequestGivenValidParametersUsingIKGFData) {
- Prng prng;
- BitSupplier rnd_func = Prng::Generate;
- void* rnd_param = &prng;
- JoinRequest join_request;
- FpElemStr f = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
- };
- IssuerNonce ni = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
- };
- const GroupPubKey* grp_public_key = reinterpret_cast<const GroupPubKey*>(
- this->kGroupPublicKeyDataIkgf.data());
- EXPECT_EQ(kEpidNoErr, EpidRequestJoin(grp_public_key, &ni, &f, rnd_func,
- rnd_param, kSha256, &join_request));
-}
-
-TEST_F(EpidMemberTest, GeneratesValidJoinRequestGivenValidParameters) {
- Prng prng;
- BitSupplier rnd_func = Prng::Generate;
- void* rnd_param = &prng;
- JoinRequest join_request;
- GroupPubKey pub_key = kPubKey;
- FpElemStr f = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
- };
- IssuerNonce ni = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
- };
- EXPECT_EQ(kEpidNoErr, EpidRequestJoin(&pub_key, &ni, &f, rnd_func, rnd_param,
- kSha256, &join_request));
-}
-
-TEST_F(EpidMemberTest, GeneratesDiffJoinRequestsOnMultipleCalls) {
- Prng prng;
- BitSupplier rnd_func = Prng::Generate;
- void* rnd_param = &prng;
- JoinRequest join_request1;
- JoinRequest join_request2;
- GroupPubKey pub_key = kPubKey;
- FpElemStr f = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
- };
- IssuerNonce ni = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
- };
- prng.set_seed(0x1234);
- EXPECT_EQ(kEpidNoErr, EpidRequestJoin(&pub_key, &ni, &f, rnd_func, rnd_param,
- kSha256, &join_request1));
- EXPECT_EQ(kEpidNoErr, EpidRequestJoin(&pub_key, &ni, &f, rnd_func, rnd_param,
- kSha256, &join_request2));
- EXPECT_NE(0, memcmp(&join_request1, &join_request2, sizeof(join_request1)));
-}
-
-TEST_F(EpidMemberTest, GeneratesDiffJoinRequestsGivenDiffHashAlgs) {
- Prng prng;
- BitSupplier rnd_func = Prng::Generate;
- void* rnd_param = &prng;
- JoinRequest join_request1;
- JoinRequest join_request2;
- GroupPubKey pub_key = kPubKey;
- FpElemStr f = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
- };
- IssuerNonce ni = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
- 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01,
- };
- prng.set_seed(0x1234);
- EXPECT_EQ(kEpidNoErr, EpidRequestJoin(&pub_key, &ni, &f, rnd_func, rnd_param,
- kSha256, &join_request1));
- prng.set_seed(0x1234);
- EXPECT_EQ(kEpidNoErr, EpidRequestJoin(&pub_key, &ni, &f, rnd_func, rnd_param,
- kSha512, &join_request2));
- EXPECT_NE(0, memcmp(&join_request1, &join_request2, sizeof(join_request1)));
-}
-
-TEST_F(EpidMemberTest, EpidAssemblePrivKeyFailsGivenNullParameters) {
- MembershipCredential credential = {this->kGrpXMember9PrivKey.gid,
- this->kGrpXMember9PrivKey.A,
- this->kGrpXMember9PrivKey.x};
- PrivKey new_priv_key;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(nullptr, &this->kGrpXMember9PrivKey.f,
- &this->kGrpXKey, &new_priv_key));
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, nullptr, &this->kGrpXKey,
- &new_priv_key));
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &this->kGrpXMember9PrivKey.f,
- nullptr, &new_priv_key));
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &this->kGrpXMember9PrivKey.f,
- &this->kGrpXKey, nullptr));
-}
-
-TEST_F(EpidMemberTest, EpidAssemblePrivKeyFailsGivenGroupIdMissmatch) {
- // Check wrong gid for GroupPubKey
- PrivKey new_priv_key;
- MembershipCredential credential = {this->kGrpXMember9PrivKey.gid,
- this->kGrpXMember9PrivKey.A,
- this->kGrpXMember9PrivKey.x};
- FpElemStr f = this->kGrpXMember9PrivKey.f;
- GroupPubKey group_pub_key = this->kGrpXKey;
- group_pub_key.gid.data[0] = group_pub_key.gid.data[0] ^ 0xFF;
- EXPECT_EQ(kEpidBadArgErr, EpidAssemblePrivKey(&credential, &f, &group_pub_key,
- &new_priv_key));
- // Check wrong gid for PrivKey
- credential.gid.data[sizeof(credential.gid.data) - 1] =
- credential.gid.data[sizeof(credential.gid.data) - 1] ^ 0xFF;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &this->kGrpXKey, &new_priv_key));
- // Check wrong gid for both GroupPubKey and PrivKey
- EXPECT_EQ(kEpidBadArgErr, EpidAssemblePrivKey(&credential, &f, &group_pub_key,
- &new_priv_key));
-}
-
-TEST_F(EpidMemberTest, EpidAssemblePrivKeyRejectsInvalidPrivKey) {
- // test for invalid key components values (eg. out of range, not in EC group)
- PrivKey new_priv_key;
- MembershipCredential credential = {this->kGrpXMember9PrivKey.gid,
- this->kGrpXMember9PrivKey.A,
- this->kGrpXMember9PrivKey.x};
- FpElemStr f = this->kGrpXMember9PrivKey.f;
- credential.A.x.data.data[0] = 0xFF;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &this->kGrpXKey, &new_priv_key));
- credential.A = this->kGrpXMember9PrivKey.A;
-
- credential.A.y.data.data[0] = 0xFF;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &this->kGrpXKey, &new_priv_key));
- credential.A = this->kGrpXMember9PrivKey.A;
-
- FpElemStr inv_f = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
- };
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &inv_f, &this->kGrpXKey, &new_priv_key));
-
- credential.x.data.data[0] = 0xFF;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &this->kGrpXKey, &new_priv_key));
-}
-
-TEST_F(EpidMemberTest, EpidAssemblePrivKeyRejectsInvalidGroupKey) {
- // test for invalid key components values (eg. out of range, not in EC group)
- PrivKey new_priv_key;
- MembershipCredential credential = {this->kGrpXMember9PrivKey.gid,
- this->kGrpXMember9PrivKey.A,
- this->kGrpXMember9PrivKey.x};
- FpElemStr f = this->kGrpXMember9PrivKey.f;
- GroupPubKey pub_key = this->kGrpXKey;
- pub_key.h1.x.data.data[0] = 0xFF;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &pub_key, &new_priv_key));
-
- pub_key = this->kGrpXKey;
- pub_key.h1.y.data.data[0] = 0xFF;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &pub_key, &new_priv_key));
-
- pub_key = this->kGrpXKey;
- pub_key.h2.x.data.data[0] = 0xFF;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &pub_key, &new_priv_key));
-
- pub_key = this->kGrpXKey;
- pub_key.h2.y.data.data[0] = 0xFF;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &pub_key, &new_priv_key));
-
- pub_key = this->kGrpXKey;
- pub_key.w.x[0].data.data[0] = 0xFF;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &pub_key, &new_priv_key));
-
- pub_key = this->kGrpXKey;
- pub_key.w.x[1].data.data[0] = 0xFF;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &pub_key, &new_priv_key));
-
- pub_key = this->kGrpXKey;
- pub_key.w.y[0].data.data[0] = 0xFF;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &pub_key, &new_priv_key));
-
- pub_key = this->kGrpXKey;
- pub_key.w.y[1].data.data[0] = 0xFF;
- EXPECT_EQ(kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &pub_key, &new_priv_key));
-}
-
-TEST_F(EpidMemberTest, EpidAssemblePrivKeyRejectsKeyNotInGroup) {
- PrivKey new_priv_key;
- MembershipCredential credential = {this->kGrpXMember9PrivKey.gid,
- this->kGrpXMember9PrivKey.A,
- this->kGrpXMember9PrivKey.x};
- FpElemStr f = this->kGrpXMember9PrivKey.f;
- EXPECT_EQ(
- kEpidBadArgErr,
- EpidAssemblePrivKey(&credential, &f, &this->kGrpYKey, &new_priv_key));
-}
-
-TEST_F(EpidMemberTest, EpidAssemblePrivKeyRejectsKeyNotInGroupUsingIKGFData) {
- const GroupPubKey* grp_public_key = reinterpret_cast<const GroupPubKey*>(
- this->kGroupPublicKeyDataIkgf.data());
- const PrivKey mbr_private_key = {
-#include "epid/common-testhelper/testdata/ikgf/groupb/member0/mprivkey.inc"
- };
- PrivKey new_priv_key;
- MembershipCredential credential = {mbr_private_key.gid, mbr_private_key.A,
- mbr_private_key.x};
- FpElemStr f = mbr_private_key.f;
- EXPECT_EQ(kEpidBadArgErr, EpidAssemblePrivKey(&credential, &f, grp_public_key,
- &new_priv_key));
-}
-
-TEST_F(EpidMemberTest, EpidAssemblePrivKeyAssemblesKeyInGroup) {
- MembershipCredential credential = {this->kGrpXMember9PrivKey.gid,
- this->kGrpXMember9PrivKey.A,
- this->kGrpXMember9PrivKey.x};
- PrivKey new_priv_key;
- EXPECT_EQ(kEpidNoErr,
- EpidAssemblePrivKey(&credential, &this->kGrpXMember9PrivKey.f,
- &this->kGrpXKey, &new_priv_key));
- EXPECT_EQ(0, memcmp(&this->kGrpXMember9PrivKey, &new_priv_key,
- sizeof(new_priv_key)));
-}
-
-} // namespace
diff --git a/epid/member/unittests/resize-test.cc b/epid/member/unittests/resize-test.cc
new file mode 100644
index 0000000..f674aab
--- /dev/null
+++ b/epid/member/unittests/resize-test.cc
@@ -0,0 +1,63 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+/// ResizeOctStr unit tests.
+/*! \file */
+#include <vector>
+
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/src/resize.h"
+}
+
+#include "epid/common-testhelper/errors-testhelper.h"
+namespace {
+TEST(ResizeOctStr, FailsGivenNullPointer) {
+ uint8_t a[3] = {0, 1, 2};
+ uint8_t r[3] = {0};
+ EXPECT_EQ(kEpidBadArgErr, ResizeOctStr(nullptr, sizeof(a), r, sizeof(r)));
+ EXPECT_EQ(kEpidBadArgErr, ResizeOctStr(a, sizeof(a), nullptr, sizeof(r)));
+}
+
+TEST(ResizeOctStr, FailsGivenInvalidSize) {
+ uint8_t a[3] = {0, 1, 2};
+ uint8_t r[3] = {0};
+ EXPECT_EQ(kEpidBadArgErr, ResizeOctStr(a, 0, r, sizeof(r)));
+ EXPECT_EQ(kEpidBadArgErr, ResizeOctStr(a, sizeof(a), r, 0));
+}
+
+TEST(ResizeOctStr, FailsGivenResultIsTooSmall) {
+ uint8_t a[3] = {0, 1, 2};
+ uint8_t r[1] = {0};
+ EXPECT_EQ(kEpidBadArgErr, ResizeOctStr(a, sizeof(a), r, sizeof(r)));
+}
+
+TEST(ResizeOctStr, CanShrink) {
+ uint8_t a[3] = {0, 1, 2};
+ std::vector<uint8_t> r(2);
+ std::vector<uint8_t> r_expected = {1, 2};
+ EXPECT_EQ(kEpidNoErr, ResizeOctStr(a, sizeof(a), r.data(), r.size()));
+ EXPECT_EQ(r_expected, r);
+}
+
+TEST(ResizeOctStr, CanExtend) {
+ uint8_t a[3] = {0, 1, 2};
+ std::vector<uint8_t> r(5);
+ std::vector<uint8_t> r_expected = {0, 0, 0, 1, 2};
+ EXPECT_EQ(kEpidNoErr, ResizeOctStr(a, sizeof(a), r.data(), r.size()));
+ EXPECT_EQ(r_expected, r);
+}
+} // namespace
diff --git a/epid/member/unittests/sign-test.cc b/epid/member/unittests/sign-test.cc
index 46dc838..64994e2 100644
--- a/epid/member/unittests/sign-test.cc
+++ b/epid/member/unittests/sign-test.cc
@@ -19,6 +19,7 @@
* \brief Sign unit tests.
*/
#include <vector>
+
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
@@ -30,8 +31,8 @@ extern "C" {
#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/prng-testhelper.h"
-#include "epid/member/unittests/member-testhelper.h"
#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
namespace {
/// Count of elements in array
@@ -219,8 +220,6 @@ TEST_F(EpidMemberTest, SignsMessageUsingRandomBaseNoSigRl) {
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
- auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
size_t sig_len = sig_data.size() * sizeof(uint8_t);
@@ -364,6 +363,71 @@ TEST_F(EpidMemberTest,
EXPECT_EQ(kEpidSigValid,
EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
}
+#ifndef TPM_TSS
+TEST_F(EpidMemberTest, SignsMessageUsingHugeBasenameNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGrpXKey, this->kGrpXMember0PrivKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ std::vector<uint8_t> bsn(1024 * 1024); // exactly 1 MB
+ uint8_t c = 0;
+ for (size_t i = 0; i < bsn.size(); ++i) {
+ bsn[i] = c++;
+ }
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
+ EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
+ size_t sig_len = sig_data.size() * sizeof(uint8_t);
+ EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), sig, sig_len));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGrpXKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+TEST_F(EpidMemberTest, SignsMessageUsingHugeBasenameWithSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGrpXKey, this->kGrpXMember0PrivKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ std::vector<uint8_t> bsn(1024 * 1024); // exactly 1 MB
+ uint8_t c = 0;
+ for (size_t i = 0; i < bsn.size(); ++i) {
+ bsn[i] = c++;
+ }
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ SigRl const* srl = reinterpret_cast<SigRl const*>(this->kGrpXSigRl.data());
+ size_t srl_size = this->kGrpXSigRl.size() * sizeof(this->kGrpXSigRl[0]);
+ std::vector<uint8_t> sig_data(EpidGetSigSize(srl));
+ EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
+ size_t sig_len = sig_data.size() * sizeof(uint8_t);
+ THROW_ON_EPIDERR(EpidMemberSetSigRl(member, srl, srl_size));
+ EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), sig, sig_len));
+ VerifierCtxObj ctx(this->kGrpXKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+}
+
+TEST_F(EpidMemberTest, SignsMsgUsingBsnContainingAllPossibleBytesNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kData_0_255;
+ std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
+ EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
+ size_t sig_len = sig_data.size() * sizeof(uint8_t);
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+#endif
/////////////////////////////////////////////////////////////////////////
// Variable sigRL
@@ -631,18 +695,61 @@ TEST_F(EpidMemberTest, SignMessageReportsIfMemberRevokedUsingIKGFData) {
EXPECT_EQ(kEpidSigRevokedInSigRl,
EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
}
+
+/////////////////////////////////////////////////////////////////////////
+// Revoked member by sigRL for TPM case
+
+TEST_F(EpidMemberTest,
+ PROTECTED_SignMessageByCedentialReportsIfMemberRevoked_EPS0) {
+ // note: a complete sig + nr proof should still be returned!!
+ auto& pub_key = this->kEps0GroupPublicKey;
+ auto credential = *(MembershipCredential const*)&this->kEps0MemberPrivateKey;
+ const std::vector<uint8_t> msg = {'t', 'e', 's', 't', '2'};
+ Prng my_prng;
+ MemberCtxObj member(pub_key, credential, &Prng::Generate, &my_prng);
+ const std::vector<uint8_t> kEps0SigRlMember0Sha256Rndbase0Msg0FirstEntry = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+ 0x39, 0x97, 0x09, 0x11, 0x30, 0xb0, 0x2a, 0x29, 0xa7, 0x9b, 0xf1, 0xef,
+ 0xe9, 0xe5, 0xc7, 0x03, 0x17, 0xe6, 0x4f, 0x6f, 0x49, 0x4d, 0xeb, 0x0f,
+ 0xfd, 0x1c, 0x3f, 0xce, 0xcc, 0xc8, 0x40, 0x6b, 0x23, 0xd3, 0xec, 0x78,
+ 0x78, 0x15, 0x4a, 0x34, 0x0f, 0xd1, 0xd3, 0xfa, 0xd2, 0xb2, 0x5a, 0xc9,
+ 0xec, 0xa2, 0x41, 0xe1, 0x46, 0x6d, 0xed, 0xb3, 0x4a, 0xa6, 0xdf, 0xb6,
+ 0xc2, 0x11, 0x49, 0x0d, 0x8b, 0xc4, 0xdc, 0xe0, 0x3f, 0x86, 0x59, 0xb6,
+ 0x47, 0x0e, 0x72, 0xd9, 0x04, 0x91, 0x06, 0x8d, 0xe7, 0xb0, 0x4e, 0x40,
+ 0x4a, 0x72, 0xe2, 0x99, 0xcc, 0xf2, 0x93, 0x1f, 0xcb, 0x32, 0x2e, 0xa3,
+ 0x62, 0xf5, 0x35, 0x51, 0x8b, 0x8e, 0xc8, 0xf4, 0x1e, 0xbe, 0xc9, 0xf4,
+ 0xa9, 0xc4, 0x63, 0xd3, 0x86, 0x5d, 0xf6, 0x44, 0x36, 0x5c, 0x44, 0x11,
+ 0xb4, 0xa3, 0x85, 0xd5, 0x9e, 0xaf, 0x56, 0x83};
+ auto srl = reinterpret_cast<SigRl const*>(
+ kEps0SigRlMember0Sha256Rndbase0Msg0FirstEntry.data());
+ size_t srl_size = kEps0SigRlMember0Sha256Rndbase0Msg0FirstEntry.size();
+
+ std::vector<uint8_t> sig_data(EpidGetSigSize(srl));
+ EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
+ size_t sig_len = sig_data.size() * sizeof(uint8_t);
+ THROW_ON_EPIDERR(EpidMemberSetSigRl(member, srl, srl_size));
+ EXPECT_EQ(kEpidSigRevokedInSigRl,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+
+ VerifierCtxObj ctx(pub_key);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+
+ EXPECT_EQ(kEpidSigRevokedInSigRl,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
/////////////////////////////////////////////////////////////////////////
// Variable hash alg
TEST_F(EpidMemberTest, SignsMessageUsingSha256HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha256,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
size_t sig_len = sig_data.size() * sizeof(uint8_t);
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
EXPECT_EQ(kEpidNoErr,
EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
// verify signature
@@ -654,13 +761,12 @@ TEST_F(EpidMemberTest, SignsMessageUsingSha256HashAlg) {
TEST_F(EpidMemberTest, SignsMessageUsingSha384HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha384,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
size_t sig_len = sig_data.size() * sizeof(uint8_t);
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha384));
EXPECT_EQ(kEpidNoErr,
EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
// verify signature
@@ -672,13 +778,12 @@ TEST_F(EpidMemberTest, SignsMessageUsingSha384HashAlg) {
TEST_F(EpidMemberTest, SignsMessageUsingSha512HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha512,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
size_t sig_len = sig_data.size() * sizeof(uint8_t);
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512));
EXPECT_EQ(kEpidNoErr,
EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
// verify signature
@@ -691,12 +796,12 @@ TEST_F(EpidMemberTest, SignsMessageUsingSha512HashAlg) {
TEST_F(EpidMemberTest, SignsMessageUsingSha512256HashAlg) {
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
- this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ kSha512_256, this->kMemberPrecomp, &Prng::Generate,
+ &my_prng);
auto& msg = this->kMsg0;
std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
size_t sig_len = sig_data.size() * sizeof(uint8_t);
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512_256));
EXPECT_EQ(kEpidNoErr,
EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
// verify signature
@@ -707,6 +812,71 @@ TEST_F(EpidMemberTest, SignsMessageUsingSha512256HashAlg) {
}
/////////////////////////////////////////////////////////////////////////
+// Variable hash alg for TPM data
+
+TEST_F(EpidMemberTest,
+ PROTECTED_SignsMessageByCredentialUsingSha256HashAlg_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
+ EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
+ size_t sig_len = sig_data.size() * sizeof(uint8_t);
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest,
+ DISABLED_PROTECTED_SignsMessageByCredentialUsingSha384HashAlg_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
+ EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
+ size_t sig_len = sig_data.size() * sizeof(uint8_t);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha384));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha384));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest,
+ DISABLED_PROTECTED_SignsMessageByCredentialUsingSha512HashAlg_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
+ EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
+ size_t sig_len = sig_data.size() * sizeof(uint8_t);
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha512));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+/////////////////////////////////////////////////////////////////////////
// Variable precomputed signatures
TEST_F(EpidMemberTest, SignConsumesPrecomputedSignaturesNoSigRl) {
@@ -962,4 +1132,19 @@ TEST_F(EpidMemberTest, SignsLongMessageWithSigRl) {
<< "EpidVerify for message_len: " << 1000000 << " failed";
}
+TEST_F(EpidMemberTest, SignsMsgContainingAllPossibleBytesNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ std::vector<uint8_t> sig_data(EpidGetSigSize(nullptr));
+ EpidSignature* sig = reinterpret_cast<EpidSignature*>(sig_data.data());
+ size_t sig_len = sig_data.size() * sizeof(uint8_t);
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ std::vector<uint8_t> msg = this->kData_0_255;
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
} // namespace
diff --git a/epid/member/unittests/signbasic-test.cc b/epid/member/unittests/signbasic-test.cc
index 3dd4302..1a92f7b 100644
--- a/epid/member/unittests/signbasic-test.cc
+++ b/epid/member/unittests/signbasic-test.cc
@@ -13,25 +13,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.
############################################################################*/
+/// SignBasic unit tests.
+/*! \file */
-/*!
- * \file
- * \brief SignBasic unit tests.
- */
-
+#include <cstring>
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
extern "C" {
#include "epid/member/api.h"
+#include "epid/member/src/signbasic.h"
#include "epid/verifier/api.h"
}
#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/prng-testhelper.h"
-#include "epid/member/unittests/member-testhelper.h"
#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
+bool operator==(BigNumStr const& lhs, BigNumStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
namespace {
/// Count of elements in array
@@ -46,14 +48,47 @@ TEST_F(EpidMemberTest, SignBasicFailsGivenNullParameters) {
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
BasicSignature basic_sig;
- EXPECT_EQ(kEpidBadArgErr, EpidSignBasic(nullptr, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
- EXPECT_EQ(kEpidBadArgErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), nullptr));
- EXPECT_EQ(kEpidBadArgErr, EpidSignBasic(member, nullptr, msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSignBasic(nullptr, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), nullptr, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSignBasic(member, nullptr, msg.size(), bsn.data(), bsn.size(),
+ &basic_sig, nullptr));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSignBasic(member, msg.data(), msg.size(), nullptr, bsn.size(),
+ &basic_sig, nullptr));
+}
+TEST_F(EpidMemberTest, SignBasicFailsGivenNullBasenameAndNullRandomBasename) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ BasicSignature basic_sig;
EXPECT_EQ(kEpidBadArgErr, EpidSignBasic(member, msg.data(), msg.size(),
- nullptr, bsn.size(), &basic_sig));
+ nullptr, 0, &basic_sig, nullptr));
+}
+TEST_F(EpidMemberTest, SignBasicDoesNotComputeRandomBasenameGivenBasename) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ BigNumStr rnd_bsn = {0};
+ BigNumStr zero = {0};
+ BasicSignature basic_sig;
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, &rnd_bsn));
+ EXPECT_EQ(zero, rnd_bsn);
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
}
TEST_F(EpidMemberTest, SignBasicFailsForBasenameWithoutRegisteredBasenames) {
Prng my_prng;
@@ -62,10 +97,11 @@ TEST_F(EpidMemberTest, SignBasicFailsForBasenameWithoutRegisteredBasenames) {
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
BasicSignature basic_sig;
- EXPECT_EQ(kEpidBadArgErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
}
-TEST_F(EpidMemberTest, SignBasicFailsIfGivenUnregisteredBasename) {
+TEST_F(EpidMemberTest, SignBasicFailsForUnregisteredBasename) {
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
@@ -76,7 +112,7 @@ TEST_F(EpidMemberTest, SignBasicFailsIfGivenUnregisteredBasename) {
BasicSignature basic_sig;
EXPECT_EQ(kEpidBadArgErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn1.data(),
- bsn1.size(), &basic_sig));
+ bsn1.size(), &basic_sig, nullptr));
}
/////////////////////////////////////////////////////////////////////////
// Anonymity
@@ -87,10 +123,11 @@ TEST_F(EpidMemberTest, BasicSignaturesOfSameMessageAreDifferent) {
auto& msg = this->kMsg0;
BasicSignature basic_sig1 = {0};
BasicSignature basic_sig2 = {0};
+ BigNumStr rnd_bsn = {0};
EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig1));
+ 0, &basic_sig1, &rnd_bsn));
EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig2));
+ 0, &basic_sig2, &rnd_bsn));
EXPECT_NE(0, memcmp(&basic_sig1, &basic_sig2, sizeof(BasicSignature)));
}
TEST_F(EpidMemberTest,
@@ -103,10 +140,12 @@ TEST_F(EpidMemberTest,
BasicSignature basic_sig1;
BasicSignature basic_sig2;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig1));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig2));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig1, nullptr));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig2, nullptr));
EXPECT_NE(0, memcmp(&basic_sig1, &basic_sig2, sizeof(BasicSignature)));
}
/////////////////////////////////////////////////////////////////////////
@@ -117,13 +156,36 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingRandomBase) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
BasicSignature basic_sig;
+ BigNumStr rnd_bsn = {0};
+ BigNumStr zero = {0};
EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig));
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_NE(0, memcmp(&rnd_bsn, &zero, sizeof(BigNumStr)));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
EXPECT_EQ(kEpidSigValid,
EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
}
+TEST_F(EpidMemberTest,
+ PROTECTED_SignBasicSucceedsUsingRandomBaseWithCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ BasicSignature basic_sig;
+ BigNumStr rnd_bsn = {0};
+ BigNumStr zero = {0};
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &basic_sig, &rnd_bsn));
+ EXPECT_NE(0, memcmp(&rnd_bsn, &zero, sizeof(BigNumStr)));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
TEST_F(EpidMemberTest, SignBasicSucceedsUsingBasename) {
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
@@ -132,14 +194,38 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingBasename) {
auto& bsn = this->kBsn0;
BasicSignature basic_sig;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
EXPECT_EQ(kEpidSigValid,
EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
}
+
+TEST_F(EpidMemberTest,
+ PROTECTED_SignBasicSucceedsUsingBasenameWithCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ BasicSignature basic_sig;
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
+
TEST_F(EpidMemberTest, SignBasicSucceedsUsingBasenameUsingIKGFData) {
Prng my_prng;
GroupPubKey grp_public_key = *reinterpret_cast<const GroupPubKey*>(
@@ -152,8 +238,9 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingBasenameUsingIKGFData) {
auto& bsn = this->kBsn0;
BasicSignature basic_sig;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
// verify basic signature
VerifierCtxObj ctx(grp_public_key);
THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
@@ -169,11 +256,11 @@ TEST_F(EpidMemberTest,
auto& bsn = this->kBsn0;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ BigNumStr rnd_bsn = {0};
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &basic_sig, &rnd_bsn));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
- THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
EXPECT_EQ(kEpidSigValid,
EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
}
@@ -184,43 +271,127 @@ TEST_F(EpidMemberTest,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
BasicSignature basic_sig;
+ BigNumStr rnd_bsn = {0};
EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig));
+ 0, &basic_sig, &rnd_bsn));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
EXPECT_EQ(kEpidSigValid,
EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
}
+#ifndef TPM_TSS
+TEST_F(EpidMemberTest, SignBasicSucceedsUsingBsnContainingAllPossibleBytes) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kData_0_255;
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ BasicSignature basic_sig;
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
+#endif
+
+TEST_F(EpidMemberTest,
+ PROTECTED_SignBasicSucceedsAllPossibleBytesForCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kData_0_255;
+ // 0 - 123
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), 124));
+ BasicSignature basic_sig;
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
+ bsn.data(), 124, &basic_sig, nullptr));
+ VerifierCtxObj ctx1(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx1, bsn.data(), 124));
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx1, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx1, &basic_sig, msg.data(), msg.size()));
+
+ // 124 - 247
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data() + 124, 124));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data() + 124, 124,
+ &basic_sig, nullptr));
+ VerifierCtxObj ctx2(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx2, bsn.data() + 124, 124));
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx2, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx2, &basic_sig, msg.data(), msg.size()));
+
+ // 248 - 255
+ THROW_ON_EPIDERR(
+ EpidRegisterBaseName(member, bsn.data() + 124 * 2, 256 - 124 * 2));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data() + 124 * 2,
+ 256 - 124 * 2, &basic_sig, nullptr));
+ VerifierCtxObj ctx3(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(
+ EpidVerifierSetBasename(ctx3, bsn.data() + 124 * 2, 256 - 124 * 2));
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx3, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx3, &basic_sig, msg.data(), msg.size()));
+}
/////////////////////////////////////////////////////////////////////////
// Variable hash alg
TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha256HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha256,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
EXPECT_EQ(kEpidSigValid,
EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
}
+TEST_F(EpidMemberTest,
+ PROTECTED_SignBasicSucceedsUsingSha256HashAlgWithCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey, kSha256,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ BasicSignature basic_sig;
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha384HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha384,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha384));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha384));
@@ -229,15 +400,15 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha384HashAlg) {
}
TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha512HashAlg) {
Prng my_prng;
- MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey, kSha512,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha512));
@@ -247,14 +418,15 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha512HashAlg) {
TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha512256HashAlg) {
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
- this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ kSha512_256, this->kMemberPrecomp, &Prng::Generate,
+ &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512_256));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha512_256));
@@ -272,24 +444,45 @@ TEST_F(EpidMemberTest, SignBasicConsumesPrecomputedSignatures) {
auto& bsn = this->kBsn0;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
// use 1 precomputed signature
- ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ ASSERT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
EXPECT_EQ((size_t)2, EpidGetNumPreSigs(member));
}
TEST_F(EpidMemberTest, SignBasicSucceedsWithPrecomputedSignatures) {
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
- THROW_ON_EPIDERR(EpidAddPreSigs(member, 1));
auto& msg = this->kMsg0;
BasicSignature basic_sig;
- auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ BigNumStr rnd_bsn = {0};
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &basic_sig, &rnd_bsn));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
- THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
+TEST_F(EpidMemberTest,
+ PROTECTED_SignBasicSucceedsUsingPrecompSigWithCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+
+ THROW_ON_EPIDERR(EpidAddPreSigs(member, 1));
+
+ auto& msg = this->kMsg0;
+
+ BasicSignature basic_sig;
+ BigNumStr rnd_bsn = {0};
+
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &basic_sig, &rnd_bsn));
+
+ VerifierCtxObj ctx(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
EXPECT_EQ(kEpidSigValid,
EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
}
@@ -302,11 +495,13 @@ TEST_F(EpidMemberTest, SignBasicSucceedsWithoutPrecomputedSignatures) {
BasicSignature basic_sig;
auto& bsn = this->kBsn0;
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
- ASSERT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ ASSERT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
// test sign without precomputed signatures
- EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(),
- bsn.data(), bsn.size(), &basic_sig));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
// verify basic signature
VerifierCtxObj ctx(this->kGroupPublicKey);
THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
@@ -324,7 +519,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsGivenEmptyMessage) {
THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), 0, bsn.data(),
- bsn.size(), &basic_sig));
+ bsn.size(), &basic_sig, nullptr));
VerifierCtxObj ctx(this->kGroupPublicKey);
THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
EXPECT_EQ(kEpidSigValid, EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), 0));
@@ -336,6 +531,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsWithShortMessage) {
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
BasicSignature basic_sig;
+ BigNumStr rnd_bsn = {0};
VerifierCtxObj ctx(this->kGroupPublicKey);
size_t lengths[] = {1, 13, 128, 256,
512, 1021, 1024}; // have desired lengths to loop over
@@ -345,8 +541,8 @@ TEST_F(EpidMemberTest, SignBasicSucceedsWithShortMessage) {
msg.at(n) = (uint8_t)n;
}
for (auto length : lengths) {
- EXPECT_EQ(kEpidNoErr,
- EpidSignBasic(member, msg.data(), length, nullptr, 0, &basic_sig))
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), length, nullptr, 0,
+ &basic_sig, &rnd_bsn))
<< "EpidSignBasic for message_len: " << length << " failed";
EXPECT_EQ(kEpidNoErr,
EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), length))
@@ -358,6 +554,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsWithLongMessage) {
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
BasicSignature basic_sig;
+ BigNumStr rnd_bsn = {0};
VerifierCtxObj ctx(this->kGroupPublicKey);
{ // 1000000
std::vector<uint8_t> msg(1000000); // allocate message for max size
@@ -365,12 +562,48 @@ TEST_F(EpidMemberTest, SignBasicSucceedsWithLongMessage) {
msg.at(n) = (uint8_t)n;
}
EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
- 0, &basic_sig))
+ 0, &basic_sig, &rnd_bsn))
<< "EpidSignBasic for message_len: " << 1000000 << " failed";
EXPECT_EQ(kEpidNoErr,
EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()))
<< "EpidVerifyBasicSig for message_len: " << 1000000 << " failed";
}
}
+TEST_F(EpidMemberTest, SignBasicSucceedsWithMsgContainingAllPossibleBytes) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kData_0_255;
+ auto& bsn = this->kBsn0;
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ BasicSignature basic_sig;
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
+TEST_F(EpidMemberTest,
+ PROTECTED_SignBasicSucceedsMsgAllPossibleBytesForCredential_EPS0) {
+ Prng my_prng;
+ MemberCtxObj member(
+ this->kEps0GroupPublicKey,
+ *(MembershipCredential const*)&this->kEps0MemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kData_0_255;
+ auto& bsn = this->kBsn0;
+ BasicSignature basic_sig;
+ THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), &basic_sig, nullptr));
+ VerifierCtxObj ctx(this->kEps0GroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
} // namespace
diff --git a/epid/member/unittests/storage-test.cc b/epid/member/unittests/storage-test.cc
new file mode 100644
index 0000000..0548e2b
--- /dev/null
+++ b/epid/member/unittests/storage-test.cc
@@ -0,0 +1,126 @@
+/*############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief Member credentials storage helper API unit tests.
+ */
+#include <cstring>
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+#include "epid/common-testhelper/epid2params_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tpm2/unittests/tpm2-testhelper.h"
+#include "epid/member/unittests/member-testhelper.h"
+
+extern "C" {
+#include "epid/member/src/storage.h"
+#include "epid/member/tpm2/nv.h"
+}
+
+namespace {
+
+TEST_F(EpidMemberTest, NvWriteMembershipCredentialFailsGivenNullPointer) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+
+ uint32_t nv_index = 0x01c10100;
+ GroupPubKey const pub_key = this->kGroupPublicKey;
+ // PrivKey can be trimed to MembershipCredential
+ MembershipCredential const credential =
+ *(MembershipCredential*)&this->kMemberPrivateKey;
+
+ EXPECT_EQ(kEpidBadArgErr, EpidNvWriteMembershipCredential(
+ nullptr, &pub_key, &credential, nv_index));
+ EXPECT_EQ(kEpidBadArgErr, EpidNvWriteMembershipCredential(
+ tpm, nullptr, &credential, nv_index));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNvWriteMembershipCredential(tpm, &pub_key, nullptr, nv_index));
+ // cleanup nv_index for next test
+ Tpm2NvUndefineSpace(tpm, nv_index);
+}
+
+TEST_F(EpidMemberTest, NvReadMembershipCredentialFailsGivenNoCredentials) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+
+ uint32_t nv_index = 0x01c10101;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ // PrivKey can be trimed to MembershipCredential
+ MembershipCredential credential =
+ *(MembershipCredential*)&this->kMemberPrivateKey;
+
+ EXPECT_EQ(kEpidBadArgErr, EpidNvReadMembershipCredential(
+ tpm, nv_index, &pub_key, &credential));
+}
+
+TEST_F(EpidMemberTest, NvReadMembershipCredentialFailsGivenNullPointer) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+
+ uint32_t nv_index = 0x01c10100;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ // PrivKey can be trimed to MembershipCredential
+ MembershipCredential credential =
+ *(MembershipCredential*)&this->kMemberPrivateKey;
+
+ // write credentials
+ EXPECT_EQ(kEpidNoErr, EpidNvWriteMembershipCredential(tpm, &pub_key,
+ &credential, nv_index));
+
+ EXPECT_EQ(kEpidBadArgErr, EpidNvReadMembershipCredential(
+ nullptr, nv_index, &pub_key, &credential));
+ EXPECT_EQ(kEpidBadArgErr, EpidNvReadMembershipCredential(
+ tpm, nv_index, nullptr, &credential));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNvReadMembershipCredential(tpm, nv_index, &pub_key, nullptr));
+ // cleanup nv_index for next test
+ Tpm2NvUndefineSpace(tpm, nv_index);
+}
+
+TEST_F(EpidMemberTest, WrittenMembershipCredentialCanBeRead) {
+ Prng my_prng;
+ Epid2ParamsObj epid2params;
+ Tpm2CtxObj tpm(&Prng::Generate, &my_prng, nullptr, epid2params);
+
+ uint32_t nv_index = 0x01c10100;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ // PrivKey can be trimed to MembershipCredential
+ MembershipCredential credential_expected =
+ *(MembershipCredential*)&this->kMemberPrivateKey;
+ MembershipCredential credential;
+
+ // write credentials
+ EXPECT_EQ(kEpidNoErr, EpidNvWriteMembershipCredential(
+ tpm, &pub_key, &credential_expected, nv_index));
+
+ // read credentials
+ EXPECT_EQ(kEpidNoErr, EpidNvReadMembershipCredential(tpm, nv_index, &pub_key,
+ &credential));
+
+ EXPECT_EQ(this->kGroupPublicKey, pub_key);
+ EXPECT_EQ(credential_expected, credential);
+ // cleanup nv_index for next test
+ Tpm2NvUndefineSpace(tpm, nv_index);
+}
+
+} // namespace
diff --git a/epid/verifier/1.1/api.h b/epid/verifier/1.1/api.h
index 610f930..ef8aa5b 100644
--- a/epid/verifier/1.1/api.h
+++ b/epid/verifier/1.1/api.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,9 +17,9 @@
#define EPID_VERIFIER_1_1_API_H_
#include <stddef.h>
-#include "epid/common/stdtypes.h"
#include "epid/common/1.1/types.h"
#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
#include "epid/verifier/api.h"
/*!
@@ -29,7 +29,7 @@
/// Intel(R) EPID 1.1 Verifier functionality
/*!
- \defgroup Epid11VerifierModule EPID 1.1 support
+ \defgroup Epid11VerifierModule Intel(R) EPID 1.1 support
To verify signatures coming from member devices that belong to an
Intel&reg; EPID 1.1 group, you need to use Intel&reg; EPID 1.1
@@ -74,7 +74,7 @@ typedef struct Epid11VerifierCtx Epid11VerifierCtx;
This API supports Intel(R) EPID 1.1 verification.
\note e12 = 0 implies that this data is not valid
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
#pragma pack(1)
@@ -110,7 +110,7 @@ typedef struct Epid11VerifierPrecomp {
\see Epid11VerifierDelete
\see Epid11VerifierWritePrecomp
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11VerifierCreate(Epid11GroupPubKey const* pub_key,
@@ -129,7 +129,7 @@ EpidStatus Epid11VerifierCreate(Epid11GroupPubKey const* pub_key,
The verifier context. Can be NULL.
\see Epid11VerifierCreate
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
void Epid11VerifierDelete(Epid11VerifierCtx** ctx);
@@ -147,7 +147,7 @@ void Epid11VerifierDelete(Epid11VerifierCtx** ctx);
\note
If the result is not ::kEpidNoErr the content of precomp is undefined.
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11VerifierWritePrecomp(Epid11VerifierCtx const* ctx,
@@ -186,7 +186,7 @@ EpidStatus Epid11VerifierWritePrecomp(Epid11VerifierCtx const* ctx,
pointed to by the verifier is undefined.
\see Epid11VerifierCreate
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11VerifierSetPrivRl(Epid11VerifierCtx* ctx,
@@ -227,7 +227,7 @@ EpidStatus Epid11VerifierSetPrivRl(Epid11VerifierCtx* ctx,
\see Epid11VerifierCreate
\see SdkOverview_11Verifier \see <a
- href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11VerifierSetSigRl(Epid11VerifierCtx* ctx,
@@ -267,7 +267,7 @@ EpidStatus Epid11VerifierSetSigRl(Epid11VerifierCtx* ctx,
to by the verifier is undefined.
\see Epid11VerifierCreate
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11VerifierSetGroupRl(Epid11VerifierCtx* ctx,
@@ -329,7 +329,7 @@ EpidStatus Epid11VerifierSetBasename(Epid11VerifierCtx* ctx,
verify should de considered to have failed.
\see Epid11VerifierCreate
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11Verify(Epid11VerifierCtx const* ctx,
@@ -364,7 +364,7 @@ EpidStatus Epid11Verify(Epid11VerifierCtx const* ctx,
verified.
\see Epid11VerifyBasicSig
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
bool Epid11AreSigsLinked(Epid11BasicSignature const* sig1,
@@ -396,7 +396,7 @@ bool Epid11AreSigsLinked(Epid11BasicSignature const* sig1,
failed.
\see Epid11VerifierCreate
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11VerifyBasicSig(Epid11VerifierCtx const* ctx,
@@ -442,7 +442,7 @@ EpidStatus Epid11VerifyBasicSig(Epid11VerifierCtx const* ctx,
\see Epid11VerifierCreate
\see Epid11VerifyBasicSig
\see Epid11CheckPrivRlEntry
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11NrVerify(Epid11VerifierCtx const* ctx,
@@ -482,7 +482,7 @@ EpidStatus Epid11NrVerify(Epid11VerifierCtx const* ctx,
\see Epid11VerifierCreate
\see Epid11NrVerify
\see Epid11VerifyBasicSig
- \see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1
+ \see <a href="group___epid11_verifier_module.html#details"><b>Intel(R) EPID 1.1
support</b></a>
*/
EpidStatus Epid11CheckPrivRlEntry(Epid11VerifierCtx const* ctx,
diff --git a/epid/verifier/1.1/src/context.c b/epid/verifier/1.1/src/context.c
index 2ecae20..3b80007 100644
--- a/epid/verifier/1.1/src/context.c
+++ b/epid/verifier/1.1/src/context.c
@@ -1,5 +1,5 @@
/*############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,13 +16,13 @@
/*!
* \file
-* \brief Intel EPID 1.1 Verifier context implementation.
+* \brief Intel Intel(R) EPID 1.1 Verifier context implementation.
*/
-#include "epid/verifier/1.1/api.h"
#include "epid/verifier/1.1/src/context.h"
-#include "epid/common/src/memory.h"
#include "epid/common/src/endian_convert.h"
+#include "epid/common/src/memory.h"
+#include "epid/verifier/1.1/api.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
diff --git a/epid/verifier/1.1/src/context.h b/epid/verifier/1.1/src/context.h
index 62663cb..653048b 100644
--- a/epid/verifier/1.1/src/context.h
+++ b/epid/verifier/1.1/src/context.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,11 +19,11 @@
* \file
* \brief Intel(R) EPID 1.1 Verifier context interface.
*/
+#include "epid/common/1.1/src/commitment.h"
+#include "epid/common/1.1/src/epid11params.h"
#include "epid/common/1.1/src/grouppubkey.h"
#include "epid/common/math/ecgroup.h"
#include "epid/common/math/finitefield.h"
-#include "epid/common/1.1/src/epid11params.h"
-#include "epid/common/1.1/src/commitment.h"
/// Verifier context definition
struct Epid11VerifierCtx {
diff --git a/epid/verifier/1.1/src/nrverify.c b/epid/verifier/1.1/src/nrverify.c
index dc834d8..7dd7126 100644
--- a/epid/verifier/1.1/src/nrverify.c
+++ b/epid/verifier/1.1/src/nrverify.c
@@ -18,12 +18,12 @@
* \file
* \brief Epid11NrVerify implementation.
*/
-#include "ext/ipp/include/ippcp.h"
+#include "epid/common/math/hash.h"
+#include "epid/common/src/endian_convert.h"
#include "epid/common/src/memory.h"
#include "epid/verifier/1.1/api.h"
#include "epid/verifier/1.1/src/context.h"
-#include "epid/common/src/endian_convert.h"
-#include "epid/common/math/hash.h"
+#include "ext/ipp/include/ippcp.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
if (kEpidNoErr != (ret)) { \
diff --git a/epid/verifier/1.1/src/verify.c b/epid/verifier/1.1/src/verify.c
index 98d062e..257aee0 100644
--- a/epid/verifier/1.1/src/verify.c
+++ b/epid/verifier/1.1/src/verify.c
@@ -20,9 +20,9 @@
*/
#include <string.h>
+#include "epid/common/src/endian_convert.h"
#include "epid/verifier/1.1/api.h"
#include "epid/verifier/1.1/src/context.h"
-#include "epid/common/src/endian_convert.h"
static size_t Epid11GetSignatureRlCount(Epid11Signature const* sig) {
return (!sig) ? 0 : ntohl(sig->n2);
diff --git a/epid/verifier/1.1/src/verifybasic.c b/epid/verifier/1.1/src/verifybasic.c
index d5a1480..2569a65 100644
--- a/epid/verifier/1.1/src/verifybasic.c
+++ b/epid/verifier/1.1/src/verifybasic.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,10 +20,10 @@
*/
#include <stdio.h>
#include <string.h>
-#include "epid/verifier/1.1/api.h"
-#include "epid/verifier/1.1/src/context.h"
#include "epid/common/math/src/bignum-internal.h"
#include "epid/common/src/memory.h"
+#include "epid/verifier/1.1/api.h"
+#include "epid/verifier/1.1/src/context.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
if (kEpidNoErr != (ret)) { \
diff --git a/epid/verifier/1.1/unittests/check_privrl_entry-test.cc b/epid/verifier/1.1/unittests/check_privrl_entry-test.cc
index 7fe6072..f5c9645 100644
--- a/epid/verifier/1.1/unittests/check_privrl_entry-test.cc
+++ b/epid/verifier/1.1/unittests/check_privrl_entry-test.cc
@@ -26,8 +26,8 @@ extern "C" {
#include "epid/verifier/1.1/api.h"
}
-#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
#include "epid/common-testhelper/1.1/verifier_wrapper-testhelper.h"
+#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
namespace {
diff --git a/epid/verifier/1.1/unittests/context-test.cc b/epid/verifier/1.1/unittests/context-test.cc
index b3e2172..56620fa 100644
--- a/epid/verifier/1.1/unittests/context-test.cc
+++ b/epid/verifier/1.1/unittests/context-test.cc
@@ -29,9 +29,9 @@ extern "C" {
#include "epid/verifier/1.1/src/context.h"
}
-#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/1.1/verifier_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
bool operator==(Epid11VerifierPrecomp const& lhs,
Epid11VerifierPrecomp const& rhs) {
return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
@@ -475,4 +475,15 @@ TEST_F(Epid11VerifierTest, SetBasenameResetsBasenameGivenNullBasename) {
THROW_ON_EPIDERR(Epid11VerifierSetBasename(ctx, nullptr, 0));
EXPECT_EQ(nullptr, ctx->basename_hash);
}
+TEST_F(Epid11VerifierTest, SetBasenameAcceptsBsnContainingAllPossibleBytes) {
+ Epid11VerifierCtxObj verifier(this->kPubKeyStrForMsg0_255,
+ this->kVerifierPrecompStr);
+ Epid11VerifierCtx* ctx = verifier;
+ auto& basename = this->kData_0_255;
+ EXPECT_EQ(kEpidNoErr,
+ Epid11VerifierSetBasename(ctx, basename.data(), basename.size()));
+ EXPECT_EQ(basename.size(), ctx->basename_len);
+ EXPECT_EQ(0, memcmp(basename.data(), ctx->basename, ctx->basename_len));
+ EXPECT_NE(nullptr, ctx->basename_hash);
+}
} // namespace
diff --git a/epid/verifier/1.1/unittests/nrverify-test.cc b/epid/verifier/1.1/unittests/nrverify-test.cc
index a384822..9d572e6 100644
--- a/epid/verifier/1.1/unittests/nrverify-test.cc
+++ b/epid/verifier/1.1/unittests/nrverify-test.cc
@@ -23,14 +23,14 @@
#include "gtest/gtest.h"
extern "C" {
+#include "epid/common/1.1/types.h"
#include "epid/verifier/1.1/api.h"
#include "epid/verifier/1.1/src/context.h"
-#include "epid/common/1.1/types.h"
}
-#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
-#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/common-testhelper/1.1/verifier_wrapper-testhelper.h"
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
namespace {
@@ -217,4 +217,16 @@ TEST_F(Epid11VerifierTest, NrVerifyAcceptsSigWithRandomBaseName) {
&sig_rl->bk[0], &epid_signature->sigma[0]));
}
+TEST_F(Epid11VerifierTest, NrVerifyAcceptsMsgContainingAllPossibleBytes) {
+ Epid11VerifierCtxObj verifier(this->kPubKeyStrForMsg0_255);
+ Epid11Signature const* epid_signature =
+ (Epid11Signature*)kSigGrp01Member0Sha256kBsn0Data_0_255.data();
+ Epid11SigRl const* sig_rl =
+ reinterpret_cast<Epid11SigRl const*>(this->kSigRlForMsg0_255.data());
+ EXPECT_EQ(kEpidSigValid,
+ Epid11NrVerify(verifier, &epid_signature->sigma0,
+ this->kData_0_255.data(), this->kData_0_255.size(),
+ &sig_rl->bk[0], &epid_signature->sigma[0]));
+}
+
} // namespace
diff --git a/epid/verifier/1.1/unittests/verifier-testhelper.cc b/epid/verifier/1.1/unittests/verifier-testhelper.cc
index 6ae3af0..9c3906a 100644
--- a/epid/verifier/1.1/unittests/verifier-testhelper.cc
+++ b/epid/verifier/1.1/unittests/verifier-testhelper.cc
@@ -18,8 +18,8 @@
* \file
* \brief Test fixture class for EpidVerifier.
*/
-#include <vector>
#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
+#include <vector>
const Epid11G3ElemStr Epid11VerifierTest::kG3IdentityStr = {0};
const Epid11GroupPubKey Epid11VerifierTest::kPubKeyStr = {
// gid
@@ -27,38 +27,76 @@ const Epid11GroupPubKey Epid11VerifierTest::kPubKeyStr = {
0x00, 0x00, 0x00, 0x7b,
},
// h1
- {{0x08, 0x4a, 0x9d, 0x2e, 0xf9, 0x4f, 0x78, 0x02, 0xd7, 0x89, 0x75, 0xb4,
- 0xe7, 0x25, 0x26, 0x9f, 0x00, 0x57, 0xad, 0x33, 0x30, 0xea, 0xa9, 0x6c,
- 0x00, 0x9e, 0x8b, 0xc8, 0x13, 0x23, 0xcb, 0x06},
- {0x04, 0xbe, 0x42, 0x74, 0x11, 0x07, 0xb1, 0x06, 0xd7, 0xef, 0x5f, 0x66,
- 0x87, 0xd9, 0xfa, 0xdd, 0x53, 0xae, 0xd7, 0xf4, 0x54, 0xf8, 0xd0, 0x21,
- 0x75, 0xe0, 0x07, 0x44, 0xc9, 0xc3, 0x4e, 0xf7}},
+ {{0x08, 0x4a, 0x9d, 0x2e, 0xf9, 0x4f, 0x78, 0x02, 0xd7, 0x89, 0x75,
+ 0xb4, 0xe7, 0x25, 0x26, 0x9f, 0x00, 0x57, 0xad, 0x33, 0x30, 0xea,
+ 0xa9, 0x6c, 0x00, 0x9e, 0x8b, 0xc8, 0x13, 0x23, 0xcb, 0x06},
+ {0x04, 0xbe, 0x42, 0x74, 0x11, 0x07, 0xb1, 0x06, 0xd7, 0xef, 0x5f,
+ 0x66, 0x87, 0xd9, 0xfa, 0xdd, 0x53, 0xae, 0xd7, 0xf4, 0x54, 0xf8,
+ 0xd0, 0x21, 0x75, 0xe0, 0x07, 0x44, 0xc9, 0xc3, 0x4e, 0xf7}},
// h2
- {{0x06, 0xd8, 0xa9, 0x90, 0x02, 0x8f, 0xca, 0xa5, 0x73, 0x36, 0x24, 0x03,
- 0xc9, 0xa8, 0x7e, 0x9d, 0x64, 0x12, 0xac, 0xa7, 0xbd, 0x17, 0x7f, 0x7c,
- 0x96, 0x8d, 0x2e, 0x13, 0xd9, 0xb2, 0x69, 0x47},
- {0x09, 0xdb, 0xe3, 0xbf, 0xbc, 0xa1, 0x34, 0x0f, 0xc6, 0xe2, 0x00, 0x3d,
- 0x98, 0xa3, 0x7d, 0xab, 0xd4, 0x0e, 0xec, 0xde, 0x4f, 0x97, 0xa9, 0xbb,
- 0xdd, 0x60, 0x94, 0x24, 0x7b, 0xb3, 0xf5, 0x94}},
+ {{0x06, 0xd8, 0xa9, 0x90, 0x02, 0x8f, 0xca, 0xa5, 0x73, 0x36, 0x24,
+ 0x03, 0xc9, 0xa8, 0x7e, 0x9d, 0x64, 0x12, 0xac, 0xa7, 0xbd, 0x17,
+ 0x7f, 0x7c, 0x96, 0x8d, 0x2e, 0x13, 0xd9, 0xb2, 0x69, 0x47},
+ {0x09, 0xdb, 0xe3, 0xbf, 0xbc, 0xa1, 0x34, 0x0f, 0xc6, 0xe2, 0x00,
+ 0x3d, 0x98, 0xa3, 0x7d, 0xab, 0xd4, 0x0e, 0xec, 0xde, 0x4f, 0x97,
+ 0xa9, 0xbb, 0xdd, 0x60, 0x94, 0x24, 0x7b, 0xb3, 0xf5, 0x94}},
// w
- {{{0x02, 0x43, 0x78, 0x9f, 0x54, 0xc1, 0x21, 0x3a, 0x2b, 0x4d, 0x12, 0x65,
- 0x2f, 0x51, 0x94, 0xc6, 0x34, 0x24, 0xd9, 0x7b, 0x06, 0x3a, 0xc4, 0xf5,
- 0x56, 0xeb, 0x32, 0xe3, 0xee, 0x7b, 0xad, 0x6b},
- {0x04, 0x90, 0x86, 0x31, 0x18, 0x2a, 0xa4, 0xcf, 0xa3, 0x90, 0xa5, 0x80,
- 0x7b, 0xae, 0x3b, 0xb1, 0x77, 0x03, 0xe7, 0x7e, 0xf2, 0xfc, 0x6d, 0x3a,
- 0xab, 0x8f, 0xbf, 0x95, 0x40, 0xed, 0x08, 0x03},
- {0x01, 0x05, 0x86, 0xf5, 0x42, 0xea, 0x4d, 0xf7, 0x4f, 0xef, 0x46, 0xdf,
- 0x8f, 0xe8, 0x2d, 0xbb, 0x5d, 0x0d, 0x2f, 0x4f, 0xf4, 0xd8, 0x31, 0xc6,
- 0x5a, 0x97, 0x98, 0x44, 0xcf, 0x42, 0x5a, 0xf3}},
- {{0x03, 0x5f, 0xb6, 0x38, 0x45, 0x5a, 0x15, 0x1e, 0xb9, 0x54, 0xfa, 0x2c,
- 0x3f, 0x68, 0x7b, 0x4e, 0x85, 0x35, 0xf3, 0x5b, 0xe5, 0xdc, 0x96, 0x2b,
- 0x18, 0x84, 0x5e, 0x1e, 0x53, 0xdc, 0x22, 0x23},
- {0x06, 0x08, 0x91, 0x5a, 0x2d, 0x27, 0xe2, 0x12, 0x69, 0xfa, 0xab, 0x19,
- 0x7c, 0x47, 0x6b, 0xec, 0xde, 0xc6, 0x25, 0xd4, 0x43, 0xb4, 0x65, 0x23,
- 0x61, 0x0f, 0x1f, 0x2d, 0xfd, 0xb1, 0x18, 0xb0},
- {0x04, 0x8e, 0x1a, 0xc5, 0x95, 0x9a, 0x0e, 0x37, 0x7c, 0x5e, 0x95, 0x38,
- 0xc2, 0xcf, 0xfa, 0x1f, 0xe3, 0x3a, 0x2b, 0x85, 0xa5, 0xfd, 0x6b, 0xc4,
- 0x1d, 0xfb, 0x47, 0x27, 0xaf, 0xc1, 0x94, 0xcd}}}};
+ {{{0x02, 0x43, 0x78, 0x9f, 0x54, 0xc1, 0x21, 0x3a, 0x2b, 0x4d, 0x12,
+ 0x65, 0x2f, 0x51, 0x94, 0xc6, 0x34, 0x24, 0xd9, 0x7b, 0x06, 0x3a,
+ 0xc4, 0xf5, 0x56, 0xeb, 0x32, 0xe3, 0xee, 0x7b, 0xad, 0x6b},
+ {0x04, 0x90, 0x86, 0x31, 0x18, 0x2a, 0xa4, 0xcf, 0xa3, 0x90, 0xa5,
+ 0x80, 0x7b, 0xae, 0x3b, 0xb1, 0x77, 0x03, 0xe7, 0x7e, 0xf2, 0xfc,
+ 0x6d, 0x3a, 0xab, 0x8f, 0xbf, 0x95, 0x40, 0xed, 0x08, 0x03},
+ {0x01, 0x05, 0x86, 0xf5, 0x42, 0xea, 0x4d, 0xf7, 0x4f, 0xef, 0x46,
+ 0xdf, 0x8f, 0xe8, 0x2d, 0xbb, 0x5d, 0x0d, 0x2f, 0x4f, 0xf4, 0xd8,
+ 0x31, 0xc6, 0x5a, 0x97, 0x98, 0x44, 0xcf, 0x42, 0x5a, 0xf3}},
+ {{0x03, 0x5f, 0xb6, 0x38, 0x45, 0x5a, 0x15, 0x1e, 0xb9, 0x54, 0xfa,
+ 0x2c, 0x3f, 0x68, 0x7b, 0x4e, 0x85, 0x35, 0xf3, 0x5b, 0xe5, 0xdc,
+ 0x96, 0x2b, 0x18, 0x84, 0x5e, 0x1e, 0x53, 0xdc, 0x22, 0x23},
+ {0x06, 0x08, 0x91, 0x5a, 0x2d, 0x27, 0xe2, 0x12, 0x69, 0xfa, 0xab,
+ 0x19, 0x7c, 0x47, 0x6b, 0xec, 0xde, 0xc6, 0x25, 0xd4, 0x43, 0xb4,
+ 0x65, 0x23, 0x61, 0x0f, 0x1f, 0x2d, 0xfd, 0xb1, 0x18, 0xb0},
+ {0x04, 0x8e, 0x1a, 0xc5, 0x95, 0x9a, 0x0e, 0x37, 0x7c, 0x5e, 0x95,
+ 0x38, 0xc2, 0xcf, 0xfa, 0x1f, 0xe3, 0x3a, 0x2b, 0x85, 0xa5, 0xfd,
+ 0x6b, 0xc4, 0x1d, 0xfb, 0x47, 0x27, 0xaf, 0xc1, 0x94, 0xcd}}}};
+const Epid11GroupPubKey Epid11VerifierTest::kPubKeyStrForMsg0_255 = {
+ // gid
+ {
+ 0x00, 0x00, 0x00, 0x7b,
+ },
+ // h1
+ {{0x02, 0x5a, 0xc4, 0xc5, 0xcd, 0x7d, 0xaa, 0xfd, 0x26, 0xe5, 0x0b,
+ 0xa9, 0xb4, 0xe1, 0x72, 0xa1, 0x65, 0x2d, 0x84, 0xad, 0x34, 0x34,
+ 0xf8, 0x62, 0x98, 0x6a, 0x15, 0xbe, 0xea, 0xe3, 0xcc, 0x56},
+ {0x05, 0x70, 0x5f, 0x4f, 0x11, 0xaf, 0x45, 0xcf, 0x04, 0x1b, 0x96,
+ 0xad, 0xeb, 0x26, 0xee, 0x95, 0x65, 0x4b, 0xd3, 0xd6, 0x5c, 0x13,
+ 0x76, 0xb7, 0x7a, 0xa1, 0xc6, 0xda, 0xed, 0x5a, 0x40, 0xce}},
+ // h2
+ {{0x06, 0x0e, 0x26, 0xa3, 0xe8, 0xbd, 0xca, 0x35, 0x9d, 0x48, 0x66,
+ 0xc2, 0x2d, 0x38, 0xf6, 0x57, 0xec, 0x46, 0xec, 0x42, 0x21, 0xd9,
+ 0x8f, 0x3f, 0x5b, 0x9a, 0xcf, 0xb8, 0x69, 0x2a, 0x40, 0x8f},
+ {0x03, 0x20, 0x3d, 0x12, 0x7f, 0x00, 0xe9, 0x84, 0x29, 0x4a, 0x96,
+ 0xfa, 0x69, 0x61, 0x34, 0x0f, 0x3d, 0x98, 0x67, 0x2f, 0x65, 0xf9,
+ 0x67, 0x09, 0xa1, 0x2e, 0xe7, 0x81, 0x9f, 0xe1, 0x2f, 0x1f}},
+ // w
+ {{{0x03, 0x05, 0xff, 0x49, 0x41, 0x48, 0xcf, 0x6d, 0x38, 0xce, 0x94,
+ 0xe8, 0xcd, 0xae, 0x18, 0x44, 0xba, 0x54, 0x0f, 0x84, 0xa5, 0x8a,
+ 0xb6, 0x58, 0x70, 0x39, 0xe3, 0x33, 0xfb, 0x75, 0xce, 0x98},
+ {0x08, 0xb1, 0x96, 0x12, 0xc7, 0x01, 0x20, 0x57, 0x40, 0x42, 0xdc,
+ 0x83, 0x59, 0xee, 0xdf, 0xf8, 0x20, 0x01, 0x84, 0xa6, 0x15, 0x3c,
+ 0xfe, 0x46, 0x23, 0xac, 0x2b, 0xcd, 0xb8, 0xab, 0x9f, 0x46},
+ {0x06, 0x60, 0xef, 0xd9, 0x2a, 0x5b, 0xb1, 0x96, 0x92, 0x63, 0xe7,
+ 0x46, 0x23, 0x8b, 0x8f, 0xa2, 0x91, 0xa3, 0x0c, 0x7c, 0x81, 0x75,
+ 0x1b, 0xc4, 0x38, 0x10, 0x18, 0x2a, 0xc4, 0xe6, 0xe3, 0x7e}},
+ {{0x08, 0xeb, 0x6b, 0x8d, 0x0d, 0x4e, 0x40, 0xb2, 0x15, 0xa0, 0x0a,
+ 0x2d, 0x70, 0xb6, 0x5e, 0xe8, 0xcf, 0xff, 0xcf, 0x59, 0x7f, 0xed,
+ 0x6c, 0x6a, 0x92, 0xd9, 0x2d, 0x61, 0xbb, 0x22, 0x12, 0x9e},
+ {0x08, 0xe2, 0x50, 0x02, 0x97, 0x31, 0x1e, 0xd0, 0x4d, 0xf2, 0x39,
+ 0xe1, 0xb6, 0x04, 0xce, 0x5f, 0x05, 0xe9, 0xab, 0x38, 0xb3, 0x22,
+ 0x63, 0x5e, 0xc8, 0x89, 0x88, 0x8f, 0x2c, 0x5b, 0xc0, 0xf6},
+ {0x06, 0x4a, 0x1d, 0x49, 0x98, 0x02, 0x1e, 0x42, 0x1c, 0xf2, 0x8d,
+ 0x0c, 0x7a, 0x86, 0x76, 0x2d, 0xc1, 0x74, 0x53, 0x7a, 0x7c, 0x65,
+ 0xad, 0x57, 0x1c, 0x92, 0xa8, 0xd3, 0x8a, 0x9b, 0x91, 0xe6}}}};
const Epid11Params Epid11VerifierTest::kParamsStr = {
#include "epid/common/1.1/src/epid11params_tate.inc"
};
@@ -107,6 +145,26 @@ const std::vector<uint8_t> Epid11VerifierTest::kSigRl = {
0xec, 0x7b, 0xf5, 0xe9, 0x29, 0x4a, 0x3e, 0x78, 0xbd, 0xb6, 0x3c, 0x10,
0xf8, 0xec, 0xc6, 0x2c, 0x4b, 0x4d, 0x8a, 0xc1, 0x3d, 0x65, 0xf5, 0x93,
0x8d, 0x5b, 0x07, 0x3f, 0x78, 0x92, 0x1c, 0xfa};
+
+const std::vector<uint8_t> Epid11VerifierTest::kSigRlForMsg0_255 = {
+ // gid
+ 0x00, 0x00, 0x00, 0x7b,
+ // rev
+ 0x00, 0x00, 0x00, 0x01,
+ // n2
+ 0x00, 0x00, 0x00, 0x01,
+ // bks
+ 0x73, 0x2c, 0x11, 0x04, 0x16, 0x77, 0x2b, 0x90, 0xe3, 0x35, 0x3b, 0x99,
+ 0xf0, 0x26, 0x09, 0x90, 0x8d, 0xb8, 0xa8, 0x73, 0x94, 0xf9, 0x05, 0x1b,
+ 0x28, 0xc9, 0x11, 0xdc, 0xf7, 0x44, 0xea, 0x94, 0x80, 0x22, 0x4a, 0x18,
+ 0x86, 0x42, 0x3e, 0x4c, 0x68, 0x07, 0x91, 0xab, 0x62, 0xbb, 0xd1, 0xb7,
+ 0x2b, 0xa0, 0xbe, 0x3d, 0x9f, 0xda, 0x1c, 0xf3, 0x6e, 0xe7, 0x08, 0x0e,
+ 0x5e, 0xcc, 0xb9, 0x28, 0xfb, 0xc9, 0x6e, 0x9c, 0x58, 0x1b, 0xb9, 0x0b,
+ 0x1b, 0xac, 0x16, 0x81, 0xef, 0x02, 0x02, 0x6f, 0x16, 0xa8, 0x6a, 0xbb,
+ 0x54, 0xcd, 0xef, 0x1f, 0xbc, 0xd4, 0xd5, 0x84, 0x96, 0xe8, 0x7f, 0x19,
+ 0xc7, 0xfe, 0xac, 0xc6, 0xc1, 0xd8, 0xed, 0x64, 0xa6, 0xcd, 0x2d, 0xa1,
+ 0x37, 0x0f, 0x37, 0x41, 0xd9, 0xb5, 0xec, 0x95, 0x13, 0xc6, 0x1d, 0x4b,
+ 0xe2, 0x35, 0x7f, 0x42, 0x5e, 0xf5, 0x20, 0x71};
const std::vector<uint8_t> Epid11VerifierTest::kEmptySigRl = {
// gid
0x00, 0x00, 0x00, 0x7b,
@@ -143,6 +201,30 @@ const std::vector<uint8_t> Epid11VerifierTest::kMsg0 = {
const std::vector<uint8_t> Epid11VerifierTest::kBsn0 = {'b', 'a', 's', 'e', 'n',
'a', 'm', 'e', '1'};
+const std::vector<uint8_t> Epid11VerifierTest::kData_0_255 = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
+ 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
+ 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
+ 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b,
+ 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83,
+ 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b,
+ 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3,
+ 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb,
+ 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3,
+ 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,
+ 0xfc, 0xfd, 0xfe, 0xff,
+};
const std::vector<uint8_t> Epid11VerifierTest::kSigGrpXMember0Sha256Bsn0Msg0 = {
#include "epid/common-testhelper/1.1/testdata/grp_x/member0/sig_sha256_bsn0_msg0.inc"
};
@@ -172,6 +254,11 @@ const std::vector<uint8_t>
Epid11VerifierTest::kSigGrpXMember0Sha256RandbaseMsg1 = {
#include "epid/common-testhelper/1.1/testdata/grp_x/member0/sig_sha256_rndbase_msg1.inc"
};
+
+const std::vector<uint8_t>
+ Epid11VerifierTest::kSigGrp01Member0Sha256kBsn0Data_0_255 = {
+#include "epid/common-testhelper/1.1/testdata/grp01/member0/sig_bsn0_msg_0_255_sha256.inc"
+};
const std::vector<uint8_t> Epid11VerifierTest::kSigGrpXMember1Sha256Bsn0Msg0 = {
#include "epid/common-testhelper/1.1/testdata/grp_x/member1/sig_sha256_bsn0_msg0.inc"
};
diff --git a/epid/verifier/1.1/unittests/verifier-testhelper.h b/epid/verifier/1.1/unittests/verifier-testhelper.h
index 7dac1e8..58db1de 100644
--- a/epid/verifier/1.1/unittests/verifier-testhelper.h
+++ b/epid/verifier/1.1/unittests/verifier-testhelper.h
@@ -37,10 +37,16 @@ class Epid11VerifierTest : public ::testing::Test {
static const Epid11G3ElemStr kG3IdentityStr;
/// test public key
static const Epid11GroupPubKey kPubKeyStr;
+ /// test public key for tests of msg containing all bytes
+ static const Epid11GroupPubKey kPubKeyStrForMsg0_255;
/// the message "test message"
static const std::vector<uint8_t> kMsg0;
/// the basename "basename1"
static const std::vector<uint8_t> kBsn0;
+ /// a data with bytes [0,255]
+ static const std::vector<uint8_t> kData_0_255;
+ /// Signature of kData_0_255 with kBsn0 by Grp01 Member0 using Sha256
+ static const std::vector<uint8_t> kSigGrp01Member0Sha256kBsn0Data_0_255;
/// the privrl of group X
static const std::vector<uint8_t> kGrpXPrivRl;
/// currpted privrl of group X
@@ -92,6 +98,8 @@ class Epid11VerifierTest : public ::testing::Test {
/// signature based revocation list
static const std::vector<uint8_t> kSigRl;
+ /// signature based revocation list for tests of msg containing all bytes
+ static const std::vector<uint8_t> kSigRlForMsg0_255;
/// signature based revocation list (empty rl)
static const std::vector<uint8_t> kEmptySigRl;
diff --git a/epid/verifier/1.1/unittests/verify-test.cc b/epid/verifier/1.1/unittests/verify-test.cc
index e389f43..84dbae8 100644
--- a/epid/verifier/1.1/unittests/verify-test.cc
+++ b/epid/verifier/1.1/unittests/verify-test.cc
@@ -23,13 +23,13 @@
#include "gtest/gtest.h"
extern "C" {
-#include "epid/verifier/1.1/api.h"
#include "epid/common/src/endian_convert.h"
+#include "epid/verifier/1.1/api.h"
}
-#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
#include "epid/common-testhelper/1.1/verifier_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
namespace {
@@ -48,6 +48,20 @@ TEST_F(Epid11VerifierTest, VerifyFailsGivenNullParameters) {
sig.size(), nullptr, msg.size()));
}
+TEST_F(Epid11VerifierTest, VerifyFailsGivenTooShortSigLen) {
+ Epid11VerifierCtxObj verifier(this->kPubKeyStr);
+ auto sig = this->kSigGrpXMember0Sha256RandbaseMsg0;
+ auto msg = this->kMsg0;
+
+ EXPECT_EQ(kEpidBadArgErr,
+ Epid11Verify(verifier, (Epid11Signature const*)sig.data(), 0,
+ msg.data(), msg.size()));
+ EXPECT_EQ(kEpidBadArgErr,
+ Epid11Verify(verifier, (Epid11Signature const*)sig.data(),
+ sizeof(Epid11Signature) - sizeof(Epid11NrProof) - 1,
+ msg.data(), msg.size()));
+}
+
TEST_F(Epid11VerifierTest, VerifyFailsGivenSigLenTooShortForRlCount) {
Epid11VerifierCtxObj verifier(this->kPubKeyStr);
Epid11VerifierSetSigRl(verifier, (Epid11SigRl const*)this->kSigRl.data(),
@@ -734,4 +748,25 @@ TEST_F(Epid11VerifierTest, VerifyAcceptsSigWithRandomBaseNameAllRl) {
sig.size(), msg.data(), msg.size()));
}
+TEST_F(Epid11VerifierTest, VerifyAcceptsSigGivenMsgContainingAllPossibleBytes) {
+ auto& pub_key = this->kPubKeyStrForMsg0_255;
+ auto& msg = this->kData_0_255;
+ auto& grp_rl = this->kGroupRlEmptyBuf;
+ auto& priv_rl = this->kGrpXPrivRl;
+ auto& sig = this->kSigGrp01Member0Sha256kBsn0Data_0_255;
+
+ Epid11VerifierCtxObj verifier(pub_key);
+ THROW_ON_EPIDERR(Epid11VerifierSetGroupRl(
+ verifier, (Epid11GroupRl const*)grp_rl.data(), grp_rl.size()));
+ THROW_ON_EPIDERR(Epid11VerifierSetPrivRl(
+ verifier, (Epid11PrivRl const*)priv_rl.data(), priv_rl.size()));
+ THROW_ON_EPIDERR(Epid11VerifierSetSigRl(
+ verifier, (Epid11SigRl const*)this->kSigRlForMsg0_255.data(),
+ this->kSigRlForMsg0_255.size()));
+
+ EXPECT_EQ(kEpidSigValid,
+ Epid11Verify(verifier, (Epid11Signature const*)sig.data(),
+ sig.size(), msg.data(), msg.size()));
+}
+
} // namespace
diff --git a/epid/verifier/1.1/unittests/verifybasic-test.cc b/epid/verifier/1.1/unittests/verifybasic-test.cc
index b32379a..d76a00a 100644
--- a/epid/verifier/1.1/unittests/verifybasic-test.cc
+++ b/epid/verifier/1.1/unittests/verifybasic-test.cc
@@ -26,9 +26,9 @@ extern "C" {
#include "epid/verifier/1.1/api.h"
}
+#include "epid/common-testhelper/1.1/verifier_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
#include "epid/verifier/1.1/unittests/verifier-testhelper.h"
-#include "epid/common-testhelper/1.1/verifier_wrapper-testhelper.h"
namespace {
@@ -97,4 +97,16 @@ TEST_F(Epid11VerifierTest, VerifyBasicSigCanVerifyWithBasename) {
Epid11VerifyBasicSig(verifier, &basic_sig, msg.data(), msg.size()));
}
+TEST_F(Epid11VerifierTest,
+ VerifyBasicSigCanVerifyMsgContainingAllPossibleBytes) {
+ Epid11VerifierCtxObj verifier(kPubKeyStrForMsg0_255);
+ auto const& sig = (Epid11Signature const*)this
+ ->kSigGrp01Member0Sha256kBsn0Data_0_255.data();
+ const Epid11BasicSignature basic_sig = sig->sigma0;
+
+ auto& msg = this->kData_0_255;
+ EXPECT_EQ(kEpidNoErr,
+ Epid11VerifyBasicSig(verifier, &basic_sig, msg.data(), msg.size()));
+}
+
} // namespace
diff --git a/epid/verifier/Makefile b/epid/verifier/Makefile
index 8cb293f..209362c 100644
--- a/epid/verifier/Makefile
+++ b/epid/verifier/Makefile
@@ -22,7 +22,7 @@ VERIFIER_SRC += $(wildcard ./1.1/src/*.c)
VERIFIER_OBJ = $(VERIFIER_SRC:.c=.o)
VERIFIER_LIB = ./libverifier.a
-VERIFIER_UTEST_EXE = ./verifier-utest
+VERIFIER_UTEST_EXE = ./verifier-utest$(EXE_EXTENSION)
VERIFIER_UTEST_SRC = $(wildcard ./unittests/*.cc)
VERIFIER_UTEST_SRC += $(wildcard ./1.1/unittests/*.cc)
VERIFIER_UTEST_OBJ = $(VERIFIER_UTEST_SRC:.cc=.o)
diff --git a/epid/verifier/api.h b/epid/verifier/api.h
index 2555ce6..48db5bd 100644
--- a/epid/verifier/api.h
+++ b/epid/verifier/api.h
@@ -17,9 +17,9 @@
#define EPID_VERIFIER_API_H_
#include <stddef.h>
+#include "epid/common/errors.h"
#include "epid/common/stdtypes.h"
#include "epid/common/types.h"
-#include "epid/common/errors.h"
/*!
* \file
diff --git a/epid/verifier/src/context.c b/epid/verifier/src/context.c
index 6350c49..c5737d1 100644
--- a/epid/verifier/src/context.c
+++ b/epid/verifier/src/context.c
@@ -18,14 +18,14 @@
* \file
* \brief Verifier context implementation.
*/
-#include <string.h>
-#include "epid/verifier/api.h"
#include "epid/verifier/src/context.h"
-#include "epid/common/src/epid2params.h"
-#include "epid/common/src/memory.h"
+#include <string.h>
#include "epid/common/math/pairing.h"
#include "epid/common/src/endian_convert.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/memory.h"
#include "epid/common/src/sigrlvalid.h"
+#include "epid/verifier/api.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
@@ -127,8 +127,11 @@ EpidStatus EpidVerifierCreate(GroupPubKey const* pubkey,
break;
}
- // set SHA512 as the default hash algorithm
+ // set the default hash algorithm
verifier_ctx->hash_alg = kSha512;
+#ifdef TPM_TSS // if build for TSS, make Sha256 default
+ verifier_ctx->hash_alg = kSha256;
+#endif
// Internal representation of Epid2Params
result = CreateEpid2Params(&verifier_ctx->epid2_params);
@@ -481,9 +484,9 @@ EpidStatus EpidBlacklistSig(VerifierCtx* ctx, EpidSignature const* sig,
result = kEpidBadArgErr;
break;
}
- ver_rl =
- SAFE_REALLOC(ctx->verifier_rl, EpidGetVerifierRlSize(ctx) +
- sizeof(((VerifierRl*)0)->K[0]));
+ ver_rl = SAFE_REALLOC(
+ ctx->verifier_rl,
+ EpidGetVerifierRlSize(ctx) + sizeof(((VerifierRl*)0)->K[0]));
if (!ver_rl) {
result = kEpidMemAllocErr;
break;
@@ -555,7 +558,8 @@ EpidStatus EpidVerifierSetBasename(VerifierCtx* ctx, void const* basename,
break;
}
- result = EcHash(G1, basename, basename_len, ctx->hash_alg, basename_hash);
+ result =
+ EcHash(G1, basename, basename_len, ctx->hash_alg, basename_hash, NULL);
if (kEpidNoErr != result) {
break;
}
diff --git a/epid/verifier/src/context.h b/epid/verifier/src/context.h
index 705c55e..783e451 100644
--- a/epid/verifier/src/context.h
+++ b/epid/verifier/src/context.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,11 +19,11 @@
* \file
* \brief Verifier context interface.
*/
-#include "epid/common/src/grouppubkey.h"
#include "epid/common/math/ecgroup.h"
#include "epid/common/math/finitefield.h"
-#include "epid/common/src/epid2params.h"
#include "epid/common/src/commitment.h"
+#include "epid/common/src/epid2params.h"
+#include "epid/common/src/grouppubkey.h"
/// Verifier context definition
struct VerifierCtx {
diff --git a/epid/verifier/src/verify.c b/epid/verifier/src/verify.c
index 5c37b68..b0b60ae 100644
--- a/epid/verifier/src/verify.c
+++ b/epid/verifier/src/verify.c
@@ -19,9 +19,9 @@
* \brief Verify implementation.
*/
#include <string.h>
+#include "epid/common/src/endian_convert.h"
#include "epid/verifier/api.h"
#include "epid/verifier/src/context.h"
-#include "epid/common/src/endian_convert.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
diff --git a/epid/verifier/src/verifybasic.c b/epid/verifier/src/verifybasic.c
index d3ab4de..119f7ee 100644
--- a/epid/verifier/src/verifybasic.c
+++ b/epid/verifier/src/verifybasic.c
@@ -19,9 +19,9 @@
* \brief VerifyBasicSig implementation.
*/
+#include "epid/common/src/memory.h"
#include "epid/verifier/api.h"
#include "epid/verifier/src/context.h"
-#include "epid/common/src/memory.h"
/// Handle SDK Error with Break
#define BREAK_ON_EPID_ERROR(ret) \
diff --git a/epid/verifier/unittests/check_privrl_entry-test.cc b/epid/verifier/unittests/check_privrl_entry-test.cc
index d8164c1..4efc40e 100644
--- a/epid/verifier/unittests/check_privrl_entry-test.cc
+++ b/epid/verifier/unittests/check_privrl_entry-test.cc
@@ -26,9 +26,9 @@ extern "C" {
#include "epid/verifier/api.h"
}
-#include "epid/verifier/unittests/verifier-testhelper.h"
-#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/verifier/unittests/verifier-testhelper.h"
namespace {
diff --git a/epid/verifier/unittests/context-test.cc b/epid/verifier/unittests/context-test.cc
index 0b637b4..1054bd5 100644
--- a/epid/verifier/unittests/context-test.cc
+++ b/epid/verifier/unittests/context-test.cc
@@ -19,21 +19,21 @@
* \brief VerifierCreate unit tests.
*/
-#include <vector>
#include <cstring>
+#include <vector>
#include "epid/common-testhelper/epid_gtest-testhelper.h"
#include "gtest/gtest.h"
extern "C" {
+#include "epid/common/src/endian_convert.h"
#include "epid/verifier/api.h"
#include "epid/verifier/src/context.h"
-#include "epid/common/src/endian_convert.h"
}
-#include "epid/verifier/unittests/verifier-testhelper.h"
-#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/verifier/unittests/verifier-testhelper.h"
bool operator==(VerifierPrecomp const& lhs, VerifierPrecomp const& rhs) {
return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
}
@@ -991,6 +991,27 @@ TEST_F(EpidVerifierTest,
EXPECT_EQ(rlver_expected, ver_rl->version);
// missing K checks
}
+TEST_F(EpidVerifierTest, BlacklistSigWorksForMsgContainingAllPossibleBytes) {
+ VerifierCtxObj verifier(this->kPubKeySigRlVerify);
+ auto sig = this->kSigGrp01Member0Sha512kBsn0Data_0_255;
+ auto msg = this->kData_0_255;
+ auto bsn = this->kBsn0;
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(verifier, kSha512));
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(verifier, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidNoErr, EpidBlacklistSig(verifier, (EpidSignature*)sig.data(),
+ sig.size(), msg.data(), msg.size()));
+
+ std::vector<uint8_t> ver_rl_vec(EpidGetVerifierRlSize(verifier));
+ VerifierRl* ver_rl = (VerifierRl*)ver_rl_vec.data();
+ size_t ver_rl_size = ver_rl_vec.size();
+
+ THROW_ON_EPIDERR(EpidWriteVerifierRl(verifier, ver_rl, ver_rl_size));
+
+ OctStr32 n4_expected = {0x00, 0x00, 0x00, 0x01};
+ OctStr32 rlver_expected = {0x00, 0x00, 0x00, 0x01};
+ EXPECT_EQ(n4_expected, ver_rl->n4);
+ EXPECT_EQ(rlver_expected, ver_rl->version);
+}
//////////////////////////////////////////////////////////////////////////
// EpidVerifierSetHashAlg
TEST_F(EpidVerifierTest, SetHashAlgFailsGivenNullPointer) {
@@ -1080,4 +1101,11 @@ TEST_F(EpidVerifierTest, SetBasenameResetsVerifierBlacklist) {
EXPECT_EQ(nullptr, ctx->verifier_rl);
}
+TEST_F(EpidVerifierTest, SetBasenameAcceptsBsnContainingAllPossibleBytes) {
+ VerifierCtxObj verifier(this->kPubKeyStr, this->kVerifierPrecompStr);
+ VerifierCtx* ctx = verifier;
+ auto& basename = this->kData_0_255;
+ EXPECT_EQ(kEpidNoErr,
+ EpidVerifierSetBasename(ctx, basename.data(), basename.size()));
+}
} // namespace
diff --git a/epid/verifier/unittests/nrverify-test.cc b/epid/verifier/unittests/nrverify-test.cc
index 045fcf4..2b0f553 100644
--- a/epid/verifier/unittests/nrverify-test.cc
+++ b/epid/verifier/unittests/nrverify-test.cc
@@ -26,9 +26,9 @@ extern "C" {
#include "epid/verifier/api.h"
}
-#include "epid/verifier/unittests/verifier-testhelper.h"
-#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/verifier/unittests/verifier-testhelper.h"
namespace {
@@ -276,4 +276,17 @@ TEST_F(EpidVerifierTest, NrVerifyAcceptsSigWithRandomBaseNameSha512256) {
&epid_signature->sigma[0]));
}
+TEST_F(EpidVerifierTest, NrVerifyAcceptsMsgContainingAllPossibleBytes) {
+ VerifierCtxObj verifier(this->kPubKeySigRlVerify);
+ EpidSignature const* epid_signature =
+ (EpidSignature*)kSigGrp01Member0Sha512kBsn0Data_0_255.data();
+ SigRl const* sig_rl =
+ reinterpret_cast<SigRl const*>(this->kGrp01SigRl.data());
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(verifier, kSha512));
+ EXPECT_EQ(kEpidSigValid,
+ EpidNrVerify(verifier, &epid_signature->sigma0,
+ this->kData_0_255.data(), this->kData_0_255.size(),
+ &sig_rl->bk[0], &epid_signature->sigma[0]));
+}
+
} // namespace
diff --git a/epid/verifier/unittests/sigs_linked-test.cc b/epid/verifier/unittests/sigs_linked-test.cc
index debf4a2..a7c7598 100644
--- a/epid/verifier/unittests/sigs_linked-test.cc
+++ b/epid/verifier/unittests/sigs_linked-test.cc
@@ -26,8 +26,8 @@ extern "C" {
#include "epid/verifier/api.h"
}
-#include "epid/verifier/unittests/verifier-testhelper.h"
#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/verifier/unittests/verifier-testhelper.h"
namespace {
diff --git a/epid/verifier/unittests/testdata/sigrl/pub_key_sigrl_verify.inc b/epid/verifier/unittests/testdata/sigrl/pub_key_sigrl_verify.inc
index 0a05d35..1f5b34e 100644
--- a/epid/verifier/unittests/testdata/sigrl/pub_key_sigrl_verify.inc
+++ b/epid/verifier/unittests/testdata/sigrl/pub_key_sigrl_verify.inc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
############################################################################*/
// group_pub_key
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x01, 0xB3, 0x6F, 0xFF, 0x81, 0xE2, 0x1B, 0x17, 0xEB, 0x3D,
+ 0x00, 0x00, 0x2a, 0xB3, 0x6F, 0xFF, 0x81, 0xE2, 0x1B, 0x17, 0xEB, 0x3D,
0x75, 0x3D, 0x61, 0x7E, 0x27, 0xB0, 0xCB, 0xD0, 0x6D, 0x8F, 0x9D, 0x64,
0xCE, 0xE3, 0xCE, 0x43, 0x4C, 0x62, 0xFD, 0xB5, 0x80, 0xE0, 0x99, 0x3A,
0x07, 0x56, 0x80, 0xE0, 0x88, 0x59, 0xA4, 0xFD, 0xB5, 0xB7, 0x9D, 0xE9,
diff --git a/epid/verifier/unittests/testdata/sigrl/sigrl_five_entries.inc b/epid/verifier/unittests/testdata/sigrl/sigrl_five_entries.inc
index 312c8ad..11ba8c8 100644
--- a/epid/verifier/unittests/testdata/sigrl/sigrl_five_entries.inc
+++ b/epid/verifier/unittests/testdata/sigrl/sigrl_five_entries.inc
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/epid/verifier/unittests/verifier-testhelper.cc b/epid/verifier/unittests/verifier-testhelper.cc
index 9decb75..68130dc 100644
--- a/epid/verifier/unittests/verifier-testhelper.cc
+++ b/epid/verifier/unittests/verifier-testhelper.cc
@@ -22,12 +22,12 @@
#include "epid/verifier/unittests/verifier-testhelper.h"
const G1ElemStr EpidVerifierTest::kG1IdentityStr = {
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
- {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}};
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}},
+ {{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}}};
const GroupPubKey EpidVerifierTest::kPubKeyStr = {
// gid
@@ -36,60 +36,60 @@ const GroupPubKey EpidVerifierTest::kPubKeyStr = {
0x00, 0x00, 0x00, 0x2A,
},
// h1
- {{0xB3, 0x6F, 0xFF, 0x81, 0xE2, 0x1B, 0x17, 0xEB, 0x3D, 0x75, 0x3D, 0x61,
- 0x7E, 0x27, 0xB0, 0xCB, 0xD0, 0x6D, 0x8F, 0x9D, 0x64, 0xCE, 0xE3, 0xCE,
- 0x43, 0x4C, 0x62, 0xFD, 0xB5, 0x80, 0xE0, 0x99},
- {0x3A, 0x07, 0x56, 0x80, 0xE0, 0x88, 0x59, 0xA4, 0xFD, 0xB5, 0xB7, 0x9D,
- 0xE9, 0x4D, 0xAE, 0x9C, 0xEE, 0x3D, 0x66, 0x42, 0x82, 0x45, 0x7E, 0x7F,
- 0xD8, 0x69, 0x3E, 0xA1, 0x74, 0xF4, 0x59, 0xEE}},
+ {{0xB3, 0x6F, 0xFF, 0x81, 0xE2, 0x1B, 0x17, 0xEB, 0x3D, 0x75, 0x3D,
+ 0x61, 0x7E, 0x27, 0xB0, 0xCB, 0xD0, 0x6D, 0x8F, 0x9D, 0x64, 0xCE,
+ 0xE3, 0xCE, 0x43, 0x4C, 0x62, 0xFD, 0xB5, 0x80, 0xE0, 0x99},
+ {0x3A, 0x07, 0x56, 0x80, 0xE0, 0x88, 0x59, 0xA4, 0xFD, 0xB5, 0xB7,
+ 0x9D, 0xE9, 0x4D, 0xAE, 0x9C, 0xEE, 0x3D, 0x66, 0x42, 0x82, 0x45,
+ 0x7E, 0x7F, 0xD8, 0x69, 0x3E, 0xA1, 0x74, 0xF4, 0x59, 0xEE}},
// h2
- {{0xD2, 0x74, 0x2E, 0x9F, 0x63, 0xC2, 0x51, 0x8E, 0xD5, 0xDB, 0xCA, 0x1C,
- 0x54, 0x74, 0x10, 0x7B, 0xDC, 0x99, 0xED, 0x42, 0xD5, 0x5B, 0xA7, 0x04,
- 0x29, 0x66, 0x61, 0x63, 0xBC, 0xDD, 0x7F, 0xE1},
- {0x76, 0x5D, 0xC0, 0x6E, 0xE3, 0x14, 0xAC, 0x72, 0x48, 0x12, 0x0A, 0xA6,
- 0xE8, 0x5B, 0x08, 0x7B, 0xDA, 0x3F, 0x51, 0x7D, 0xDE, 0x4C, 0xEA, 0xCB,
- 0x93, 0xA5, 0x6E, 0xCC, 0xE7, 0x8E, 0x10, 0x84}},
+ {{0xD2, 0x74, 0x2E, 0x9F, 0x63, 0xC2, 0x51, 0x8E, 0xD5, 0xDB, 0xCA,
+ 0x1C, 0x54, 0x74, 0x10, 0x7B, 0xDC, 0x99, 0xED, 0x42, 0xD5, 0x5B,
+ 0xA7, 0x04, 0x29, 0x66, 0x61, 0x63, 0xBC, 0xDD, 0x7F, 0xE1},
+ {0x76, 0x5D, 0xC0, 0x6E, 0xE3, 0x14, 0xAC, 0x72, 0x48, 0x12, 0x0A,
+ 0xA6, 0xE8, 0x5B, 0x08, 0x7B, 0xDA, 0x3F, 0x51, 0x7D, 0xDE, 0x4C,
+ 0xEA, 0xCB, 0x93, 0xA5, 0x6E, 0xCC, 0xE7, 0x8E, 0x10, 0x84}},
// w
- {{{0xBD, 0x19, 0x5A, 0x95, 0xE2, 0x0F, 0xCA, 0x1C, 0x50, 0x71, 0x94, 0x51,
- 0x40, 0x1B, 0xA5, 0xB6, 0x78, 0x87, 0x53, 0xF6, 0x6A, 0x95, 0xCA, 0xC6,
- 0x8D, 0xCD, 0x36, 0x88, 0x07, 0x28, 0xE8, 0x96},
- {0xCA, 0x78, 0x11, 0x5B, 0xB8, 0x6A, 0xE7, 0xE5, 0xA6, 0x65, 0x7A, 0x68,
- 0x15, 0xD7, 0x75, 0xF8, 0x24, 0x14, 0xCF, 0xD1, 0x0F, 0x6C, 0x56, 0xF5,
- 0x22, 0xD9, 0xFD, 0xE0, 0xE2, 0xF4, 0xB3, 0xA1}},
- {{0x90, 0x21, 0xA7, 0xE0, 0xE8, 0xB3, 0xC7, 0x25, 0xBC, 0x07, 0x72, 0x30,
- 0x5D, 0xEE, 0xF5, 0x6A, 0x89, 0x88, 0x46, 0xDD, 0x89, 0xC2, 0x39, 0x9C,
- 0x0A, 0x3B, 0x58, 0x96, 0x57, 0xE4, 0xF3, 0x3C},
- {0x79, 0x51, 0x69, 0x36, 0x1B, 0xB6, 0xF7, 0x05, 0x5D, 0x0A, 0x88, 0xDB,
- 0x1F, 0x3D, 0xEA, 0xA2, 0xBA, 0x6B, 0xF0, 0xDA, 0x8E, 0x25, 0xC6, 0xAD,
- 0x83, 0x7D, 0x3E, 0x31, 0xEE, 0x11, 0x40, 0xA9}}}};
+ {{{0xBD, 0x19, 0x5A, 0x95, 0xE2, 0x0F, 0xCA, 0x1C, 0x50, 0x71, 0x94,
+ 0x51, 0x40, 0x1B, 0xA5, 0xB6, 0x78, 0x87, 0x53, 0xF6, 0x6A, 0x95,
+ 0xCA, 0xC6, 0x8D, 0xCD, 0x36, 0x88, 0x07, 0x28, 0xE8, 0x96},
+ {0xCA, 0x78, 0x11, 0x5B, 0xB8, 0x6A, 0xE7, 0xE5, 0xA6, 0x65, 0x7A,
+ 0x68, 0x15, 0xD7, 0x75, 0xF8, 0x24, 0x14, 0xCF, 0xD1, 0x0F, 0x6C,
+ 0x56, 0xF5, 0x22, 0xD9, 0xFD, 0xE0, 0xE2, 0xF4, 0xB3, 0xA1}},
+ {{0x90, 0x21, 0xA7, 0xE0, 0xE8, 0xB3, 0xC7, 0x25, 0xBC, 0x07, 0x72,
+ 0x30, 0x5D, 0xEE, 0xF5, 0x6A, 0x89, 0x88, 0x46, 0xDD, 0x89, 0xC2,
+ 0x39, 0x9C, 0x0A, 0x3B, 0x58, 0x96, 0x57, 0xE4, 0xF3, 0x3C},
+ {0x79, 0x51, 0x69, 0x36, 0x1B, 0xB6, 0xF7, 0x05, 0x5D, 0x0A, 0x88,
+ 0xDB, 0x1F, 0x3D, 0xEA, 0xA2, 0xBA, 0x6B, 0xF0, 0xDA, 0x8E, 0x25,
+ 0xC6, 0xAD, 0x83, 0x7D, 0x3E, 0x31, 0xEE, 0x11, 0x40, 0xA9}}}};
const GroupPubKey EpidVerifierTest::kPubKeyIkgfStr = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00}, // group id
- {{{{0x45, 0xcb, 0x06, 0x04, 0xb3, 0xf7, 0x23, 0xb2, 0xd1, 0xd1, 0x0d, 0x4f,
- 0x51, 0x7b, 0xbb, 0x8f, 0x71, 0x15, 0xd7, 0xf1, 0xdc, 0x15, 0x37, 0xc8,
- 0xb8, 0x3d, 0x68, 0x0a, 0x18, 0xa5, 0x34, 0x14}}},
- {{{0x0c, 0xdc, 0xd9, 0x15, 0x7e, 0xba, 0x56, 0xc5, 0xe5, 0x61, 0xfa, 0x6a,
- 0x86, 0xa0, 0xac, 0x6a, 0x81, 0x36, 0x6d, 0x01, 0x5f, 0x86, 0xc0, 0x04,
- 0x8b, 0x1e, 0xff, 0x49, 0xd9, 0x37, 0x96, 0x66}}}}, // h1
- {{{{0xf1, 0xc3, 0x16, 0xb5, 0xc5, 0x1c, 0x67, 0xb6, 0xff, 0x28, 0x23, 0x79,
- 0x59, 0xea, 0x80, 0xe6, 0x09, 0x07, 0xe7, 0xd3, 0x38, 0xec, 0xb9, 0x16,
- 0x83, 0x88, 0xda, 0x64, 0xdd, 0xc4, 0x9d, 0x6a}}},
- {{{0x5c, 0xb2, 0x1c, 0x88, 0x97, 0xea, 0xaf, 0xa9, 0xf3, 0x3e, 0x07, 0xea,
- 0xb6, 0x2a, 0xd5, 0x7a, 0xed, 0x32, 0xd9, 0x3d, 0x90, 0xd7, 0xb9, 0x91,
- 0x08, 0x05, 0x9e, 0xe3, 0x22, 0x75, 0x06, 0x35}}}}, // h2
- {{{{{0xe5, 0xc4, 0x77, 0xad, 0x52, 0xb9, 0x7c, 0x04, 0x2d, 0x7e, 0x81, 0xf2,
- 0x5d, 0x5d, 0x52, 0x7d, 0xd7, 0x1d, 0x29, 0xfb, 0x6a, 0xa7, 0xbc, 0xb5,
- 0xa9, 0x1a, 0xa6, 0xfd, 0x20, 0xea, 0xf2, 0x98}}},
- {{{0xe2, 0x67, 0x33, 0x28, 0x67, 0x5f, 0xbe, 0x23, 0xa0, 0x43, 0xe8, 0x71,
- 0xaa, 0xab, 0xf6, 0xf0, 0x6a, 0x2b, 0x52, 0xa8, 0x61, 0x51, 0x22, 0x44,
- 0x00, 0x91, 0xd7, 0xf1, 0x7e, 0x05, 0x48, 0xdc}}}},
- {{{{0x51, 0x0c, 0xef, 0xa0, 0xf3, 0x72, 0xcd, 0x59, 0xd4, 0x7a, 0x2a, 0x60,
- 0xa3, 0x62, 0x54, 0xa8, 0xb6, 0x8f, 0xed, 0x90, 0xdf, 0x3e, 0x94, 0xe8,
- 0xa4, 0x89, 0x32, 0xaa, 0x52, 0x5a, 0x97, 0xae}}},
- {{{0x4c, 0x86, 0xf4, 0xba, 0xec, 0xc6, 0x36, 0x13, 0x87, 0x42, 0x5d, 0x16,
- 0x49, 0x12, 0x66, 0xc5, 0xe0, 0xe4, 0x9b, 0xf9, 0x68, 0xaa, 0xa9, 0x95,
- 0x81, 0x16, 0x5c, 0xd2, 0xca, 0xd4, 0x2e, 0x61}}}}} // w
+ {{{{0x45, 0xcb, 0x06, 0x04, 0xb3, 0xf7, 0x23, 0xb2, 0xd1, 0xd1, 0x0d,
+ 0x4f, 0x51, 0x7b, 0xbb, 0x8f, 0x71, 0x15, 0xd7, 0xf1, 0xdc, 0x15,
+ 0x37, 0xc8, 0xb8, 0x3d, 0x68, 0x0a, 0x18, 0xa5, 0x34, 0x14}}},
+ {{{0x0c, 0xdc, 0xd9, 0x15, 0x7e, 0xba, 0x56, 0xc5, 0xe5, 0x61, 0xfa,
+ 0x6a, 0x86, 0xa0, 0xac, 0x6a, 0x81, 0x36, 0x6d, 0x01, 0x5f, 0x86,
+ 0xc0, 0x04, 0x8b, 0x1e, 0xff, 0x49, 0xd9, 0x37, 0x96, 0x66}}}}, // h1
+ {{{{0xf1, 0xc3, 0x16, 0xb5, 0xc5, 0x1c, 0x67, 0xb6, 0xff, 0x28, 0x23,
+ 0x79, 0x59, 0xea, 0x80, 0xe6, 0x09, 0x07, 0xe7, 0xd3, 0x38, 0xec,
+ 0xb9, 0x16, 0x83, 0x88, 0xda, 0x64, 0xdd, 0xc4, 0x9d, 0x6a}}},
+ {{{0x5c, 0xb2, 0x1c, 0x88, 0x97, 0xea, 0xaf, 0xa9, 0xf3, 0x3e, 0x07,
+ 0xea, 0xb6, 0x2a, 0xd5, 0x7a, 0xed, 0x32, 0xd9, 0x3d, 0x90, 0xd7,
+ 0xb9, 0x91, 0x08, 0x05, 0x9e, 0xe3, 0x22, 0x75, 0x06, 0x35}}}}, // h2
+ {{{{{0xe5, 0xc4, 0x77, 0xad, 0x52, 0xb9, 0x7c, 0x04, 0x2d, 0x7e, 0x81,
+ 0xf2, 0x5d, 0x5d, 0x52, 0x7d, 0xd7, 0x1d, 0x29, 0xfb, 0x6a, 0xa7,
+ 0xbc, 0xb5, 0xa9, 0x1a, 0xa6, 0xfd, 0x20, 0xea, 0xf2, 0x98}}},
+ {{{0xe2, 0x67, 0x33, 0x28, 0x67, 0x5f, 0xbe, 0x23, 0xa0, 0x43, 0xe8,
+ 0x71, 0xaa, 0xab, 0xf6, 0xf0, 0x6a, 0x2b, 0x52, 0xa8, 0x61, 0x51,
+ 0x22, 0x44, 0x00, 0x91, 0xd7, 0xf1, 0x7e, 0x05, 0x48, 0xdc}}}},
+ {{{{0x51, 0x0c, 0xef, 0xa0, 0xf3, 0x72, 0xcd, 0x59, 0xd4, 0x7a, 0x2a,
+ 0x60, 0xa3, 0x62, 0x54, 0xa8, 0xb6, 0x8f, 0xed, 0x90, 0xdf, 0x3e,
+ 0x94, 0xe8, 0xa4, 0x89, 0x32, 0xaa, 0x52, 0x5a, 0x97, 0xae}}},
+ {{{0x4c, 0x86, 0xf4, 0xba, 0xec, 0xc6, 0x36, 0x13, 0x87, 0x42, 0x5d,
+ 0x16, 0x49, 0x12, 0x66, 0xc5, 0xe0, 0xe4, 0x9b, 0xf9, 0x68, 0xaa,
+ 0xa9, 0x95, 0x81, 0x16, 0x5c, 0xd2, 0xca, 0xd4, 0x2e, 0x61}}}}} // w
};
const GroupPubKey EpidVerifierTest::kPubKeyRevGroupIkgfStr = {
@@ -477,6 +477,10 @@ const std::vector<uint8_t>
#include "epid/common-testhelper/testdata/grp01/member0/sig_test0_sha256_sigrl.inc"
};
const std::vector<uint8_t>
+ EpidVerifierTest::kSigGrp01Member0Sha512kBsn0Data_0_255 = {
+#include "epid/common-testhelper/testdata/grp01/member0/sig_bsn0_msg_0_255_sha512.inc"
+};
+const std::vector<uint8_t>
EpidVerifierTest::kSigMember0Sha256RandombaseMsg0Ikgf = {
#include "epid/common-testhelper/testdata/ikgf/groupa/sig_msg0_sha256_sigrl.inc"
};
@@ -525,6 +529,30 @@ const std::vector<uint8_t> EpidVerifierTest::kBasename = {'b', 'a', 's', 'e',
const std::vector<uint8_t> EpidVerifierTest::kBasename1 = {
'b', 'a', 's', 'e', 'n', 'a', 'm', 'e', '1'};
+const std::vector<uint8_t> EpidVerifierTest::kData_0_255 = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23,
+ 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
+ 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53,
+ 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b,
+ 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83,
+ 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b,
+ 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3,
+ 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb,
+ 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3,
+ 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb,
+ 0xfc, 0xfd, 0xfe, 0xff,
+};
const OctStr32 EpidVerifierTest::kOctStr32_1 = {0x00, 0x00, 0x00, 0x01};
const GroupPubKey EpidVerifierTest::kPubKeySigRlVerify = {
@@ -721,6 +749,10 @@ const std::vector<uint8_t> EpidVerifierTest::kSigGrpXMember0Sha512Bsn0Msg0 = {
#include "epid/common-testhelper/testdata/grp_x/member0/sig_sha512_bsn0_msg0.inc"
};
const std::vector<uint8_t>
+EpidVerifierTest::kSigGrpXMember0Sha512HugeBsnMsg0 = {
+#include "epid/common-testhelper/testdata/grp_x/member0/sig_sha512_huge_bsn_msg0.inc"
+};
+const std::vector<uint8_t>
EpidVerifierTest::kSigGrpXMember0Sha512RandbaseMsg0 = {
#include "epid/common-testhelper/testdata/grp_x/member0/sig_sha512_rndbase_msg0.inc"
};
diff --git a/epid/verifier/unittests/verifier-testhelper.h b/epid/verifier/unittests/verifier-testhelper.h
index 2ca7848..5e3f9f9 100644
--- a/epid/verifier/unittests/verifier-testhelper.h
+++ b/epid/verifier/unittests/verifier-testhelper.h
@@ -73,6 +73,10 @@ class EpidVerifierTest : public ::testing::Test {
static const std::vector<uint8_t> kBasename;
/// the basename "basename1"
static const std::vector<uint8_t> kBasename1;
+ /// a data with bytes [0,255]
+ static const std::vector<uint8_t> kData_0_255;
+ /// Signature of kData_0_255 with kBsn0 by Grp01 Member0 using Sha512
+ static const std::vector<uint8_t> kSigGrp01Member0Sha512kBsn0Data_0_255;
/// Signature of Test0 with RandomBase by Grp01 Member0 using Sha256
static const std::vector<uint8_t> kSigGrp01Member0Sha256RandombaseTest0;
/// Signature of Test with RandomBase, Member0 using Sha256 from Ikgf
@@ -224,6 +228,8 @@ class EpidVerifierTest : public ::testing::Test {
static const std::vector<uint8_t> kSigGrpXMember0Sha384RandbaseMsg0;
/// signature of msg0 by member0 of groupX with Sha512 bsn0
static const std::vector<uint8_t> kSigGrpXMember0Sha512Bsn0Msg0;
+ /// signature of msg0 by member0 of groupX with Sha512 huge bsn
+ static const std::vector<uint8_t> kSigGrpXMember0Sha512HugeBsnMsg0;
/// signature of msg0 by member0 of groupX with Sha512 rnd base
static const std::vector<uint8_t> kSigGrpXMember0Sha512RandbaseMsg0;
/// signature of msg0 by member0 of groupX with Sha512256 bsn0
diff --git a/epid/verifier/unittests/verify-test.cc b/epid/verifier/unittests/verify-test.cc
index 85c8d2e..d221742 100644
--- a/epid/verifier/unittests/verify-test.cc
+++ b/epid/verifier/unittests/verify-test.cc
@@ -23,13 +23,13 @@
#include "gtest/gtest.h"
extern "C" {
-#include "epid/verifier/api.h"
#include "epid/common/src/endian_convert.h"
+#include "epid/verifier/api.h"
}
-#include "epid/verifier/unittests/verifier-testhelper.h"
-#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/verifier/unittests/verifier-testhelper.h"
namespace {
@@ -38,7 +38,7 @@ namespace {
TEST_F(EpidVerifierTest, VerifyFailsGivenNullParameters) {
VerifierCtxObj verifier(this->kGrp01Key);
- auto& sig = this->kSigGrp01Member0Sha256RandombaseTest0;
+ auto& sig = this->kSigGrp01Member0Sha512RandombaseTest0;
auto& msg = this->kTest0;
EXPECT_EQ(kEpidBadArgErr,
@@ -51,11 +51,25 @@ TEST_F(EpidVerifierTest, VerifyFailsGivenNullParameters) {
nullptr, msg.size()));
}
+TEST_F(EpidVerifierTest, VerifyFailsGivenTooShortSigLen) {
+ VerifierCtxObj verifier(this->kGrp01Key);
+ auto& sig = this->kSigGrp01Member0Sha512RandombaseTest0;
+ auto& msg = this->kTest0;
+
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidVerify(verifier, (EpidSignature const*)sig.data(), 0,
+ msg.data(), msg.size()));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidVerify(verifier, (EpidSignature const*)sig.data(),
+ sizeof(EpidSignature) - sizeof(NrProof) - 1, msg.data(),
+ msg.size()));
+}
+
TEST_F(EpidVerifierTest, VerifyFailsGivenSigLenTooShortForRlCount) {
VerifierCtxObj verifier(this->kGrp01Key);
EpidVerifierSetSigRl(verifier, (SigRl const*)this->kGrp01SigRl.data(),
this->kGrp01SigRl.size());
- auto sig = this->kSigGrp01Member0Sha256RandombaseTest0;
+ auto sig = this->kSigGrp01Member0Sha512RandombaseTest0;
auto n2 = this->kGrp01SigRlN2;
sig.resize(sizeof(EpidSignature) +
(n2 - 2) * sizeof(((EpidSignature*)0)->sigma));
@@ -70,7 +84,7 @@ TEST_F(EpidVerifierTest, VerifyFailsGivenSigLenTooLongForRlCount) {
VerifierCtxObj verifier(this->kGrp01Key);
EpidVerifierSetSigRl(verifier, (SigRl const*)this->kGrp01SigRl.data(),
this->kGrp01SigRl.size());
- auto sig = this->kSigGrp01Member0Sha256RandombaseTest0;
+ auto sig = this->kSigGrp01Member0Sha512RandombaseTest0;
auto n2 = this->kGrp01SigRlN2;
sig.resize(sizeof(EpidSignature) + n2 * sizeof(((EpidSignature*)0)->sigma));
auto& msg = this->kTest0;
@@ -85,7 +99,7 @@ TEST_F(EpidVerifierTest, VerifyFailsGivenRlCountTooBig) {
VerifierCtxObj verifier(this->kGrp01Key);
EpidVerifierSetSigRl(verifier, (SigRl const*)this->kGrp01SigRl.data(),
this->kGrp01SigRl.size());
- auto sig = this->kSigGrp01Member0Sha256RandombaseTest0;
+ auto sig = this->kSigGrp01Member0Sha512RandombaseTest0;
uint32_t n2 = SIZE_MAX / sizeof(NrProof) + 1;
uint32_t n2_ = ntohl(n2);
EpidSignature* sig_struct = (EpidSignature*)sig.data();
@@ -115,9 +129,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithBNotInG1) {
// result must be kEpidSigInvalid
VerifierCtxObj verifier(this->kGrp01Key);
auto& msg = this->kTest0;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.B.x.data.data[31]++;
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
@@ -130,9 +144,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithBIdentityOfG1) {
auto& msg = this->kTest0;
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.B = this->kG1IdentityStr;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
}
@@ -142,7 +156,7 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithDiffBaseNameSameHashAlg) {
// B = G1.hash(bsn).
// result must be kEpidSigInvalid
auto& pub_key = this->kGrpXKey;
- auto& sig = this->kSigGrpXMember0Sha256Bsn0Msg0;
+ auto& sig = this->kSigGrpXMember0Sha512Bsn0Msg0;
auto& msg = this->kMsg0;
auto& bsn = this->kBasename1;
@@ -171,6 +185,30 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithSameBaseNameDiffHashAlg) {
msg.data(), msg.size()));
}
+TEST_F(EpidVerifierTest, VerifyRejectsSigWithDifferentHugeBaseName) {
+ // * 4.1.2 step 2.c - If bsn is provided, the verifier verifies
+ // B = G1.hash(bsn).
+ // result must be kEpidSigInvalid
+ auto& pub_key = this->kGrpXKey;
+ auto& sig = this->kSigGrpXMember0Sha512HugeBsnMsg0;
+ auto& msg = this->kMsg0;
+ std::vector<uint8_t> bsn(1024 * 1024);
+ uint8_t c = 0;
+ for (size_t i = 0; i < bsn.size(); ++i) {
+ // change middle kilobyte
+ if (i == 512 * 1024) c++;
+ if (i == 513 * 1024) c--;
+ bsn[i] = c++;
+ }
+
+ VerifierCtxObj verifier(pub_key);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(verifier, kSha512));
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(verifier, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidSigInvalid,
+ EpidVerify(verifier, (EpidSignature const*)sig.data(), sig.size(),
+ msg.data(), msg.size()));
+}
+
TEST_F(EpidVerifierTest, VerifyRejectsSigWithKNotInG1) {
// * 4.1.2 step 2.d - The verifier verifies G1.inGroup(K) = true.
// result must be kEpidSigInvalid
@@ -178,9 +216,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithKNotInG1) {
auto& msg = this->kTest0;
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.K.x.data.data[31]++;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
}
@@ -192,9 +230,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithTNotInG1) {
auto& msg = this->kTest0;
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.T.x.data.data[31]++;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
}
@@ -206,9 +244,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithCNotInRange) {
auto& msg = this->kTest0;
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.c.data = this->kParamsStr.p.data;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
}
@@ -220,9 +258,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithSxNotInRange) {
auto& msg = this->kTest0;
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.sx.data = this->kParamsStr.p.data;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
}
@@ -234,9 +272,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithSfNotInRange) {
auto& msg = this->kTest0;
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.sf.data = this->kParamsStr.p.data;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
}
@@ -248,9 +286,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithSaNotInRange) {
auto& msg = this->kTest0;
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.sa.data = this->kParamsStr.p.data;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
}
@@ -262,9 +300,9 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigWithSbNotInRange) {
auto& msg = this->kTest0;
EpidSignature sig = *(
- const EpidSignature*)(this->kSigGrp01Member0Sha256RandombaseTest0.data());
+ const EpidSignature*)(this->kSigGrp01Member0Sha512RandombaseTest0.data());
sig.sigma0.sb.data = this->kParamsStr.p.data;
- size_t size = this->kSigGrp01Member0Sha256RandombaseTest0.size();
+ size_t size = this->kSigGrp01Member0Sha512RandombaseTest0.size();
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, &sig, size, msg.data(), msg.size()));
}
@@ -301,7 +339,7 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigDifferingOnlyInMsg) {
// * 4.1.2 step 2.o - The verifier verifies c = Fp.hash(t3 || m).
// result must be kEpidSigInvalid
VerifierCtxObj verifier(this->kGrp01Key);
- auto& sig = this->kSigGrp01Member0Sha256RandombaseTest0;
+ auto& sig = this->kSigGrp01Member0Sha512RandombaseTest0;
auto msg = this->kTest0;
msg[0]++;
@@ -313,14 +351,16 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigDifferingOnlyInMsg) {
TEST_F(EpidVerifierTest, VerifyRejectsSigDifferingOnlyInBaseName) {
// * 4.1.2 step 2.o - The verifier verifies c = Fp.hash(t3 || m).
// result must be kEpidSigInvalid
- VerifierCtxObj verifier(this->kGrp01Key);
+ VerifierCtxObj verifier(this->kGrpXKey);
// copy sig data to a local buffer
- auto sig_data = this->kSigGrpXMember0Sha256Bsn0Msg0;
+ auto sig_data = this->kSigGrpXMember0Sha512Bsn0Msg0;
EpidSignature* sig = (EpidSignature*)sig_data.data();
// simulate change to basename
sig->sigma0.B.x.data.data[0] += 1;
- auto msg = this->kTest1;
+ auto msg = this->kMsg0;
+ auto bsn = this->kBsn0;
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(verifier, bsn.data(), bsn.size()));
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, sig, sig_data.size(), msg.data(), msg.size()));
}
@@ -328,14 +368,14 @@ TEST_F(EpidVerifierTest, VerifyRejectsSigDifferingOnlyInBaseName) {
TEST_F(EpidVerifierTest, VerifyRejectsSigDifferingOnlyInGroup) {
// * 4.1.2 step 2.o - The verifier verifies c = Fp.hash(t3 || m).
// result must be kEpidSigInvalid
- VerifierCtxObj verifier(this->kGrp01Key);
+ VerifierCtxObj verifier(this->kGrpXKey);
// copy sig data to a local buffer
- auto sig_data = this->kSigGrpXMember0Sha256Bsn0Msg0;
+ auto sig_data = this->kSigGrpXMember0Sha512RandbaseMsg0;
EpidSignature* sig = (EpidSignature*)sig_data.data();
// simulate change to h1
sig->sigma0.T.x.data.data[0] += 1;
- auto msg = this->kTest1;
+ auto msg = this->kMsg0;
EXPECT_EQ(kEpidSigInvalid,
EpidVerify(verifier, sig, sig_data.size(), msg.data(), msg.size()));
}
@@ -1140,6 +1180,25 @@ TEST_F(EpidVerifierTest, VerifyAcceptsSigWithBaseNameAllRlSha512) {
msg.data(), msg.size()));
}
+TEST_F(EpidVerifierTest, VerifyAcceptsSigWithHugeBaseNameNoRlSha512) {
+ auto& pub_key = this->kGrpXKey;
+ auto& msg = this->kMsg0;
+ auto& sig = this->kSigGrpXMember0Sha512HugeBsnMsg0;
+ std::vector<uint8_t> bsn(1024 * 1024);
+ uint8_t c = 0;
+ for (int i = 0; i < 1024 * 1024; ++i) {
+ bsn[i] = c++;
+ }
+
+ VerifierCtxObj verifier(pub_key);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(verifier, kSha512));
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(verifier, bsn.data(), bsn.size()));
+
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(verifier, (EpidSignature const*)sig.data(), sig.size(),
+ msg.data(), msg.size()));
+}
+
TEST_F(EpidVerifierTest, VerifyAcceptsSigWithRandomBaseNameAllRlSha512) {
auto& pub_key = this->kGrpXKey;
auto& msg = this->kMsg0;
@@ -1211,4 +1270,48 @@ TEST_F(EpidVerifierTest, VerifyAcceptsSigWithRandomBaseNameAllRlSha512256) {
msg.data(), msg.size()));
}
+TEST_F(EpidVerifierTest, VerifyAcceptsSigGivenMsgContainingAllPossibleBytes) {
+ auto& pub_key = this->kPubKeySigRlVerify;
+ auto& msg = this->kData_0_255;
+ auto& bsn = this->kBsn0;
+ auto& grp_rl = this->kGrpRl;
+ auto& priv_rl = this->kGrp01PrivRl;
+ std::vector<uint8_t> sig_rl = {
+ // gid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x2A,
+ // version
+ 0x00, 0x00, 0x00, 0x00,
+ // n2
+ 0x00, 0x00, 0x00, 0x01,
+ // bk's
+ 0x9c, 0xa5, 0xe5, 0xae, 0x5f, 0xae, 0x51, 0x59, 0x33, 0x35, 0x27, 0xd,
+ 0x8, 0xb1, 0xbe, 0x5d, 0x69, 0x50, 0x84, 0xc5, 0xfe, 0xe2, 0x87, 0xea,
+ 0x2e, 0xef, 0xfa, 0xee, 0x67, 0xf2, 0xd8, 0x28, 0x56, 0x43, 0xc6, 0x94,
+ 0x67, 0xa6, 0x72, 0xf6, 0x41, 0x15, 0x4, 0x58, 0x42, 0x16, 0x88, 0x57,
+ 0x9d, 0xc7, 0x71, 0xd1, 0xc, 0x84, 0x13, 0xa, 0x90, 0x23, 0x18, 0x8, 0xad,
+ 0x7d, 0xfe, 0xf5, 0xc8, 0xae, 0xfc, 0x51, 0x40, 0xa7, 0xd1, 0x28, 0xc2,
+ 0x89, 0xb2, 0x6b, 0x4e, 0xb4, 0xc1, 0x55, 0x87, 0x98, 0xbd, 0x72, 0xf9,
+ 0xcf, 0xd, 0x40, 0x15, 0xee, 0x32, 0xc, 0xf3, 0x56, 0xc5, 0xc, 0x61, 0x9d,
+ 0x4f, 0x7a, 0xb5, 0x2b, 0x16, 0xa9, 0xa3, 0x97, 0x38, 0xe2, 0xdd, 0x3a,
+ 0x33, 0xad, 0xf6, 0x7b, 0x68, 0x8b, 0x68, 0xcf, 0xa3, 0xd3, 0x98, 0x37,
+ 0xce, 0xec, 0xd1, 0xa8, 0xc, 0x8b,
+ };
+ auto& sig = this->kSigGrp01Member0Sha512kBsn0Data_0_255;
+
+ VerifierCtxObj verifier(pub_key);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(verifier, kSha512));
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(verifier, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidVerifierSetGroupRl(
+ verifier, (GroupRl const*)grp_rl.data(), grp_rl.size()));
+ THROW_ON_EPIDERR(EpidVerifierSetPrivRl(
+ verifier, (PrivRl const*)priv_rl.data(), priv_rl.size()));
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(verifier, (SigRl const*)sig_rl.data(),
+ sig_rl.size()));
+
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(verifier, (EpidSignature const*)sig.data(), sig.size(),
+ msg.data(), msg.size()));
+}
+
} // namespace
diff --git a/epid/verifier/unittests/verifybasic-test.cc b/epid/verifier/unittests/verifybasic-test.cc
index af984f5..20c1bac 100644
--- a/epid/verifier/unittests/verifybasic-test.cc
+++ b/epid/verifier/unittests/verifybasic-test.cc
@@ -29,10 +29,10 @@ extern "C" {
#include "epid/verifier/api.h"
}
-#include "epid/verifier/unittests/verifier-testhelper.h"
-#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
#include "epid/member/unittests/member-testhelper.h"
+#include "epid/verifier/unittests/verifier-testhelper.h"
namespace {
@@ -161,4 +161,19 @@ TEST_F(EpidVerifierTest, VerifyBasicSigCanVerifyWithBasenameUsingIkgfData) {
EpidVerifyBasicSig(verifier, &basic_sig, msg.data(), msg.size()));
}
+TEST_F(EpidVerifierTest, VerifyBasicSigCanVerifyMsgContainingAllPossibleBytes) {
+ VerifierCtxObj verifier(this->kPubKeySigRlVerify);
+ auto const& sig =
+ (EpidSignature const*)this->kSigGrp01Member0Sha512kBsn0Data_0_255.data();
+ const BasicSignature basic_sig = sig->sigma0;
+
+ auto& msg = this->kData_0_255;
+ auto& basename = this->kBsn0;
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(verifier, kSha512));
+ THROW_ON_EPIDERR(
+ EpidVerifierSetBasename(verifier, basename.data(), basename.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidVerifyBasicSig(verifier, &basic_sig, msg.data(), msg.size()));
+}
+
} // namespace
diff --git a/epid/verifier/verifier.parts b/epid/verifier/verifier.parts
index 5f2f140..2671811 100644
--- a/epid/verifier/verifier.parts
+++ b/epid/verifier/verifier.parts
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -89,6 +89,9 @@ else:
env.Append(CPPPATH='#')
+ if 'use_tss' in env['MODE']:
+ env.Append(CPPDEFINES=['TPM_TSS'])
+
testenv = env.Clone()
outputs = env.Library('${PART_NAME}', src_files + epid11_src_files)
env.Sdk(outputs)
diff --git a/example/Makefile b/example/Makefile
index 762a2b6..a892059 100644
--- a/example/Makefile
+++ b/example/Makefile
@@ -8,12 +8,12 @@ COMPRESSED_DEFAULT_FILES_INSTALL_DIR = $(epidinstalldir)/compressed_example
SIGNMSG_INCLUDE_DIR = ./signmsg
SIGNMSG_SRC = $(wildcard ./signmsg/src/*.c)
SIGNMSG_OBJ = $(SIGNMSG_SRC:.c=.o)
-SIGNMSG_EXE = ./signmsg/src/signmsg
+SIGNMSG_EXE = ./signmsg/src/signmsg$(EXE_EXTENSION)
VERIFYSIG_INCLUDE_DIR = ./verifysig
VERIFYSIG_SRC = $(wildcard ./verifysig/src/*.c)
VERIFYSIG_OBJ = $(VERIFYSIG_SRC:.c=.o)
-VERIFYSIG_EXE = ./verifysig/src/verifysig
+VERIFYSIG_EXE = ./verifysig/src/verifysig$(EXE_EXTENSION)
LIB_UTIL_DIR = ./util/src
diff --git a/example/compressed_data/README.md b/example/compressed_data/README.md
index 9b48b15..74c3341 100644
--- a/example/compressed_data/README.md
+++ b/example/compressed_data/README.md
@@ -172,7 +172,7 @@ There are 2 group revocation lists:
- `grprl_empty.bin` - group revocation list with 0 entries
-### IoT EPID Issuing CA certificate
+### IoT Issuing CA certificate
- `cacert.bin` - CA certificate used to check that revocation
lists and group public keys are authorized by the issuer, e.g.,
diff --git a/example/data/README.md b/example/data/README.md
index d4a4658..f1c0aa3 100644
--- a/example/data/README.md
+++ b/example/data/README.md
@@ -172,7 +172,7 @@ There are 2 group revocation lists:
- `grprl_empty.bin` - group revocation list with 0 entries
-### IoT EPID Issuing CA certificate
+### IoT Intel(R) EPID Issuing CA certificate
- `/data/cacert.bin` - CA certificate used to check that revocation
lists and group public keys are authorized by the issuer, e.g.,
diff --git a/example/signmsg/src/main.c b/example/signmsg/src/main.c
index 79debf1..5954545 100644
--- a/example/signmsg/src/main.c
+++ b/example/signmsg/src/main.c
@@ -19,14 +19,14 @@
* \brief Signmsg example implementation.
*/
+#include <dropt.h>
#include <stdlib.h>
#include <string.h>
-#include <dropt.h>
+#include "src/signmsg.h"
#include "util/buffutil.h"
#include "util/convutil.h"
#include "util/envutil.h"
-#include "src/signmsg.h"
// Defaults
#define PROGRAM_NAME "signmsg"
@@ -70,7 +70,7 @@ int main(int argc, char* argv[]) {
// intermediate return value for C style functions
int ret_value = EXIT_SUCCESS;
- // intermediate return value for EPID functions
+ // intermediate return value for Intel(R) EPID functions
EpidStatus result = kEpidErr;
// User Settings
@@ -102,9 +102,6 @@ int main(int argc, char* argv[]) {
// Member pre-computed settings input file name parameter
static char* mprecmpi_file = NULL;
- // Member pre-computed settings output file name parameter
- static char* mprecmpo_file = NULL;
-
// CA certificate file name parameter
static char* cacert_file = NULL;
@@ -137,9 +134,7 @@ int main(int argc, char* argv[]) {
// Member pre-computed settings
MemberPrecomp member_precmp = {0};
-
- // Flag that Member pre-computed settings input is valid
- bool use_precmp_in;
+ MemberPrecomp* member_precmp_ptr = NULL;
// Hash algorithm
static HashAlg hashalg = kSha512;
@@ -167,8 +162,6 @@ int main(int argc, char* argv[]) {
"FILE", dropt_handle_string, &mprivkey_file},
{'\0', "mprecmpi", "load pre-computed member data from FILE", "FILE",
dropt_handle_string, &mprecmpi_file},
- {'\0', "mprecmpo", "write pre-computed member data to FILE", "FILE",
- dropt_handle_string, &mprecmpo_file},
{'\0', "capubkey",
"load IoT Issuing CA public key from FILE (default: " CACERT_DEFAULT ")",
"FILE", dropt_handle_string, &cacert_file},
@@ -283,7 +276,6 @@ int main(int argc, char* argv[]) {
log_msg(" pubkey_file : %s", pubkey_file);
log_msg(" mprivkey_file : %s", mprivkey_file);
log_msg(" mprecmpi_file : %s", mprecmpi_file);
- log_msg(" mprecmpo_file : %s", mprecmpo_file);
log_msg(" hashalg : %s", HashAlgToString(hashalg));
log_msg(" cacert_file : %s", cacert_file);
log_msg("");
@@ -298,8 +290,9 @@ int main(int argc, char* argv[]) {
break;
}
// Security note:
- // Application must confirm that IoT EPID Issuing CA certificate is
- // authorized by IoT EPID Root CA, e.g., signed by IoT EPID Root CA.
+ // Application must confirm that IoT Intel(R) EPID Issuing CA certificate
+ // is authorized by IoT Intel(R) EPID Root CA, e.g.,
+ // signed by IoT Intel(R) EPID Root CA.
if (!IsCaCertAuthorizedByRootCa(&cacert, sizeof(cacert))) {
log_error("CA certificate is not authorized");
ret_value = EXIT_FAILURE;
@@ -341,7 +334,8 @@ int main(int argc, char* argv[]) {
break;
}
if (mprivkey_size != sizeof(PrivKey) &&
- mprivkey_size != sizeof(CompressedPrivKey)) {
+ mprivkey_size != sizeof(CompressedPrivKey) &&
+ mprivkey_size != sizeof(MembershipCredential)) {
log_error("Private Key file size is inconsistent");
ret_value = EXIT_FAILURE;
break;
@@ -351,19 +345,18 @@ int main(int argc, char* argv[]) {
break;
}
// Load Member pre-computed settings
- use_precmp_in = false;
if (mprecmpi_file) {
if (sizeof(MemberPrecomp) != GetFileSize(mprecmpi_file)) {
log_error("incorrect input precomp size");
ret_value = EXIT_FAILURE;
break;
}
- use_precmp_in = true;
if (0 != ReadLoud(mprecmpi_file, &member_precmp, sizeof(MemberPrecomp))) {
ret_value = EXIT_FAILURE;
break;
}
+ member_precmp_ptr = &member_precmp;
}
// Report Settings
@@ -387,16 +380,16 @@ int main(int argc, char* argv[]) {
PrintBuffer(signed_pubkey, signed_pubkey_size);
log_msg("");
log_msg(" [in] Member Private Key: ");
- PrintBuffer(&mprivkey, sizeof(mprivkey));
+ PrintBuffer(mprivkey, mprivkey_size);
log_msg("");
log_msg(" [in] Hash Algorithm: %s", HashAlgToString(hashalg));
log_msg("");
- log_msg(" [in] IoT EPID Issuing CA Certificate: ");
+ log_msg(" [in] IoT Intel(R) EPID Issuing CA Certificate: ");
PrintBuffer(&cacert, sizeof(cacert));
- if (use_precmp_in) {
+ if (member_precmp_ptr) {
log_msg("");
log_msg(" [in] Member PreComp: ");
- PrintBuffer(&member_precmp, sizeof(member_precmp));
+ PrintBuffer(member_precmp_ptr, sizeof(member_precmp));
}
log_msg("==============================================");
}
@@ -405,7 +398,7 @@ int main(int argc, char* argv[]) {
result = SignMsg(msg_str, msg_size, basename_str, basename_size,
signed_sig_rl, signed_sig_rl_size, signed_pubkey,
signed_pubkey_size, mprivkey, mprivkey_size, hashalg,
- &member_precmp, use_precmp_in, &sig, &sig_size, &cacert);
+ member_precmp_ptr, &sig, &sig_size, &cacert);
// Report Result
if (kEpidNoErr != result) {
@@ -426,15 +419,6 @@ int main(int argc, char* argv[]) {
}
}
- // Store Member pre-computed settings
- if (mprecmpo_file) {
- if (0 !=
- WriteLoud(&member_precmp, sizeof(member_precmp), mprecmpo_file)) {
- ret_value = EXIT_FAILURE;
- break;
- }
- }
-
// Success
ret_value = EXIT_SUCCESS;
} while (0);
diff --git a/example/signmsg/src/prng.c b/example/signmsg/src/prng.c
index e1da167..129b859 100644
--- a/example/signmsg/src/prng.c
+++ b/example/signmsg/src/prng.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,9 +18,9 @@
* \file
* \brief Pseudo random number generator implementation.
*/
-#include <time.h>
#include <ippcp.h>
#include <stdlib.h>
+#include <time.h>
#include "src/prng.h"
diff --git a/example/signmsg/src/signmsg.c b/example/signmsg/src/signmsg.c
index b6a78a9..5a70dbc 100644
--- a/example/signmsg/src/signmsg.c
+++ b/example/signmsg/src/signmsg.c
@@ -22,12 +22,14 @@
* Review the walk-through for correctness after making changes to this
* file.
*/
+#include "src/signmsg.h"
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "src/signmsg.h"
-#include "src/prng.h"
-#include "epid/member/api.h"
#include "epid/common/file_parser.h"
+#include "epid/member/api.h"
+#include "src/prng.h"
+#include "util/convutil.h"
EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
size_t basename_len, unsigned char const* signed_sig_rl,
@@ -35,9 +37,8 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
unsigned char const* signed_pubkey,
size_t signed_pubkey_size, unsigned char const* priv_key_ptr,
size_t privkey_size, HashAlg hash_alg,
- MemberPrecomp* member_precomp, bool member_precomp_is_input,
- EpidSignature** sig, size_t* sig_len,
- EpidCaCertificate const* cacert) {
+ MemberPrecomp* member_precomp, EpidSignature** sig,
+ size_t* sig_len, EpidCaCertificate const* cacert) {
EpidStatus sts = kEpidErr;
void* prng = NULL;
MemberCtx* member = NULL;
@@ -46,7 +47,9 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
do {
GroupPubKey pub_key = {0};
PrivKey priv_key = {0};
+ MembershipCredential member_credential = {0};
size_t sig_rl_size = 0;
+ MemberParams params = {0};
if (!sig) {
sts = kEpidBadArgErr;
@@ -59,8 +62,7 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
if (kEpidNoErr != sts) {
break;
}
-
- // decompress private key
+ // handle compressed private key or membership credential
if (privkey_size == sizeof(PrivKey)) {
priv_key = *(PrivKey*)priv_key_ptr;
} else if (privkey_size == sizeof(CompressedPrivKey)) {
@@ -69,6 +71,8 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
if (kEpidNoErr != sts) {
break;
}
+ } else if (privkey_size == sizeof(MembershipCredential)) {
+ member_credential = *(MembershipCredential*)priv_key_ptr;
} else {
sts = kEpidErr;
break;
@@ -80,20 +84,35 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
break;
}
+ SetMemberParams(&PrngGen, prng, NULL, &params);
// create member
- sts = EpidMemberCreate(&pub_key, &priv_key,
- member_precomp_is_input ? member_precomp : NULL,
- PrngGen, prng, &member);
+ sts = EpidMemberCreate(&params, &member);
+ if (kEpidNoErr != sts) {
+ break;
+ }
+
+ sts = EpidMemberSetHashAlg(member, hash_alg);
if (kEpidNoErr != sts) {
break;
}
- if (!member_precomp_is_input && member_precomp) {
- // return member pre-computation blob if requested
- sts = EpidMemberWritePrecomp(member, member_precomp);
+ if (privkey_size == sizeof(PrivKey) ||
+ privkey_size == sizeof(CompressedPrivKey)) {
+ sts = EpidProvisionKey(member, &pub_key, &priv_key, member_precomp);
if (kEpidNoErr != sts) {
break;
}
+ } else if (privkey_size == sizeof(MembershipCredential)) {
+ sts = EpidProvisionCredential(member, &pub_key, &member_credential,
+ member_precomp);
+ if (kEpidNoErr != sts) {
+ break;
+ }
+ } // if (privkey_size == sizeof(PrivKey))
+ // start member
+ sts = EpidMemberStartup(member);
+ if (kEpidNoErr != sts) {
+ break;
}
// register any provided basename as allowed
@@ -138,11 +157,6 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
}
} // if (signed_sig_rl)
- sts = EpidMemberSetHashAlg(member, hash_alg);
- if (kEpidNoErr != sts) {
- break;
- }
-
// Signature
// Note: Signature size must be computed after sig_rl is loaded.
*sig_len = EpidGetSigSize(sig_rl);
diff --git a/example/signmsg/src/signmsg.h b/example/signmsg/src/signmsg.h
index 4426ea9..376b42a 100644
--- a/example/signmsg/src/signmsg.h
+++ b/example/signmsg/src/signmsg.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,8 +22,9 @@
#ifndef EXAMPLE_SIGNMSG_SRC_SIGNMSG_H_
#define EXAMPLE_SIGNMSG_SRC_SIGNMSG_H_
-#include "epid/member/api.h"
#include "epid/common/file_parser.h"
+#include "epid/common/stdtypes.h"
+#include "epid/member/api.h"
/// Check if opaque data blob containing CA certificate is authorized
bool IsCaCertAuthorizedByRootCa(void const* data, size_t size);
@@ -33,10 +34,9 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
size_t basename_len, unsigned char const* signed_sig_rl,
size_t signed_sig_rl_size,
unsigned char const* signed_pubkey,
- size_t signed_pubkey_size, unsigned char const* priv_key,
+ size_t signed_pubkey_size, unsigned char const* priv_key_ptr,
size_t privkey_size, HashAlg hash_alg,
- MemberPrecomp* member_precomp, bool member_precomp_is_input,
- EpidSignature** sig, size_t* sig_len,
- EpidCaCertificate const* cacert);
+ MemberPrecomp* member_precomp, EpidSignature** sig,
+ size_t* sig_len, EpidCaCertificate const* cacert);
#endif // EXAMPLE_SIGNMSG_SRC_SIGNMSG_H_
diff --git a/example/util/convutil.h b/example/util/convutil.h
index 83aeb9a..15df691 100644
--- a/example/util/convutil.h
+++ b/example/util/convutil.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,9 +22,18 @@
#define EXAMPLE_UTIL_CONVUTIL_H_
#include <stddef.h>
-#include "epid/common/types.h"
+#include "epid/common/bitsupplier.h"
#include "epid/common/file_parser.h"
+#include "epid/common/types.h"
#include "util/stdtypes.h"
+#ifdef TPM_TSS
+#include "epid/member/tpm_member.h"
+#else
+#include "epid/member/software_member.h"
+#endif
+
+/// Implementation specific configuration parameters.
+typedef struct MemberParams MemberParams;
/// convert a hash algorithm to a string
/*!
@@ -42,36 +51,48 @@ char const* HashAlgToString(HashAlg alg);
*/
bool StringToHashAlg(char const* str, HashAlg* alg);
-/// convert an EPID version to a string
+/// convert an Intel(R) EPID version to a string
/*!
-\param[in] version an EPID version
+\param[in] version an Intel(R) EPID version
\returns string representing the version
*/
char const* EpidVersionToString(EpidVersion version);
-/// convert a string to an EPID version
+/// convert a string to an Intel(R) EPID version
/*!
\param[in] str a string
-\param[out] version an EPID version
-\retval true string represents an EPID version
-\retval false string does not represent an EPID version
+\param[out] version an Intel(R) EPID version
+\retval true string represents an Intel(R) EPID version
+\retval false string does not represent an Intel(R) EPID version
*/
bool StringToEpidVersion(char const* str, EpidVersion* version);
-/// convert an EPID file type to a string
+/// convert an Intel(R) EPID file type to a string
/*!
-\param[in] type an EPID file type
+\param[in] type an Intel(R) EPID file type
\returns string representing the algorithm
*/
char const* EpidFileTypeToString(EpidFileType type);
-/// convert a string to an EPID file type
+/// convert a string to an Intel(R) EPID file type
/*!
\param[in] str a string
-\param[out] type an EPID file type
-\retval true string represents an EPID file type
-\retval false string does not represent an EPID file type
+\param[out] type an Intel(R) EPID file type
+\retval true string represents an Intel(R) EPID file type
+\retval false string does not represent an Intel(R) EPID file type
*/
bool StringToEpidFileType(char const* str, EpidFileType* type);
+/// set MemberParams to encapsulate different structure of Memparams
+/// in case of TPM mode and none TPM mode
+/*!
+\param[in] rnd_func a Intel(R) EPID BitSupplier
+\param[in] rnd_param a random parameters for BitSupplier
+\param[in] f is Intel(R) EPID FpElemStr
+\param[out] params is Intel(R) EPID MemberParams
+\returns void
+*/
+void SetMemberParams(BitSupplier rnd_func, void* rnd_param, FpElemStr* f,
+ MemberParams* params);
+
#endif // EXAMPLE_UTIL_CONVUTIL_H_
diff --git a/example/util/src/bufutil.c b/example/util/src/bufutil.c
index adfb337..6e87cda 100644
--- a/example/util/src/bufutil.c
+++ b/example/util/src/bufutil.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,9 +21,9 @@
#include <util/buffutil.h>
+#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
#include "util/envutil.h"
/// file static variable that indicates verbose logging
diff --git a/example/util/src/convutil.c b/example/util/src/convutil.c
index 4a57c68..c3bf2bc 100644
--- a/example/util/src/convutil.c
+++ b/example/util/src/convutil.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,10 +21,10 @@
*
*/
-#include <stdlib.h>
+#include "util/convutil.h"
#include <ctype.h>
+#include <stdlib.h>
#include <string.h>
-#include "util/convutil.h"
#include "util/envutil.h"
const char* hash_alg_to_string[] = {"SHA-256", "SHA-384", "SHA-512",
@@ -93,3 +93,16 @@ bool StringToEpidFileType(char const* str, EpidFileType* type) {
log_error("epid file type \"%s\" is unknown", str);
return false;
}
+
+void SetMemberParams(BitSupplier rnd_func, void* rnd_param, FpElemStr* f,
+ MemberParams* params) {
+#ifdef TPM_TSS
+ (void)rnd_func;
+ (void)rnd_param;
+ params->f = f;
+#else
+ params->rnd_func = rnd_func;
+ params->rnd_param = rnd_param;
+ params->f = f;
+#endif
+}
diff --git a/example/util/src/envutil.c b/example/util/src/envutil.c
index dbec178..f594e35 100644
--- a/example/util/src/envutil.c
+++ b/example/util/src/envutil.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
* \brief Environment utilities implementation.
*/
-#include <stdio.h>
-#include <stdarg.h>
#include "util/envutil.h"
+#include <stdarg.h>
+#include <stdio.h>
static char const* prog_name = NULL;
diff --git a/example/util/strutil.h b/example/util/strutil.h
index 885fc59..1cfe5b3 100644
--- a/example/util/strutil.h
+++ b/example/util/strutil.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
#ifndef EXAMPLE_UTIL_STRUTIL_H_
#define EXAMPLE_UTIL_STRUTIL_H_
-#include <stdio.h>
#include <stdarg.h>
+#include <stdio.h>
// Prior to version 14.0 snprintf was not supported in MSVC
#if defined(_MSC_VER) && _MSC_VER < 1900
diff --git a/example/util/util.parts b/example/util/util.parts
index 881dfe3..585847a 100644
--- a/example/util/util.parts
+++ b/example/util/util.parts
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,30 +18,32 @@ Import('*')
env.PartName("util")
-src_files = Pattern(src_dir='src',
- includes=['*.c'],
- recursive=True).files()
+src_files = Pattern(src_dir='src', includes=['*.c'], recursive=True).files()
-api_headers = Pattern(src_dir='.',
- includes=['*.h'],
- recursive=False).files()
+api_headers = Pattern(src_dir='.', includes=['*.h'], recursive=False).files()
parts_file = ['util.parts']
makefile = ['Makefile']
#unit tests
-utest_files = Pattern(src_dir='.',
- includes=['*-test.cc', '*-testhelper.cc'],
- excludes=[],
- recursive=True).files()
+utest_files = Pattern(
+ src_dir='.',
+ includes=['*-test.cc', '*-testhelper.cc'],
+ excludes=[],
+ recursive=True).files()
+
+if 'use_tss' in env['MODE']:
+ env.Append(CPPDEFINES=['TPM_TSS'])
if 'install_package' in env['MODE']:
env.InstallTopLevel(src_files, sub_dir='example/${PART_SHORT_NAME}/src')
env.InstallTopLevel(api_headers, sub_dir='example/${PART_SHORT_NAME}')
- env.InstallTopLevel(utest_files, sub_dir='example/${PART_SHORT_NAME}/utest')
+ env.InstallTopLevel(
+ utest_files, sub_dir='example/${PART_SHORT_NAME}/utest')
env.InstallTopLevel(parts_file, sub_dir='example/${PART_SHORT_NAME}')
env.InstallTopLevel(makefile, sub_dir='example/${PART_SHORT_NAME}')
else:
- env.DependsOn([Component('common', requires=REQ.HEADERS)])
+ env.DependsOn(
+ [Component('common', requires=REQ.HEADERS), Component('member')])
env.Append(CPPPATH='#/example')
diff --git a/example/verifysig/src/main.c b/example/verifysig/src/main.c
index 8069506..07a728c 100644
--- a/example/verifysig/src/main.c
+++ b/example/verifysig/src/main.c
@@ -19,18 +19,18 @@
* \brief Verifysig example implementation.
*/
+#include <dropt.h>
#include <stdlib.h>
#include <string.h>
-#include <dropt.h>
#include "epid/common/file_parser.h"
-#include "epid/verifier/api.h"
#include "epid/verifier/1.1/api.h"
+#include "epid/verifier/api.h"
+#include "src/verifysig.h"
+#include "src/verifysig11.h"
#include "util/buffutil.h"
#include "util/convutil.h"
#include "util/envutil.h"
-#include "src/verifysig.h"
-#include "src/verifysig11.h"
// Defaults
#define PROGRAM_NAME "verifysig"
@@ -79,7 +79,7 @@ static dropt_error HandleHashalg(dropt_context* context,
int main(int argc, char* argv[]) {
// intermediate return value for C style functions
int ret_value = EXIT_SUCCESS;
- // intermediate return value for EPID functions
+ // intermediate return value for Intel(R) EPID functions
EpidStatus result = kEpidErr;
// User Settings
@@ -306,9 +306,9 @@ int main(int argc, char* argv[]) {
log_msg(" verrl_file : %s", verrl_file);
log_msg(" vprecmpi_file : %s", vprecmpi_file);
log_msg(" vprecmpo_file : %s", vprecmpo_file);
- log_msg(" hashalg : %s", (UNPARSED_HASHALG == hashalg)
- ? "(default)"
- : HashAlgToString(hashalg));
+ log_msg(" hashalg : %s",
+ (UNPARSED_HASHALG == hashalg) ? "(default)"
+ : HashAlgToString(hashalg));
log_msg(" cacert_file_name : %s", cacert_file_name);
log_msg("");
}
@@ -370,15 +370,16 @@ int main(int argc, char* argv[]) {
}
// Security note:
- // Application must confirm that IoT EPID Issuing CA certificate is
- // authorized by IoT EPID Root CA, e.g., signed by IoT EPID Root CA.
+ // Application must confirm that IoT Issuing CA
+ // certificate is authorized by IoT Root CA,
+ // e.g., signed by IoT Root CA.
if (!IsCaCertAuthorizedByRootCa(&cacert, sizeof(cacert))) {
log_error("CA certificate is not authorized");
ret_value = EXIT_FAILURE;
break;
}
- // Detect EPID version
+ // Detect Intel(R) EPID version
result = EpidParseFileHeader(signed_pubkey, signed_pubkey_size,
&epid_version, NULL);
if (kEpidNoErr != result || kNumEpidVersions <= epid_version) {
@@ -419,7 +420,8 @@ int main(int argc, char* argv[]) {
log_msg("==============================================");
log_msg("Verifying Message:");
log_msg("");
- log_msg(" [in] EPID version: %s", EpidVersionToString(epid_version));
+ log_msg(" [in] Intel(R) EPID version: %s",
+ EpidVersionToString(epid_version));
log_msg("");
log_msg(" [in] Signature Len: %d", (int)sig_size);
log_msg(" [in] Signature: ");
diff --git a/example/verifysig/src/verifysig.c b/example/verifysig/src/verifysig.c
index e0d9d36..d8dae5b 100644
--- a/example/verifysig/src/verifysig.c
+++ b/example/verifysig/src/verifysig.c
@@ -23,8 +23,8 @@
#include <stdlib.h>
-#include "epid/verifier/api.h"
#include "epid/common/file_parser.h"
+#include "epid/verifier/api.h"
EpidStatus Verify(EpidSignature const* sig, size_t sig_len, void const* msg,
size_t msg_len, void const* basename, size_t basename_len,
diff --git a/example/verifysig/src/verifysig.h b/example/verifysig/src/verifysig.h
index 0239b28..6ee95b7 100644
--- a/example/verifysig/src/verifysig.h
+++ b/example/verifysig/src/verifysig.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -22,8 +22,8 @@
#define EXAMPLE_VERIFYSIG_SRC_VERIFYSIG_H_
#include <stddef.h>
-#include "epid/common/stdtypes.h"
#include "epid/common/errors.h"
+#include "epid/common/stdtypes.h"
#include "epid/common/types.h"
struct EpidCaCertificate;
@@ -31,7 +31,7 @@ struct EpidCaCertificate;
/// Check if opaque data blob containing CA certificate is authorized
bool IsCaCertAuthorizedByRootCa(void const* data, size_t size);
-/// verify EPID 2.x signature
+/// verify Intel(R) EPID 2.x signature
EpidStatus Verify(EpidSignature const* sig, size_t sig_len, void const* msg,
size_t msg_len, void const* basename, size_t basename_len,
void const* signed_priv_rl, size_t signed_priv_rl_size,
diff --git a/example/verifysig/src/verifysig11.c b/example/verifysig/src/verifysig11.c
index d1b0c95..5e5f8df 100644
--- a/example/verifysig/src/verifysig11.c
+++ b/example/verifysig/src/verifysig11.c
@@ -16,15 +16,15 @@
/*!
* \file
- * \brief EPID 1.1 signature verification implementation.
+ * \brief Intel(R) EPID 1.1 signature verification implementation.
*/
#include "src/verifysig11.h"
#include <stdlib.h>
-#include "epid/verifier/1.1/api.h"
#include "epid/common/1.1/file_parser.h"
+#include "epid/verifier/1.1/api.h"
EpidStatus Verify11(Epid11Signature const* sig, size_t sig_len, void const* msg,
size_t msg_len, void const* basename, size_t basename_len,
diff --git a/example/verifysig/src/verifysig11.h b/example/verifysig/src/verifysig11.h
index a4032bd..9a3665f 100644
--- a/example/verifysig/src/verifysig11.h
+++ b/example/verifysig/src/verifysig11.h
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,18 +16,18 @@
/*!
* \file
- * \brief EPID 1.1 signature verification interface.
+ * \brief Intel(R) EPID 1.1 signature verification interface.
*/
#ifndef EXAMPLE_VERIFYSIG_SRC_VERIFYSIG11_H_
#define EXAMPLE_VERIFYSIG_SRC_VERIFYSIG11_H_
#include <stddef.h>
-#include "epid/common/errors.h"
#include "epid/common/1.1/types.h"
+#include "epid/common/errors.h"
struct EpidCaCertificate;
-/// verify EPID 1.x signature
+/// verify Intel(R) EPID 1.x signature
EpidStatus Verify11(Epid11Signature const* sig, size_t sig_len, void const* msg,
size_t msg_len, void const* basename, size_t basename_len,
void const* signed_priv_rl, size_t signed_priv_rl_size,
diff --git a/ext/gtest/gtest-all.cc b/ext/gtest/gtest-all.cc
index 41cfb5b..983bd02 100644
--- a/ext/gtest/gtest-all.cc
+++ b/ext/gtest/gtest-all.cc
@@ -316,6 +316,8 @@ class GTEST_API_ SingleFailureChecker {
#include <algorithm>
#include <iomanip>
#include <limits>
+#include <list>
+#include <map>
#include <ostream> // NOLINT
#include <sstream>
#include <vector>
@@ -350,6 +352,7 @@ class GTEST_API_ SingleFailureChecker {
#elif GTEST_OS_WINDOWS_MOBILE // We are on Windows CE.
# include <windows.h> // NOLINT
+# undef min
#elif GTEST_OS_WINDOWS // We are on Windows proper.
@@ -372,6 +375,7 @@ class GTEST_API_ SingleFailureChecker {
// cpplint thinks that the header is already included, so we want to
// silence it.
# include <windows.h> // NOLINT
+# undef min
#else
@@ -394,6 +398,8 @@ class GTEST_API_ SingleFailureChecker {
#if GTEST_CAN_STREAM_RESULTS_
# include <arpa/inet.h> // NOLINT
# include <netdb.h> // NOLINT
+# include <sys/socket.h> // NOLINT
+# include <sys/types.h> // NOLINT
#endif
// Indicates that this translation unit is part of Google Test's
@@ -444,7 +450,7 @@ class GTEST_API_ SingleFailureChecker {
// GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is
// part of Google Test's implementation; otherwise it's undefined.
#if !GTEST_IMPLEMENTATION_
-// A user is trying to include this from his code - just say no.
+// If this file is included from the user's code, just say no.
# error "gtest-internal-inl.h is part of Google Test's internal implementation."
# error "It must not be included except by Google Test itself."
#endif // GTEST_IMPLEMENTATION_
@@ -501,6 +507,7 @@ const char kShuffleFlag[] = "shuffle";
const char kStackTraceDepthFlag[] = "stack_trace_depth";
const char kStreamResultToFlag[] = "stream_result_to";
const char kThrowOnFailureFlag[] = "throw_on_failure";
+const char kFlagfileFlag[] = "flagfile";
// A valid random seed must be in [1, kMaxRandomSeed].
const int kMaxRandomSeed = 99999;
@@ -833,6 +840,10 @@ class OsStackTraceGetterInterface {
// CurrentStackTrace() will use to find and hide Google Test stack frames.
virtual void UponLeavingGTest() = 0;
+ // This string is inserted in place of stack frames that are part of
+ // Google Test's implementation.
+ static const char* const kElidedFramesMarker;
+
private:
GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
};
@@ -840,26 +851,12 @@ class OsStackTraceGetterInterface {
// A working implementation of the OsStackTraceGetterInterface interface.
class OsStackTraceGetter : public OsStackTraceGetterInterface {
public:
- OsStackTraceGetter() : caller_frame_(NULL) {}
-
- virtual string CurrentStackTrace(int max_depth, int skip_count)
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- virtual void UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_);
+ OsStackTraceGetter() {}
- // This string is inserted in place of stack frames that are part of
- // Google Test's implementation.
- static const char* const kElidedFramesMarker;
+ virtual string CurrentStackTrace(int max_depth, int skip_count);
+ virtual void UponLeavingGTest();
private:
- Mutex mutex_; // protects all internal state
-
- // We save the stack frame below the frame that calls user code.
- // We do this because the address of the frame immediately below
- // the user code changes between the call to UponLeavingGTest()
- // and any calls to CurrentStackTrace() from within the user code.
- void* caller_frame_;
-
GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
};
@@ -1369,32 +1366,6 @@ GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);
// platform.
GTEST_API_ std::string GetLastErrnoDescription();
-# if GTEST_OS_WINDOWS
-// Provides leak-safe Windows kernel handle ownership.
-class AutoHandle {
- public:
- AutoHandle() : handle_(INVALID_HANDLE_VALUE) {}
- explicit AutoHandle(HANDLE handle) : handle_(handle) {}
-
- ~AutoHandle() { Reset(); }
-
- HANDLE Get() const { return handle_; }
- void Reset() { Reset(INVALID_HANDLE_VALUE); }
- void Reset(HANDLE handle) {
- if (handle != handle_) {
- if (handle_ != INVALID_HANDLE_VALUE)
- ::CloseHandle(handle_);
- handle_ = handle;
- }
- }
-
- private:
- HANDLE handle_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
-};
-# endif // GTEST_OS_WINDOWS
-
// Attempts to parse a string into a positive integer pointed to by the
// number parameter. Returns true if that is possible.
// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use
@@ -1468,7 +1439,7 @@ class TestResultAccessor {
#if GTEST_CAN_STREAM_RESULTS_
// Streams test results to the given port on the given host machine.
-class StreamingListener : public EmptyTestEventListener {
+class GTEST_API_ StreamingListener : public EmptyTestEventListener {
public:
// Abstract base class for writing strings to a socket.
class AbstractSocketWriter {
@@ -1667,6 +1638,12 @@ bool g_help_flag = false;
} // namespace internal
static const char* GetDefaultFilter() {
+#ifdef GTEST_TEST_FILTER_ENV_VAR_
+ const char* const testbridge_test_only = getenv(GTEST_TEST_FILTER_ENV_VAR_);
+ if (testbridge_test_only != NULL) {
+ return testbridge_test_only;
+ }
+#endif // GTEST_TEST_FILTER_ENV_VAR_
return kUniversalFilter;
}
@@ -1767,6 +1744,13 @@ GTEST_DEFINE_bool_(
"if exceptions are enabled or exit the program with a non-zero code "
"otherwise.");
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+GTEST_DEFINE_string_(
+ flagfile,
+ internal::StringFromGTestEnv("flagfile", ""),
+ "This flag specifies the flagfile to read command-line flags from.");
+#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
+
namespace internal {
// Generates a random number from [0, range), using a Linear
@@ -1791,13 +1775,7 @@ UInt32 Random::Generate(UInt32 range) {
// GTestIsInitialized() returns true iff the user has initialized
// Google Test. Useful for catching the user mistake of not initializing
// Google Test before calling RUN_ALL_TESTS().
-//
-// A user must call testing::InitGoogleTest() to initialize Google
-// Test. g_init_gtest_count is set to the number of times
-// InitGoogleTest() has been called. We don't protect this variable
-// under a mutex as it is only accessed in the main thread.
-GTEST_API_ int g_init_gtest_count = 0;
-static bool GTestIsInitialized() { return g_init_gtest_count != 0; }
+static bool GTestIsInitialized() { return GetArgvs().size() > 0; }
// Iterates over a vector of TestCases, keeping a running sum of the
// results of calling a given int-returning method on each.
@@ -1853,8 +1831,16 @@ void AssertHelper::operator=(const Message& message) const {
// Mutex for linked pointers.
GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
-// Application pathname gotten in InitGoogleTest.
-std::string g_executable_path;
+// A copy of all command line arguments. Set by InitGoogleTest().
+::std::vector<testing::internal::string> g_argvs;
+
+const ::std::vector<testing::internal::string>& GetArgvs() {
+#if defined(GTEST_CUSTOM_GET_ARGVS_)
+ return GTEST_CUSTOM_GET_ARGVS_();
+#else // defined(GTEST_CUSTOM_GET_ARGVS_)
+ return g_argvs;
+#endif // defined(GTEST_CUSTOM_GET_ARGVS_)
+}
// Returns the current application's name, removing directory path if that
// is present.
@@ -1862,9 +1848,9 @@ FilePath GetCurrentExecutableName() {
FilePath result;
#if GTEST_OS_WINDOWS
- result.Set(FilePath(g_executable_path).RemoveExtension("exe"));
+ result.Set(FilePath(GetArgvs()[0]).RemoveExtension("exe"));
#else
- result.Set(FilePath(g_executable_path));
+ result.Set(FilePath(GetArgvs()[0]));
#endif // GTEST_OS_WINDOWS
return result.RemoveDirectoryName();
@@ -2256,8 +2242,12 @@ int UnitTestImpl::test_to_run_count() const {
// CurrentOsStackTraceExceptTop(1), Foo() will be included in the
// trace but Bar() and CurrentOsStackTraceExceptTop() won't.
std::string UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {
- (void)skip_count;
- return "";
+ return os_stack_trace_getter()->CurrentStackTrace(
+ static_cast<int>(GTEST_FLAG(stack_trace_depth)),
+ skip_count + 1
+ // Skips the user-specified number of frames plus this function
+ // itself.
+ ); // NOLINT
}
// Returns the current time in milliseconds.
@@ -2286,21 +2276,13 @@ TimeInMillis GetTimeInMillis() {
#elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_
__timeb64 now;
-# ifdef _MSC_VER
-
// MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
// (deprecated function) there.
// TODO(kenton@google.com): Use GetTickCount()? Or use
// SystemTimeToFileTime()
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4996) // Temporarily disables warning 4996.
- _ftime64(&now);
-# pragma warning(pop) // Restores the warning state.
-# else
-
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
_ftime64(&now);
-
-# endif // _MSC_VER
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
#elif GTEST_HAS_GETTIMEOFDAY_
@@ -2385,6 +2367,23 @@ static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
#endif // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
+void SplitString(const ::std::string& str, char delimiter,
+ ::std::vector< ::std::string>* dest) {
+ ::std::vector< ::std::string> parsed;
+ ::std::string::size_type pos = 0;
+ while (::testing::internal::AlwaysTrue()) {
+ const ::std::string::size_type colon = str.find(delimiter, pos);
+ if (colon == ::std::string::npos) {
+ parsed.push_back(str.substr(pos));
+ break;
+ } else {
+ parsed.push_back(str.substr(pos, colon - pos));
+ pos = colon + 1;
+ }
+ }
+ dest->swap(parsed);
+}
+
} // namespace internal
// Constructs an empty Message.
@@ -2440,6 +2439,13 @@ AssertionResult::AssertionResult(const AssertionResult& other)
static_cast< ::std::string*>(NULL)) {
}
+// Swaps two AssertionResults.
+void AssertionResult::swap(AssertionResult& other) {
+ using std::swap;
+ swap(success_, other.success_);
+ swap(message_, other.message_);
+}
+
// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
AssertionResult AssertionResult::operator!() const {
AssertionResult negation(!success_);
@@ -2466,6 +2472,276 @@ AssertionResult AssertionFailure(const Message& message) {
namespace internal {
+namespace edit_distance {
+std::vector<EditType> CalculateOptimalEdits(const std::vector<size_t>& left,
+ const std::vector<size_t>& right) {
+ std::vector<std::vector<double> > costs(
+ left.size() + 1, std::vector<double>(right.size() + 1));
+ std::vector<std::vector<EditType> > best_move(
+ left.size() + 1, std::vector<EditType>(right.size() + 1));
+
+ // Populate for empty right.
+ for (size_t l_i = 0; l_i < costs.size(); ++l_i) {
+ costs[l_i][0] = static_cast<double>(l_i);
+ best_move[l_i][0] = kRemove;
+ }
+ // Populate for empty left.
+ for (size_t r_i = 1; r_i < costs[0].size(); ++r_i) {
+ costs[0][r_i] = static_cast<double>(r_i);
+ best_move[0][r_i] = kAdd;
+ }
+
+ for (size_t l_i = 0; l_i < left.size(); ++l_i) {
+ for (size_t r_i = 0; r_i < right.size(); ++r_i) {
+ if (left[l_i] == right[r_i]) {
+ // Found a match. Consume it.
+ costs[l_i + 1][r_i + 1] = costs[l_i][r_i];
+ best_move[l_i + 1][r_i + 1] = kMatch;
+ continue;
+ }
+
+ const double add = costs[l_i + 1][r_i];
+ const double remove = costs[l_i][r_i + 1];
+ const double replace = costs[l_i][r_i];
+ if (add < remove && add < replace) {
+ costs[l_i + 1][r_i + 1] = add + 1;
+ best_move[l_i + 1][r_i + 1] = kAdd;
+ } else if (remove < add && remove < replace) {
+ costs[l_i + 1][r_i + 1] = remove + 1;
+ best_move[l_i + 1][r_i + 1] = kRemove;
+ } else {
+ // We make replace a little more expensive than add/remove to lower
+ // their priority.
+ costs[l_i + 1][r_i + 1] = replace + 1.00001;
+ best_move[l_i + 1][r_i + 1] = kReplace;
+ }
+ }
+ }
+
+ // Reconstruct the best path. We do it in reverse order.
+ std::vector<EditType> best_path;
+ for (size_t l_i = left.size(), r_i = right.size(); l_i > 0 || r_i > 0;) {
+ EditType move = best_move[l_i][r_i];
+ best_path.push_back(move);
+ l_i -= move != kAdd;
+ r_i -= move != kRemove;
+ }
+ std::reverse(best_path.begin(), best_path.end());
+ return best_path;
+}
+
+namespace {
+
+// Helper class to convert string into ids with deduplication.
+class InternalStrings {
+ public:
+ size_t GetId(const std::string& str) {
+ IdMap::iterator it = ids_.find(str);
+ if (it != ids_.end()) return it->second;
+ size_t id = ids_.size();
+ return ids_[str] = id;
+ }
+
+ private:
+ typedef std::map<std::string, size_t> IdMap;
+ IdMap ids_;
+};
+
+} // namespace
+
+std::vector<EditType> CalculateOptimalEdits(
+ const std::vector<std::string>& left,
+ const std::vector<std::string>& right) {
+ std::vector<size_t> left_ids, right_ids;
+ {
+ InternalStrings intern_table;
+ for (size_t i = 0; i < left.size(); ++i) {
+ left_ids.push_back(intern_table.GetId(left[i]));
+ }
+ for (size_t i = 0; i < right.size(); ++i) {
+ right_ids.push_back(intern_table.GetId(right[i]));
+ }
+ }
+ return CalculateOptimalEdits(left_ids, right_ids);
+}
+
+namespace {
+
+// Helper class that holds the state for one hunk and prints it out to the
+// stream.
+// It reorders adds/removes when possible to group all removes before all
+// adds. It also adds the hunk header before printint into the stream.
+class Hunk {
+ public:
+ Hunk(size_t left_start, size_t right_start)
+ : left_start_(left_start),
+ right_start_(right_start),
+ adds_(),
+ removes_(),
+ common_() {}
+
+ void PushLine(char edit, const char* line) {
+ switch (edit) {
+ case ' ':
+ ++common_;
+ FlushEdits();
+ hunk_.push_back(std::make_pair(' ', line));
+ break;
+ case '-':
+ ++removes_;
+ hunk_removes_.push_back(std::make_pair('-', line));
+ break;
+ case '+':
+ ++adds_;
+ hunk_adds_.push_back(std::make_pair('+', line));
+ break;
+ }
+ }
+
+ void PrintTo(std::ostream* os) {
+ PrintHeader(os);
+ FlushEdits();
+ for (std::list<std::pair<char, const char*> >::const_iterator it =
+ hunk_.begin();
+ it != hunk_.end(); ++it) {
+ *os << it->first << it->second << "\n";
+ }
+ }
+
+ bool has_edits() const { return adds_ || removes_; }
+
+ private:
+ void FlushEdits() {
+ hunk_.splice(hunk_.end(), hunk_removes_);
+ hunk_.splice(hunk_.end(), hunk_adds_);
+ }
+
+ // Print a unified diff header for one hunk.
+ // The format is
+ // "@@ -<left_start>,<left_length> +<right_start>,<right_length> @@"
+ // where the left/right parts are ommitted if unnecessary.
+ void PrintHeader(std::ostream* ss) const {
+ *ss << "@@ ";
+ if (removes_) {
+ *ss << "-" << left_start_ << "," << (removes_ + common_);
+ }
+ if (removes_ && adds_) {
+ *ss << " ";
+ }
+ if (adds_) {
+ *ss << "+" << right_start_ << "," << (adds_ + common_);
+ }
+ *ss << " @@\n";
+ }
+
+ size_t left_start_, right_start_;
+ size_t adds_, removes_, common_;
+ std::list<std::pair<char, const char*> > hunk_, hunk_adds_, hunk_removes_;
+};
+
+} // namespace
+
+// Create a list of diff hunks in Unified diff format.
+// Each hunk has a header generated by PrintHeader above plus a body with
+// lines prefixed with ' ' for no change, '-' for deletion and '+' for
+// addition.
+// 'context' represents the desired unchanged prefix/suffix around the diff.
+// If two hunks are close enough that their contexts overlap, then they are
+// joined into one hunk.
+std::string CreateUnifiedDiff(const std::vector<std::string>& left,
+ const std::vector<std::string>& right,
+ size_t context) {
+ const std::vector<EditType> edits = CalculateOptimalEdits(left, right);
+
+ size_t l_i = 0, r_i = 0, edit_i = 0;
+ std::stringstream ss;
+ while (edit_i < edits.size()) {
+ // Find first edit.
+ while (edit_i < edits.size() && edits[edit_i] == kMatch) {
+ ++l_i;
+ ++r_i;
+ ++edit_i;
+ }
+
+ // Find the first line to include in the hunk.
+ const size_t prefix_context = std::min(l_i, context);
+ Hunk hunk(l_i - prefix_context + 1, r_i - prefix_context + 1);
+ for (size_t i = prefix_context; i > 0; --i) {
+ hunk.PushLine(' ', left[l_i - i].c_str());
+ }
+
+ // Iterate the edits until we found enough suffix for the hunk or the input
+ // is over.
+ size_t n_suffix = 0;
+ for (; edit_i < edits.size(); ++edit_i) {
+ if (n_suffix >= context) {
+ // Continue only if the next hunk is very close.
+ std::vector<EditType>::const_iterator it = edits.begin() + edit_i;
+ while (it != edits.end() && *it == kMatch) ++it;
+ if (it == edits.end() || (it - edits.begin()) - edit_i >= context) {
+ // There is no next edit or it is too far away.
+ break;
+ }
+ }
+
+ EditType edit = edits[edit_i];
+ // Reset count when a non match is found.
+ n_suffix = edit == kMatch ? n_suffix + 1 : 0;
+
+ if (edit == kMatch || edit == kRemove || edit == kReplace) {
+ hunk.PushLine(edit == kMatch ? ' ' : '-', left[l_i].c_str());
+ }
+ if (edit == kAdd || edit == kReplace) {
+ hunk.PushLine('+', right[r_i].c_str());
+ }
+
+ // Advance indices, depending on edit type.
+ l_i += edit != kAdd;
+ r_i += edit != kRemove;
+ }
+
+ if (!hunk.has_edits()) {
+ // We are done. We don't want this hunk.
+ break;
+ }
+
+ hunk.PrintTo(&ss);
+ }
+ return ss.str();
+}
+
+} // namespace edit_distance
+
+namespace {
+
+// The string representation of the values received in EqFailure() are already
+// escaped. Split them on escaped '\n' boundaries. Leave all other escaped
+// characters the same.
+std::vector<std::string> SplitEscapedString(const std::string& str) {
+ std::vector<std::string> lines;
+ size_t start = 0, end = str.size();
+ if (end > 2 && str[0] == '"' && str[end - 1] == '"') {
+ ++start;
+ --end;
+ }
+ bool escaped = false;
+ for (size_t i = start; i + 1 < end; ++i) {
+ if (escaped) {
+ escaped = false;
+ if (str[i] == 'n') {
+ lines.push_back(str.substr(start, i - start - 1));
+ start = i + 1;
+ }
+ } else {
+ escaped = str[i] == '\\';
+ }
+ }
+ lines.push_back(str.substr(start, end - start));
+ return lines;
+}
+
+} // namespace
+
// Constructs and returns the message for an equality assertion
// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
//
@@ -2473,31 +2749,42 @@ namespace internal {
// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
// where foo is 5 and bar is 6, we have:
//
-// expected_expression: "foo"
-// actual_expression: "bar"
-// expected_value: "5"
-// actual_value: "6"
+// lhs_expression: "foo"
+// rhs_expression: "bar"
+// lhs_value: "5"
+// rhs_value: "6"
//
// The ignoring_case parameter is true iff the assertion is a
-// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
+// *_STRCASEEQ*. When it's true, the string "Ignoring case" will
// be inserted into the message.
-AssertionResult EqFailure(const char* expected_expression,
- const char* actual_expression,
- const std::string& expected_value,
- const std::string& actual_value,
+AssertionResult EqFailure(const char* lhs_expression,
+ const char* rhs_expression,
+ const std::string& lhs_value,
+ const std::string& rhs_value,
bool ignoring_case) {
Message msg;
- msg << "Value of: " << actual_expression;
- if (actual_value != actual_expression) {
- msg << "\n Actual: " << actual_value;
+ msg << " Expected: " << lhs_expression;
+ if (lhs_value != lhs_expression) {
+ msg << "\n Which is: " << lhs_value;
+ }
+ msg << "\nTo be equal to: " << rhs_expression;
+ if (rhs_value != rhs_expression) {
+ msg << "\n Which is: " << rhs_value;
}
- msg << "\nExpected: " << expected_expression;
if (ignoring_case) {
- msg << " (ignoring case)";
+ msg << "\nIgnoring case";
}
- if (expected_value != expected_expression) {
- msg << "\nWhich is: " << expected_value;
+
+ if (!lhs_value.empty() && !rhs_value.empty()) {
+ const std::vector<std::string> lhs_lines =
+ SplitEscapedString(lhs_value);
+ const std::vector<std::string> rhs_lines =
+ SplitEscapedString(rhs_value);
+ if (lhs_lines.size() > 1 || rhs_lines.size() > 1) {
+ msg << "\nWith diff:\n"
+ << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines);
+ }
}
return AssertionFailure() << msg;
@@ -2595,18 +2882,18 @@ namespace internal {
// The helper function for {ASSERT|EXPECT}_EQ with int or enum
// arguments.
-AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual) {
- if (expected == actual) {
+AssertionResult CmpHelperEQ(const char* lhs_expression,
+ const char* rhs_expression,
+ BiggestInt lhs,
+ BiggestInt rhs) {
+ if (lhs == rhs) {
return AssertionSuccess();
}
- return EqFailure(expected_expression,
- actual_expression,
- FormatForComparisonFailureMessage(expected, actual),
- FormatForComparisonFailureMessage(actual, expected),
+ return EqFailure(lhs_expression,
+ rhs_expression,
+ FormatForComparisonFailureMessage(lhs, rhs),
+ FormatForComparisonFailureMessage(rhs, lhs),
false);
}
@@ -2645,34 +2932,34 @@ GTEST_IMPL_CMP_HELPER_(GT, > )
#undef GTEST_IMPL_CMP_HELPER_
// The helper function for {ASSERT|EXPECT}_STREQ.
-AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual) {
- if (String::CStringEquals(expected, actual)) {
+AssertionResult CmpHelperSTREQ(const char* lhs_expression,
+ const char* rhs_expression,
+ const char* lhs,
+ const char* rhs) {
+ if (String::CStringEquals(lhs, rhs)) {
return AssertionSuccess();
}
- return EqFailure(expected_expression,
- actual_expression,
- PrintToString(expected),
- PrintToString(actual),
+ return EqFailure(lhs_expression,
+ rhs_expression,
+ PrintToString(lhs),
+ PrintToString(rhs),
false);
}
// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
-AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual) {
- if (String::CaseInsensitiveCStringEquals(expected, actual)) {
+AssertionResult CmpHelperSTRCASEEQ(const char* lhs_expression,
+ const char* rhs_expression,
+ const char* lhs,
+ const char* rhs) {
+ if (String::CaseInsensitiveCStringEquals(lhs, rhs)) {
return AssertionSuccess();
}
- return EqFailure(expected_expression,
- actual_expression,
- PrintToString(expected),
- PrintToString(actual),
+ return EqFailure(lhs_expression,
+ rhs_expression,
+ PrintToString(lhs),
+ PrintToString(rhs),
true);
}
@@ -3027,18 +3314,18 @@ bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {
}
// Helper function for *_STREQ on wide strings.
-AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const wchar_t* expected,
- const wchar_t* actual) {
- if (String::WideCStringEquals(expected, actual)) {
+AssertionResult CmpHelperSTREQ(const char* lhs_expression,
+ const char* rhs_expression,
+ const wchar_t* lhs,
+ const wchar_t* rhs) {
+ if (String::WideCStringEquals(lhs, rhs)) {
return AssertionSuccess();
}
- return EqFailure(expected_expression,
- actual_expression,
- PrintToString(expected),
- PrintToString(actual),
+ return EqFailure(lhs_expression,
+ rhs_expression,
+ PrintToString(lhs),
+ PrintToString(rhs),
false);
}
@@ -3371,14 +3658,15 @@ int TestResult::test_property_count() const {
// Creates a Test object.
-// The c'tor saves the values of all Google Test flags.
+// The c'tor saves the states of all flags.
Test::Test()
- : gtest_flag_saver_(new internal::GTestFlagSaver) {
+ : gtest_flag_saver_(new GTEST_FLAG_SAVER_) {
}
-// The d'tor restores the values of all Google Test flags.
+// The d'tor restores the states of all flags. The actual work is
+// done by the d'tor of the gtest_flag_saver_ field, and thus not
+// visible here.
Test::~Test() {
- delete gtest_flag_saver_;
}
// Sets up the test fixture.
@@ -3447,8 +3735,8 @@ bool Test::HasSameFixtureClass() {
const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
if (first_is_TEST || this_is_TEST) {
- // The user mixed TEST and TEST_F in this test case - we'll tell
- // him/her how to fix it.
+ // Both TEST and TEST_F appear in same test case, which is incorrect.
+ // Tell the user how to fix this.
// Gets the name of the TEST and the name of the TEST_F. Note
// that first_is_TEST and this_is_TEST cannot both be true, as
@@ -3468,8 +3756,8 @@ bool Test::HasSameFixtureClass() {
<< "want to change the TEST to TEST_F or move it to another test\n"
<< "case.";
} else {
- // The user defined two fixture classes with the same name in
- // two namespaces - we'll tell him/her how to fix it.
+ // Two fixture classes with the same name appear in two different
+ // namespaces, which is not allowed. Tell the user how to fix this.
ADD_FAILURE()
<< "All tests in the same test case must use the same test fixture\n"
<< "class. However, in test case "
@@ -3662,12 +3950,14 @@ TestInfo::TestInfo(const std::string& a_test_case_name,
const std::string& a_name,
const char* a_type_param,
const char* a_value_param,
+ internal::CodeLocation a_code_location,
internal::TypeId fixture_class_id,
internal::TestFactoryBase* factory)
: test_case_name_(a_test_case_name),
name_(a_name),
type_param_(a_type_param ? new std::string(a_type_param) : NULL),
value_param_(a_value_param ? new std::string(a_value_param) : NULL),
+ location_(a_code_location),
fixture_class_id_(fixture_class_id),
should_run_(false),
is_disabled_(false),
@@ -3691,6 +3981,7 @@ namespace internal {
// this is not a typed or a type-parameterized test.
// value_param: text representation of the test's value parameter,
// or NULL if this is not a value-parameterized test.
+// code_location: code location where the test is defined
// fixture_class_id: ID of the test fixture class
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
@@ -3702,20 +3993,21 @@ TestInfo* MakeAndRegisterTestInfo(
const char* name,
const char* type_param,
const char* value_param,
+ CodeLocation code_location,
TypeId fixture_class_id,
SetUpTestCaseFunc set_up_tc,
TearDownTestCaseFunc tear_down_tc,
TestFactoryBase* factory) {
TestInfo* const test_info =
new TestInfo(test_case_name, name, type_param, value_param,
- fixture_class_id, factory);
+ code_location, fixture_class_id, factory);
GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
return test_info;
}
#if GTEST_HAS_PARAM_TEST
void ReportInvalidTestCaseType(const char* test_case_name,
- const char* file, int line) {
+ CodeLocation code_location) {
Message errors;
errors
<< "Attempted redefinition of test case " << test_case_name << ".\n"
@@ -3727,7 +4019,9 @@ void ReportInvalidTestCaseType(const char* test_case_name,
<< "probably rename one of the classes to put the tests into different\n"
<< "test cases.";
- fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
+ fprintf(stderr, "%s %s",
+ FormatFileLocation(code_location.file.c_str(),
+ code_location.line).c_str(),
errors.GetString().c_str());
}
#endif // GTEST_HAS_PARAM_TEST
@@ -3753,14 +4047,11 @@ class TestNameIs {
: name_(name) {}
// Returns true iff the test name of test_info matches name_.
- bool operator()(const TestInfo* test_info) const {
- // These 2 lines are to avoid ICPC warning #177 functions operator() never
+ bool operator()(const TestInfo * test_info) const {
+ // Next 2 lines are to avoid ICPC warning #177 functions operator() never
// used.
bool res = false;
res = &TestNameIs::operator();
- // The line below is to avoid ICPC warning #177: this class constructor
- // never used.
- TestNameIs t("");
return test_info && test_info->name() == name_;
}
@@ -4045,7 +4336,8 @@ enum GTestColor {
COLOR_YELLOW
};
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
+ !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
// Returns the character attribute for the given color.
WORD GetColorAttribute(GTestColor color) {
@@ -4090,6 +4382,10 @@ bool ShouldUseColor(bool stdout_is_tty) {
String::CStringEquals(term, "xterm-256color") ||
String::CStringEquals(term, "screen") ||
String::CStringEquals(term, "screen-256color") ||
+ String::CStringEquals(term, "tmux") ||
+ String::CStringEquals(term, "tmux-256color") ||
+ String::CStringEquals(term, "rxvt-unicode") ||
+ String::CStringEquals(term, "rxvt-unicode-256color") ||
String::CStringEquals(term, "linux") ||
String::CStringEquals(term, "cygwin");
return stdout_is_tty && term_supports_color;
@@ -4113,8 +4409,9 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
-#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || GTEST_OS_IOS
- const bool use_color = false;
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \
+ GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
+ const bool use_color = AlwaysFalse();
#else
static const bool in_color_mode =
ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
@@ -4128,7 +4425,8 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
return;
}
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
+ !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
// Gets the current text color.
@@ -4703,34 +5001,39 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
// Formats the given time in milliseconds as seconds.
std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {
::std::stringstream ss;
- ss << ms/1000.0;
+ ss << (static_cast<double>(ms) * 1e-3);
return ss.str();
}
-// Converts the given epoch time in milliseconds to a date string in the ISO
-// 8601 format, without the timezone information.
-std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {
- // Using non-reentrant version as localtime_r is not portable.
- time_t seconds = static_cast<time_t>(ms / 1000);
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4996) // Temporarily disables warning 4996
- // (function or variable may be unsafe).
- const struct tm* const time_struct = localtime(&seconds); // NOLINT
-# pragma warning(pop) // Restores the warning state again.
+static bool PortableLocaltime(time_t seconds, struct tm* out) {
+#if defined(_MSC_VER)
+ return localtime_s(out, &seconds) == 0;
+#elif defined(__MINGW32__) || defined(__MINGW64__)
+ // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
+ // Windows' localtime(), which has a thread-local tm buffer.
+ struct tm* tm_ptr = localtime(&seconds); // NOLINT
+ if (tm_ptr == NULL)
+ return false;
+ *out = *tm_ptr;
+ return true;
#else
- const struct tm* const time_struct = localtime(&seconds); // NOLINT
+ return localtime_r(&seconds, out) != NULL;
#endif
- if (time_struct == NULL)
- return ""; // Invalid ms value
+}
+// Converts the given epoch time in milliseconds to a date string in the ISO
+// 8601 format, without the timezone information.
+std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {
+ struct tm time_struct;
+ if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))
+ return "";
// YYYY-MM-DDThh:mm:ss
- return StreamableToString(time_struct->tm_year + 1900) + "-" +
- String::FormatIntWidth2(time_struct->tm_mon + 1) + "-" +
- String::FormatIntWidth2(time_struct->tm_mday) + "T" +
- String::FormatIntWidth2(time_struct->tm_hour) + ":" +
- String::FormatIntWidth2(time_struct->tm_min) + ":" +
- String::FormatIntWidth2(time_struct->tm_sec);
+ return StreamableToString(time_struct.tm_year + 1900) + "-" +
+ String::FormatIntWidth2(time_struct.tm_mon + 1) + "-" +
+ String::FormatIntWidth2(time_struct.tm_mday) + "T" +
+ String::FormatIntWidth2(time_struct.tm_hour) + ":" +
+ String::FormatIntWidth2(time_struct.tm_min) + ":" +
+ String::FormatIntWidth2(time_struct.tm_sec);
}
// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
@@ -4993,26 +5296,15 @@ ScopedTrace::~ScopedTrace()
// class OsStackTraceGetter
-// Returns the current OS stack trace as an std::string. Parameters:
-//
-// max_depth - the maximum number of stack frames to be included
-// in the trace.
-// skip_count - the number of top frames to be skipped; doesn't count
-// against max_depth.
-//
-string OsStackTraceGetter::CurrentStackTrace(int /* max_depth */,
- int /* skip_count */)
- GTEST_LOCK_EXCLUDED_(mutex_) {
- return "";
-}
+const char* const OsStackTraceGetterInterface::kElidedFramesMarker =
+ "... " GTEST_NAME_ " internal frames ...";
-void OsStackTraceGetter::UponLeavingGTest()
- GTEST_LOCK_EXCLUDED_(mutex_) {
+string OsStackTraceGetter::CurrentStackTrace(int /*max_depth*/,
+ int /*skip_count*/) {
+ return "";
}
-const char* const
-OsStackTraceGetter::kElidedFramesMarker =
- "... " GTEST_NAME_ " internal frames ...";
+void OsStackTraceGetter::UponLeavingGTest() {}
// A helper class that creates the premature-exit file in its
// constructor and deletes the file in its destructor.
@@ -5303,7 +5595,7 @@ void UnitTest::AddTestPartResult(
// with another testing framework) and specify the former on the
// command line for debugging.
if (GTEST_FLAG(break_on_failure)) {
-#if GTEST_OS_WINDOWS
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
// Using DebugBreak on Windows allows gtest to still break into a debugger
// when a failure happens and both the --gtest_break_on_failure and
// the --gtest_catch_exceptions flags are specified.
@@ -5381,7 +5673,7 @@ int UnitTest::Run() {
// process. In either case the user does not want to see pop-up dialogs
// about crashes - they are expected.
if (impl()->catch_exceptions() || in_death_test_child_process) {
-# if !GTEST_OS_WINDOWS_MOBILE
+# if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
// SetErrorMode doesn't exist on CE.
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |
SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
@@ -5484,17 +5776,10 @@ namespace internal {
UnitTestImpl::UnitTestImpl(UnitTest* parent)
: parent_(parent),
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4355) // Temporarily disables warning 4355
- // (using this in initializer).
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355 /* using this in initializer */)
default_global_test_part_result_reporter_(this),
default_per_thread_test_part_result_reporter_(this),
-# pragma warning(pop) // Restores the warning state again.
-#else
- default_global_test_part_result_reporter_(this),
- default_per_thread_test_part_result_reporter_(this),
-#endif // _MSC_VER
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
global_test_part_result_repoter_(
&default_global_test_part_result_reporter_),
per_thread_test_part_result_reporter_(
@@ -5605,6 +5890,11 @@ void UnitTestImpl::PostFlagParsingInit() {
if (!post_flag_parse_init_performed_) {
post_flag_parse_init_performed_ = true;
+#if defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
+ // Register to send notifications about key process state changes.
+ listeners()->Append(new GTEST_CUSTOM_TEST_EVENT_LISTENER_());
+#endif // defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
+
#if GTEST_HAS_DEATH_TEST
InitDeathTestSubprocessControlInfo();
SuppressTestEventsIfInSubprocess();
@@ -5738,6 +6028,11 @@ bool UnitTestImpl::RunAllTests() {
#if GTEST_HAS_DEATH_TEST
in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);
+# if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
+ if (in_subprocess_for_death_test) {
+ GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();
+ }
+# endif // defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
#endif // GTEST_HAS_DEATH_TEST
const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
@@ -6074,7 +6369,11 @@ void UnitTestImpl::set_os_stack_trace_getter(
// getter, and returns it.
OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
if (os_stack_trace_getter_ == NULL) {
+#ifdef GTEST_OS_STACK_TRACE_GETTER_
+ os_stack_trace_getter_ = new GTEST_OS_STACK_TRACE_GETTER_;
+#else
os_stack_trace_getter_ = new OsStackTraceGetter;
+#endif // GTEST_OS_STACK_TRACE_GETTER_
}
return os_stack_trace_getter_;
@@ -6373,6 +6672,58 @@ static const char kColorEncodedHelpMessage[] =
"(not one in your own code or tests), please report it to\n"
"@G<" GTEST_DEV_EMAIL_ ">@D.\n";
+bool ParseGoogleTestFlag(const char* const arg) {
+ return ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,
+ &GTEST_FLAG(also_run_disabled_tests)) ||
+ ParseBoolFlag(arg, kBreakOnFailureFlag,
+ &GTEST_FLAG(break_on_failure)) ||
+ ParseBoolFlag(arg, kCatchExceptionsFlag,
+ &GTEST_FLAG(catch_exceptions)) ||
+ ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
+ ParseStringFlag(arg, kDeathTestStyleFlag,
+ &GTEST_FLAG(death_test_style)) ||
+ ParseBoolFlag(arg, kDeathTestUseFork,
+ &GTEST_FLAG(death_test_use_fork)) ||
+ ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||
+ ParseStringFlag(arg, kInternalRunDeathTestFlag,
+ &GTEST_FLAG(internal_run_death_test)) ||
+ ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
+ ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
+ ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
+ ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
+ ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||
+ ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
+ ParseInt32Flag(arg, kStackTraceDepthFlag,
+ &GTEST_FLAG(stack_trace_depth)) ||
+ ParseStringFlag(arg, kStreamResultToFlag,
+ &GTEST_FLAG(stream_result_to)) ||
+ ParseBoolFlag(arg, kThrowOnFailureFlag,
+ &GTEST_FLAG(throw_on_failure));
+}
+
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+void LoadFlagsFromFile(const std::string& path) {
+ FILE* flagfile = posix::FOpen(path.c_str(), "r");
+ if (!flagfile) {
+ fprintf(stderr,
+ "Unable to open file \"%s\"\n",
+ GTEST_FLAG(flagfile).c_str());
+ fflush(stderr);
+ exit(EXIT_FAILURE);
+ }
+ std::string contents(ReadEntireFile(flagfile));
+ posix::FClose(flagfile);
+ std::vector<std::string> lines;
+ SplitString(contents, '\n', &lines);
+ for (size_t i = 0; i < lines.size(); ++i) {
+ if (lines[i].empty())
+ continue;
+ if (!ParseGoogleTestFlag(lines[i].c_str()))
+ g_help_flag = true;
+ }
+}
+#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
+
// Parses the command line for Google Test flags, without initializing
// other parts of Google Test. The type parameter CharType can be
// instantiated to either char or wchar_t.
@@ -6386,35 +6737,24 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
using internal::ParseInt32Flag;
using internal::ParseStringFlag;
- // Do we see a Google Test flag?
- if (ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,
- &GTEST_FLAG(also_run_disabled_tests)) ||
- ParseBoolFlag(arg, kBreakOnFailureFlag,
- &GTEST_FLAG(break_on_failure)) ||
- ParseBoolFlag(arg, kCatchExceptionsFlag,
- &GTEST_FLAG(catch_exceptions)) ||
- ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
- ParseStringFlag(arg, kDeathTestStyleFlag,
- &GTEST_FLAG(death_test_style)) ||
- ParseBoolFlag(arg, kDeathTestUseFork,
- &GTEST_FLAG(death_test_use_fork)) ||
- ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||
- ParseStringFlag(arg, kInternalRunDeathTestFlag,
- &GTEST_FLAG(internal_run_death_test)) ||
- ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
- ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
- ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
- ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
- ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||
- ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
- ParseInt32Flag(arg, kStackTraceDepthFlag,
- &GTEST_FLAG(stack_trace_depth)) ||
- ParseStringFlag(arg, kStreamResultToFlag,
- &GTEST_FLAG(stream_result_to)) ||
- ParseBoolFlag(arg, kThrowOnFailureFlag,
- &GTEST_FLAG(throw_on_failure))
- ) {
- // Yes. Shift the remainder of the argv list left by one. Note
+ bool remove_flag = false;
+ if (ParseGoogleTestFlag(arg)) {
+ remove_flag = true;
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+ } else if (ParseStringFlag(arg, kFlagfileFlag, &GTEST_FLAG(flagfile))) {
+ LoadFlagsFromFile(GTEST_FLAG(flagfile));
+ remove_flag = true;
+#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
+ } else if (arg_string == "--help" || arg_string == "-h" ||
+ arg_string == "-?" || arg_string == "/?" ||
+ HasGoogleTestFlagPrefix(arg)) {
+ // Both help flag and unrecognized Google Test flags (excluding
+ // internal ones) trigger help display.
+ g_help_flag = true;
+ }
+
+ if (remove_flag) {
+ // Shift the remainder of the argv list left by one. Note
// that argv has (*argc + 1) elements, the last one always being
// NULL. The following loop moves the trailing NULL element as
// well.
@@ -6428,12 +6768,6 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
// We also need to decrement the iterator as we just removed
// an element.
i--;
- } else if (arg_string == "--help" || arg_string == "-h" ||
- arg_string == "-?" || arg_string == "/?" ||
- HasGoogleTestFlagPrefix(arg)) {
- // Both help flag and unrecognized Google Test flags (excluding
- // internal ones) trigger help display.
- g_help_flag = true;
}
}
@@ -6460,24 +6794,16 @@ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {
// wchar_t.
template <typename CharType>
void InitGoogleTestImpl(int* argc, CharType** argv) {
- g_init_gtest_count++;
-
// We don't want to run the initialization code twice.
- if (g_init_gtest_count != 1) return;
+ if (GTestIsInitialized()) return;
if (*argc <= 0) return;
- internal::g_executable_path = internal::StreamableToString(argv[0]);
-
-#if GTEST_HAS_DEATH_TEST
-
g_argvs.clear();
for (int i = 0; i != *argc; i++) {
g_argvs.push_back(StreamableToString(argv[i]));
}
-#endif // GTEST_HAS_DEATH_TEST
-
ParseGoogleTestFlagsOnly(argc, argv);
GetUnitTestImpl()->PostFlagParsingInit();
}
@@ -6494,13 +6820,21 @@ void InitGoogleTestImpl(int* argc, CharType** argv) {
//
// Calling the function for the second time has no user-visible effect.
void InitGoogleTest(int* argc, char** argv) {
+#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+ GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
+#else // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
internal::InitGoogleTestImpl(argc, argv);
+#endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
}
// This overloaded version can be used in Windows programs compiled in
// UNICODE mode.
void InitGoogleTest(int* argc, wchar_t** argv) {
+#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+ GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
+#else // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
internal::InitGoogleTestImpl(argc, argv);
+#endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
}
} // namespace testing
@@ -6570,9 +6904,9 @@ void InitGoogleTest(int* argc, wchar_t** argv) {
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
+// included, or there will be a compiler error. This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
#define GTEST_IMPLEMENTATION_ 1
#undef GTEST_IMPLEMENTATION_
@@ -6621,7 +6955,9 @@ namespace internal {
// Valid only for fast death tests. Indicates the code is running in the
// child process of a fast style death test.
+# if !GTEST_OS_WINDOWS
static bool g_in_fast_death_test_child = false;
+# endif
// Returns a Boolean value indicating whether the caller is currently
// executing in the context of the death test child process. Tools such as
@@ -6670,6 +7006,14 @@ KilledBySignal::KilledBySignal(int signum) : signum_(signum) {
// KilledBySignal function-call operator.
bool KilledBySignal::operator()(int exit_status) const {
+# if defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
+ {
+ bool result;
+ if (GTEST_KILLED_BY_SIGNAL_OVERRIDE_(signum_, exit_status, &result)) {
+ return result;
+ }
+ }
+# endif // defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;
}
# endif // !GTEST_OS_WINDOWS
@@ -7376,6 +7720,11 @@ class ExecDeathTest : public ForkingDeathTest {
static ::std::vector<testing::internal::string>
GetArgvsForDeathTestChildProcess() {
::std::vector<testing::internal::string> args = GetInjectableArgvs();
+# if defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
+ ::std::vector<testing::internal::string> extra_args =
+ GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_();
+ args.insert(args.end(), extra_args.begin(), extra_args.end());
+# endif // defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
return args;
}
// The name of the file in which the death test is located.
@@ -7486,6 +7835,8 @@ void StackLowerThanAddress(const void* ptr, bool* result) {
*result = (&dummy < ptr);
}
+// Make sure AddressSanitizer does not tamper with the stack here.
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
bool StackGrowsDown() {
int dummy;
bool result;
@@ -7703,26 +8054,6 @@ bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
return true;
}
-// Splits a given string on a given delimiter, populating a given
-// vector with the fields. GTEST_HAS_DEATH_TEST implies that we have
-// ::std::string, so we can use it here.
-static void SplitString(const ::std::string& str, char delimiter,
- ::std::vector< ::std::string>* dest) {
- ::std::vector< ::std::string> parsed;
- ::std::string::size_type pos = 0;
- while (::testing::internal::AlwaysTrue()) {
- const ::std::string::size_type colon = str.find(delimiter, pos);
- if (colon == ::std::string::npos) {
- parsed.push_back(str.substr(pos));
- break;
- } else {
- parsed.push_back(str.substr(pos, colon - pos));
- pos = colon + 1;
- }
- }
- dest->swap(parsed);
-}
-
# if GTEST_OS_WINDOWS
// Recreates the pipe and event handles from the provided parameters,
// signals the event, and returns a file descriptor wrapped around the pipe
@@ -7911,7 +8242,6 @@ namespace internal {
// of them.
const char kPathSeparator = '\\';
const char kAlternatePathSeparator = '/';
-const char kPathSeparatorString[] = "\\";
const char kAlternatePathSeparatorString[] = "/";
# if GTEST_OS_WINDOWS_MOBILE
// Windows CE doesn't have a current directory. You should not use
@@ -7925,7 +8255,6 @@ const char kCurrentDirectoryString[] = ".\\";
# endif // GTEST_OS_WINDOWS_MOBILE
#else
const char kPathSeparator = '/';
-const char kPathSeparatorString[] = "/";
const char kCurrentDirectoryString[] = "./";
#endif // GTEST_OS_WINDOWS
@@ -7940,7 +8269,7 @@ static bool IsPathSeparator(char c) {
// Returns the current working directory, or "" if unsuccessful.
FilePath FilePath::GetCurrentDir() {
-#if GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
// Windows CE doesn't have a current directory, so we just return
// something reasonable.
return FilePath(kCurrentDirectoryString);
@@ -7949,7 +8278,14 @@ FilePath FilePath::GetCurrentDir() {
return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
#else
char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
- return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
+ char* result = getcwd(cwd, sizeof(cwd));
+# if GTEST_OS_NACL
+ // getcwd will likely fail in NaCl due to the sandbox, so return something
+ // reasonable. The user may have provided a shim implementation for getcwd,
+ // however, so fallback only when failure is detected.
+ return FilePath(result == NULL ? kCurrentDirectoryString : cwd);
+# endif // GTEST_OS_NACL
+ return FilePath(result == NULL ? "" : cwd);
#endif // GTEST_OS_WINDOWS_MOBILE
}
@@ -8257,15 +8593,16 @@ void FilePath::Normalize() {
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <fstream>
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h> // For TerminateProcess()
-#elif GTEST_OS_WINDOWS
+#if GTEST_OS_WINDOWS
+# include <windows.h>
# include <io.h>
# include <sys/stat.h>
+# include <map> // Used in ThreadLocal.
#else
# include <unistd.h>
-#endif // GTEST_OS_WINDOWS_MOBILE
+#endif // GTEST_OS_WINDOWS
#if GTEST_OS_MAC
# include <mach/mach_init.h>
@@ -8275,15 +8612,21 @@ void FilePath::Normalize() {
#if GTEST_OS_QNX
# include <devctl.h>
+# include <fcntl.h>
# include <sys/procfs.h>
#endif // GTEST_OS_QNX
+#if GTEST_OS_AIX
+# include <procinfo.h>
+# include <sys/types.h>
+#endif // GTEST_OS_AIX
+
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
+// included, or there will be a compiler error. This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
#define GTEST_IMPLEMENTATION_ 1
#undef GTEST_IMPLEMENTATION_
@@ -8299,10 +8642,31 @@ const int kStdOutFileno = STDOUT_FILENO;
const int kStdErrFileno = STDERR_FILENO;
#endif // _MSC_VER
-#if GTEST_OS_MAC
+#if GTEST_OS_LINUX
+
+namespace {
+template <typename T>
+T ReadProcFileField(const string& filename, int field) {
+ std::string dummy;
+ std::ifstream file(filename.c_str());
+ while (field-- > 0) {
+ file >> dummy;
+ }
+ T output = 0;
+ file >> output;
+ return output;
+}
+} // namespace
+
+// Returns the number of active threads, or 0 when there is an error.
+size_t GetThreadCount() {
+ const string filename =
+ (Message() << "/proc/" << getpid() << "/stat").GetString();
+ return ReadProcFileField<int>(filename, 19);
+}
+
+#elif GTEST_OS_MAC
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
size_t GetThreadCount() {
const task_t task = mach_task_self();
mach_msg_type_number_t thread_count;
@@ -8340,6 +8704,19 @@ size_t GetThreadCount() {
}
}
+#elif GTEST_OS_AIX
+
+size_t GetThreadCount() {
+ struct procentry64 entry;
+ pid_t pid = getpid();
+ int status = getprocs64(&entry, sizeof(entry), NULL, 0, &pid, 1);
+ if (status == 1) {
+ return entry.pi_thcount;
+ } else {
+ return 0;
+ }
+}
+
#else
size_t GetThreadCount() {
@@ -8348,7 +8725,390 @@ size_t GetThreadCount() {
return 0;
}
-#endif // GTEST_OS_MAC
+#endif // GTEST_OS_LINUX
+
+#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+
+void SleepMilliseconds(int n) {
+ ::Sleep(n);
+}
+
+AutoHandle::AutoHandle()
+ : handle_(INVALID_HANDLE_VALUE) {}
+
+AutoHandle::AutoHandle(Handle handle)
+ : handle_(handle) {}
+
+AutoHandle::~AutoHandle() {
+ Reset();
+}
+
+AutoHandle::Handle AutoHandle::Get() const {
+ return handle_;
+}
+
+void AutoHandle::Reset() {
+ Reset(INVALID_HANDLE_VALUE);
+}
+
+void AutoHandle::Reset(HANDLE handle) {
+ // Resetting with the same handle we already own is invalid.
+ if (handle_ != handle) {
+ if (IsCloseable()) {
+ ::CloseHandle(handle_);
+ }
+ handle_ = handle;
+ } else {
+ GTEST_CHECK_(!IsCloseable())
+ << "Resetting a valid handle to itself is likely a programmer error "
+ "and thus not allowed.";
+ }
+}
+
+bool AutoHandle::IsCloseable() const {
+ // Different Windows APIs may use either of these values to represent an
+ // invalid handle.
+ return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
+}
+
+Notification::Notification()
+ : event_(::CreateEvent(NULL, // Default security attributes.
+ TRUE, // Do not reset automatically.
+ FALSE, // Initially unset.
+ NULL)) { // Anonymous event.
+ GTEST_CHECK_(event_.Get() != NULL);
+}
+
+void Notification::Notify() {
+ GTEST_CHECK_(::SetEvent(event_.Get()) != FALSE);
+}
+
+void Notification::WaitForNotification() {
+ GTEST_CHECK_(
+ ::WaitForSingleObject(event_.Get(), INFINITE) == WAIT_OBJECT_0);
+}
+
+Mutex::Mutex()
+ : owner_thread_id_(0),
+ type_(kDynamic),
+ critical_section_init_phase_(0),
+ critical_section_(new CRITICAL_SECTION) {
+ ::InitializeCriticalSection(critical_section_);
+}
+
+Mutex::~Mutex() {
+ // Static mutexes are leaked intentionally. It is not thread-safe to try
+ // to clean them up.
+ // TODO(yukawa): Switch to Slim Reader/Writer (SRW) Locks, which requires
+ // nothing to clean it up but is available only on Vista and later.
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/aa904937.aspx
+ if (type_ == kDynamic) {
+ ::DeleteCriticalSection(critical_section_);
+ delete critical_section_;
+ critical_section_ = NULL;
+ }
+}
+
+void Mutex::Lock() {
+ ThreadSafeLazyInit();
+ ::EnterCriticalSection(critical_section_);
+ owner_thread_id_ = ::GetCurrentThreadId();
+}
+
+void Mutex::Unlock() {
+ ThreadSafeLazyInit();
+ // We don't protect writing to owner_thread_id_ here, as it's the
+ // caller's responsibility to ensure that the current thread holds the
+ // mutex when this is called.
+ owner_thread_id_ = 0;
+ ::LeaveCriticalSection(critical_section_);
+}
+
+// Does nothing if the current thread holds the mutex. Otherwise, crashes
+// with high probability.
+void Mutex::AssertHeld() {
+ ThreadSafeLazyInit();
+ GTEST_CHECK_(owner_thread_id_ == ::GetCurrentThreadId())
+ << "The current thread is not holding the mutex @" << this;
+}
+
+// Initializes owner_thread_id_ and critical_section_ in static mutexes.
+void Mutex::ThreadSafeLazyInit() {
+ // Dynamic mutexes are initialized in the constructor.
+ if (type_ == kStatic) {
+ switch (
+ ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {
+ case 0:
+ // If critical_section_init_phase_ was 0 before the exchange, we
+ // are the first to test it and need to perform the initialization.
+ owner_thread_id_ = 0;
+ critical_section_ = new CRITICAL_SECTION;
+ ::InitializeCriticalSection(critical_section_);
+ // Updates the critical_section_init_phase_ to 2 to signal
+ // initialization complete.
+ GTEST_CHECK_(::InterlockedCompareExchange(
+ &critical_section_init_phase_, 2L, 1L) ==
+ 1L);
+ break;
+ case 1:
+ // Somebody else is already initializing the mutex; spin until they
+ // are done.
+ while (::InterlockedCompareExchange(&critical_section_init_phase_,
+ 2L,
+ 2L) != 2L) {
+ // Possibly yields the rest of the thread's time slice to other
+ // threads.
+ ::Sleep(0);
+ }
+ break;
+
+ case 2:
+ break; // The mutex is already initialized and ready for use.
+
+ default:
+ GTEST_CHECK_(false)
+ << "Unexpected value of critical_section_init_phase_ "
+ << "while initializing a static mutex.";
+ }
+ }
+}
+
+namespace {
+
+class ThreadWithParamSupport : public ThreadWithParamBase {
+ public:
+ static HANDLE CreateThread(Runnable* runnable,
+ Notification* thread_can_start) {
+ ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
+ DWORD thread_id;
+ // TODO(yukawa): Consider to use _beginthreadex instead.
+ HANDLE thread_handle = ::CreateThread(
+ NULL, // Default security.
+ 0, // Default stack size.
+ &ThreadWithParamSupport::ThreadMain,
+ param, // Parameter to ThreadMainStatic
+ 0x0, // Default creation flags.
+ &thread_id); // Need a valid pointer for the call to work under Win98.
+ GTEST_CHECK_(thread_handle != NULL) << "CreateThread failed with error "
+ << ::GetLastError() << ".";
+ if (thread_handle == NULL) {
+ delete param;
+ }
+ return thread_handle;
+ }
+
+ private:
+ struct ThreadMainParam {
+ ThreadMainParam(Runnable* runnable, Notification* thread_can_start)
+ : runnable_(runnable),
+ thread_can_start_(thread_can_start) {
+ }
+ scoped_ptr<Runnable> runnable_;
+ // Does not own.
+ Notification* thread_can_start_;
+ };
+
+ static DWORD WINAPI ThreadMain(void* ptr) {
+ // Transfers ownership.
+ scoped_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));
+ if (param->thread_can_start_ != NULL)
+ param->thread_can_start_->WaitForNotification();
+ param->runnable_->Run();
+ return 0;
+ }
+
+ // Prohibit instantiation.
+ ThreadWithParamSupport();
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport);
+};
+
+} // namespace
+
+ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+ Notification* thread_can_start)
+ : thread_(ThreadWithParamSupport::CreateThread(runnable,
+ thread_can_start)) {
+}
+
+ThreadWithParamBase::~ThreadWithParamBase() {
+ Join();
+}
+
+void ThreadWithParamBase::Join() {
+ GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
+ << "Failed to join the thread with error " << ::GetLastError() << ".";
+}
+
+// Maps a thread to a set of ThreadIdToThreadLocals that have values
+// instantiated on that thread and notifies them when the thread exits. A
+// ThreadLocal instance is expected to persist until all threads it has
+// values on have terminated.
+class ThreadLocalRegistryImpl {
+ public:
+ // Registers thread_local_instance as having value on the current thread.
+ // Returns a value that can be used to identify the thread from other threads.
+ static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
+ const ThreadLocalBase* thread_local_instance) {
+ DWORD current_thread = ::GetCurrentThreadId();
+ MutexLock lock(&mutex_);
+ ThreadIdToThreadLocals* const thread_to_thread_locals =
+ GetThreadLocalsMapLocked();
+ ThreadIdToThreadLocals::iterator thread_local_pos =
+ thread_to_thread_locals->find(current_thread);
+ if (thread_local_pos == thread_to_thread_locals->end()) {
+ thread_local_pos = thread_to_thread_locals->insert(
+ std::make_pair(current_thread, ThreadLocalValues())).first;
+ StartWatcherThreadFor(current_thread);
+ }
+ ThreadLocalValues& thread_local_values = thread_local_pos->second;
+ ThreadLocalValues::iterator value_pos =
+ thread_local_values.find(thread_local_instance);
+ if (value_pos == thread_local_values.end()) {
+ value_pos =
+ thread_local_values
+ .insert(std::make_pair(
+ thread_local_instance,
+ linked_ptr<ThreadLocalValueHolderBase>(
+ thread_local_instance->NewValueForCurrentThread())))
+ .first;
+ }
+ return value_pos->second.get();
+ }
+
+ static void OnThreadLocalDestroyed(
+ const ThreadLocalBase* thread_local_instance) {
+ std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
+ // Clean up the ThreadLocalValues data structure while holding the lock, but
+ // defer the destruction of the ThreadLocalValueHolderBases.
+ {
+ MutexLock lock(&mutex_);
+ ThreadIdToThreadLocals* const thread_to_thread_locals =
+ GetThreadLocalsMapLocked();
+ for (ThreadIdToThreadLocals::iterator it =
+ thread_to_thread_locals->begin();
+ it != thread_to_thread_locals->end();
+ ++it) {
+ ThreadLocalValues& thread_local_values = it->second;
+ ThreadLocalValues::iterator value_pos =
+ thread_local_values.find(thread_local_instance);
+ if (value_pos != thread_local_values.end()) {
+ value_holders.push_back(value_pos->second);
+ thread_local_values.erase(value_pos);
+ // This 'if' can only be successful at most once, so theoretically we
+ // could break out of the loop here, but we don't bother doing so.
+ }
+ }
+ }
+ // Outside the lock, let the destructor for 'value_holders' deallocate the
+ // ThreadLocalValueHolderBases.
+ }
+
+ static void OnThreadExit(DWORD thread_id) {
+ GTEST_CHECK_(thread_id != 0) << ::GetLastError();
+ std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
+ // Clean up the ThreadIdToThreadLocals data structure while holding the
+ // lock, but defer the destruction of the ThreadLocalValueHolderBases.
+ {
+ MutexLock lock(&mutex_);
+ ThreadIdToThreadLocals* const thread_to_thread_locals =
+ GetThreadLocalsMapLocked();
+ ThreadIdToThreadLocals::iterator thread_local_pos =
+ thread_to_thread_locals->find(thread_id);
+ if (thread_local_pos != thread_to_thread_locals->end()) {
+ ThreadLocalValues& thread_local_values = thread_local_pos->second;
+ for (ThreadLocalValues::iterator value_pos =
+ thread_local_values.begin();
+ value_pos != thread_local_values.end();
+ ++value_pos) {
+ value_holders.push_back(value_pos->second);
+ }
+ thread_to_thread_locals->erase(thread_local_pos);
+ }
+ }
+ // Outside the lock, let the destructor for 'value_holders' deallocate the
+ // ThreadLocalValueHolderBases.
+ }
+
+ private:
+ // In a particular thread, maps a ThreadLocal object to its value.
+ typedef std::map<const ThreadLocalBase*,
+ linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues;
+ // Stores all ThreadIdToThreadLocals having values in a thread, indexed by
+ // thread's ID.
+ typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;
+
+ // Holds the thread id and thread handle that we pass from
+ // StartWatcherThreadFor to WatcherThreadFunc.
+ typedef std::pair<DWORD, HANDLE> ThreadIdAndHandle;
+
+ static void StartWatcherThreadFor(DWORD thread_id) {
+ // The returned handle will be kept in thread_map and closed by
+ // watcher_thread in WatcherThreadFunc.
+ HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
+ FALSE,
+ thread_id);
+ GTEST_CHECK_(thread != NULL);
+ // We need to to pass a valid thread ID pointer into CreateThread for it
+ // to work correctly under Win98.
+ DWORD watcher_thread_id;
+ HANDLE watcher_thread = ::CreateThread(
+ NULL, // Default security.
+ 0, // Default stack size
+ &ThreadLocalRegistryImpl::WatcherThreadFunc,
+ reinterpret_cast<LPVOID>(new ThreadIdAndHandle(thread_id, thread)),
+ CREATE_SUSPENDED,
+ &watcher_thread_id);
+ GTEST_CHECK_(watcher_thread != NULL);
+ // Give the watcher thread the same priority as ours to avoid being
+ // blocked by it.
+ ::SetThreadPriority(watcher_thread,
+ ::GetThreadPriority(::GetCurrentThread()));
+ ::ResumeThread(watcher_thread);
+ ::CloseHandle(watcher_thread);
+ }
+
+ // Monitors exit from a given thread and notifies those
+ // ThreadIdToThreadLocals about thread termination.
+ static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+ const ThreadIdAndHandle* tah =
+ reinterpret_cast<const ThreadIdAndHandle*>(param);
+ GTEST_CHECK_(
+ ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+ OnThreadExit(tah->first);
+ ::CloseHandle(tah->second);
+ delete tah;
+ return 0;
+ }
+
+ // Returns map of thread local instances.
+ static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
+ mutex_.AssertHeld();
+ static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
+ return map;
+ }
+
+ // Protects access to GetThreadLocalsMapLocked() and its return value.
+ static Mutex mutex_;
+ // Protects access to GetThreadMapLocked() and its return value.
+ static Mutex thread_map_mutex_;
+};
+
+Mutex ThreadLocalRegistryImpl::mutex_(Mutex::kStaticMutex);
+Mutex ThreadLocalRegistryImpl::thread_map_mutex_(Mutex::kStaticMutex);
+
+ThreadLocalValueHolderBase* ThreadLocalRegistry::GetValueOnCurrentThread(
+ const ThreadLocalBase* thread_local_instance) {
+ return ThreadLocalRegistryImpl::GetValueOnCurrentThread(
+ thread_local_instance);
+}
+
+void ThreadLocalRegistry::OnThreadLocalDestroyed(
+ const ThreadLocalBase* thread_local_instance) {
+ ThreadLocalRegistryImpl::OnThreadLocalDestroyed(thread_local_instance);
+}
+
+#endif // GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
#if GTEST_USES_POSIX_RE
@@ -8698,7 +9458,6 @@ GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
return file_name + ":" + StreamableToString(line);
}
-
GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
: severity_(severity) {
const char* const marker =
@@ -8719,10 +9478,7 @@ GTestLog::~GTestLog() {
}
// Disable Microsoft deprecation warnings for POSIX functions called from
// this class (creat, dup, dup2, and close)
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable: 4996)
-#endif // _MSC_VER
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
#if GTEST_HAS_STREAM_REDIRECTION
@@ -8798,12 +9554,6 @@ class CapturedStream {
}
private:
- // Reads the entire content of a file as an std::string.
- static std::string ReadEntireFile(FILE* file);
-
- // Returns the size (in bytes) of a file.
- static size_t GetFileSize(FILE* file);
-
const int fd_; // A stream to capture.
int uncaptured_fd_;
// Name of the temporary file holding the stderr output.
@@ -8812,38 +9562,7 @@ class CapturedStream {
GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
};
-// Returns the size (in bytes) of a file.
-size_t CapturedStream::GetFileSize(FILE* file) {
- fseek(file, 0, SEEK_END);
- return static_cast<size_t>(ftell(file));
-}
-
-// Reads the entire content of a file as a string.
-std::string CapturedStream::ReadEntireFile(FILE* file) {
- const size_t file_size = GetFileSize(file);
- char* const buffer = new char[file_size];
-
- size_t bytes_last_read = 0; // # of bytes read in the last fread()
- size_t bytes_read = 0; // # of bytes read so far
-
- fseek(file, 0, SEEK_SET);
-
- // Keeps reading the file until we cannot read further or the
- // pre-determined file size is reached.
- do {
- bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
- bytes_read += bytes_last_read;
- } while (bytes_last_read > 0 && bytes_read < file_size);
-
- const std::string content(buffer, bytes_read);
- delete[] buffer;
-
- return content;
-}
-
-# ifdef _MSC_VER
-# pragma warning(pop)
-# endif // _MSC_VER
+GTEST_DISABLE_MSC_WARNINGS_POP_()
static CapturedStream* g_captured_stderr = NULL;
static CapturedStream* g_captured_stdout = NULL;
@@ -8889,10 +9608,52 @@ std::string GetCapturedStderr() {
#endif // GTEST_HAS_STREAM_REDIRECTION
-#if GTEST_HAS_DEATH_TEST
+std::string TempDir() {
+#if GTEST_OS_WINDOWS_MOBILE
+ return "\\temp\\";
+#elif GTEST_OS_WINDOWS
+ const char* temp_dir = posix::GetEnv("TEMP");
+ if (temp_dir == NULL || temp_dir[0] == '\0')
+ return "\\temp\\";
+ else if (temp_dir[strlen(temp_dir) - 1] == '\\')
+ return temp_dir;
+ else
+ return std::string(temp_dir) + "\\";
+#elif GTEST_OS_LINUX_ANDROID
+ return "/sdcard/";
+#else
+ return "/tmp/";
+#endif // GTEST_OS_WINDOWS_MOBILE
+}
-// A copy of all command line arguments. Set by InitGoogleTest().
-::std::vector<testing::internal::string> g_argvs;
+size_t GetFileSize(FILE* file) {
+ fseek(file, 0, SEEK_END);
+ return static_cast<size_t>(ftell(file));
+}
+
+std::string ReadEntireFile(FILE* file) {
+ const size_t file_size = GetFileSize(file);
+ char* const buffer = new char[file_size];
+
+ size_t bytes_last_read = 0; // # of bytes read in the last fread()
+ size_t bytes_read = 0; // # of bytes read so far
+
+ fseek(file, 0, SEEK_SET);
+
+ // Keeps reading the file until we cannot read further or the
+ // pre-determined file size is reached.
+ do {
+ bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
+ bytes_read += bytes_last_read;
+ } while (bytes_last_read > 0 && bytes_read < file_size);
+
+ const std::string content(buffer, bytes_read);
+ delete[] buffer;
+
+ return content;
+}
+
+#if GTEST_HAS_DEATH_TEST
static const ::std::vector<testing::internal::string>* g_injected_test_argvs =
NULL; // Owned.
@@ -8907,7 +9668,7 @@ const ::std::vector<testing::internal::string>& GetInjectableArgvs() {
if (g_injected_test_argvs != NULL) {
return *g_injected_test_argvs;
}
- return g_argvs;
+ return GetArgvs();
}
#endif // GTEST_HAS_DEATH_TEST
@@ -8981,6 +9742,9 @@ bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
//
// The value is considered true iff it's not "0".
bool BoolFromGTestEnv(const char* flag, bool default_value) {
+#if defined(GTEST_GET_BOOL_FROM_ENV_)
+ return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
+#endif // defined(GTEST_GET_BOOL_FROM_ENV_)
const std::string env_var = FlagToEnvVar(flag);
const char* const string_value = posix::GetEnv(env_var.c_str());
return string_value == NULL ?
@@ -8991,6 +9755,9 @@ bool BoolFromGTestEnv(const char* flag, bool default_value) {
// variable corresponding to the given flag; if it isn't set or
// doesn't represent a valid 32-bit integer, returns default_value.
Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
+#if defined(GTEST_GET_INT32_FROM_ENV_)
+ return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
+#endif // defined(GTEST_GET_INT32_FROM_ENV_)
const std::string env_var = FlagToEnvVar(flag);
const char* const string_value = posix::GetEnv(env_var.c_str());
if (string_value == NULL) {
@@ -9012,10 +9779,33 @@ Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
// Reads and returns the string environment variable corresponding to
// the given flag; if it's not set, returns default_value.
-const char* StringFromGTestEnv(const char* flag, const char* default_value) {
+std::string StringFromGTestEnv(const char* flag, const char* default_value) {
+#if defined(GTEST_GET_STRING_FROM_ENV_)
+ return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
+#endif // defined(GTEST_GET_STRING_FROM_ENV_)
const std::string env_var = FlagToEnvVar(flag);
- const char* const value = posix::GetEnv(env_var.c_str());
- return value == NULL ? default_value : value;
+ const char* value = posix::GetEnv(env_var.c_str());
+ if (value != NULL) {
+ return value;
+ }
+
+ // As a special case for the 'output' flag, if GTEST_OUTPUT is not
+ // set, we look for XML_OUTPUT_FILE, which is set by the Bazel build
+ // system. The value of XML_OUTPUT_FILE is a filename without the
+ // "xml:" prefix of GTEST_OUTPUT.
+ //
+ // The net priority order after flag processing is thus:
+ // --gtest_output command line flag
+ // GTEST_OUTPUT environment variable
+ // XML_OUTPUT_FILE environment variable
+ // 'default_value'
+ if (strcmp(flag, "output") == 0) {
+ value = posix::GetEnv("XML_OUTPUT_FILE");
+ if (value != NULL) {
+ return std::string("xml:") + value;
+ }
+ }
+ return default_value;
}
} // namespace internal
@@ -9066,6 +9856,7 @@ const char* StringFromGTestEnv(const char* flag, const char* default_value) {
#include <ctype.h>
#include <stdio.h>
+#include <cwchar>
#include <ostream> // NOLINT
#include <string>
@@ -9076,6 +9867,9 @@ namespace {
using ::std::ostream;
// Prints a segment of bytes in the given object.
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,
size_t count, ostream* os) {
char text[5] = "";
@@ -9272,6 +10066,9 @@ void PrintTo(wchar_t wc, ostream* os) {
// The array starts at begin, the length is len, it may include '\0' characters
// and may not be NUL-terminated.
template <typename CharType>
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
static void PrintCharsAsStringTo(
const CharType* begin, size_t len, ostream* os) {
const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\"";
@@ -9293,6 +10090,9 @@ static void PrintCharsAsStringTo(
// Prints a (const) char/wchar_t array of 'len' elements, starting at address
// 'begin'. CharType must be either char or wchar_t.
template <typename CharType>
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
static void UniversalPrintCharArray(
const CharType* begin, size_t len, ostream* os) {
// The code
@@ -9349,7 +10149,7 @@ void PrintTo(const wchar_t* s, ostream* os) {
*os << "NULL";
} else {
*os << ImplicitCast_<const void*>(s) << " pointing to ";
- PrintCharsAsStringTo(s, wcslen(s), os);
+ PrintCharsAsStringTo(s, std::wcslen(s), os);
}
}
#endif // wchar_t is native
@@ -9417,9 +10217,9 @@ void PrintWideStringTo(const ::std::wstring& s, ostream* os) {
// Indicates that this translation unit is part of Google Test's
// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
+// included, or there will be a compiler error. This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
#define GTEST_IMPLEMENTATION_ 1
#undef GTEST_IMPLEMENTATION_
@@ -9534,33 +10334,41 @@ static const char* SkipSpaces(const char* str) {
return str;
}
+static std::vector<std::string> SplitIntoTestNames(const char* src) {
+ std::vector<std::string> name_vec;
+ src = SkipSpaces(src);
+ for (; src != NULL; src = SkipComma(src)) {
+ name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src)));
+ }
+ return name_vec;
+}
+
// Verifies that registered_tests match the test names in
-// defined_test_names_; returns registered_tests if successful, or
+// registered_tests_; returns registered_tests if successful, or
// aborts the program otherwise.
const char* TypedTestCasePState::VerifyRegisteredTestNames(
const char* file, int line, const char* registered_tests) {
- typedef ::std::set<const char*>::const_iterator DefinedTestIter;
+ typedef RegisteredTestsMap::const_iterator RegisteredTestIter;
registered_ = true;
- // Skip initial whitespace in registered_tests since some
- // preprocessors prefix stringizied literals with whitespace.
- registered_tests = SkipSpaces(registered_tests);
+ std::vector<std::string> name_vec = SplitIntoTestNames(registered_tests);
Message errors;
- ::std::set<std::string> tests;
- for (const char* names = registered_tests; names != NULL;
- names = SkipComma(names)) {
- const std::string name = GetPrefixUntilComma(names);
+
+ std::set<std::string> tests;
+ for (std::vector<std::string>::const_iterator name_it = name_vec.begin();
+ name_it != name_vec.end(); ++name_it) {
+ const std::string& name = *name_it;
if (tests.count(name) != 0) {
errors << "Test " << name << " is listed more than once.\n";
continue;
}
bool found = false;
- for (DefinedTestIter it = defined_test_names_.begin();
- it != defined_test_names_.end();
+ for (RegisteredTestIter it = registered_tests_.begin();
+ it != registered_tests_.end();
++it) {
- if (name == *it) {
+ if (name == it->first) {
found = true;
break;
}
@@ -9574,11 +10382,11 @@ const char* TypedTestCasePState::VerifyRegisteredTestNames(
}
}
- for (DefinedTestIter it = defined_test_names_.begin();
- it != defined_test_names_.end();
+ for (RegisteredTestIter it = registered_tests_.begin();
+ it != registered_tests_.end();
++it) {
- if (tests.count(*it) == 0) {
- errors << "You forgot to list test " << *it << ".\n";
+ if (tests.count(it->first) == 0) {
+ errors << "You forgot to list test " << it->first << ".\n";
}
}
diff --git a/ext/gtest/gtest.h b/ext/gtest/gtest.h
index a023379..e0039f7 100644
--- a/ext/gtest/gtest.h
+++ b/ext/gtest/gtest.h
@@ -126,8 +126,11 @@
// Authors: wan@google.com (Zhanyong Wan)
//
// Low-level types and utilities for porting Google Test to various
-// platforms. They are subject to change without notice. DO NOT USE
-// THEM IN USER CODE.
+// platforms. All macros ending with _ and symbols defined in an
+// internal namespace are subject to change without notice. Code
+// outside Google Test MUST NOT USE THEM DIRECTLY. Macros that don't
+// end with _ are part of Google Test's public API and can be used by
+// code outside Google Test.
//
// This file is fundamental to Google Test. All other Google Test source
// files are expected to #include this. Therefore, it cannot #include
@@ -136,9 +139,30 @@
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
-// The user can define the following macros in the build script to
-// control Google Test's behavior. If the user doesn't define a macro
-// in this list, Google Test will define it.
+// Environment-describing macros
+// -----------------------------
+//
+// Google Test can be used in many different environments. Macros in
+// this section tell Google Test what kind of environment it is being
+// used in, such that Google Test can provide environment-specific
+// features and implementations.
+//
+// Google Test tries to automatically detect the properties of its
+// environment, so users usually don't need to worry about these
+// macros. However, the automatic detection is not perfect.
+// Sometimes it's necessary for a user to define some of the following
+// macros in the build script to override Google Test's decisions.
+//
+// If the user doesn't define a macro in the list, Google Test will
+// provide a default definition. After this header is #included, all
+// macros in this list will be defined to either 1 or 0.
+//
+// Notes to maintainers:
+// - Each macro here is a user-tweakable knob; do not grow the list
+// lightly.
+// - Use #if to key off these macros. Don't use #ifdef or "#if
+// defined(...)", which will not work as these macros are ALWAYS
+// defined.
//
// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
// is/isn't available.
@@ -182,18 +206,23 @@
// - Define to 1 when compiling Google Test itself
// as a shared library.
-// This header defines the following utilities:
+// Platform-indicating macros
+// --------------------------
+//
+// Macros indicating the platform on which Google Test is being used
+// (a macro is defined to 1 if compiled on the given platform;
+// otherwise UNDEFINED -- it's never defined to 0.). Google Test
+// defines these macros automatically. Code outside Google Test MUST
+// NOT define them.
//
-// Macros indicating the current platform (defined to 1 if compiled on
-// the given platform; otherwise undefined):
// GTEST_OS_AIX - IBM AIX
// GTEST_OS_CYGWIN - Cygwin
+// GTEST_OS_FREEBSD - FreeBSD
// GTEST_OS_HPUX - HP-UX
// GTEST_OS_LINUX - Linux
// GTEST_OS_LINUX_ANDROID - Google Android
// GTEST_OS_MAC - Mac OS X
// GTEST_OS_IOS - iOS
-// GTEST_OS_IOS_SIMULATOR - iOS simulator
// GTEST_OS_NACL - Google Native Client (NaCl)
// GTEST_OS_OPENBSD - OpenBSD
// GTEST_OS_QNX - QNX
@@ -203,6 +232,8 @@
// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
// GTEST_OS_WINDOWS_MINGW - MinGW
// GTEST_OS_WINDOWS_MOBILE - Windows Mobile
+// GTEST_OS_WINDOWS_PHONE - Windows Phone
+// GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
// GTEST_OS_ZOS - z/OS
//
// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
@@ -212,22 +243,50 @@
// googletestframework@googlegroups.com (patches for fixing them are
// even more welcome!).
//
-// Note that it is possible that none of the GTEST_OS_* macros are defined.
+// It is possible that none of the GTEST_OS_* macros are defined.
+
+// Feature-indicating macros
+// -------------------------
+//
+// Macros indicating which Google Test features are available (a macro
+// is defined to 1 if the corresponding feature is supported;
+// otherwise UNDEFINED -- it's never defined to 0.). Google Test
+// defines these macros automatically. Code outside Google Test MUST
+// NOT define them.
+//
+// These macros are public so that portable tests can be written.
+// Such tests typically surround code using a feature with an #if
+// which controls that code. For example:
+//
+// #if GTEST_HAS_DEATH_TEST
+// EXPECT_DEATH(DoSomethingDeadly());
+// #endif
//
-// Macros indicating available Google Test features (defined to 1 if
-// the corresponding feature is supported; otherwise undefined):
// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized
// tests)
// GTEST_HAS_DEATH_TEST - death tests
// GTEST_HAS_PARAM_TEST - value-parameterized tests
// GTEST_HAS_TYPED_TEST - typed tests
// GTEST_HAS_TYPED_TEST_P - type-parameterized tests
+// GTEST_IS_THREADSAFE - Google Test is thread-safe.
// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
// GTEST_HAS_POSIX_RE (see above) which users can
// define themselves.
// GTEST_USES_SIMPLE_RE - our own simple regex is used;
// the above two are mutually exclusive.
// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
+
+// Misc public macros
+// ------------------
+//
+// GTEST_FLAG(flag_name) - references the variable corresponding to
+// the given Google Test flag.
+
+// Internal utilities
+// ------------------
+//
+// The following macros and utilities are for Google Test's INTERNAL
+// use only. Code outside Google Test MUST NOT USE THEM DIRECTLY.
//
// Macros for basic C++ coding:
// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
@@ -236,13 +295,18 @@
// GTEST_DISALLOW_ASSIGN_ - disables operator=.
// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
+// GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
+// suppressed (constant conditional).
+// GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127
+// is suppressed.
+//
+// C++11 feature wrappers:
+//
+// testing::internal::move - portability wrapper for std::move.
//
// Synchronization:
// Mutex, MutexLock, ThreadLocal, GetThreadCount()
-// - synchronization primitives.
-// GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
-// synchronization primitives have real implementations
-// and Google Test is thread-safe; or 0 otherwise.
+// - synchronization primitives.
//
// Template meta programming:
// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only.
@@ -278,7 +342,6 @@
// BiggestInt - the biggest signed integer type.
//
// Command-line utilities:
-// GTEST_FLAG() - references a flag.
// GTEST_DECLARE_*() - declares a flag.
// GTEST_DEFINE_*() - defines a flag.
// GetInjectableArgvs() - returns the command line as a vector of strings.
@@ -304,23 +367,49 @@
# include <TargetConditionals.h>
#endif
+#include <algorithm> // NOLINT
#include <iostream> // NOLINT
#include <sstream> // NOLINT
#include <string> // NOLINT
+#include <utility>
+#include <vector> // NOLINT
-#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
-#define GTEST_FLAG_PREFIX_ "gtest_"
-#define GTEST_FLAG_PREFIX_DASH_ "gtest-"
-#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
-#define GTEST_NAME_ "Google Test"
-#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the GTEST_OS_* macro.
+// It is separate from gtest-port.h so that custom/gtest-port.h can include it.
-// Determines the version of gcc that is used to compile this.
-#ifdef __GNUC__
-// 40302 means version 4.3.2.
-# define GTEST_GCC_VER_ \
- (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
-#endif // __GNUC__
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
// Determines the platform on which Google Test is compiled.
#ifdef __CYGWIN__
@@ -333,6 +422,19 @@
# define GTEST_OS_WINDOWS_MOBILE 1
# elif defined(__MINGW__) || defined(__MINGW32__)
# define GTEST_OS_WINDOWS_MINGW 1
+# elif defined(WINAPI_FAMILY)
+# include <winapifamily.h>
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+# define GTEST_OS_WINDOWS_DESKTOP 1
+# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+# define GTEST_OS_WINDOWS_PHONE 1
+# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+# define GTEST_OS_WINDOWS_RT 1
+# else
+ // WINAPI_FAMILY defined but no known partition matched.
+ // Default to desktop.
+# define GTEST_OS_WINDOWS_DESKTOP 1
+# endif
# else
# define GTEST_OS_WINDOWS_DESKTOP 1
# endif // _WIN32_WCE
@@ -340,10 +442,9 @@
# define GTEST_OS_MAC 1
# if TARGET_OS_IPHONE
# define GTEST_OS_IOS 1
-# if TARGET_IPHONE_SIMULATOR
-# define GTEST_OS_IOS_SIMULATOR 1
-# endif
# endif
+#elif defined __FreeBSD__
+# define GTEST_OS_FREEBSD 1
#elif defined __linux__
# define GTEST_OS_LINUX 1
# if defined __ANDROID__
@@ -365,6 +466,114 @@
# define GTEST_OS_QNX 1
#endif // __CYGWIN__
+#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+// Flag related macros:
+// GTEST_FLAG(flag_name)
+// GTEST_USE_OWN_FLAGFILE_FLAG_ - Define to 0 when the system provides its
+// own flagfile flag parsing.
+// GTEST_DECLARE_bool_(name)
+// GTEST_DECLARE_int32_(name)
+// GTEST_DECLARE_string_(name)
+// GTEST_DEFINE_bool_(name, default_val, doc)
+// GTEST_DEFINE_int32_(name, default_val, doc)
+// GTEST_DEFINE_string_(name, default_val, doc)
+//
+// Test filtering:
+// GTEST_TEST_FILTER_ENV_VAR_ - The name of an environment variable that
+// will be used if --GTEST_FLAG(test_filter)
+// is not provided.
+//
+// Logging:
+// GTEST_LOG_(severity)
+// GTEST_CHECK_(condition)
+// Functions LogToStderr() and FlushInfoLog() have to be provided too.
+//
+// Threading:
+// GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided.
+// GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are
+// already provided.
+// Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and
+// GTEST_DEFINE_STATIC_MUTEX_(mutex)
+//
+// GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
+// GTEST_LOCK_EXCLUDED_(locks)
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+
+#endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+
+#if !defined(GTEST_DEV_EMAIL_)
+# define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
+# define GTEST_FLAG_PREFIX_ "gtest_"
+# define GTEST_FLAG_PREFIX_DASH_ "gtest-"
+# define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
+# define GTEST_NAME_ "Google Test"
+# define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
+#endif // !defined(GTEST_DEV_EMAIL_)
+
+#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
+# define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
+#endif // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
+
+// Determines the version of gcc that is used to compile this.
+#ifdef __GNUC__
+// 40302 means version 4.3.2.
+# define GTEST_GCC_VER_ \
+ (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
+#endif // __GNUC__
+
+// Macros for disabling Microsoft Visual C++ warnings.
+//
+// GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
+// /* code that triggers warnings C4800 and C4385 */
+// GTEST_DISABLE_MSC_WARNINGS_POP_()
+#if _MSC_VER >= 1500
+# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable: warnings))
+# define GTEST_DISABLE_MSC_WARNINGS_POP_() \
+ __pragma(warning(pop))
+#else
+// Older versions of MSVC don't have __pragma.
+# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
+# define GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif
+
#ifndef GTEST_LANG_CXX11
// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a
@@ -378,19 +587,89 @@
# endif
#endif
+// Distinct from C++11 language support, some environments don't provide
+// proper C++11 library support. Notably, it's possible to build in
+// C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
+// with no C++11 support.
+//
+// libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
+// 20110325, but maintenance releases in the 4.4 and 4.5 series followed
+// this date, so check for those versions by their date stamps.
+// https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
+#if GTEST_LANG_CXX11 && \
+ (!defined(__GLIBCXX__) || ( \
+ __GLIBCXX__ >= 20110325ul && /* GCC >= 4.6.0 */ \
+ /* Blacklist of patch releases of older branches: */ \
+ __GLIBCXX__ != 20110416ul && /* GCC 4.4.6 */ \
+ __GLIBCXX__ != 20120313ul && /* GCC 4.4.7 */ \
+ __GLIBCXX__ != 20110428ul && /* GCC 4.5.3 */ \
+ __GLIBCXX__ != 20120702ul)) /* GCC 4.5.4 */
+# define GTEST_STDLIB_CXX11 1
+#endif
+
+// Only use C++11 library features if the library provides them.
+#if GTEST_STDLIB_CXX11
+# define GTEST_HAS_STD_BEGIN_AND_END_ 1
+# define GTEST_HAS_STD_FORWARD_LIST_ 1
+# define GTEST_HAS_STD_FUNCTION_ 1
+# define GTEST_HAS_STD_INITIALIZER_LIST_ 1
+# define GTEST_HAS_STD_MOVE_ 1
+# define GTEST_HAS_STD_SHARED_PTR_ 1
+# define GTEST_HAS_STD_TYPE_TRAITS_ 1
+# define GTEST_HAS_STD_UNIQUE_PTR_ 1
+#endif
+
+// C++11 specifies that <tuple> provides std::tuple.
+// Some platforms still might not have it, however.
+#if GTEST_LANG_CXX11
+# define GTEST_HAS_STD_TUPLE_ 1
+# if defined(__clang__)
+// Inspired by http://clang.llvm.org/docs/LanguageExtensions.html#__has_include
+# if defined(__has_include) && !__has_include(<tuple>)
+# undef GTEST_HAS_STD_TUPLE_
+# endif
+# elif defined(_MSC_VER)
+// Inspired by boost/config/stdlib/dinkumware.hpp
+# if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
+# undef GTEST_HAS_STD_TUPLE_
+# endif
+# elif defined(__GLIBCXX__)
+// Inspired by boost/config/stdlib/libstdcpp3.hpp,
+// http://gcc.gnu.org/gcc-4.2/changes.html and
+// http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
+# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+# undef GTEST_HAS_STD_TUPLE_
+# endif
+# endif
+#endif
+
// Brings in definitions for functions used in the testing::internal::posix
// namespace (read, write, close, chdir, isatty, stat). We do not currently
// use them on Windows Mobile.
-#if !GTEST_OS_WINDOWS
+#if GTEST_OS_WINDOWS
+# if !GTEST_OS_WINDOWS_MOBILE
+# include <direct.h>
+# include <io.h>
+# endif
+
+# if GTEST_OS_WINDOWS_MINGW
+ // MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
+ // separate (equivalent) structs, instead of using typedef
+ typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
+# else
+ // In order to avoid having to include <windows.h>, use forward declaration
+ // assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
+ // This assumption is verified by
+ // WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
+ struct _RTL_CRITICAL_SECTION;
+# endif
+#else
// This assumes that non-Windows OSes provide unistd.h. For OSes where this
// is not the case, we need to include headers that provide the functions
// mentioned above.
# include <unistd.h>
# include <strings.h>
-#elif !GTEST_OS_WINDOWS_MOBILE
-# include <direct.h>
-# include <io.h>
-#endif
+#endif // GTEST_OS_WINDOWS
#if GTEST_OS_LINUX_ANDROID
// Used to define __ANDROID_API__ matching the target NDK API level.
@@ -407,7 +686,10 @@
# endif
#endif
-#if GTEST_HAS_POSIX_RE
+#if GTEST_USES_PCRE
+// The appropriate headers have already been included.
+
+#elif GTEST_HAS_POSIX_RE
// On some platforms, <regex.h> needs someone to define size_t, and
// won't compile otherwise. We can #include it here as we already
@@ -429,7 +711,7 @@
// simple regex implementation instead.
# define GTEST_USES_SIMPLE_RE 1
-#endif // GTEST_HAS_POSIX_RE
+#endif // GTEST_USES_PCRE
#ifndef GTEST_HAS_EXCEPTIONS
// The user didn't tell us whether exceptions are enabled, so we need
@@ -442,6 +724,15 @@
# define _HAS_EXCEPTIONS 1
# endif // _HAS_EXCEPTIONS
# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
+# elif defined(__clang__)
+// clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
+// but iff cleanups are enabled after that. In Obj-C++ files, there can be
+// cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
+// are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
+// exceptions starting at clang r206352, but which checked for cleanups prior to
+// that. To reliably check for C++ exception availability with clang, check for
+// __EXCEPTIONS && __has_feature(cxx_exceptions).
+# define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
# elif defined(__GNUC__) && __EXCEPTIONS
// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
# define GTEST_HAS_EXCEPTIONS 1
@@ -567,13 +858,13 @@
// Determines whether Google Test can use the pthreads library.
#ifndef GTEST_HAS_PTHREAD
-// The user didn't tell us explicitly, so we assume pthreads support is
-// available on Linux and Mac.
+// The user didn't tell us explicitly, so we make reasonable assumptions about
+// which platforms have pthreads support.
//
// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
// to your compiler flags.
# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
- || GTEST_OS_QNX)
+ || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NACL)
#endif // GTEST_HAS_PTHREAD
#if GTEST_HAS_PTHREAD
@@ -585,6 +876,15 @@
# include <time.h> // NOLINT
#endif
+// Determines if hash_map/hash_set are available.
+// Only used for testing against those containers.
+#if !defined(GTEST_HAS_HASH_MAP_)
+# if _MSC_VER
+# define GTEST_HAS_HASH_MAP_ 1 // Indicates that hash_map is available.
+# define GTEST_HAS_HASH_SET_ 1 // Indicates that hash_set is available.
+# endif // _MSC_VER
+#endif // !defined(GTEST_HAS_HASH_MAP_)
+
// Determines whether Google Test can use tr1/tuple. You can define
// this macro to 0 to prevent Google Test from using tuple (any
// feature depending on tuple with be disabled in this mode).
@@ -635,8 +935,18 @@
// To avoid conditional compilation everywhere, we make it
// gtest-port.h's responsibility to #include the header implementing
-// tr1/tuple.
+// tuple.
+#if GTEST_HAS_STD_TUPLE_
+# include <tuple> // IWYU pragma: export
+# define GTEST_TUPLE_NAMESPACE_ ::std
+#endif // GTEST_HAS_STD_TUPLE_
+
+// We include tr1::tuple even if std::tuple is available to define printers for
+// them.
#if GTEST_HAS_TR1_TUPLE
+# ifndef GTEST_TUPLE_NAMESPACE_
+# define GTEST_TUPLE_NAMESPACE_ ::std::tr1
+# endif // GTEST_TUPLE_NAMESPACE_
# if GTEST_USE_OWN_TR1_TUPLE
// This file was GENERATED by command:
@@ -694,6 +1004,14 @@
private:
#endif
+// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
+// with our own definitions. Therefore using our own tuple does not work on
+// those compilers.
+#if defined(_MSC_VER) && _MSC_VER >= 1600 /* 1600 is Visual Studio 2010 */
+# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
+GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
+#endif
+
// GTEST_n_TUPLE_(T) is the type of an n-tuple.
#define GTEST_0_TUPLE_(T) tuple<>
#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
@@ -1681,7 +1999,7 @@ using ::std::tuple_size;
// This prevents <boost/tr1/detail/config.hpp>, which defines
// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
-# include <tuple>
+# include <tuple> // IWYU pragma: export // NOLINT
# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header. This does
@@ -1704,7 +2022,7 @@ using ::std::tuple_size;
# else
// If the compiler is not GCC 4.0+, we assume the user is using a
// spec-conforming TR1 implementation.
-# include <tuple> // NOLINT
+# include <tuple> // IWYU pragma: export // NOLINT
# endif // GTEST_USE_OWN_TR1_TUPLE
#endif // GTEST_HAS_TR1_TUPLE
@@ -1738,7 +2056,8 @@ using ::std::tuple_size;
#ifndef GTEST_HAS_STREAM_REDIRECTION
// By default, we assume that stream redirection is supported on all
// platforms except known mobile ones.
-# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
+# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
+ GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
# define GTEST_HAS_STREAM_REDIRECTION 0
# else
# define GTEST_HAS_STREAM_REDIRECTION 1
@@ -1750,12 +2069,11 @@ using ::std::tuple_size;
// abort() in a VC 7.1 application compiled as GUI in debug config
// pops up a dialog window that cannot be suppressed programmatically.
#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
- (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
+ (GTEST_OS_MAC && !GTEST_OS_IOS) || \
(GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
- GTEST_OS_OPENBSD || GTEST_OS_QNX)
+ GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD)
# define GTEST_HAS_DEATH_TEST 1
-# include <vector> // NOLINT
#endif
// We don't support MSVC 7.1 with exceptions disabled now. Therefore
@@ -1819,7 +2137,12 @@ using ::std::tuple_size;
// compiler the variable/parameter does not have to be used.
#if defined(__GNUC__) && !defined(COMPILER_ICC)
# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
-#else
+#elif defined(__clang__)
+# if __has_attribute(unused)
+# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
+# endif
+#endif
+#ifndef GTEST_ATTRIBUTE_UNUSED_
# define GTEST_ATTRIBUTE_UNUSED_
#endif
@@ -1845,6 +2168,19 @@ using ::std::tuple_size;
# define GTEST_MUST_USE_RESULT_
#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
+// MS C++ compiler emits warning when a conditional expression is compile time
+// constant. In some contexts this warning is false positive and needs to be
+// suppressed. Use the following two macros in such cases:
+//
+// GTEST_INTENTIONAL_CONST_COND_PUSH_()
+// while (true) {
+// GTEST_INTENTIONAL_CONST_COND_POP_()
+// }
+# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
+# define GTEST_INTENTIONAL_CONST_COND_POP_() \
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
+
// Determine whether the compiler supports Microsoft's Structured Exception
// Handling. This is supported by several Windows compilers but generally
// does not exist on any other system.
@@ -1859,17 +2195,22 @@ using ::std::tuple_size;
# define GTEST_HAS_SEH 0
# endif
+#define GTEST_IS_THREADSAFE \
+ (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
+ || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
+ || GTEST_HAS_PTHREAD)
+
#endif // GTEST_HAS_SEH
#ifdef _MSC_VER
-
# if GTEST_LINKED_AS_SHARED_LIBRARY
# define GTEST_API_ __declspec(dllimport)
# elif GTEST_CREATE_SHARED_LIBRARY
# define GTEST_API_ __declspec(dllexport)
# endif
-
-#endif // _MSC_VER
+#elif __GNUC__ >= 4 || defined(__clang__)
+# define GTEST_API_ __attribute__((visibility ("default")))
+#endif // _MSC_VER
#ifndef GTEST_API_
# define GTEST_API_
@@ -1889,10 +2230,58 @@ using ::std::tuple_size;
# define GTEST_HAS_CXXABI_H_ 0
#endif
+// A function level attribute to disable checking for use of uninitialized
+// memory when built with MemorySanitizer.
+#if defined(__clang__)
+# if __has_feature(memory_sanitizer)
+# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
+ __attribute__((no_sanitize_memory))
+# else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+# endif // __has_feature(memory_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+#endif // __clang__
+
+// A function level attribute to disable AddressSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(address_sanitizer)
+# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
+ __attribute__((no_sanitize_address))
+# else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+# endif // __has_feature(address_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+#endif // __clang__
+
+// A function level attribute to disable ThreadSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(thread_sanitizer)
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
+ __attribute__((no_sanitize_thread))
+# else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+# endif // __has_feature(thread_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+#endif // __clang__
+
namespace testing {
class Message;
+#if defined(GTEST_TUPLE_NAMESPACE_)
+// Import tuple and friends into the ::testing namespace.
+// It is part of our interface, having them in ::testing allows us to change
+// their types as needed.
+using GTEST_TUPLE_NAMESPACE_::get;
+using GTEST_TUPLE_NAMESPACE_::make_tuple;
+using GTEST_TUPLE_NAMESPACE_::tuple;
+using GTEST_TUPLE_NAMESPACE_::tuple_size;
+using GTEST_TUPLE_NAMESPACE_::tuple_element;
+#endif // defined(GTEST_TUPLE_NAMESPACE_)
+
namespace internal {
// A secret type that Google Test users don't know about. It has no
@@ -1904,8 +2293,8 @@ class Secret;
// expression is true. For example, you could use it to verify the
// size of a static array:
//
-// GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
-// content_type_names_incorrect_size);
+// GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
+// names_incorrect_size);
//
// or to make sure a struct is smaller than a certain size:
//
@@ -1915,16 +2304,22 @@ class Secret;
// the expression is false, most compilers will issue a warning/error
// containing the name of the variable.
+#if GTEST_LANG_CXX11
+# define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
+#else // !GTEST_LANG_CXX11
template <bool>
-struct CompileAssert {
+ struct CompileAssert {
};
-#define GTEST_COMPILE_ASSERT_(expr, msg) \
+# define GTEST_COMPILE_ASSERT_(expr, msg) \
typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
+#endif // !GTEST_LANG_CXX11
// Implementation details of GTEST_COMPILE_ASSERT_:
//
+// (In C++11, we simply use static_assert instead of the following)
+//
// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
// elements (and thus is invalid) when the expression is false.
//
@@ -1971,7 +2366,12 @@ template <typename T1, typename T2>
struct StaticAssertTypeEqHelper;
template <typename T>
-struct StaticAssertTypeEqHelper<T, T> {};
+struct StaticAssertTypeEqHelper<T, T> {
+ enum { value = true };
+};
+
+// Evaluates to the number of elements in 'array'.
+#define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
#if GTEST_HAS_GLOBAL_STRING
typedef ::string string;
@@ -2020,6 +2420,11 @@ class scoped_ptr {
}
}
+ friend void swap(scoped_ptr& a, scoped_ptr& b) {
+ using std::swap;
+ swap(a.ptr_, b.ptr_);
+ }
+
private:
T* ptr_;
@@ -2143,13 +2548,18 @@ class GTEST_API_ GTestLog {
GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
};
-#define GTEST_LOG_(severity) \
+#if !defined(GTEST_LOG_)
+
+# define GTEST_LOG_(severity) \
::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
__FILE__, __LINE__).GetStream()
inline void LogToStderr() {}
inline void FlushInfoLog() { fflush(NULL); }
+#endif // !defined(GTEST_LOG_)
+
+#if !defined(GTEST_CHECK_)
// INTERNAL IMPLEMENTATION - DO NOT USE.
//
// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
@@ -2164,12 +2574,13 @@ inline void FlushInfoLog() { fflush(NULL); }
// condition itself, plus additional message streamed into it, if any,
// and then it aborts the program. It aborts the program irrespective of
// whether it is built in the debug mode or not.
-#define GTEST_CHECK_(condition) \
+# define GTEST_CHECK_(condition) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if (::testing::internal::IsTrue(condition)) \
; \
else \
GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+#endif // !defined(GTEST_CHECK_)
// An all-mode assert to verify that the given POSIX-style function
// call returns 0 (indicating success). Known limitation: this
@@ -2181,6 +2592,15 @@ inline void FlushInfoLog() { fflush(NULL); }
GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
<< gtest_error
+#if GTEST_HAS_STD_MOVE_
+using std::move;
+#else // GTEST_HAS_STD_MOVE_
+template <typename T>
+const T& move(const T& t) {
+ return t;
+}
+#endif // GTEST_HAS_STD_MOVE_
+
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
// Use ImplicitCast_ as a safe version of static_cast for upcasting in
@@ -2231,7 +2651,9 @@ inline To DownCast_(From* f) { // so we only accept pointers
// for compile-time type checking, and has no overhead in an
// optimized build at run-time, as it will be optimized away
// completely.
+ GTEST_INTENTIONAL_CONST_COND_PUSH_()
if (false) {
+ GTEST_INTENTIONAL_CONST_COND_POP_()
const To to = NULL;
::testing::internal::ImplicitCast_<From*>(to);
}
@@ -2252,6 +2674,11 @@ template <class Derived, class Base>
Derived* CheckedDowncastToActualType(Base* base) {
#if GTEST_HAS_RTTI
GTEST_CHECK_(typeid(*base) == typeid(Derived));
+#endif
+
+#if GTEST_HAS_DOWNCAST_
+ return ::down_cast<Derived*>(base);
+#elif GTEST_HAS_RTTI
return dynamic_cast<Derived*>(base); // NOLINT
#else
return static_cast<Derived*>(base); // Poor man's downcast.
@@ -2273,6 +2700,17 @@ GTEST_API_ std::string GetCapturedStderr();
#endif // GTEST_HAS_STREAM_REDIRECTION
+// Returns a path to temporary directory.
+GTEST_API_ std::string TempDir();
+
+// Returns the size (in bytes) of a file.
+GTEST_API_ size_t GetFileSize(FILE* file);
+
+// Reads the entire content of a file as a string.
+GTEST_API_ std::string ReadEntireFile(FILE* file);
+
+// All command line arguments.
+GTEST_API_ const ::std::vector<testing::internal::string>& GetArgvs();
#if GTEST_HAS_DEATH_TEST
@@ -2280,18 +2718,15 @@ const ::std::vector<testing::internal::string>& GetInjectableArgvs();
void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
new_argvs);
-// A copy of all command line arguments. Set by InitGoogleTest().
-extern ::std::vector<testing::internal::string> g_argvs;
#endif // GTEST_HAS_DEATH_TEST
// Defines synchronization primitives.
-
-#if GTEST_HAS_PTHREAD
-
-// Sleeps for (roughly) n milli-seconds. This function is only for
-// testing Google Test's own constructs. Don't use it in user tests,
-// either directly or indirectly.
+#if GTEST_IS_THREADSAFE
+# if GTEST_HAS_PTHREAD
+// Sleeps for (roughly) n milliseconds. This function is only for testing
+// Google Test's own constructs. Don't use it in user tests, either
+// directly or indirectly.
inline void SleepMilliseconds(int n) {
const timespec time = {
0, // 0 seconds.
@@ -2299,7 +2734,13 @@ inline void SleepMilliseconds(int n) {
};
nanosleep(&time, NULL);
}
+# endif // GTEST_HAS_PTHREAD
+
+# if GTEST_HAS_NOTIFICATION_
+// Notification has already been imported into the namespace.
+// Nothing to do here.
+# elif GTEST_HAS_PTHREAD
// Allows a controller thread to pause execution of newly created
// threads until notified. Instances of this class must be created
// and destroyed in the controller thread.
@@ -2343,6 +2784,62 @@ class Notification {
GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
};
+# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+GTEST_API_ void SleepMilliseconds(int n);
+
+// Provides leak-safe Windows kernel handle ownership.
+// Used in death tests and in threading support.
+class GTEST_API_ AutoHandle {
+ public:
+ // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
+ // avoid including <windows.h> in this header file. Including <windows.h> is
+ // undesirable because it defines a lot of symbols and macros that tend to
+ // conflict with client code. This assumption is verified by
+ // WindowsTypesTest.HANDLEIsVoidStar.
+ typedef void* Handle;
+ AutoHandle();
+ explicit AutoHandle(Handle handle);
+
+ ~AutoHandle();
+
+ Handle Get() const;
+ void Reset();
+ void Reset(Handle handle);
+
+ private:
+ // Returns true iff the handle is a valid handle object that can be closed.
+ bool IsCloseable() const;
+
+ Handle handle_;
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
+};
+
+// Allows a controller thread to pause execution of newly created
+// threads until notified. Instances of this class must be created
+// and destroyed in the controller thread.
+//
+// This class is only for testing Google Test's own constructs. Do not
+// use it in user tests, either directly or indirectly.
+class GTEST_API_ Notification {
+ public:
+ Notification();
+ void Notify();
+ void WaitForNotification();
+
+ private:
+ AutoHandle event_;
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
+};
+# endif // GTEST_HAS_NOTIFICATION_
+
+// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
+// defined, but we don't want to use MinGW's pthreads implementation, which
+// has conformance problems with some versions of the POSIX standard.
+# if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
+
// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
// Consequently, it cannot select a correct instantiation of ThreadWithParam
// in order to call its Run(). Introducing ThreadWithParamBase as a
@@ -2380,10 +2877,9 @@ extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
template <typename T>
class ThreadWithParam : public ThreadWithParamBase {
public:
- typedef void (*UserThreadFunc)(T);
+ typedef void UserThreadFunc(T);
- ThreadWithParam(
- UserThreadFunc func, T param, Notification* thread_can_start)
+ ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
: func_(func),
param_(param),
thread_can_start_(thread_can_start),
@@ -2410,7 +2906,7 @@ class ThreadWithParam : public ThreadWithParamBase {
}
private:
- const UserThreadFunc func_; // User-supplied thread function.
+ UserThreadFunc* const func_; // User-supplied thread function.
const T param_; // User-supplied parameter to the thread function.
// When non-NULL, used to block execution until the controller thread
// notifies.
@@ -2420,26 +2916,297 @@ class ThreadWithParam : public ThreadWithParamBase {
GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
};
+# endif // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
+ // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+
+# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+// Mutex and ThreadLocal have already been imported into the namespace.
+// Nothing to do here.
+
+# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
-// MutexBase and Mutex implement mutex on pthreads-based platforms. They
-// are used in conjunction with class MutexLock:
+// Mutex implements mutex on Windows platforms. It is used in conjunction
+// with class MutexLock:
//
// Mutex mutex;
// ...
-// MutexLock lock(&mutex); // Acquires the mutex and releases it at the end
-// // of the current scope.
-//
-// MutexBase implements behavior for both statically and dynamically
-// allocated mutexes. Do not use MutexBase directly. Instead, write
-// the following to define a static mutex:
+// MutexLock lock(&mutex); // Acquires the mutex and releases it at the
+// // end of the current scope.
//
+// A static Mutex *must* be defined or declared using one of the following
+// macros:
// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
+// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
//
-// You can forward declare a static mutex like this:
+// (A non-static Mutex is defined/declared in the usual way).
+class GTEST_API_ Mutex {
+ public:
+ enum MutexType { kStatic = 0, kDynamic = 1 };
+ // We rely on kStaticMutex being 0 as it is to what the linker initializes
+ // type_ in static mutexes. critical_section_ will be initialized lazily
+ // in ThreadSafeLazyInit().
+ enum StaticConstructorSelector { kStaticMutex = 0 };
+
+ // This constructor intentionally does nothing. It relies on type_ being
+ // statically initialized to 0 (effectively setting it to kStatic) and on
+ // ThreadSafeLazyInit() to lazily initialize the rest of the members.
+ explicit Mutex(StaticConstructorSelector /*dummy*/) {}
+
+ Mutex();
+ ~Mutex();
+
+ void Lock();
+
+ void Unlock();
+
+ // Does nothing if the current thread holds the mutex. Otherwise, crashes
+ // with high probability.
+ void AssertHeld();
+
+ private:
+ // Initializes owner_thread_id_ and critical_section_ in static mutexes.
+ void ThreadSafeLazyInit();
+
+ // Per http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx,
+ // we assume that 0 is an invalid value for thread IDs.
+ unsigned int owner_thread_id_;
+
+ // For static mutexes, we rely on these members being initialized to zeros
+ // by the linker.
+ MutexType type_;
+ long critical_section_init_phase_; // NOLINT
+#if GTEST_OS_WINDOWS_MINGW
+ GTEST_CRITICAL_SECTION* critical_section_;
+#else
+ _RTL_CRITICAL_SECTION* critical_section_;
+#endif
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
+};
+
+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+ extern ::testing::internal::Mutex mutex
+
+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+ ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
+
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)". Hence the typedef trick below.
+class GTestMutexLock {
+ public:
+ explicit GTestMutexLock(Mutex* mutex)
+ : mutex_(mutex) { mutex_->Lock(); }
+
+ ~GTestMutexLock() { mutex_->Unlock(); }
+
+ private:
+ Mutex* const mutex_;
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
+};
+
+typedef GTestMutexLock MutexLock;
+
+// Base class for ValueHolder<T>. Allows a caller to hold and delete a value
+// without knowing its type.
+class ThreadLocalValueHolderBase {
+ public:
+ virtual ~ThreadLocalValueHolderBase() {}
+};
+
+// Provides a way for a thread to send notifications to a ThreadLocal
+// regardless of its parameter type.
+class ThreadLocalBase {
+ public:
+ // Creates a new ValueHolder<T> object holding a default value passed to
+ // this ThreadLocal<T>'s constructor and returns it. It is the caller's
+ // responsibility not to call this when the ThreadLocal<T> instance already
+ // has a value on the current thread.
+ virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
+
+ protected:
+ ThreadLocalBase() {}
+ virtual ~ThreadLocalBase() {}
+
+ private:
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
+};
+
+// Maps a thread to a set of ThreadLocals that have values instantiated on that
+// thread and notifies them when the thread exits. A ThreadLocal instance is
+// expected to persist until all threads it has values on have terminated.
+class GTEST_API_ ThreadLocalRegistry {
+ public:
+ // Registers thread_local_instance as having value on the current thread.
+ // Returns a value that can be used to identify the thread from other threads.
+ static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
+ const ThreadLocalBase* thread_local_instance);
+
+ // Invoked when a ThreadLocal instance is destroyed.
+ static void OnThreadLocalDestroyed(
+ const ThreadLocalBase* thread_local_instance);
+};
+
+class GTEST_API_ ThreadWithParamBase {
+ public:
+ void Join();
+
+ protected:
+ class Runnable {
+ public:
+ virtual ~Runnable() {}
+ virtual void Run() = 0;
+ };
+
+ ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
+ virtual ~ThreadWithParamBase();
+
+ private:
+ AutoHandle thread_;
+};
+
+// Helper class for testing Google Test's multi-threading constructs.
+template <typename T>
+class ThreadWithParam : public ThreadWithParamBase {
+ public:
+ typedef void UserThreadFunc(T);
+
+ ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
+ : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
+ }
+ virtual ~ThreadWithParam() {}
+
+ private:
+ class RunnableImpl : public Runnable {
+ public:
+ RunnableImpl(UserThreadFunc* func, T param)
+ : func_(func),
+ param_(param) {
+ }
+ virtual ~RunnableImpl() {}
+ virtual void Run() {
+ func_(param_);
+ }
+
+ private:
+ UserThreadFunc* const func_;
+ const T param_;
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
+ };
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
+};
+
+// Implements thread-local storage on Windows systems.
//
-// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
+// // Thread 1
+// ThreadLocal<int> tl(100); // 100 is the default value for each thread.
//
-// To create a dynamic mutex, just define an object of type Mutex.
+// // Thread 2
+// tl.set(150); // Changes the value for thread 2 only.
+// EXPECT_EQ(150, tl.get());
+//
+// // Thread 1
+// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
+// tl.set(200);
+// EXPECT_EQ(200, tl.get());
+//
+// The template type argument T must have a public copy constructor.
+// In addition, the default ThreadLocal constructor requires T to have
+// a public default constructor.
+//
+// The users of a TheadLocal instance have to make sure that all but one
+// threads (including the main one) using that instance have exited before
+// destroying it. Otherwise, the per-thread objects managed for them by the
+// ThreadLocal instance are not guaranteed to be destroyed on all platforms.
+//
+// Google Test only uses global ThreadLocal objects. That means they
+// will die after main() has returned. Therefore, no per-thread
+// object managed by Google Test will be leaked as long as all threads
+// using Google Test have exited when main() returns.
+template <typename T>
+class ThreadLocal : public ThreadLocalBase {
+ public:
+ ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
+ explicit ThreadLocal(const T& value)
+ : default_factory_(new InstanceValueHolderFactory(value)) {}
+
+ ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
+
+ T* pointer() { return GetOrCreateValue(); }
+ const T* pointer() const { return GetOrCreateValue(); }
+ const T& get() const { return *pointer(); }
+ void set(const T& value) { *pointer() = value; }
+
+ private:
+ // Holds a value of T. Can be deleted via its base class without the caller
+ // knowing the type of T.
+ class ValueHolder : public ThreadLocalValueHolderBase {
+ public:
+ ValueHolder() : value_() {}
+ explicit ValueHolder(const T& value) : value_(value) {}
+
+ T* pointer() { return &value_; }
+
+ private:
+ T value_;
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
+ };
+
+
+ T* GetOrCreateValue() const {
+ return static_cast<ValueHolder*>(
+ ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
+ }
+
+ virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
+ return default_factory_->MakeNewHolder();
+ }
+
+ class ValueHolderFactory {
+ public:
+ ValueHolderFactory() {}
+ virtual ~ValueHolderFactory() {}
+ virtual ValueHolder* MakeNewHolder() const = 0;
+
+ private:
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
+ };
+
+ class DefaultValueHolderFactory : public ValueHolderFactory {
+ public:
+ DefaultValueHolderFactory() {}
+ virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+
+ private:
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
+ };
+
+ class InstanceValueHolderFactory : public ValueHolderFactory {
+ public:
+ explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
+ virtual ValueHolder* MakeNewHolder() const {
+ return new ValueHolder(value_);
+ }
+
+ private:
+ const T value_; // The value for each thread.
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
+ };
+
+ scoped_ptr<ValueHolderFactory> default_factory_;
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
+};
+
+# elif GTEST_HAS_PTHREAD
+
+// MutexBase and Mutex implement mutex on pthreads-based platforms.
class MutexBase {
public:
// Acquires this mutex.
@@ -2484,17 +3251,12 @@ class MutexBase {
};
// Forward-declares a static mutex.
-# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
- extern ::testing::internal::MutexBase mutex
+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+ extern ::testing::internal::MutexBase mutex
// Defines and statically (i.e. at link time) initializes a static mutex.
-// The initialization list here does not explicitly initialize each field,
-// instead relying on default initialization for the unspecified fields. In
-// particular, the owner_ field (a pthread_t) is not explicitly initialized.
-// This allows initialization to work whether pthread_t is a scalar or struct.
-// The flag -Wmissing-field-initializers must not be specified for this to work.
-# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
- ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+ ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() }
// The Mutex class can only be used for mutexes created at runtime. It
// shares its API with MutexBase otherwise.
@@ -2512,9 +3274,11 @@ class Mutex : public MutexBase {
GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
};
-// We cannot name this class MutexLock as the ctor declaration would
+// We cannot name this class MutexLock because the ctor declaration would
// conflict with a macro named MutexLock, which is defined on some
-// platforms. Hence the typedef trick below.
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)". Hence the typedef trick below.
class GTestMutexLock {
public:
explicit GTestMutexLock(MutexBase* mutex)
@@ -2548,41 +3312,14 @@ extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
}
// Implements thread-local storage on pthreads-based systems.
-//
-// // Thread 1
-// ThreadLocal<int> tl(100); // 100 is the default value for each thread.
-//
-// // Thread 2
-// tl.set(150); // Changes the value for thread 2 only.
-// EXPECT_EQ(150, tl.get());
-//
-// // Thread 1
-// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
-// tl.set(200);
-// EXPECT_EQ(200, tl.get());
-//
-// The template type argument T must have a public copy constructor.
-// In addition, the default ThreadLocal constructor requires T to have
-// a public default constructor.
-//
-// An object managed for a thread by a ThreadLocal instance is deleted
-// when the thread exits. Or, if the ThreadLocal instance dies in
-// that thread, when the ThreadLocal dies. It's the user's
-// responsibility to ensure that all other threads using a ThreadLocal
-// have exited when it dies, or the per-thread objects for those
-// threads will not be deleted.
-//
-// Google Test only uses global ThreadLocal objects. That means they
-// will die after main() has returned. Therefore, no per-thread
-// object managed by Google Test will be leaked as long as all threads
-// using Google Test have exited when main() returns.
template <typename T>
class ThreadLocal {
public:
- ThreadLocal() : key_(CreateKey()),
- default_() {}
- explicit ThreadLocal(const T& value) : key_(CreateKey()),
- default_(value) {}
+ ThreadLocal()
+ : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
+ explicit ThreadLocal(const T& value)
+ : key_(CreateKey()),
+ default_factory_(new InstanceValueHolderFactory(value)) {}
~ThreadLocal() {
// Destroys the managed object for the current thread, if any.
@@ -2602,6 +3339,7 @@ class ThreadLocal {
// Holds a value of type T.
class ValueHolder : public ThreadLocalValueHolderBase {
public:
+ ValueHolder() : value_() {}
explicit ValueHolder(const T& value) : value_(value) {}
T* pointer() { return &value_; }
@@ -2627,22 +3365,54 @@ class ThreadLocal {
return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
}
- ValueHolder* const new_holder = new ValueHolder(default_);
+ ValueHolder* const new_holder = default_factory_->MakeNewHolder();
ThreadLocalValueHolderBase* const holder_base = new_holder;
GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
return new_holder->pointer();
}
+ class ValueHolderFactory {
+ public:
+ ValueHolderFactory() {}
+ virtual ~ValueHolderFactory() {}
+ virtual ValueHolder* MakeNewHolder() const = 0;
+
+ private:
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
+ };
+
+ class DefaultValueHolderFactory : public ValueHolderFactory {
+ public:
+ DefaultValueHolderFactory() {}
+ virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+
+ private:
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
+ };
+
+ class InstanceValueHolderFactory : public ValueHolderFactory {
+ public:
+ explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
+ virtual ValueHolder* MakeNewHolder() const {
+ return new ValueHolder(value_);
+ }
+
+ private:
+ const T value_; // The value for each thread.
+
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
+ };
+
// A key pthreads uses for looking up per-thread values.
const pthread_key_t key_;
- const T default_; // The default value for each thread.
+ scoped_ptr<ValueHolderFactory> default_factory_;
GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
};
-# define GTEST_IS_THREADSAFE 1
+# endif // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
-#else // GTEST_HAS_PTHREAD
+#else // GTEST_IS_THREADSAFE
// A dummy implementation of synchronization primitives (mutex, lock,
// and thread-local variable). Necessary for compiling Google Test where
@@ -2662,6 +3432,11 @@ class Mutex {
# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)". Hence the typedef trick below.
class GTestMutexLock {
public:
explicit GTestMutexLock(Mutex*) {} // NOLINT
@@ -2682,11 +3457,7 @@ class ThreadLocal {
T value_;
};
-// The above synchronization primitives have dummy implementations.
-// Therefore Google Test is not thread-safe.
-# define GTEST_IS_THREADSAFE 0
-
-#endif // GTEST_HAS_PTHREAD
+#endif // GTEST_IS_THREADSAFE
// Returns the number of threads running in the process, or 0 to indicate that
// we cannot detect it.
@@ -2796,6 +3567,13 @@ inline char ToUpper(char ch) {
return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
}
+inline std::string StripTrailingSpaces(std::string str) {
+ std::string::iterator it = str.end();
+ while (it != str.begin() && IsSpace(*--it))
+ it = str.erase(it);
+ return str;
+}
+
// The testing::internal::posix namespace holds wrappers for common
// POSIX functions. These wrappers hide the differences between
// Windows/MSVC and POSIX systems. Since some compilers define these
@@ -2859,11 +3637,7 @@ inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
// Functions deprecated by MSVC 8.0.
-#ifdef _MSC_VER
-// Temporarily disable warning 4996 (deprecated function).
-# pragma warning(push)
-# pragma warning(disable:4996)
-#endif
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
inline const char* StrNCpy(char* dest, const char* src, size_t n) {
return strncpy(dest, src, n);
@@ -2873,7 +3647,7 @@ inline const char* StrNCpy(char* dest, const char* src, size_t n) {
// StrError() aren't needed on Windows CE at this time and thus not
// defined there.
-#if !GTEST_OS_WINDOWS_MOBILE
+#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
inline int ChDir(const char* dir) { return chdir(dir); }
#endif
inline FILE* FOpen(const char* path, const char* mode) {
@@ -2897,8 +3671,9 @@ inline int Close(int fd) { return close(fd); }
inline const char* StrError(int errnum) { return strerror(errnum); }
#endif
inline const char* GetEnv(const char* name) {
-#if GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT
// We are on Windows CE, which has no environment variables.
+ static_cast<void>(name); // To prevent 'unused argument' warning.
return NULL;
#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
// Environment variables which we programmatically clear will be set to the
@@ -2910,9 +3685,7 @@ inline const char* GetEnv(const char* name) {
#endif
}
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif
+GTEST_DISABLE_MSC_WARNINGS_POP_()
#if GTEST_OS_WINDOWS_MOBILE
// Windows CE has no C library. The abort() function is used in
@@ -3013,11 +3786,20 @@ typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
// Utilities for command line flags and environment variables.
// Macro for referencing flags.
-#define GTEST_FLAG(name) FLAGS_gtest_##name
+#if !defined(GTEST_FLAG)
+# define GTEST_FLAG(name) FLAGS_gtest_##name
+#endif // !defined(GTEST_FLAG)
+
+#if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
+# define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
+#endif // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
+
+#if !defined(GTEST_DECLARE_bool_)
+# define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
// Macros for declaring flags.
-#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
-#define GTEST_DECLARE_int32_(name) \
+# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
+# define GTEST_DECLARE_int32_(name) \
GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
#define GTEST_DECLARE_string_(name) \
GTEST_API_ extern ::std::string GTEST_FLAG(name)
@@ -3030,9 +3812,13 @@ typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds.
#define GTEST_DEFINE_string_(name, default_val, doc) \
GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
+#endif // !defined(GTEST_DECLARE_bool_)
+
// Thread annotations
-#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
-#define GTEST_LOCK_EXCLUDED_(locks)
+#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
+# define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
+# define GTEST_LOCK_EXCLUDED_(locks)
+#endif // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
// Parses 'str' for a 32-bit signed integer. If successful, writes the result
// to *value and returns true; otherwise leaves *value unchanged and returns
@@ -3046,7 +3832,7 @@ bool ParseInt32(const Message& src_text, const char* str, Int32* value);
// corresponding to the given Google Test flag.
bool BoolFromGTestEnv(const char* flag, bool default_val);
GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
-const char* StringFromGTestEnv(const char* flag, const char* default_val);
+std::string StringFromGTestEnv(const char* flag, const char* default_val);
} // namespace internal
} // namespace testing
@@ -3069,7 +3855,10 @@ const char* StringFromGTestEnv(const char* flag, const char* default_val);
#include <string.h>
#include <iomanip>
#include <limits>
+#include <map>
#include <set>
+#include <string>
+#include <vector>
// Copyright 2005, Google Inc.
// All rights reserved.
@@ -7057,9 +7846,6 @@ class ScopedTrace; // Implements scoped trace.
class TestInfoImpl; // Opaque implementation of TestInfo
class UnitTestImpl; // Opaque implementation of UnitTest
-// How many times InitGoogleTest() has been called.
-GTEST_API_ extern int g_init_gtest_count;
-
// The text used in failure messages to indicate the start of the
// stack trace.
GTEST_API_ extern const char kStackTraceMarker[];
@@ -7131,6 +7917,36 @@ class GTEST_API_ ScopedTrace {
// c'tor and d'tor. Therefore it doesn't
// need to be used otherwise.
+namespace edit_distance {
+// Returns the optimal edits to go from 'left' to 'right'.
+// All edits cost the same, with replace having lower priority than
+// add/remove.
+// Simple implementation of the Wagner–Fischer algorithm.
+// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
+enum EditType { kMatch, kAdd, kRemove, kReplace };
+GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
+ const std::vector<size_t>& left, const std::vector<size_t>& right);
+
+// Same as above, but the input is represented as strings.
+GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
+ const std::vector<std::string>& left,
+ const std::vector<std::string>& right);
+
+// Create a diff of the input strings in Unified diff format.
+GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
+ const std::vector<std::string>& right,
+ size_t context = 2);
+
+} // namespace edit_distance
+
+// Calculate the diff between 'left' and 'right' and return it in unified diff
+// format.
+// If not null, stores in 'total_line_count' the total number of lines found
+// in left + right.
+GTEST_API_ std::string DiffStrings(const std::string& left,
+ const std::string& right,
+ size_t* total_line_count);
+
// Constructs and returns the message for an equality assertion
// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
//
@@ -7431,6 +8247,13 @@ GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
typedef void (*SetUpTestCaseFunc)();
typedef void (*TearDownTestCaseFunc)();
+struct CodeLocation {
+ CodeLocation(const string& a_file, int a_line) : file(a_file), line(a_line) {}
+
+ string file;
+ int line;
+};
+
// Creates a new TestInfo object and registers it with Google Test;
// returns the created object.
//
@@ -7442,6 +8265,7 @@ typedef void (*TearDownTestCaseFunc)();
// this is not a typed or a type-parameterized test.
// value_param text representation of the test's value parameter,
// or NULL if this is not a type-parameterized test.
+// code_location: code location where the test is defined
// fixture_class_id: ID of the test fixture class
// set_up_tc: pointer to the function that sets up the test case
// tear_down_tc: pointer to the function that tears down the test case
@@ -7453,6 +8277,7 @@ GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
const char* name,
const char* type_param,
const char* value_param,
+ CodeLocation code_location,
TypeId fixture_class_id,
SetUpTestCaseFunc set_up_tc,
TearDownTestCaseFunc tear_down_tc,
@@ -7482,10 +8307,21 @@ class GTEST_API_ TypedTestCasePState {
fflush(stderr);
posix::Abort();
}
- defined_test_names_.insert(test_name);
+ registered_tests_.insert(
+ ::std::make_pair(test_name, CodeLocation(file, line)));
return true;
}
+ bool TestExists(const std::string& test_name) const {
+ return registered_tests_.count(test_name) > 0;
+ }
+
+ const CodeLocation& GetCodeLocation(const std::string& test_name) const {
+ RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
+ GTEST_CHECK_(it != registered_tests_.end());
+ return it->second;
+ }
+
// Verifies that registered_tests match the test names in
// defined_test_names_; returns registered_tests if successful, or
// aborts the program otherwise.
@@ -7493,8 +8329,10 @@ class GTEST_API_ TypedTestCasePState {
const char* file, int line, const char* registered_tests);
private:
+ typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
+
bool registered_;
- ::std::set<const char*> defined_test_names_;
+ RegisteredTestsMap registered_tests_;
};
// Skips to the first non-space char after the first comma in 'str';
@@ -7515,6 +8353,11 @@ inline std::string GetPrefixUntilComma(const char* str) {
return comma == NULL ? str : std::string(str, comma);
}
+// Splits a given string on a given delimiter, populating a given
+// vector with the fields.
+void SplitString(const ::std::string& str, char delimiter,
+ ::std::vector< ::std::string>* dest);
+
// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
// registers a list of type-parameterized tests with Google Test. The
// return value is insignificant - we just need to return something
@@ -7529,8 +8372,10 @@ class TypeParameterizedTest {
// specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
// Types). Valid values for 'index' are [0, N - 1] where N is the
// length of Types.
- static bool Register(const char* prefix, const char* case_name,
- const char* test_names, int index) {
+ static bool Register(const char* prefix,
+ CodeLocation code_location,
+ const char* case_name, const char* test_names,
+ int index) {
typedef typename Types::Head Type;
typedef Fixture<Type> FixtureClass;
typedef typename GTEST_BIND_(TestSel, Type) TestClass;
@@ -7540,9 +8385,10 @@ class TypeParameterizedTest {
MakeAndRegisterTestInfo(
(std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
+ StreamableToString(index)).c_str(),
- GetPrefixUntilComma(test_names).c_str(),
+ StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
GetTypeName<Type>().c_str(),
NULL, // No value parameter.
+ code_location,
GetTypeId<FixtureClass>(),
TestClass::SetUpTestCase,
TestClass::TearDownTestCase,
@@ -7550,7 +8396,7 @@ class TypeParameterizedTest {
// Next, recurses (at compile time) with the tail of the type list.
return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
- ::Register(prefix, case_name, test_names, index + 1);
+ ::Register(prefix, code_location, case_name, test_names, index + 1);
}
};
@@ -7558,8 +8404,9 @@ class TypeParameterizedTest {
template <GTEST_TEMPLATE_ Fixture, class TestSel>
class TypeParameterizedTest<Fixture, TestSel, Types0> {
public:
- static bool Register(const char* /*prefix*/, const char* /*case_name*/,
- const char* /*test_names*/, int /*index*/) {
+ static bool Register(const char* /*prefix*/, CodeLocation,
+ const char* /*case_name*/, const char* /*test_names*/,
+ int /*index*/) {
return true;
}
};
@@ -7571,17 +8418,31 @@ class TypeParameterizedTest<Fixture, TestSel, Types0> {
template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
class TypeParameterizedTestCase {
public:
- static bool Register(const char* prefix, const char* case_name,
- const char* test_names) {
+ static bool Register(const char* prefix, CodeLocation code_location,
+ const TypedTestCasePState* state,
+ const char* case_name, const char* test_names) {
+ std::string test_name = StripTrailingSpaces(
+ GetPrefixUntilComma(test_names));
+ if (!state->TestExists(test_name)) {
+ fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
+ case_name, test_name.c_str(),
+ FormatFileLocation(code_location.file.c_str(),
+ code_location.line).c_str());
+ fflush(stderr);
+ posix::Abort();
+ }
+ const CodeLocation& test_location = state->GetCodeLocation(test_name);
+
typedef typename Tests::Head Head;
// First, register the first test in 'Test' for each type in 'Types'.
TypeParameterizedTest<Fixture, Head, Types>::Register(
- prefix, case_name, test_names, 0);
+ prefix, test_location, case_name, test_names, 0);
// Next, recurses (at compile time) with the tail of the test list.
return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
- ::Register(prefix, case_name, SkipComma(test_names));
+ ::Register(prefix, code_location, state,
+ case_name, SkipComma(test_names));
}
};
@@ -7589,8 +8450,9 @@ class TypeParameterizedTestCase {
template <GTEST_TEMPLATE_ Fixture, typename Types>
class TypeParameterizedTestCase<Fixture, Templates0, Types> {
public:
- static bool Register(const char* /*prefix*/, const char* /*case_name*/,
- const char* /*test_names*/) {
+ static bool Register(const char* /*prefix*/, CodeLocation,
+ const TypedTestCasePState* /*state*/,
+ const char* /*case_name*/, const char* /*test_names*/) {
return true;
}
};
@@ -7744,7 +8606,7 @@ class ImplicitlyConvertible {
// MakeFrom() is an expression whose type is From. We cannot simply
// use From(), as the type From may not have a public default
// constructor.
- static From MakeFrom();
+ static typename AddReference<From>::type MakeFrom();
// These two functions are overloaded. Given an expression
// Helper(x), the compiler will pick the first version if x can be
@@ -7762,25 +8624,20 @@ class ImplicitlyConvertible {
// We have to put the 'public' section after the 'private' section,
// or MSVC refuses to compile the code.
public:
- // MSVC warns about implicitly converting from double to int for
- // possible loss of data, so we need to temporarily disable the
- // warning.
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4244) // Temporarily disables warning 4244.
-
- static const bool value =
- sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
-# pragma warning(pop) // Restores the warning state.
-#elif defined(__BORLANDC__)
+#if defined(__BORLANDC__)
// C++Builder cannot use member overload resolution during template
// instantiation. The simplest workaround is to use its C++0x type traits
// functions (C++Builder 2009 and above only).
static const bool value = __is_convertible(From, To);
#else
+ // MSVC warns about implicitly converting from double to int for
+ // possible loss of data, so we need to temporarily disable the
+ // warning.
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
static const bool value =
sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
-#endif // _MSV_VER
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif // __BORLANDC__
};
template <typename From, typename To>
const bool ImplicitlyConvertible<From, To>::value;
@@ -7906,11 +8763,10 @@ void CopyArray(const T* from, size_t size, U* to) {
// The relation between an NativeArray object (see below) and the
// native array it represents.
-enum RelationToSource {
- kReference, // The NativeArray references the native array.
- kCopy // The NativeArray makes a copy of the native array and
- // owns the copy.
-};
+// We use 2 different structs to allow non-copyable types to be used, as long
+// as RelationToSourceReference() is passed.
+struct RelationToSourceReference {};
+struct RelationToSourceCopy {};
// Adapts a native array to a read-only STL-style container. Instead
// of the complete STL container concept, this adaptor only implements
@@ -7928,22 +8784,23 @@ class NativeArray {
typedef Element* iterator;
typedef const Element* const_iterator;
- // Constructs from a native array.
- NativeArray(const Element* array, size_t count, RelationToSource relation) {
- Init(array, count, relation);
+ // Constructs from a native array. References the source.
+ NativeArray(const Element* array, size_t count, RelationToSourceReference) {
+ InitRef(array, count);
+ }
+
+ // Constructs from a native array. Copies the source.
+ NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
+ InitCopy(array, count);
}
// Copy constructor.
NativeArray(const NativeArray& rhs) {
- Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
+ (this->*rhs.clone_)(rhs.array_, rhs.size_);
}
~NativeArray() {
- // Ensures that the user doesn't instantiate NativeArray with a
- // const or reference type.
- static_cast<void>(StaticAssertTypeEqHelper<Element,
- GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
- if (relation_to_source_ == kCopy)
+ if (clone_ != &NativeArray::InitRef)
delete[] array_;
}
@@ -7957,23 +8814,30 @@ class NativeArray {
}
private:
- // Initializes this object; makes a copy of the input array if
- // 'relation' is kCopy.
- void Init(const Element* array, size_t a_size, RelationToSource relation) {
- if (relation == kReference) {
- array_ = array;
- } else {
- Element* const copy = new Element[a_size];
- CopyArray(array, a_size, copy);
- array_ = copy;
- }
+ enum {
+ kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
+ Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
+ };
+
+ // Initializes this object with a copy of the input.
+ void InitCopy(const Element* array, size_t a_size) {
+ Element* const copy = new Element[a_size];
+ CopyArray(array, a_size, copy);
+ array_ = copy;
+ size_ = a_size;
+ clone_ = &NativeArray::InitCopy;
+ }
+
+ // Initializes this object with a reference of the input.
+ void InitRef(const Element* array, size_t a_size) {
+ array_ = array;
size_ = a_size;
- relation_to_source_ = relation;
+ clone_ = &NativeArray::InitRef;
}
const Element* array_;
size_t size_;
- RelationToSource relation_to_source_;
+ void (NativeArray::*clone_)(const Element*, size_t);
GTEST_DISALLOW_ASSIGN_(NativeArray);
};
@@ -8108,6 +8972,7 @@ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
::test_info_ =\
::testing::internal::MakeAndRegisterTestInfo(\
#test_case_name, #test_name, NULL, NULL, \
+ ::testing::internal::CodeLocation(__FILE__, __LINE__), \
(parent_id), \
parent_class::SetUpTestCase, \
parent_class::TearDownTestCase, \
@@ -8116,6 +8981,7 @@ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+
// Copyright 2005, Google Inc.
// All rights reserved.
//
@@ -8952,7 +9818,10 @@ TEST_P(DerivedTest, DoesBlah) {
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
+#include <ctype.h>
+
#include <iterator>
+#include <set>
#include <utility>
#include <vector>
@@ -9070,7 +9939,12 @@ class linked_ptr_internal {
MutexLock lock(&g_linked_ptr_mutex);
linked_ptr_internal const* p = ptr;
- while (p->next_ != ptr) p = p->next_;
+ while (p->next_ != ptr) {
+ assert(p->next_ != this &&
+ "Trying to join() a linked ring we are already in. "
+ "Is GMock thread safety enabled?");
+ p = p->next_;
+ }
p->next_ = this;
next_ = ptr;
}
@@ -9083,7 +9957,12 @@ class linked_ptr_internal {
if (next_ == this) return true;
linked_ptr_internal const* p = next_;
- while (p->next_ != this) p = p->next_;
+ while (p->next_ != this) {
+ assert(p->next_ != next_ &&
+ "Trying to depart() a linked ring we are not in. "
+ "Is GMock thread safety enabled?");
+ p = p->next_;
+ }
p->next_ = next_;
return false;
}
@@ -9294,6 +10173,10 @@ linked_ptr<T> make_linked_ptr(T* ptr) {
#include <utility>
#include <vector>
+#if GTEST_HAS_STD_TUPLE_
+# include <tuple>
+#endif
+
namespace testing {
// Definitions in the 'internal' and 'internal2' name spaces are
@@ -9441,6 +10324,103 @@ void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
namespace testing {
namespace internal {
+// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
+// value of type ToPrint that is an operand of a comparison assertion
+// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
+// the comparison, and is used to help determine the best way to
+// format the value. In particular, when the value is a C string
+// (char pointer) and the other operand is an STL string object, we
+// want to format the C string as a string, since we know it is
+// compared by value with the string object. If the value is a char
+// pointer but the other operand is not an STL string object, we don't
+// know whether the pointer is supposed to point to a NUL-terminated
+// string, and thus want to print it as a pointer to be safe.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
+// The default case.
+template <typename ToPrint, typename OtherOperand>
+class FormatForComparison {
+ public:
+ static ::std::string Format(const ToPrint& value) {
+ return ::testing::PrintToString(value);
+ }
+};
+
+// Array.
+template <typename ToPrint, size_t N, typename OtherOperand>
+class FormatForComparison<ToPrint[N], OtherOperand> {
+ public:
+ static ::std::string Format(const ToPrint* value) {
+ return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
+ }
+};
+
+// By default, print C string as pointers to be safe, as we don't know
+// whether they actually point to a NUL-terminated string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
+ template <typename OtherOperand> \
+ class FormatForComparison<CharType*, OtherOperand> { \
+ public: \
+ static ::std::string Format(CharType* value) { \
+ return ::testing::PrintToString(static_cast<const void*>(value)); \
+ } \
+ }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
+
+// If a C string is compared with an STL string object, we know it's meant
+// to point to a NUL-terminated string, and thus can print it as a string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
+ template <> \
+ class FormatForComparison<CharType*, OtherStringType> { \
+ public: \
+ static ::std::string Format(CharType* value) { \
+ return ::testing::PrintToString(value); \
+ } \
+ }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
+
+#if GTEST_HAS_GLOBAL_STRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
+#endif
+
+#if GTEST_HAS_GLOBAL_WSTRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
+#endif
+
+#if GTEST_HAS_STD_WSTRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
+#endif
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
+
+// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
+// operand to be used in a failure message. The type (but not value)
+// of the other operand may affect the format. This allows us to
+// print a char* as a raw pointer when it is compared against another
+// char* or void*, and print it as a C string when it is compared
+// against an std::string object, for example.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+template <typename T1, typename T2>
+std::string FormatForComparisonFailureMessage(
+ const T1& value, const T2& /* other_operand */) {
+ return FormatForComparison<T1, T2>::Format(value);
+}
+
// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
// value to the given ostream. The caller must ensure that
// 'ostream_ptr' is not NULL, or the behavior is undefined.
@@ -9671,14 +10651,16 @@ inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
}
#endif // GTEST_HAS_STD_WSTRING
-#if GTEST_HAS_TR1_TUPLE
-// Overload for ::std::tr1::tuple. Needed for printing function arguments,
-// which are packed as tuples.
-
+#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
// Helper function for printing a tuple. T must be instantiated with
// a tuple type.
template <typename T>
void PrintTupleTo(const T& t, ::std::ostream* os);
+#endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+
+#if GTEST_HAS_TR1_TUPLE
+// Overload for ::std::tr1::tuple. Needed for printing function arguments,
+// which are packed as tuples.
// Overloaded PrintTo() for tuples of various arities. We support
// tuples of up-to 10 fields. The following implementation works
@@ -9752,6 +10734,13 @@ void PrintTo(
}
#endif // GTEST_HAS_TR1_TUPLE
+#if GTEST_HAS_STD_TUPLE_
+template <typename... Types>
+void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
+ PrintTupleTo(t, os);
+}
+#endif // GTEST_HAS_STD_TUPLE_
+
// Overload for std::pair.
template <typename T1, typename T2>
void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
@@ -9771,10 +10760,7 @@ class UniversalPrinter {
public:
// MSVC warns about adding const to a function type, so we want to
// disable the warning.
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4180) // Temporarily disables warning 4180.
-#endif // _MSC_VER
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
// Note: we deliberately don't call this PrintTo(), as that name
// conflicts with ::testing::internal::PrintTo in the body of the
@@ -9791,9 +10777,7 @@ class UniversalPrinter {
PrintTo(value, os);
}
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif // _MSC_VER
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
};
// UniversalPrintArray(begin, len, os) prints an array of 'len'
@@ -9845,10 +10829,7 @@ class UniversalPrinter<T&> {
public:
// MSVC warns about adding const to a function type, so we want to
// disable the warning.
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4180) // Temporarily disables warning 4180.
-#endif // _MSC_VER
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
static void Print(const T& value, ::std::ostream* os) {
// Prints the address of the value. We use reinterpret_cast here
@@ -9859,9 +10840,7 @@ class UniversalPrinter<T&> {
UniversalPrint(value, os);
}
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif // _MSC_VER
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
};
// Prints a value tersely: for a reference type, the referenced value
@@ -9947,16 +10926,65 @@ void UniversalPrint(const T& value, ::std::ostream* os) {
UniversalPrinter<T1>::Print(value, os);
}
-#if GTEST_HAS_TR1_TUPLE
typedef ::std::vector<string> Strings;
+// TuplePolicy<TupleT> must provide:
+// - tuple_size
+// size of tuple TupleT.
+// - get<size_t I>(const TupleT& t)
+// static function extracting element I of tuple TupleT.
+// - tuple_element<size_t I>::type
+// type of element I of tuple TupleT.
+template <typename TupleT>
+struct TuplePolicy;
+
+#if GTEST_HAS_TR1_TUPLE
+template <typename TupleT>
+struct TuplePolicy {
+ typedef TupleT Tuple;
+ static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
+
+ template <size_t I>
+ struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
+
+ template <size_t I>
+ static typename AddReference<
+ const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
+ const Tuple& tuple) {
+ return ::std::tr1::get<I>(tuple);
+ }
+};
+template <typename TupleT>
+const size_t TuplePolicy<TupleT>::tuple_size;
+#endif // GTEST_HAS_TR1_TUPLE
+
+#if GTEST_HAS_STD_TUPLE_
+template <typename... Types>
+struct TuplePolicy< ::std::tuple<Types...> > {
+ typedef ::std::tuple<Types...> Tuple;
+ static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
+
+ template <size_t I>
+ struct tuple_element : ::std::tuple_element<I, Tuple> {};
+
+ template <size_t I>
+ static const typename ::std::tuple_element<I, Tuple>::type& get(
+ const Tuple& tuple) {
+ return ::std::get<I>(tuple);
+ }
+};
+template <typename... Types>
+const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
+#endif // GTEST_HAS_STD_TUPLE_
+
+#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
// This helper template allows PrintTo() for tuples and
// UniversalTersePrintTupleFieldsToStrings() to be defined by
// induction on the number of tuple fields. The idea is that
// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
// fields in tuple t, and can be defined in terms of
// TuplePrefixPrinter<N - 1>.
-
+//
// The inductive case.
template <size_t N>
struct TuplePrefixPrinter {
@@ -9964,9 +10992,14 @@ struct TuplePrefixPrinter {
template <typename Tuple>
static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
- *os << ", ";
- UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
- ::Print(::std::tr1::get<N - 1>(t), os);
+ GTEST_INTENTIONAL_CONST_COND_PUSH_()
+ if (N > 1) {
+ GTEST_INTENTIONAL_CONST_COND_POP_()
+ *os << ", ";
+ }
+ UniversalPrinter<
+ typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
+ ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
}
// Tersely prints the first N fields of a tuple to a string vector,
@@ -9975,12 +11008,12 @@ struct TuplePrefixPrinter {
static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
::std::stringstream ss;
- UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
+ UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
strings->push_back(ss.str());
}
};
-// Base cases.
+// Base case.
template <>
struct TuplePrefixPrinter<0> {
template <typename Tuple>
@@ -9989,34 +11022,13 @@ struct TuplePrefixPrinter<0> {
template <typename Tuple>
static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
};
-// We have to specialize the entire TuplePrefixPrinter<> class
-// template here, even though the definition of
-// TersePrintPrefixToStrings() is the same as the generic version, as
-// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
-// support specializing a method template of a class template.
-template <>
-struct TuplePrefixPrinter<1> {
- template <typename Tuple>
- static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
- UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
- Print(::std::tr1::get<0>(t), os);
- }
-
- template <typename Tuple>
- static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
- ::std::stringstream ss;
- UniversalTersePrint(::std::tr1::get<0>(t), &ss);
- strings->push_back(ss.str());
- }
-};
-// Helper function for printing a tuple. T must be instantiated with
-// a tuple type.
-template <typename T>
-void PrintTupleTo(const T& t, ::std::ostream* os) {
+// Helper function for printing a tuple.
+// Tuple must be either std::tr1::tuple or std::tuple type.
+template <typename Tuple>
+void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
*os << "(";
- TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
- PrintPrefixTo(t, os);
+ TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
*os << ")";
}
@@ -10026,11 +11038,11 @@ void PrintTupleTo(const T& t, ::std::ostream* os) {
template <typename Tuple>
Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
Strings result;
- TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
+ TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
TersePrintPrefixToStrings(value, &result);
return result;
}
-#endif // GTEST_HAS_TR1_TUPLE
+#endif // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
} // namespace internal
@@ -10043,11 +11055,78 @@ template <typename T>
} // namespace testing
+// Include any custom printer added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// This file provides an injection point for custom printers in a local
+// installation of gTest.
+// It will be included from gtest-printers.h and the overrides in this file
+// will be visible to everyone.
+// See documentation at gtest/gtest-printers.h for details on how to define a
+// custom printer.
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+
+#endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+
#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
#if GTEST_HAS_PARAM_TEST
namespace testing {
+
+// Input to a parameterized test name generator, describing a test parameter.
+// Consists of the parameter value and the integer parameter index.
+template <class ParamType>
+struct TestParamInfo {
+ TestParamInfo(const ParamType& a_param, size_t an_index) :
+ param(a_param),
+ index(an_index) {}
+ ParamType param;
+ size_t index;
+};
+
+// A builtin parameterized test name generator which returns the result of
+// testing::PrintToString.
+struct PrintToStringParamName {
+ template <class ParamType>
+ std::string operator()(const TestParamInfo<ParamType>& info) const {
+ return PrintToString(info.param);
+ }
+};
+
namespace internal {
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
@@ -10057,7 +11136,7 @@ namespace internal {
// TEST_P macro is used to define two tests with the same name
// but in different namespaces.
GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
- const char* file, int line);
+ CodeLocation code_location);
template <typename> class ParamGeneratorInterface;
template <typename> class ParamGenerator;
@@ -10205,7 +11284,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> {
return base_;
}
virtual void Advance() {
- value_ = value_ + step_;
+ value_ = static_cast<T>(value_ + step_);
index_++;
}
virtual ParamIteratorInterface<T>* Clone() const {
@@ -10242,7 +11321,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> {
const T& end,
const IncrementT& step) {
int end_index = 0;
- for (T i = begin; i < end; i = i + step)
+ for (T i = begin; i < end; i = static_cast<T>(i + step))
end_index++;
return end_index;
}
@@ -10346,6 +11425,37 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
//
+// Default parameterized test name generator, returns a string containing the
+// integer test parameter index.
+template <class ParamType>
+std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
+ Message name_stream;
+ name_stream << info.index;
+ return name_stream.GetString();
+}
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Parameterized test name overload helpers, which help the
+// INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
+// test name generator and user param name generator.
+template <class ParamType, class ParamNameGenFunctor>
+ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
+ return func;
+}
+
+template <class ParamType>
+struct ParamNameGenFunc {
+ typedef std::string Type(const TestParamInfo<ParamType>&);
+};
+
+template <class ParamType>
+typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
+ return DefaultParamName;
+}
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
// Stores a parameter value and later creates tests parameterized with that
// value.
template <class TestClass>
@@ -10448,9 +11558,11 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
typedef typename TestCase::ParamType ParamType;
// A function that returns an instance of appropriate generator type.
typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
+ typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
- explicit ParameterizedTestCaseInfo(const char* name)
- : test_case_name_(name) {}
+ explicit ParameterizedTestCaseInfo(
+ const char* name, CodeLocation code_location)
+ : test_case_name_(name), code_location_(code_location) {}
// Test case base name for display purposes.
virtual const string& GetTestCaseName() const { return test_case_name_; }
@@ -10473,9 +11585,11 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
// about a generator.
int AddTestCaseInstantiation(const string& instantiation_name,
GeneratorCreationFunc* func,
- const char* /* file */,
- int /* line */) {
- instantiations_.push_back(::std::make_pair(instantiation_name, func));
+ ParamNameGeneratorFunc* name_func,
+ const char* file,
+ int line) {
+ instantiations_.push_back(
+ InstantiationInfo(instantiation_name, func, name_func, file, line));
return 0; // Return value used only to run this method in namespace scope.
}
// UnitTest class invokes this method to register tests in this test case
@@ -10490,25 +11604,45 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
for (typename InstantiationContainer::iterator gen_it =
instantiations_.begin(); gen_it != instantiations_.end();
++gen_it) {
- const string& instantiation_name = gen_it->first;
- ParamGenerator<ParamType> generator((*gen_it->second)());
+ const string& instantiation_name = gen_it->name;
+ ParamGenerator<ParamType> generator((*gen_it->generator)());
+ ParamNameGeneratorFunc* name_func = gen_it->name_func;
+ const char* file = gen_it->file;
+ int line = gen_it->line;
string test_case_name;
if ( !instantiation_name.empty() )
test_case_name = instantiation_name + "/";
test_case_name += test_info->test_case_base_name;
- int i = 0;
+ size_t i = 0;
+ std::set<std::string> test_param_names;
for (typename ParamGenerator<ParamType>::iterator param_it =
generator.begin();
param_it != generator.end(); ++param_it, ++i) {
Message test_name_stream;
- test_name_stream << test_info->test_base_name << "/" << i;
+
+ std::string param_name = name_func(
+ TestParamInfo<ParamType>(*param_it, i));
+
+ GTEST_CHECK_(IsValidParamName(param_name))
+ << "Parameterized test name '" << param_name
+ << "' is invalid, in " << file
+ << " line " << line << std::endl;
+
+ GTEST_CHECK_(test_param_names.count(param_name) == 0)
+ << "Duplicate parameterized test name '" << param_name
+ << "', in " << file << " line " << line << std::endl;
+
+ test_param_names.insert(param_name);
+
+ test_name_stream << test_info->test_base_name << "/" << param_name;
MakeAndRegisterTestInfo(
test_case_name.c_str(),
test_name_stream.GetString().c_str(),
NULL, // No type parameter.
PrintToString(*param_it).c_str(),
+ code_location_,
GetTestCaseTypeId(),
TestCase::SetUpTestCase,
TestCase::TearDownTestCase,
@@ -10534,12 +11668,45 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
};
typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
- // Keeps pairs of <Instantiation name, Sequence generator creation function>
- // received from INSTANTIATE_TEST_CASE_P macros.
- typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
- InstantiationContainer;
+ // Records data received from INSTANTIATE_TEST_CASE_P macros:
+ // <Instantiation name, Sequence generator creation function,
+ // Name generator function, Source file, Source line>
+ struct InstantiationInfo {
+ InstantiationInfo(const std::string &name_in,
+ GeneratorCreationFunc* generator_in,
+ ParamNameGeneratorFunc* name_func_in,
+ const char* file_in,
+ int line_in)
+ : name(name_in),
+ generator(generator_in),
+ name_func(name_func_in),
+ file(file_in),
+ line(line_in) {}
+
+ std::string name;
+ GeneratorCreationFunc* generator;
+ ParamNameGeneratorFunc* name_func;
+ const char* file;
+ int line;
+ };
+ typedef ::std::vector<InstantiationInfo> InstantiationContainer;
+
+ static bool IsValidParamName(const std::string& name) {
+ // Check for empty string
+ if (name.empty())
+ return false;
+
+ // Check for invalid characters
+ for (std::string::size_type index = 0; index < name.size(); ++index) {
+ if (!isalnum(name[index]) && name[index] != '_')
+ return false;
+ }
+
+ return true;
+ }
const string test_case_name_;
+ CodeLocation code_location_;
TestInfoContainer tests_;
InstantiationContainer instantiations_;
@@ -10567,8 +11734,7 @@ class ParameterizedTestCaseRegistry {
template <class TestCase>
ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
const char* test_case_name,
- const char* file,
- int line) {
+ CodeLocation code_location) {
ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
it != test_case_infos_.end(); ++it) {
@@ -10577,7 +11743,7 @@ class ParameterizedTestCaseRegistry {
// Complain about incorrect usage of Google Test facilities
// and terminate the program since we cannot guaranty correct
// test case setup and tear-down in this case.
- ReportInvalidTestCaseType(test_case_name, file, line);
+ ReportInvalidTestCaseType(test_case_name, code_location);
posix::Abort();
} else {
// At this point we are sure that the object we found is of the same
@@ -10590,7 +11756,8 @@ class ParameterizedTestCaseRegistry {
}
}
if (typed_test_info == NULL) {
- typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
+ typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
+ test_case_name, code_location);
test_case_infos_.push_back(typed_test_info);
}
return typed_test_info;
@@ -10658,7 +11825,7 @@ class ParameterizedTestCaseRegistry {
// and at most 10 arguments in Combine. Please contact
// googletestframework@googlegroups.com if you need more.
// Please note that the number of arguments to Combine is limited
-// by the maximum arity of the implementation of tr1::tuple which is
+// by the maximum arity of the implementation of tuple which is
// currently set at 10.
#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
@@ -10695,7 +11862,10 @@ class ValueArray1 {
explicit ValueArray1(T1 v1) : v1_(v1) {}
template <typename T>
- operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
+ operator ParamGenerator<T>() const {
+ const T array[] = {static_cast<T>(v1_)};
+ return ValuesIn(array);
+ }
private:
// No implementation - assignment is unsupported.
@@ -13773,9 +14943,9 @@ class ValueArray50 {
//
template <typename T1, typename T2>
class CartesianProductGenerator2
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
public:
- typedef ::std::tr1::tuple<T1, T2> ParamType;
+ typedef ::testing::tuple<T1, T2> ParamType;
CartesianProductGenerator2(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2)
@@ -13888,9 +15058,9 @@ class CartesianProductGenerator2
template <typename T1, typename T2, typename T3>
class CartesianProductGenerator3
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
+ typedef ::testing::tuple<T1, T2, T3> ParamType;
CartesianProductGenerator3(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
@@ -14020,9 +15190,9 @@ class CartesianProductGenerator3
template <typename T1, typename T2, typename T3, typename T4>
class CartesianProductGenerator4
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
+ typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
CartesianProductGenerator4(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -14171,9 +15341,9 @@ class CartesianProductGenerator4
template <typename T1, typename T2, typename T3, typename T4, typename T5>
class CartesianProductGenerator5
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
+ typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
CartesianProductGenerator5(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -14339,10 +15509,10 @@ class CartesianProductGenerator5
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
class CartesianProductGenerator6
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
T6> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
+ typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
CartesianProductGenerator6(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -14525,10 +15695,10 @@ class CartesianProductGenerator6
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
class CartesianProductGenerator7
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
T7> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
+ typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
CartesianProductGenerator7(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -14728,10 +15898,10 @@ class CartesianProductGenerator7
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
class CartesianProductGenerator8
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
T7, T8> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
+ typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
CartesianProductGenerator8(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -14950,10 +16120,10 @@ class CartesianProductGenerator8
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
class CartesianProductGenerator9
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
T7, T8, T9> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
+ typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
CartesianProductGenerator9(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -15189,10 +16359,10 @@ class CartesianProductGenerator9
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
class CartesianProductGenerator10
- : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
T7, T8, T9, T10> > {
public:
- typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
+ typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
CartesianProductGenerator10(const ParamGenerator<T1>& g1,
const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -15454,8 +16624,8 @@ class CartesianProductHolder2 {
CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
: g1_(g1), g2_(g2) {}
template <typename T1, typename T2>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
+ operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
+ return ParamGenerator< ::testing::tuple<T1, T2> >(
new CartesianProductGenerator2<T1, T2>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_)));
@@ -15476,8 +16646,8 @@ CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
const Generator3& g3)
: g1_(g1), g2_(g2), g3_(g3) {}
template <typename T1, typename T2, typename T3>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
+ operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
+ return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
new CartesianProductGenerator3<T1, T2, T3>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -15501,8 +16671,8 @@ CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
const Generator3& g3, const Generator4& g4)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
template <typename T1, typename T2, typename T3, typename T4>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
+ operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
+ return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
new CartesianProductGenerator4<T1, T2, T3, T4>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -15528,8 +16698,8 @@ CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
const Generator3& g3, const Generator4& g4, const Generator5& g5)
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
+ operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
+ return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -15559,8 +16729,8 @@ CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
+ operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
+ return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -15592,9 +16762,9 @@ CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
: g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+ operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
T7> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
+ return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -15630,9 +16800,9 @@ CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
g8_(g8) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
+ operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
T8> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
+ return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
static_cast<ParamGenerator<T1> >(g1_),
static_cast<ParamGenerator<T2> >(g2_),
@@ -15671,9 +16841,9 @@ CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
g9_(g9) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+ return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
T9> >(
new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
static_cast<ParamGenerator<T1> >(g1_),
@@ -15715,10 +16885,10 @@ CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
g9_(g9), g10_(g10) {}
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
- operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9, T10> >() const {
- return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
- T9, T10> >(
+ operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+ T10> >() const {
+ return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+ T10> >(
new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
T10>(
static_cast<ParamGenerator<T1> >(g1_),
@@ -16953,14 +18123,17 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
static int AddToRegistry() { \
::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
GetTestCasePatternHolder<test_case_name>(\
- #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
- #test_case_name, \
- #test_name, \
- new ::testing::internal::TestMetaFactory< \
- GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
+ #test_case_name, \
+ ::testing::internal::CodeLocation(\
+ __FILE__, __LINE__))->AddTestPattern(\
+ #test_case_name, \
+ #test_name, \
+ new ::testing::internal::TestMetaFactory< \
+ GTEST_TEST_CLASS_NAME_(\
+ test_case_name, test_name)>()); \
return 0; \
} \
- static int gtest_registering_dummy_; \
+ static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
GTEST_DISALLOW_COPY_AND_ASSIGN_(\
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
}; \
@@ -16969,16 +18142,36 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
-# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
+// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
+// to specify a function or functor that generates custom test name suffixes
+// based on the test parameters. The function should accept one argument of
+// type testing::TestParamInfo<class ParamType>, and return std::string.
+//
+// testing::PrintToStringParamName is a builtin test suffix generator that
+// returns the value of testing::PrintToString(GetParam()). It does not work
+// for std::string or C strings.
+//
+// Note: test names must be non-empty, unique, and may only contain ASCII
+// alphanumeric characters or underscore.
+
+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
::testing::internal::ParamGenerator<test_case_name::ParamType> \
gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
- int gtest_##prefix##test_case_name##_dummy_ = \
+ ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
+ const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
+ return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
+ (__VA_ARGS__)(info); \
+ } \
+ int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
GetTestCasePatternHolder<test_case_name>(\
- #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
- #prefix, \
- &gtest_##prefix##test_case_name##_EvalGenerator_, \
- __FILE__, __LINE__)
+ #test_case_name, \
+ ::testing::internal::CodeLocation(\
+ __FILE__, __LINE__))->AddTestCaseInstantiation(\
+ #prefix, \
+ &gtest_##prefix##test_case_name##_EvalGenerator_, \
+ &gtest_##prefix##test_case_name##_EvalGenerateName_, \
+ __FILE__, __LINE__)
} // namespace testing
@@ -17401,7 +18594,8 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
::testing::internal::TemplateSel< \
GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
GTEST_TYPE_PARAMS_(CaseName)>::Register(\
- "", #CaseName, #TestName, 0); \
+ "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+ #CaseName, #TestName, 0); \
template <typename gtest_TypeParam_> \
void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
@@ -17472,7 +18666,10 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
::testing::internal::TypeParameterizedTestCase<CaseName, \
GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
::testing::internal::TypeList< Types >::type>::Register(\
- #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
+ #Prefix, \
+ ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+ &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), \
+ #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
#endif // GTEST_HAS_TYPED_TEST_P
@@ -17483,14 +18680,14 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
// class ::string, which has the same interface as ::std::string, but
// has a different implementation.
//
-// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
+// You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
// ::string is available AND is a distinct type to ::std::string, or
// define it to 0 to indicate otherwise.
//
-// If the user's ::std::string and ::string are the same class due to
-// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
+// If ::std::string and ::string are the same class on your platform
+// due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
//
-// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
+// If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
// heuristically.
namespace testing {
@@ -17671,8 +18868,31 @@ class GTEST_API_ AssertionResult {
// Copy constructor.
// Used in EXPECT_TRUE/FALSE(assertion_result).
AssertionResult(const AssertionResult& other);
+
+ GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
+
// Used in the EXPECT_TRUE/FALSE(bool_expression).
- explicit AssertionResult(bool success) : success_(success) {}
+ //
+ // T must be contextually convertible to bool.
+ //
+ // The second parameter prevents this overload from being considered if
+ // the argument is implicitly convertible to AssertionResult. In that case
+ // we want AssertionResult's copy constructor to be used.
+ template <typename T>
+ explicit AssertionResult(
+ const T& success,
+ typename internal::EnableIf<
+ !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
+ /*enabler*/ = NULL)
+ : success_(success) {}
+
+ GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+ // Assignment operator.
+ AssertionResult& operator=(AssertionResult other) {
+ swap(other);
+ return *this;
+ }
// Returns true iff the assertion succeeded.
operator bool() const { return success_; } // NOLINT
@@ -17713,6 +18933,9 @@ class GTEST_API_ AssertionResult {
message_->append(a_message.GetString().c_str());
}
+ // Swap the contents of this AssertionResult with other.
+ void swap(AssertionResult& other);
+
// Stores result of the assertion predicate.
bool success_;
// Stores the message describing the condition in case the expectation
@@ -17720,8 +18943,6 @@ class GTEST_API_ AssertionResult {
// Referenced via a pointer to avoid taking too much stack frame space
// with test assertions.
internal::scoped_ptr< ::std::string> message_;
-
- GTEST_DISALLOW_ASSIGN_(AssertionResult);
};
// Makes a successful assertion result.
@@ -17748,8 +18969,8 @@ GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
//
// class FooTest : public testing::Test {
// protected:
-// virtual void SetUp() { ... }
-// virtual void TearDown() { ... }
+// void SetUp() override { ... }
+// void TearDown() override { ... }
// ...
// };
//
@@ -17841,20 +19062,19 @@ class GTEST_API_ Test {
// internal method to avoid clashing with names used in user TESTs.
void DeleteSelf_() { delete this; }
- // Uses a GTestFlagSaver to save and restore all Google Test flags.
- const internal::GTestFlagSaver* const gtest_flag_saver_;
+ const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
- // Often a user mis-spells SetUp() as Setup() and spends a long time
+ // Often a user misspells SetUp() as Setup() and spends a long time
// wondering why it is never called by Google Test. The declaration of
// the following method is solely for catching such an error at
// compile time:
//
// - The return type is deliberately chosen to be not void, so it
- // will be a conflict if a user declares void Setup() in his test
- // fixture.
+ // will be a conflict if void Setup() is declared in the user's
+ // test fixture.
//
// - This method is private, so it will be another compiler error
- // if a user calls it from his test fixture.
+ // if the method is called from the user's test fixture.
//
// DO NOT OVERRIDE THIS FUNCTION.
//
@@ -18059,6 +19279,12 @@ class GTEST_API_ TestInfo {
return NULL;
}
+ // Returns the file name where this test is defined.
+ const char* file() const { return location_.file.c_str(); }
+
+ // Returns the line where this test is defined.
+ int line() const { return location_.line; }
+
// Returns true if this test should run, that is if the test is not
// disabled (or it is disabled but the also_run_disabled_tests flag has
// been specified) and its full name matches the user-specified filter.
@@ -18101,6 +19327,7 @@ class GTEST_API_ TestInfo {
const char* name,
const char* type_param,
const char* value_param,
+ internal::CodeLocation code_location,
internal::TypeId fixture_class_id,
Test::SetUpTestCaseFunc set_up_tc,
Test::TearDownTestCaseFunc tear_down_tc,
@@ -18112,6 +19339,7 @@ class GTEST_API_ TestInfo {
const std::string& name,
const char* a_type_param, // NULL if not a type-parameterized test
const char* a_value_param, // NULL if not a value-parameterized test
+ internal::CodeLocation a_code_location,
internal::TypeId fixture_class_id,
internal::TestFactoryBase* factory);
@@ -18138,6 +19366,7 @@ class GTEST_API_ TestInfo {
// Text representation of the value parameter, or NULL if this is not a
// value-parameterized test.
const internal::scoped_ptr<const ::std::string> value_param_;
+ internal::CodeLocation location_;
const internal::TypeId fixture_class_id_; // ID of the test fixture class
bool should_run_; // True iff this test should run
bool is_disabled_; // True iff this test is disabled
@@ -18337,7 +19566,7 @@ class GTEST_API_ TestCase {
};
// An Environment object is capable of setting up and tearing down an
-// environment. The user should subclass this to define his own
+// environment. You should subclass this to define your own
// environment(s).
//
// An Environment object does the set-up and tear-down in virtual
@@ -18749,137 +19978,42 @@ GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
namespace internal {
-// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
-// value of type ToPrint that is an operand of a comparison assertion
-// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
-// the comparison, and is used to help determine the best way to
-// format the value. In particular, when the value is a C string
-// (char pointer) and the other operand is an STL string object, we
-// want to format the C string as a string, since we know it is
-// compared by value with the string object. If the value is a char
-// pointer but the other operand is not an STL string object, we don't
-// know whether the pointer is supposed to point to a NUL-terminated
-// string, and thus want to print it as a pointer to be safe.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-
-// The default case.
-template <typename ToPrint, typename OtherOperand>
-class FormatForComparison {
- public:
- static ::std::string Format(const ToPrint& value) {
- return ::testing::PrintToString(value);
- }
-};
-
-// Array.
-template <typename ToPrint, size_t N, typename OtherOperand>
-class FormatForComparison<ToPrint[N], OtherOperand> {
- public:
- static ::std::string Format(const ToPrint* value) {
- return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
- }
-};
-
-// By default, print C string as pointers to be safe, as we don't know
-// whether they actually point to a NUL-terminated string.
-
-#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
- template <typename OtherOperand> \
- class FormatForComparison<CharType*, OtherOperand> { \
- public: \
- static ::std::string Format(CharType* value) { \
- return ::testing::PrintToString(static_cast<const void*>(value)); \
- } \
- }
-
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
-
-#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
-
-// If a C string is compared with an STL string object, we know it's meant
-// to point to a NUL-terminated string, and thus can print it as a string.
-
-#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
- template <> \
- class FormatForComparison<CharType*, OtherStringType> { \
- public: \
- static ::std::string Format(CharType* value) { \
- return ::testing::PrintToString(value); \
- } \
- }
-
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
-
-#if GTEST_HAS_GLOBAL_STRING
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
-#endif
-
-#if GTEST_HAS_GLOBAL_WSTRING
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
-#endif
-
-#if GTEST_HAS_STD_WSTRING
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
-#endif
-
-#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
-
-// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
-// operand to be used in a failure message. The type (but not value)
-// of the other operand may affect the format. This allows us to
-// print a char* as a raw pointer when it is compared against another
-// char* or void*, and print it as a C string when it is compared
-// against an std::string object, for example.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+// Separate the error generating code from the code path to reduce the stack
+// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
+// when calling EXPECT_* in a tight loop.
template <typename T1, typename T2>
-std::string FormatForComparisonFailureMessage(
- const T1& value, const T2& /* other_operand */) {
- return FormatForComparison<T1, T2>::Format(value);
+AssertionResult CmpHelperEQFailure(const char* lhs_expression,
+ const char* rhs_expression,
+ const T1& lhs, const T2& rhs) {
+ return EqFailure(lhs_expression,
+ rhs_expression,
+ FormatForComparisonFailureMessage(lhs, rhs),
+ FormatForComparisonFailureMessage(rhs, lhs),
+ false);
}
// The helper function for {ASSERT|EXPECT}_EQ.
template <typename T1, typename T2>
-AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual) {
-#ifdef _MSC_VER
-# pragma warning(push) // Saves the current warning state.
-# pragma warning(disable:4389) // Temporarily disables warning on
- // signed/unsigned mismatch.
-#endif
-
- if (expected == actual) {
+AssertionResult CmpHelperEQ(const char* lhs_expression,
+ const char* rhs_expression,
+ const T1& lhs,
+ const T2& rhs) {
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
+ if (lhs == rhs) {
return AssertionSuccess();
}
+GTEST_DISABLE_MSC_WARNINGS_POP_()
-#ifdef _MSC_VER
-# pragma warning(pop) // Restores the warning state.
-#endif
-
- return EqFailure(expected_expression,
- actual_expression,
- FormatForComparisonFailureMessage(expected, actual),
- FormatForComparisonFailureMessage(actual, expected),
- false);
+ return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
}
// With this overloaded version, we allow anonymous enums to be used
// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
// can be implicitly cast to BiggestInt.
-GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual);
+GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
+ const char* rhs_expression,
+ BiggestInt lhs,
+ BiggestInt rhs);
// The helper class for {ASSERT|EXPECT}_EQ. The template argument
// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
@@ -18890,12 +20024,11 @@ class EqHelper {
public:
// This templatized version is for the general case.
template <typename T1, typename T2>
- static AssertionResult Compare(const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
+ static AssertionResult Compare(const char* lhs_expression,
+ const char* rhs_expression,
+ const T1& lhs,
+ const T2& rhs) {
+ return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
}
// With this overloaded version, we allow anonymous enums to be used
@@ -18904,12 +20037,11 @@ class EqHelper {
//
// Even though its body looks the same as the above version, we
// cannot merge the two, as it will make anonymous enums unhappy.
- static AssertionResult Compare(const char* expected_expression,
- const char* actual_expression,
- BiggestInt expected,
- BiggestInt actual) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
+ static AssertionResult Compare(const char* lhs_expression,
+ const char* rhs_expression,
+ BiggestInt lhs,
+ BiggestInt rhs) {
+ return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
}
};
@@ -18924,40 +20056,52 @@ class EqHelper<true> {
// EXPECT_EQ(false, a_bool).
template <typename T1, typename T2>
static AssertionResult Compare(
- const char* expected_expression,
- const char* actual_expression,
- const T1& expected,
- const T2& actual,
+ const char* lhs_expression,
+ const char* rhs_expression,
+ const T1& lhs,
+ const T2& rhs,
// The following line prevents this overload from being considered if T2
// is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr)
// expands to Compare("", "", NULL, my_ptr), which requires a conversion
// to match the Secret* in the other overload, which would otherwise make
// this template match better.
typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
- return CmpHelperEQ(expected_expression, actual_expression, expected,
- actual);
+ return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
}
// This version will be picked when the second argument to ASSERT_EQ() is a
// pointer, e.g. ASSERT_EQ(NULL, a_pointer).
template <typename T>
static AssertionResult Compare(
- const char* expected_expression,
- const char* actual_expression,
+ const char* lhs_expression,
+ const char* rhs_expression,
// We used to have a second template parameter instead of Secret*. That
// template parameter would deduce to 'long', making this a better match
// than the first overload even without the first overload's EnableIf.
// Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
// non-pointer argument" (even a deduced integral argument), so the old
// implementation caused warnings in user code.
- Secret* /* expected (NULL) */,
- T* actual) {
- // We already know that 'expected' is a null pointer.
- return CmpHelperEQ(expected_expression, actual_expression,
- static_cast<T*>(NULL), actual);
+ Secret* /* lhs (NULL) */,
+ T* rhs) {
+ // We already know that 'lhs' is a null pointer.
+ return CmpHelperEQ(lhs_expression, rhs_expression,
+ static_cast<T*>(NULL), rhs);
}
};
+// Separate the error generating code from the code path to reduce the stack
+// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
+// when calling EXPECT_OP in a tight loop.
+template <typename T1, typename T2>
+AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
+ const T1& val1, const T2& val2,
+ const char* op) {
+ return AssertionFailure()
+ << "Expected: (" << expr1 << ") " << op << " (" << expr2
+ << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
+ << " vs " << FormatForComparisonFailureMessage(val2, val1);
+}
+
// A macro for implementing the helper functions needed to implement
// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
// of similar code.
@@ -18968,6 +20112,7 @@ class EqHelper<true> {
// with gcc 4.
//
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
template <typename T1, typename T2>\
AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
@@ -18975,10 +20120,7 @@ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
if (val1 op val2) {\
return AssertionSuccess();\
} else {\
- return AssertionFailure() \
- << "Expected: (" << expr1 << ") " #op " (" << expr2\
- << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
- << " vs " << FormatForComparisonFailureMessage(val2, val1);\
+ return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
}\
}\
GTEST_API_ AssertionResult CmpHelper##op_name(\
@@ -19002,18 +20144,18 @@ GTEST_IMPL_CMP_HELPER_(GT, >);
// The helper function for {ASSERT|EXPECT}_STREQ.
//
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual);
+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
+ const char* s2_expression,
+ const char* s1,
+ const char* s2);
// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
//
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
- const char* actual_expression,
- const char* expected,
- const char* actual);
+GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
+ const char* s2_expression,
+ const char* s1,
+ const char* s2);
// The helper function for {ASSERT|EXPECT}_STRNE.
//
@@ -19035,10 +20177,10 @@ GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
// Helper function for *_STREQ on wide strings.
//
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
- const char* actual_expression,
- const wchar_t* expected,
- const wchar_t* actual);
+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
+ const char* s2_expression,
+ const wchar_t* s1,
+ const wchar_t* s2);
// Helper function for *_STRNE on wide strings.
//
@@ -19096,28 +20238,28 @@ namespace internal {
//
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
template <typename RawType>
-AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
- const char* actual_expression,
- RawType expected,
- RawType actual) {
- const FloatingPoint<RawType> lhs(expected), rhs(actual);
+AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
+ const char* rhs_expression,
+ RawType lhs_value,
+ RawType rhs_value) {
+ const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
if (lhs.AlmostEquals(rhs)) {
return AssertionSuccess();
}
- ::std::stringstream expected_ss;
- expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << expected;
+ ::std::stringstream lhs_ss;
+ lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+ << lhs_value;
- ::std::stringstream actual_ss;
- actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << actual;
+ ::std::stringstream rhs_ss;
+ rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+ << rhs_value;
- return EqFailure(expected_expression,
- actual_expression,
- StringStreamToString(&expected_ss),
- StringStreamToString(&actual_ss),
+ return EqFailure(lhs_expression,
+ rhs_expression,
+ StringStreamToString(&lhs_ss),
+ StringStreamToString(&rhs_ss),
false);
}
@@ -19325,13 +20467,13 @@ class TestWithParam : public Test, public WithParamInterface<T> {
// AssertionResult. For more information on how to use AssertionResult with
// these macros see comments on that class.
#define EXPECT_TRUE(condition) \
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
+ GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
GTEST_NONFATAL_FAILURE_)
#define EXPECT_FALSE(condition) \
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
GTEST_NONFATAL_FAILURE_)
#define ASSERT_TRUE(condition) \
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
+ GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
GTEST_FATAL_FAILURE_)
#define ASSERT_FALSE(condition) \
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
@@ -19700,12 +20842,12 @@ AssertionResult AssertPred5Helper(const char* pred_text,
// Macros for testing equalities and inequalities.
//
-// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
-// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
-// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
-// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
-// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
-// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
+// * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
+// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
+// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
+// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
+// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
+// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
//
// When they are not, Google Test prints both the tested expressions and
// their actual values. The values must be compatible built-in types,
@@ -19727,8 +20869,8 @@ AssertionResult AssertPred5Helper(const char* pred_text,
// are related, not how their content is related. To compare two C
// strings by content, use {ASSERT|EXPECT}_STR*().
//
-// 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
-// {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
+// 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
+// {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
// what the actual value is when it fails, and similarly for the
// other comparisons.
//
@@ -19744,12 +20886,12 @@ AssertionResult AssertPred5Helper(const char* pred_text,
// ASSERT_LT(i, array_size);
// ASSERT_GT(records.size(), 0) << "There is no record left.";
-#define EXPECT_EQ(expected, actual) \
+#define EXPECT_EQ(val1, val2) \
EXPECT_PRED_FORMAT2(::testing::internal:: \
- EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
- expected, actual)
-#define EXPECT_NE(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
+ EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
+ val1, val2)
+#define EXPECT_NE(val1, val2) \
+ EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
#define EXPECT_LE(val1, val2) \
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
#define EXPECT_LT(val1, val2) \
@@ -19759,10 +20901,10 @@ AssertionResult AssertPred5Helper(const char* pred_text,
#define EXPECT_GT(val1, val2) \
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
-#define GTEST_ASSERT_EQ(expected, actual) \
+#define GTEST_ASSERT_EQ(val1, val2) \
ASSERT_PRED_FORMAT2(::testing::internal:: \
- EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
- expected, actual)
+ EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
+ val1, val2)
#define GTEST_ASSERT_NE(val1, val2) \
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
#define GTEST_ASSERT_LE(val1, val2) \
@@ -19817,29 +20959,29 @@ AssertionResult AssertPred5Helper(const char* pred_text,
//
// These macros evaluate their arguments exactly once.
-#define EXPECT_STREQ(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
+#define EXPECT_STREQ(s1, s2) \
+ EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
#define EXPECT_STRNE(s1, s2) \
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define EXPECT_STRCASEEQ(expected, actual) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
+#define EXPECT_STRCASEEQ(s1, s2) \
+ EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
#define EXPECT_STRCASENE(s1, s2)\
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
-#define ASSERT_STREQ(expected, actual) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
+#define ASSERT_STREQ(s1, s2) \
+ ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
#define ASSERT_STRNE(s1, s2) \
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define ASSERT_STRCASEEQ(expected, actual) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
+#define ASSERT_STRCASEEQ(s1, s2) \
+ ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
#define ASSERT_STRCASENE(s1, s2)\
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
// Macros for comparing floating-point numbers.
//
-// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
+// * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
// Tests that two float values are almost equal.
-// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
+// * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
// Tests that two double values are almost equal.
// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
// Tests that v1 and v2 are within the given distance to each other.
@@ -19849,21 +20991,21 @@ AssertionResult AssertPred5Helper(const char* pred_text,
// FloatingPoint template class in gtest-internal.h if you are
// interested in the implementation details.
-#define EXPECT_FLOAT_EQ(expected, actual)\
+#define EXPECT_FLOAT_EQ(val1, val2)\
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
- expected, actual)
+ val1, val2)
-#define EXPECT_DOUBLE_EQ(expected, actual)\
+#define EXPECT_DOUBLE_EQ(val1, val2)\
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
- expected, actual)
+ val1, val2)
-#define ASSERT_FLOAT_EQ(expected, actual)\
+#define ASSERT_FLOAT_EQ(val1, val2)\
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
- expected, actual)
+ val1, val2)
-#define ASSERT_DOUBLE_EQ(expected, actual)\
+#define ASSERT_DOUBLE_EQ(val1, val2)\
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
- expected, actual)
+ val1, val2)
#define EXPECT_NEAR(val1, val2, abs_error)\
EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
@@ -19985,8 +21127,8 @@ bool StaticAssertTypeEq() {
// The convention is to end the test case name with "Test". For
// example, a test case for the Foo class can be named FooTest.
//
-// The user should put his test code between braces after using this
-// macro. Example:
+// Test code should appear between braces after an invocation of
+// this macro. Example:
//
// TEST(FooTest, InitializesCorrectly) {
// Foo foo;
diff --git a/ext/gtest/gtest.parts b/ext/gtest/gtest.parts
index fe39a7b..47f7aea 100644
--- a/ext/gtest/gtest.parts
+++ b/ext/gtest/gtest.parts
@@ -15,13 +15,11 @@
############################################################################
Import('*')
-env.PartVersion("1.7.0")
+env.PartVersion("1.8.0")
env.PartName("gtest")
#files
-cpp_files=[
- 'gtest-all.cc'
- ]
+cpp_files=['gtest-all.cc']
#includes to install
install_headers = Glob('*.h')
diff --git a/parts-site/configurations/debug/g++.py b/parts-site/configurations/debug/g++.py
index 207098a..4c899c0 100644
--- a/parts-site/configurations/debug/g++.py
+++ b/parts-site/configurations/debug/g++.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,34 +14,43 @@
# limitations under the License.
############################################################################
# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
"""g++ compiler configuration for debug
"""
from parts.config import ConfigValues, configuration
+
def map_default_version(env):
return env['GCC_VERSION']
+
config = configuration(map_default_version)
-config.VersionRange("3-*",
- append=ConfigValues(
- CCFLAGS=['',
- # produce debugging information
- '-g',
- # disable optimization
- '-O0',
- # treat warnings as errors
- '-Werror',
- # enable all warnings
- '-Wall',
- # extra warnings
- '-Wextra',
- # pedantic warnings
- # '-Wpedantic',
- '-fPIC'],
- CXXFLAGS=[
- # modern C++ features support
- '-std=c++0x',
- ],
- ))
+config.VersionRange(
+ "3-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ '',
+ # produce debugging information
+ '-g',
+ # disable optimization
+ '-O0',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ # pedantic warnings
+ # '-Wpedantic',
+ '-fPIC'
+ ],
+ CXXFLAGS=[
+ # modern C++ features support
+ '-std=c++0x',
+ ],
+ CPPDEFINES=[
+ '_FORTIFY_SOURCE=2',
+ ],
+ LINKFLAGS=[
+ '-fstack-protector',
+ ], ))
diff --git a/parts-site/configurations/instr_size_optimized_release/gcc.py b/parts-site/configurations/debug/g++_win32-any.py
index 3fc9ed6..576d4d9 100644
--- a/parts-site/configurations/instr_size_optimized_release/gcc.py
+++ b/parts-site/configurations/debug/g++_win32-any.py
@@ -14,18 +14,45 @@
# limitations under the License.
############################################################################
# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""gcc compiler configuration for release
+"""g++ compiler configuration for debug
"""
from parts.config import ConfigValues, configuration
+
def map_default_version(env):
return env['GCC_VERSION']
+
config = configuration(map_default_version)
-config.VersionRange("3-*",
- append=ConfigValues(
- CCFLAGS=['-finstrument-functions'],
- )
- )
+config.VersionRange(
+ "3-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ '',
+ # produce debugging information
+ '-g',
+ # disable optimization
+ '-O0',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ # pedantic warnings
+ # '-Wpedantic',
+ ],
+ CXXFLAGS=[
+ # modern C++ features support
+ #'-std=c++0x',
+ # modern C++ features with gcc extensions
+ '-std=gnu++11'
+ ],
+ CPPDEFINES=[
+ '_FORTIFY_SOURCE=2',
+ '__int64=long long',
+ ],
+ LINKFLAGS=[
+ '-fstack-protector',
+ ], ))
diff --git a/parts-site/configurations/debug/gcc.py b/parts-site/configurations/debug/gcc.py
index c617f4e..2fc3436 100644
--- a/parts-site/configurations/debug/gcc.py
+++ b/parts-site/configurations/debug/gcc.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -14,39 +14,48 @@
# limitations under the License.
############################################################################
# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
"""gcc compiler configuration for debug
"""
from parts.config import ConfigValues, configuration
+
def map_default_version(env):
return env['GCC_VERSION']
+
config = configuration(map_default_version)
-config.VersionRange("3-*",
- append=ConfigValues(
- CCFLAGS=['',
- # produce debugging information
- '-g',
- # disable optimization
- '-O0',
- # treat warnings as errors
- '-Werror',
- # enable all warnings
- '-Wall',
- # extra warnings
- '-Wextra',
- # pedantic warnings
- # '-Wpedantic',
- # disable warnings due to gcc 4.8.5 issues
- '-Wno-missing-braces',
- '-Wno-missing-field-initializers',
- '-Wno-unknown-pragmas',
- '-Wno-unused-function',
- # do not warn about unused but set variables
- '-Wno-unused-but-set-variable',
- # do not warn about multiline comments
- '-Wno-comment',
- '-fPIC'],
- ))
+config.VersionRange(
+ "3-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ '',
+ # produce debugging information
+ '-g',
+ # disable optimization
+ '-O0',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ # pedantic warnings
+ # '-Wpedantic',
+ # disable warnings due to gcc 4.8.5 issues
+ '-Wno-missing-braces',
+ '-Wno-missing-field-initializers',
+ '-Wno-unknown-pragmas',
+ '-Wno-unused-function',
+ # do not warn about unused but set variables
+ '-Wno-unused-but-set-variable',
+ # do not warn about multiline comments
+ '-Wno-comment',
+ '-fPIC'
+ ],
+ CPPDEFINES=[
+ '_FORTIFY_SOURCE=2',
+ ],
+ LINKFLAGS=[
+ '-fstack-protector',
+ ], ))
diff --git a/parts-site/configurations/debug/gcc_win32_any.py b/parts-site/configurations/debug/gcc_win32_any.py
new file mode 100644
index 0000000..a7b3069
--- /dev/null
+++ b/parts-site/configurations/debug/gcc_win32_any.py
@@ -0,0 +1,60 @@
+############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################
+# pylint: disable=locally-disabled, invalid-name, missing-docstring
+"""gcc compiler configuration for debug
+"""
+from parts.config import ConfigValues, configuration
+
+
+def map_default_version(env):
+ return env['GCC_VERSION']
+
+
+config = configuration(map_default_version)
+
+config.VersionRange(
+ "3-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ '',
+ # produce debugging information
+ '-g',
+ # disable optimization
+ '-O0',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ # pedantic warnings
+ # '-Wpedantic',
+ # disable warnings due to gcc 4.8.5 issues
+ '-Wno-missing-braces',
+ '-Wno-missing-field-initializers',
+ '-Wno-unknown-pragmas',
+ '-Wno-unused-function',
+ # do not warn about unused but set variables
+ '-Wno-unused-but-set-variable',
+ # do not warn about multiline comments
+ '-Wno-comment',
+ ],
+ CPPDEFINES=[
+ '__int64=long long',
+ ],
+ LINKFLAGS=[
+ '-fstack-protector',
+ ], ))
diff --git a/parts-site/configurations/debug/intelc_posix-any.py b/parts-site/configurations/debug/intelc_posix-any.py
index 0817b51..beb7443 100644
--- a/parts-site/configurations/debug/intelc_posix-any.py
+++ b/parts-site/configurations/debug/intelc_posix-any.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/configurations/instr_release/__init__.py b/parts-site/configurations/instr_release/__init__.py
deleted file mode 100644
index cc18909..0000000
--- a/parts-site/configurations/instr_release/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-############################################################################
-# Copyright 2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, missing-docstring
-
-from parts.config import DefineConfiguration
-
-DefineConfiguration("instr_release", dependsOn='release')
diff --git a/parts-site/configurations/instr_release/intelc_win32-any.py b/parts-site/configurations/instr_release/intelc_win32-any.py
deleted file mode 100644
index a8fde45..0000000
--- a/parts-site/configurations/instr_release/intelc_win32-any.py
+++ /dev/null
@@ -1,35 +0,0 @@
-############################################################################
-# Copyright 2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""Intel win32 compiler configuration for release
-"""
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['INTELC_VERSION']
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- filter=ConfigValues(
- CCFLAGS=['/MT', '/MD', '/MDd']
- ),
- append=ConfigValues(
- CCFLAGS=['/Gh',
- '/MTd']
- )
- )
diff --git a/parts-site/configurations/instr_release/msvc_win32-any.py b/parts-site/configurations/instr_release/msvc_win32-any.py
deleted file mode 100644
index 70e4da5..0000000
--- a/parts-site/configurations/instr_release/msvc_win32-any.py
+++ /dev/null
@@ -1,35 +0,0 @@
-############################################################################
-# Copyright 2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""Intel win32 compiler configurations release
-"""
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['MSVC_VERSION']
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- filter=ConfigValues(
- CCFLAGS=['/MT', '/MD', '/MDd']
- ),
- append=ConfigValues(
- CCFLAGS=['/Gh',
- '/MTd']
- )
- )
diff --git a/parts-site/configurations/instr_size_optimized_release/__init__.py b/parts-site/configurations/instr_size_optimized_release/__init__.py
deleted file mode 100644
index 414313f..0000000
--- a/parts-site/configurations/instr_size_optimized_release/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-############################################################################
-# Copyright 2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, missing-docstring
-
-from parts.config import DefineConfiguration
-
-DefineConfiguration("instr_size_optimized_release", dependsOn='size_optimized_release')
diff --git a/parts-site/configurations/instr_size_optimized_release/intelc_win32-any.py b/parts-site/configurations/instr_size_optimized_release/intelc_win32-any.py
deleted file mode 100644
index a8fde45..0000000
--- a/parts-site/configurations/instr_size_optimized_release/intelc_win32-any.py
+++ /dev/null
@@ -1,35 +0,0 @@
-############################################################################
-# Copyright 2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""Intel win32 compiler configuration for release
-"""
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['INTELC_VERSION']
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- filter=ConfigValues(
- CCFLAGS=['/MT', '/MD', '/MDd']
- ),
- append=ConfigValues(
- CCFLAGS=['/Gh',
- '/MTd']
- )
- )
diff --git a/parts-site/configurations/instr_size_optimized_release/msvc_win32-any.py b/parts-site/configurations/instr_size_optimized_release/msvc_win32-any.py
deleted file mode 100644
index 70e4da5..0000000
--- a/parts-site/configurations/instr_size_optimized_release/msvc_win32-any.py
+++ /dev/null
@@ -1,35 +0,0 @@
-############################################################################
-# Copyright 2017 Intel Corporation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""Intel win32 compiler configurations release
-"""
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['MSVC_VERSION']
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- filter=ConfigValues(
- CCFLAGS=['/MT', '/MD', '/MDd']
- ),
- append=ConfigValues(
- CCFLAGS=['/Gh',
- '/MTd']
- )
- )
diff --git a/parts-site/configurations/release/g++.py b/parts-site/configurations/release/g++.py
index 609dd36..601f8d1 100644
--- a/parts-site/configurations/release/g++.py
+++ b/parts-site/configurations/release/g++.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/configurations/instr_release/g++.py b/parts-site/configurations/release/g++_win32-any.py
index d208bd6..8bce2e5 100644
--- a/parts-site/configurations/instr_release/g++.py
+++ b/parts-site/configurations/release/g++_win32-any.py
@@ -14,18 +14,48 @@
# limitations under the License.
############################################################################
# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
"""g++ compiler configuration for release
"""
from parts.config import ConfigValues, configuration
+
def map_default_version(env):
return env['GCC_VERSION']
+
config = configuration(map_default_version)
-config.VersionRange("3-*",
- append=ConfigValues(
- CCFLAGS=['-finstrument-functions'],
- )
- )
+config.VersionRange(
+ "3-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ '',
+ # second level optimization
+ '-O2',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ # pedantic warnings
+ # '-Wpedantic',
+ '-Wformat',
+ '-Wformat-security',
+ '-fstack-protector',
+ ],
+ CXXFLAGS=[
+ '',
+ # modern C++ features support
+ #'-std=c++0x',
+ # modern C++ features with gcc extensions
+ '-std=gnu++11'
+ ],
+ CPPDEFINES=[
+ 'NDEBUG',
+ '_FORTIFY_SOURCE=2',
+ '__int64=long long',
+ ],
+ LINKFLAGS=[
+ '-fstack-protector',
+ ], ))
diff --git a/parts-site/configurations/release/gcc.py b/parts-site/configurations/release/gcc.py
index f7273c8..d0b56fe 100644
--- a/parts-site/configurations/release/gcc.py
+++ b/parts-site/configurations/release/gcc.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/configurations/release/gcc_win32-any.py b/parts-site/configurations/release/gcc_win32-any.py
new file mode 100644
index 0000000..7b4f2ff
--- /dev/null
+++ b/parts-site/configurations/release/gcc_win32-any.py
@@ -0,0 +1,65 @@
+############################################################################
+# Copyright 2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################
+# pylint: disable=locally-disabled, invalid-name, missing-docstring
+"""gcc compiler configuration for release
+"""
+from parts.config import ConfigValues, configuration
+
+
+def map_default_version(env):
+ return env['GCC_VERSION']
+
+
+config = configuration(map_default_version)
+
+config.VersionRange(
+ "3-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ '',
+ # second level optimization
+ '-O2',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ # pedantic warnings
+ # '-Wpedantic',
+ # disable warnings due to gcc 4.8.5 issues
+ '-Wno-missing-braces',
+ '-Wno-missing-field-initializers',
+ '-Wno-unknown-pragmas',
+ '-Wno-unused-function',
+ # do not assume strict aliasing
+ '-fno-strict-aliasing',
+ # do not warn about unused but set variables
+ '-Wno-unused-but-set-variable',
+ # do not warn about multiline comments
+ '-Wno-comment',
+ '-Wformat',
+ '-Wformat-security',
+ '-fstack-protector',
+ ],
+ CPPDEFINES=[
+ 'NDEBUG',
+ '_FORTIFY_SOURCE=2',
+ '__int64=long long',
+ ],
+ LINKFLAGS=[
+ '-fstack-protector',
+ ], ))
diff --git a/parts-site/configurations/release/intelc_posix-any.py b/parts-site/configurations/release/intelc_posix-any.py
index 2e58042..5b42d75 100644
--- a/parts-site/configurations/release/intelc_posix-any.py
+++ b/parts-site/configurations/release/intelc_posix-any.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/configurations/size_optimized_release/__init__.py b/parts-site/configurations/size_optimized_release/__init__.py
index 7864657..4849215 100644
--- a/parts-site/configurations/size_optimized_release/__init__.py
+++ b/parts-site/configurations/size_optimized_release/__init__.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/configurations/size_optimized_release/g++.py b/parts-site/configurations/size_optimized_release/g++.py
index 7a4e144..feb20a3 100644
--- a/parts-site/configurations/size_optimized_release/g++.py
+++ b/parts-site/configurations/size_optimized_release/g++.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/configurations/instr_release/gcc.py b/parts-site/configurations/size_optimized_release/g++_win32-any.py
index 3fc9ed6..aeaed20 100644
--- a/parts-site/configurations/instr_release/gcc.py
+++ b/parts-site/configurations/size_optimized_release/g++_win32-any.py
@@ -14,18 +14,45 @@
# limitations under the License.
############################################################################
# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""gcc compiler configuration for release
+"""g++ compiler configuration for size
"""
from parts.config import ConfigValues, configuration
+
def map_default_version(env):
return env['GCC_VERSION']
+
config = configuration(map_default_version)
-config.VersionRange("3-*",
- append=ConfigValues(
- CCFLAGS=['-finstrument-functions'],
- )
- )
+config.VersionRange(
+ "3-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ '',
+ # size optimization
+ '-Os',
+ '-fdata-sections',
+ '-ffunction-sections',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ '-Wformat',
+ '-Wformat-security',
+ '-fstack-protector',
+ ],
+ CXXFLAGS=[
+ '',
+ # modern C++ features support
+ '-std=gnu++11'
+ ],
+ CPPDEFINES=['NDEBUG', '_FORTIFY_SOURCE=2', '__int64=long long'],
+ LINKFLAGS=[
+ '-fstack-protector',
+ # link only what is used
+ '-Xlinker',
+ '--gc-sections'
+ ], ))
diff --git a/parts-site/configurations/size_optimized_release/gcc.py b/parts-site/configurations/size_optimized_release/gcc.py
index 3aa9567..238a878 100644
--- a/parts-site/configurations/size_optimized_release/gcc.py
+++ b/parts-site/configurations/size_optimized_release/gcc.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/configurations/size_optimized_release/gcc_win32-any.py b/parts-site/configurations/size_optimized_release/gcc_win32-any.py
new file mode 100644
index 0000000..d940ad1
--- /dev/null
+++ b/parts-site/configurations/size_optimized_release/gcc_win32-any.py
@@ -0,0 +1,64 @@
+############################################################################
+# Copyright 2016-2017 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+############################################################################
+# pylint: disable=locally-disabled, invalid-name, missing-docstring
+"""gcc compiler configuration for size
+"""
+from parts.config import ConfigValues, configuration
+
+
+def map_default_version(env):
+ return env['GCC_VERSION']
+
+
+config = configuration(map_default_version)
+
+config.VersionRange(
+ "3-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ '',
+ # size optimization
+ '-Os',
+ '-fdata-sections',
+ '-ffunction-sections',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ # disable warnings due to gcc 4.8.5 issues
+ '-Wno-missing-braces',
+ '-Wno-missing-field-initializers',
+ '-Wno-unknown-pragmas',
+ '-Wno-unused-function',
+ # do not assume strict aliasing
+ '-fno-strict-aliasing',
+ # do not warn about unused but set variables
+ '-Wno-unused-but-set-variable',
+ # do not warn about multiline comments
+ '-Wno-comment',
+ '-Wformat',
+ '-Wformat-security',
+ '-fstack-protector',
+ ],
+ CPPDEFINES=['NDEBUG', '_FORTIFY_SOURCE=2', '__int64=long long'],
+ LINKFLAGS=[
+ '-fstack-protector',
+ # link only what is used
+ '-Xlinker',
+ '--gc-sections'
+ ], ))
diff --git a/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86.py b/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86.py
index 9a4234b..b01de68 100644
--- a/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86.py
+++ b/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86_64.py b/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86_64.py
index e2a2b3b..b56d164 100644
--- a/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86_64.py
+++ b/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86_64.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/pieces/arm_support.py b/parts-site/pieces/arm_support.py
index a32f63a..525629d 100644
--- a/parts-site/pieces/arm_support.py
+++ b/parts-site/pieces/arm_support.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/tools/g++.py b/parts-site/tools/g++.py
index 0fd7d84..8fe9d17 100644
--- a/parts-site/tools/g++.py
+++ b/parts-site/tools/g++.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/parts-site/tools/gcc.py b/parts-site/tools/gcc.py
index 2e82fe8..cd76a48 100644
--- a/parts-site/tools/gcc.py
+++ b/parts-site/tools/gcc.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016 Intel Corporation
+# Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
diff --git a/tools/Makefile b/tools/Makefile
index a668622..b3b402f 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -6,27 +6,27 @@ TOOLS_INSTALL_DIR = $(epidinstalldir)/tools
EXTRACTGRPS_INCLUDE_DIR = ./extractgrps
EXTRACTGRPS_SRC = $(wildcard ./extractgrps/src/*.c)
EXTRACTGRPS_OBJ = $(EXTRACTGRPS_SRC:.c=.o)
-EXTRACTGRPS_EXE = ./extractgrps/src/extractgrps
+EXTRACTGRPS_EXE = ./extractgrps/src/extractgrps$(EXE_EXTENSION)
EXTRACTKEYS_INCLUDE_DIR = ./extractkeys
EXTRACTKEYS_SRC = $(wildcard ./extractkeys/src/*.c)
EXTRACTKEYS_OBJ = $(EXTRACTKEYS_SRC:.c=.o)
-EXTRACTKEYS_EXE = ./extractkeys/src/extractkeys
+EXTRACTKEYS_EXE = ./extractkeys/src/extractkeys$(EXE_EXTENSION)
REVOKEGRP_INCLUDE_DIR = ./revokegrp
REVOKEGRP_SRC = $(wildcard ./revokegrp/src/*.c)
REVOKEGRP_OBJ = $(REVOKEGRP_SRC:.c=.o)
-REVOKEGRP_EXE = ./revokegrp/src/revokegrp
+REVOKEGRP_EXE = ./revokegrp/src/revokegrp$(EXE_EXTENSION)
REVOKEKEY_INCLUDE_DIR = ./revokekey
REVOKEKEY_SRC = $(wildcard ./revokekey/src/*.c)
REVOKEKEY_OBJ = $(REVOKEKEY_SRC:.c=.o)
-REVOKEKEY_EXE = ./revokekey/src/revokekey
+REVOKEKEY_EXE = ./revokekey/src/revokekey$(EXE_EXTENSION)
REVOKESIG_INCLUDE_DIR = ./revokesig
REVOKESIG_SRC = $(wildcard ./revokesig/src/*.c)
REVOKESIG_OBJ = $(REVOKESIG_SRC:.c=.o)
-REVOKESIG_EXE = ./revokesig/src/revokesig
+REVOKESIG_EXE = ./revokesig/src/revokesig$(EXE_EXTENSION)
EPID_SDK_ROOT_DIR = ..
EXAMPLE_DIR = $(EPID_SDK_ROOT_DIR)/example
diff --git a/tools/extractgrps/src/main.c b/tools/extractgrps/src/main.c
index 164a348..0f30d8f 100644
--- a/tools/extractgrps/src/main.c
+++ b/tools/extractgrps/src/main.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,28 +17,28 @@
/*!
* \file
*
- * \brief Extract group keys from EPID group key output file
+ * \brief Extract group keys from group key output file
*/
-#include <stdlib.h>
+#include <dropt.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <dropt.h>
+#include "epid/common/file_parser.h"
+#include "epid/common/types.h"
+#include "util/buffutil.h"
#include "util/envutil.h"
#include "util/stdtypes.h"
-#include "util/buffutil.h"
#include "util/strutil.h"
-#include "epid/common/types.h"
-#include "epid/common/file_parser.h"
#define PROGRAM_NAME "extractgrps"
#pragma pack(1)
-/// EPID Key Output File Entry
+/// Intel(R) EPID Key Output File Entry
typedef struct EpidBinaryGroupCertificate {
- EpidFileHeader header; ///< EPID binary file header
- GroupPubKey pubkey; ///< EPID 2.0 group public key
+ EpidFileHeader header; ///< Intel(R) EPID binary file header
+ GroupPubKey pubkey; ///< Intel(R) EPID 2.0 group public key
EcdsaSignature signature; ///< ECDSA Signature on SHA-256 of above values
} EpidBinaryGroupCertificate;
#pragma pack()
diff --git a/tools/extractkeys/src/main.c b/tools/extractkeys/src/main.c
index 6754a6d..dd97986 100644
--- a/tools/extractkeys/src/main.c
+++ b/tools/extractkeys/src/main.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,40 +17,40 @@
/*!
* \file
*
- * \brief Extract member private keys from EPID key output file
+ * \brief Extract member private keys from key output file
*
* Not validating SHA hashes in key file
*/
-#include <stdlib.h>
#include <stdio.h>
+#include <stdlib.h>
#include <dropt.h>
+#include "epid/common/types.h"
+#include "util/buffutil.h"
#include "util/envutil.h"
#include "util/stdtypes.h"
-#include "util/buffutil.h"
#include "util/strutil.h"
-#include "epid/common/types.h"
#define PROGRAM_NAME "extractkeys"
#define MANDATORY_PARAM_COUNT 2
#pragma pack(1)
-/// EPID Key Output File Entry
+/// Intel(R) EPID Key Output File Entry
typedef struct EpidKeyOutputFileKey {
unsigned char product_id[2]; ///< 2-byte Product ID (Big Endian)
unsigned char key_id[8]; ///< 8-byte Key Unique Id(Big Endian)
unsigned char svn[4]; ///< 4-byte Security Version Number (SVN) (Big Endian)
- PrivKey privkey; ///< EPID 2.0 Private Key
+ PrivKey privkey; ///< Intel(R) EPID 2.0 Private Key
unsigned char hash[20]; ///< 20-byte SHA-1 of above
} EpidKeyOutputFileKey;
-/// EPID Compressed Key Output File Entry
+/// Intel(R) EPID Compressed Key Output File Entry
typedef struct EpidCompressedKeyOutputFileKey {
unsigned char product_id[2]; ///< 2-byte Product ID (Big Endian)
unsigned char key_id[8]; ///< 8-byte Key Unique Id(Big Endian)
unsigned char svn[4]; ///< 4-byte Security Version Number (SVN) (Big Endian)
- CompressedPrivKey privkey; ///< EPID 2.0 Compressed Private Key
+ CompressedPrivKey privkey; ///< Intel(R) EPID 2.0 Compressed Private Key
unsigned char hash[20]; ///< 20-byte SHA-1 of above
} EpidCompressedKeyOutputFileKey;
#pragma pack()
diff --git a/tools/revokegrp/src/main.c b/tools/revokegrp/src/main.c
index 7213150..0716a5a 100644
--- a/tools/revokegrp/src/main.c
+++ b/tools/revokegrp/src/main.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,13 +21,13 @@
*
*/
+#include <dropt.h>
#include <stdlib.h>
#include <string.h>
-#include <dropt.h>
+#include "epid/common/file_parser.h"
#include "util/buffutil.h"
#include "util/envutil.h"
#include "util/stdtypes.h"
-#include "epid/common/file_parser.h"
const OctStr16 kEpidFileVersion = {2, 0};
@@ -43,12 +43,12 @@ const OctStr16 kEpidFileVersion = {2, 0};
#pragma pack(1)
/// Group revocation request entry
typedef struct GrpInfo {
- GroupId gid; ///< EPID Group ID
+ GroupId gid; ///< Intel(R) EPID Group ID
uint8_t reason; ///< Revocation reason
} GrpInfo;
/// Group Revocation request
typedef struct GrpRlRequest {
- EpidFileHeader header; ///< EPID File Header
+ EpidFileHeader header; ///< Intel(R) EPID File Header
uint32_t count; ///< Revoked count (big endian)
GrpInfo groups[1]; ///< Revoked group count (flexible array)
} GrpRlRequest;
@@ -317,7 +317,7 @@ int MakeRequest(char const* cacert_file, char const* pubkey_file,
break;
}
- // Check EPID and file versions
+ // Check Intel(R) EPID and file versions
if (0 != memcmp(&request->header.epid_version, &kEpidFileVersion,
sizeof(kEpidFileVersion))) {
ret_value = EXIT_FAILURE;
@@ -332,7 +332,14 @@ int MakeRequest(char const* cacert_file, char const* pubkey_file,
}
grp_count = ntohl(request->count);
-
+ // check if revoked count matches the number of group revocation request
+ // entries contained in the file
+ if (grp_count * sizeof(GrpInfo) !=
+ req_file_size - sizeof(EpidFileHeader) - sizeof(uint32_t)) {
+ log_error("Incorrect revoked request count in existing file");
+ ret_value = EXIT_FAILURE;
+ break;
+ }
// Update the reason if the group is in the request
for (grp_index = 0; grp_index < grp_count; grp_index++) {
if (0 == memcmp(&request->groups[grp_index].gid, &pubkey.gid,
diff --git a/tools/revokekey/src/main.c b/tools/revokekey/src/main.c
index 6df7abe..9efb759 100644
--- a/tools/revokekey/src/main.c
+++ b/tools/revokekey/src/main.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,15 +21,15 @@
*
*/
+#include <dropt.h>
#include <stdlib.h>
#include <string.h>
-#include <dropt.h>
+#include "epid/common/file_parser.h"
+#include "epid/member/api.h"
#include "util/buffutil.h"
#include "util/envutil.h"
#include "util/stdtypes.h"
-#include "epid/common/file_parser.h"
-#include "epid/member/api.h"
const OctStr16 kEpidFileVersion = {2, 0};
@@ -41,8 +41,8 @@ const OctStr16 kEpidFileVersion = {2, 0};
/// Partial signature request, includes all but message.
typedef struct PrivRlRequestTop {
- EpidFileHeader header; ///< EPID File Header
- PrivKey privkey; ///< EPID Private Key
+ EpidFileHeader header; ///< Intel(R) EPID File Header
+ PrivKey privkey; ///< Intel(R) EPID Private Key
} PrivRlRequestTop;
int OpenKey(char const* privkey_file, char const* gpubkey_file,
@@ -214,7 +214,7 @@ int MakeRequest(PrivKey const* priv_key, char const* req_file, bool verbose) {
log_msg("");
log_msg(" [in] Request Len: %d", sizeof(PrivRlRequestTop));
log_msg(" [in] Request: ");
- PrintBuffer(&req_top, sizeof(PrivRlRequestTop));
+ PrintBuffer(req_top, sizeof(PrivRlRequestTop));
log_msg("==============================================");
}
diff --git a/tools/revokesig/src/main.c b/tools/revokesig/src/main.c
index 861e389..9a1ea35 100644
--- a/tools/revokesig/src/main.c
+++ b/tools/revokesig/src/main.c
@@ -1,5 +1,5 @@
/*############################################################################
- # Copyright 2016 Intel Corporation
+ # Copyright 2016-2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,13 +21,13 @@
*
*/
+#include <dropt.h>
#include <stdlib.h>
#include <string.h>
-#include <dropt.h>
+#include "epid/common/file_parser.h"
#include "util/buffutil.h"
#include "util/envutil.h"
#include "util/stdtypes.h"
-#include "epid/common/file_parser.h"
// Defaults
#define PROGRAM_NAME "revokesig"
@@ -40,9 +40,9 @@
#pragma pack(1)
/// Partial signature request, includes components through sig.
typedef struct SigRlRequestTop {
- EpidFileHeader header; ///< EPID File Header
- GroupId gid; ///< EPID Group ID
- EpidSignature sig; ///< EPID Signature
+ EpidFileHeader header; ///< Intel(R) EPID File Header
+ GroupId gid; ///< Intel(R) EPID Group ID
+ EpidSignature sig; ///< Intel(R) EPID Signature
} SigRlRequestTop;
/// Partial signature request, includes components after.
@@ -168,10 +168,10 @@ int main(int argc, char* argv[]) {
break;
} else if (argc > 0) {
/* Parse the arguments from argv.
- *
- * argv[1] is always safe to access since argv[argc] is guaranteed
- * to be NULL and since we've established that argc > 0.
- */
+ *
+ * argv[1] is always safe to access since argv[argc] is guaranteed
+ * to be NULL and since we've established that argc > 0.
+ */
char** rest = dropt_parse(dropt_ctx, -1, &argv[1]);
if (dropt_get_error(dropt_ctx) != dropt_error_none) {
log_error(dropt_get_error_message(dropt_ctx));
@@ -265,7 +265,7 @@ int main(int argc, char* argv[]) {
| Field | Size |
|:--------------------------------|--------------:|
- | EPID Version (0x0200) | 2 bytes |
+ | Intel(R) EPID Version (0x0200) | 2 bytes |
| File Type (0x000B) | 2 bytes |
| Group ID Number | 16 bytes |
| Basic Signature | 52 bytes |
@@ -432,7 +432,7 @@ int MakeRequest(char const* cacert_file, char const* sig_file,
log_msg("");
log_msg(" [in] Request Len: %d", sizeof(SigRlRequestTop));
log_msg(" [in] Request: ");
- PrintBuffer(&req_top, sizeof(SigRlRequestTop));
+ PrintBuffer(req_top, sizeof(SigRlRequestTop));
log_msg("==============================================");
}