aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc A. Valle <marc.a.valle@intel.com>2017-12-07 09:28:55 -0700
committerMarc A. Valle <marc.a.valle@intel.com>2017-12-07 09:29:42 -0700
commitaa1e7c1c17f4a32df95c22ff8d404c8eeca7d235 (patch)
tree3e5a28ff0664b6465fc4e54f81715cfa3c7213f4
parent7a6547c302e0428d67d928ffd4997517f46174a5 (diff)
downloadepid-sdk-aa1e7c1c17f4a32df95c22ff8d404c8eeca7d235.tar.gz
Release SDK 6.0.0
Added ----- - The member can now be built with a substantially reduced code size using a compilation option. - New context lifetime management APIs have been added to member to give callers more control of memory allocation. - New member API `EpidClearRegisteredBasenames` has been added to clear registered basenames without recreating the member. Changed ------- - `EpidRegisterBaseName` was renamed to `EpidRegisterBasename` because basename is a single word. - Command-line parsing library used by samples and tools has been replaced by Argtable3. Deprecated ---------- - `EpidMemberCreate` has been deprecated. This API has been superseded by `EpidMemberGetSize` and `EpidMemberInit`. - `EpidMemberDelete` has been deprecated. This API has been superseded by `EpidMemberDeinit`. Removed ------- - `size_optimized_release` build configuration has been removed. Use the compilation option to build member with reduced code size. 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. - Scons build will not work natively on ARM. You can still build using `make` or cross compile.
-rw-r--r--CHANGELOG.md147
-rw-r--r--LICENSE.txt34
-rw-r--r--Makefile.in34
-rw-r--r--SConstruct161
-rw-r--r--configure88
-rw-r--r--doc/html/1_81_2file__parser_8h.html2
-rw-r--r--doc/html/1_81_2types_8h.html2
-rw-r--r--doc/html/Basenames.html2
-rw-r--r--doc/html/BuildToolsInstallation.html4
-rw-r--r--doc/html/BuildingSdk.html39
-rw-r--r--doc/html/ChangeLog.html31
-rw-r--r--doc/html/EpidOverview.html13
-rw-r--r--doc/html/Glossary.html2
-rw-r--r--doc/html/HowValidated.html6
-rw-r--r--doc/html/ImplementationNotes.html17
-rw-r--r--doc/html/IssuerMaterial.html2
-rw-r--r--doc/html/LegalInformation.html2
-rw-r--r--doc/html/Provisioning.html4
-rw-r--r--doc/html/Revocation.html2
-rw-r--r--doc/html/SdkOverview.html53
-rw-r--r--doc/html/SignVerifyTutorial.html122
-rw-r--r--doc/html/TpmConsiderations.html30
-rw-r--r--doc/html/UserManual_GeneratingAnIntelEpidSignature.html18
-rw-r--r--doc/html/UserManual_VerifyingAnIntelEpidSignature.html2
-rw-r--r--doc/html/UsingiKGF.html2
-rw-r--r--doc/html/annotated.html124
-rw-r--r--doc/html/basenames_8dox.html2
-rw-r--r--doc/html/bignum_8h.html2
-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.html58
-rw-r--r--doc/html/commit_8c.html2
-rw-r--r--doc/html/commit_8h.html2
-rw-r--r--doc/html/common_2math_2pairing_8h.html (renamed from doc/html/pairing_8h.html)22
-rw-r--r--doc/html/context_8c.html2
-rw-r--r--doc/html/context_8h.html2
-rw-r--r--doc/html/conversion_8c.html2
-rw-r--r--doc/html/conversion_8h.html2
-rw-r--r--doc/html/createprimary_8c.html2
-rw-r--r--doc/html/createprimary_8h.html2
-rw-r--r--doc/html/deprecated.html82
-rw-r--r--doc/html/dir_02c945662023679b89476bd7126bc985.html2
-rw-r--r--doc/html/dir_0d59f1b8006345e373e07b4691e0da76.html2
-rw-r--r--doc/html/dir_12b90d9c027aaf878a834df729679a56.html2
-rw-r--r--doc/html/dir_512d3e62841a8535b716ec4cf8b9e950.html2
-rw-r--r--doc/html/dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html126
-rw-r--r--doc/html/dir_a32be19bc88f3d7aac6b7249da379f26.html2
-rw-r--r--doc/html/dir_a6a596e2b2b50fb0973c7fe0b17a09e5.html87
-rw-r--r--doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html2
-rw-r--r--doc/html/dir_ea12d375fc1eb79df248c0adf953af4f.html81
-rw-r--r--doc/html/dir_ef364879bae02db2684040178ed9b186.html2
-rw-r--r--doc/html/dir_f169ebf8da29290a918fa4b3f7151050.html6
-rw-r--r--doc/html/dir_f6bef457d5f671b6e774bfccc16651f6.html5
-rw-r--r--doc/html/ecdsa_8h.html2
-rw-r--r--doc/html/ecgroup_8h.html2
-rw-r--r--doc/html/efq2_8h.html428
-rw-r--r--doc/html/efq_8h.html1096
-rw-r--r--doc/html/endian_8h.html132
-rw-r--r--doc/html/epid__overview_8dox.html2
-rw-r--r--doc/html/epiddefs_8h.html84
-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.html2
-rw-r--r--doc/html/files.html91
-rw-r--r--doc/html/finitefield_8h.html2
-rw-r--r--doc/html/fp_8h.html617
-rw-r--r--doc/html/fq12_8h.html780
-rw-r--r--doc/html/fq2_8h.html728
-rw-r--r--doc/html/fq6_8h.html645
-rw-r--r--doc/html/fq_8h.html767
-rw-r--r--doc/html/functions.html401
-rw-r--r--doc/html/functions_b.html100
-rw-r--r--doc/html/functions_c.html86
-rw-r--r--doc/html/functions_d.html96
-rw-r--r--doc/html/functions_e.html103
-rw-r--r--doc/html/functions_f.html90
-rw-r--r--doc/html/functions_g.html110
-rw-r--r--doc/html/functions_h.html97
-rw-r--r--doc/html/functions_k.html90
-rw-r--r--doc/html/functions_l.html80
-rw-r--r--doc/html/functions_n.html99
-rw-r--r--doc/html/functions_o.html79
-rw-r--r--doc/html/functions_p.html89
-rw-r--r--doc/html/functions_q.html86
-rw-r--r--doc/html/functions_r.html89
-rw-r--r--doc/html/functions_s.html141
-rw-r--r--doc/html/functions_t.html95
-rw-r--r--doc/html/functions_v.html85
-rw-r--r--doc/html/functions_vars.html401
-rw-r--r--doc/html/functions_vars_b.html100
-rw-r--r--doc/html/functions_vars_c.html86
-rw-r--r--doc/html/functions_vars_d.html96
-rw-r--r--doc/html/functions_vars_e.html103
-rw-r--r--doc/html/functions_vars_f.html90
-rw-r--r--doc/html/functions_vars_g.html110
-rw-r--r--doc/html/functions_vars_h.html97
-rw-r--r--doc/html/functions_vars_k.html90
-rw-r--r--doc/html/functions_vars_l.html80
-rw-r--r--doc/html/functions_vars_n.html99
-rw-r--r--doc/html/functions_vars_o.html79
-rw-r--r--doc/html/functions_vars_p.html89
-rw-r--r--doc/html/functions_vars_q.html86
-rw-r--r--doc/html/functions_vars_r.html89
-rw-r--r--doc/html/functions_vars_s.html141
-rw-r--r--doc/html/functions_vars_t.html95
-rw-r--r--doc/html/functions_vars_v.html85
-rw-r--r--doc/html/functions_vars_w.html84
-rw-r--r--doc/html/functions_vars_x.html104
-rw-r--r--doc/html/functions_vars_y.html101
-rw-r--r--doc/html/functions_vars_z.html86
-rw-r--r--doc/html/functions_w.html84
-rw-r--r--doc/html/functions_x.html104
-rw-r--r--doc/html/functions_y.html101
-rw-r--r--doc/html/functions_z.html86
-rw-r--r--doc/html/getrandom_8c.html2
-rw-r--r--doc/html/getrandom_8h.html2
-rw-r--r--doc/html/globals.html2
-rw-r--r--doc/html/globals_b.html9
-rw-r--r--doc/html/globals_c.html2
-rw-r--r--doc/html/globals_d.html2
-rw-r--r--doc/html/globals_defs.html41
-rw-r--r--doc/html/globals_e.html133
-rw-r--r--doc/html/globals_enum.html2
-rw-r--r--doc/html/globals_eval.html2
-rw-r--r--doc/html/globals_f.html248
-rw-r--r--doc/html/globals_func.html495
-rw-r--r--doc/html/globals_func_d.html97
-rw-r--r--doc/html/globals_func_e.html416
-rw-r--r--doc/html/globals_func_f.html364
-rw-r--r--doc/html/globals_func_i.html79
-rw-r--r--doc/html/globals_func_m.html82
-rw-r--r--doc/html/globals_func_n.html103
-rw-r--r--doc/html/globals_func_p.html125
-rw-r--r--doc/html/globals_func_r.html93
-rw-r--r--doc/html/globals_func_s.html82
-rw-r--r--doc/html/globals_func_t.html169
-rw-r--r--doc/html/globals_func_u.html82
-rw-r--r--doc/html/globals_func_v.html136
-rw-r--r--doc/html/globals_func_w.html93
-rw-r--r--doc/html/globals_g.html2
-rw-r--r--doc/html/globals_h.html5
-rw-r--r--doc/html/globals_i.html2
-rw-r--r--doc/html/globals_k.html2
-rw-r--r--doc/html/globals_m.html14
-rw-r--r--doc/html/globals_n.html5
-rw-r--r--doc/html/globals_o.html2
-rw-r--r--doc/html/globals_p.html13
-rw-r--r--doc/html/globals_r.html2
-rw-r--r--doc/html/globals_s.html23
-rw-r--r--doc/html/globals_t.html60
-rw-r--r--doc/html/globals_type.html5
-rw-r--r--doc/html/globals_u.html82
-rw-r--r--doc/html/globals_v.html62
-rw-r--r--doc/html/globals_vars.html2
-rw-r--r--doc/html/globals_w.html2
-rw-r--r--doc/html/glossary_8dox.html2
-rw-r--r--doc/html/group___big_num_primitives.html2
-rw-r--r--doc/html/group___ec_group_primitives.html2
-rw-r--r--doc/html/group___ecdsa_primitives.html2
-rw-r--r--doc/html/group___epid11_file_parser_module.html2
-rw-r--r--doc/html/group___epid11_pairing_primitives.html2
-rw-r--r--doc/html/group___epid11_types.html2
-rw-r--r--doc/html/group___epid11_verifier_module.html2
-rw-r--r--doc/html/group___epid_common.html2
-rw-r--r--doc/html/group___epid_math.html2
-rw-r--r--doc/html/group___epid_member_module.html175
-rw-r--r--doc/html/group___epid_member_module.js6
-rw-r--r--doc/html/group___epid_module.html2
-rw-r--r--doc/html/group___epid_print.html2
-rw-r--r--doc/html/group___epid_types.html2
-rw-r--r--doc/html/group___epid_verifier_module.html2
-rw-r--r--doc/html/group___error_codes.html2
-rw-r--r--doc/html/group___file_parser.html2
-rw-r--r--doc/html/group___finite_field_primitives.html2
-rw-r--r--doc/html/group___hash_primitives.html2
-rw-r--r--doc/html/group___pairing_primitives.html28
-rw-r--r--doc/html/group___pairing_primitives.js1
-rw-r--r--doc/html/group___tpm2_module.html2
-rw-r--r--doc/html/hash_8h.html2
-rw-r--r--doc/html/hashwrap_8h.html254
-rw-r--r--doc/html/how__validated_8dox.html2
-rw-r--r--doc/html/implementation__notes_8dox.html2
-rw-r--r--doc/html/implementing_member.pngbin0 -> 3858 bytes
-rw-r--r--doc/html/index.html2
-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.html2
-rw-r--r--doc/html/load__external_8h.html2
-rw-r--r--doc/html/mainpage_8dox.html2
-rw-r--r--doc/html/mathdefs_8h.html96
-rw-r--r--doc/html/mathtypes_8h.html133
-rw-r--r--doc/html/member_2api_8h.html23
-rw-r--r--doc/html/member_2tiny_2math_2pairing_8h.html169
-rw-r--r--doc/html/modules.html2
-rw-r--r--doc/html/navtreedata.js26
-rw-r--r--doc/html/navtreeindex0.js266
-rw-r--r--doc/html/navtreeindex1.js494
-rw-r--r--doc/html/navtreeindex2.js205
-rw-r--r--doc/html/nv_8c.html2
-rw-r--r--doc/html/nv_8h.html2
-rw-r--r--doc/html/organization_8dox.html2
-rw-r--r--doc/html/pageorder_8dox.html2
-rw-r--r--doc/html/pages.html3
-rw-r--r--doc/html/printtss_8c.html2
-rw-r--r--doc/html/printtss_8h.html2
-rw-r--r--doc/html/printutils_8h.html2
-rw-r--r--doc/html/provisioning_8dox.html2
-rw-r--r--doc/html/revocation_8dox.html2
-rw-r--r--doc/html/sdk__overview_8dox.html2
-rw-r--r--doc/html/serialize_8h.html694
-rw-r--r--doc/html/sha256_8h.html227
-rw-r--r--doc/html/sha512_8h.html221
-rw-r--r--doc/html/sign_8c.html2
-rw-r--r--doc/html/sign_8h.html2
-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.html2
-rw-r--r--doc/html/state_8h.html2
-rw-r--r--doc/html/stdtypes_8h.html2
-rw-r--r--doc/html/struct_basic_signature.html2
-rw-r--r--doc/html/struct_big_num_str.html2
-rw-r--r--doc/html/struct_compressed_priv_key.html2
-rw-r--r--doc/html/struct_ecc_point_fq.html101
-rw-r--r--doc/html/struct_ecc_point_fq2.html101
-rw-r--r--doc/html/struct_ecc_point_jacobi_fq.html105
-rw-r--r--doc/html/struct_ecc_point_jacobi_fq2.html105
-rw-r--r--doc/html/struct_ecdsa_private_key.html2
-rw-r--r--doc/html/struct_ecdsa_public_key.html2
-rw-r--r--doc/html/struct_ecdsa_signature.html2
-rw-r--r--doc/html/struct_epid11_basic_signature.html2
-rw-r--r--doc/html/struct_epid11_g2_elem_str.html2
-rw-r--r--doc/html/struct_epid11_group_pub_key.html2
-rw-r--r--doc/html/struct_epid11_group_rl.html2
-rw-r--r--doc/html/struct_epid11_gt_elem_str.html2
-rw-r--r--doc/html/struct_epid11_nr_proof.html2
-rw-r--r--doc/html/struct_epid11_params.html2
-rw-r--r--doc/html/struct_epid11_priv_rl.html2
-rw-r--r--doc/html/struct_epid11_sig_rl.html2
-rw-r--r--doc/html/struct_epid11_sig_rl_entry.html2
-rw-r--r--doc/html/struct_epid11_signature.html2
-rw-r--r--doc/html/struct_epid11_verifier_precomp.html2
-rw-r--r--doc/html/struct_epid2_params.html2
-rw-r--r--doc/html/struct_epid_ca_certificate.html2
-rw-r--r--doc/html/struct_epid_file_header.html2
-rw-r--r--doc/html/struct_epid_signature.html2
-rw-r--r--doc/html/struct_fp_elem.html97
-rw-r--r--doc/html/struct_fp_elem_str.html2
-rw-r--r--doc/html/struct_fq12_elem.html101
-rw-r--r--doc/html/struct_fq12_elem_str.html2
-rw-r--r--doc/html/struct_fq2_elem.html101
-rw-r--r--doc/html/struct_fq2_elem_str.html2
-rw-r--r--doc/html/struct_fq3_elem_str.html2
-rw-r--r--doc/html/struct_fq6_elem.html105
-rw-r--r--doc/html/struct_fq6_elem_str.html2
-rw-r--r--doc/html/struct_fq_elem.html97
-rw-r--r--doc/html/struct_fq_elem_str.html2
-rw-r--r--doc/html/struct_g1_elem_str.html2
-rw-r--r--doc/html/struct_g2_elem_str.html2
-rw-r--r--doc/html/struct_group_pub_key.html2
-rw-r--r--doc/html/struct_group_rl.html2
-rw-r--r--doc/html/struct_gt_elem_str.html2
-rw-r--r--doc/html/struct_i_priv_key.html2
-rw-r--r--doc/html/struct_join_request.html2
-rw-r--r--doc/html/struct_member_params.html4
-rw-r--r--doc/html/struct_member_precomp.html2
-rw-r--r--doc/html/struct_membership_credential.html2
-rw-r--r--doc/html/struct_nr_proof.html2
-rw-r--r--doc/html/struct_oct_str128.html2
-rw-r--r--doc/html/struct_oct_str16.html2
-rw-r--r--doc/html/struct_oct_str256.html2
-rw-r--r--doc/html/struct_oct_str32.html2
-rw-r--r--doc/html/struct_oct_str512.html2
-rw-r--r--doc/html/struct_oct_str600.html2
-rw-r--r--doc/html/struct_oct_str64.html2
-rw-r--r--doc/html/struct_oct_str768.html2
-rw-r--r--doc/html/struct_oct_str8.html2
-rw-r--r--doc/html/struct_oct_str80.html2
-rw-r--r--doc/html/struct_pairing_state.html98
-rw-r--r--doc/html/struct_priv_key.html2
-rw-r--r--doc/html/struct_priv_rl.html2
-rw-r--r--doc/html/struct_sha256_digest.html2
-rw-r--r--doc/html/struct_sig_rl.html2
-rw-r--r--doc/html/struct_sig_rl_entry.html2
-rw-r--r--doc/html/struct_tpm2_ctx.html2
-rw-r--r--doc/html/struct_verifier_precomp.html2
-rw-r--r--doc/html/struct_verifier_rl.html2
-rw-r--r--doc/html/struct_very_large_int.html98
-rw-r--r--doc/html/struct_very_large_int_product.html97
-rw-r--r--doc/html/structtiny__sha.html110
-rw-r--r--doc/html/tatepairing_8h.html2
-rw-r--r--doc/html/tiny__stdlib_8h.html193
-rw-r--r--doc/html/tpm__considerations_8dox.html2
-rw-r--r--doc/html/tpm__member_8h.html2
-rw-r--r--doc/html/types_8h.html2
-rw-r--r--doc/html/uml_sequence.pngbin27955 -> 27669 bytes
-rw-r--r--doc/html/unionsha__digest.html105
-rw-r--r--doc/html/using__ikgf_8dox.html2
-rw-r--r--doc/html/verifier_21_81_2api_8h.html2
-rw-r--r--doc/html/verifier_2api_8h.html2
-rw-r--r--doc/html/verifysig__walkthrough_8dox.html2
-rw-r--r--doc/html/vli_8h.html886
-rw-r--r--epid/common-testhelper/Makefile4
-rw-r--r--epid/common-testhelper/epid_gtest-testhelper.cc3
-rw-r--r--epid/common-testhelper/member_wrapper-testhelper.cc290
-rw-r--r--epid/common-testhelper/member_wrapper-testhelper.h84
-rw-r--r--epid/common/epiddefs.h39
-rw-r--r--epid/common/math/unittests/ecgroup-test.cc75
-rw-r--r--epid/common/tinycommon.parts46
-rw-r--r--epid/member/Makefile123
-rw-r--r--epid/member/api.h150
-rw-r--r--epid/member/software_member.h2
-rw-r--r--epid/member/src/context.c182
-rw-r--r--epid/member/src/nrprove.h2
-rw-r--r--epid/member/src/sign.c3
-rw-r--r--epid/member/src/signbasic.h2
-rw-r--r--epid/member/tiny/math/efq.h254
-rw-r--r--epid/member/tiny/math/efq2.h103
-rw-r--r--epid/member/tiny/math/fp.h135
-rw-r--r--epid/member/tiny/math/fq.h168
-rw-r--r--epid/member/tiny/math/fq12.h165
-rw-r--r--epid/member/tiny/math/fq2.h155
-rw-r--r--epid/member/tiny/math/fq6.h137
-rw-r--r--epid/member/tiny/math/hashwrap.h109
-rw-r--r--epid/member/tiny/math/math.parts51
-rw-r--r--epid/member/tiny/math/mathdefs.h27
-rw-r--r--epid/member/tiny/math/mathtypes.h101
-rw-r--r--epid/member/tiny/math/pairing.h48
-rw-r--r--epid/member/tiny/math/serialize.h183
-rw-r--r--epid/member/tiny/math/sha256.h133
-rw-r--r--epid/member/tiny/math/sha512.h89
-rw-r--r--epid/member/tiny/math/src/efq.c412
-rw-r--r--epid/member/tiny/math/src/efq2.c253
-rw-r--r--epid/member/tiny/math/src/fp.c120
-rw-r--r--epid/member/tiny/math/src/fq.c126
-rw-r--r--epid/member/tiny/math/src/fq12.c282
-rw-r--r--epid/member/tiny/math/src/fq2.c150
-rw-r--r--epid/member/tiny/math/src/fq6.c192
-rw-r--r--epid/member/tiny/math/src/hashwrap.c86
-rw-r--r--epid/member/tiny/math/src/pairing.c300
-rw-r--r--epid/member/tiny/math/src/serialize.c232
-rw-r--r--epid/member/tiny/math/src/sha256.c225
-rw-r--r--epid/member/tiny/math/src/sha512.c169
-rw-r--r--epid/member/tiny/math/src/vli.c316
-rw-r--r--epid/member/tiny/math/unittests/cmp-testhelper.cc71
-rw-r--r--epid/member/tiny/math/unittests/cmp-testhelper.h65
-rw-r--r--epid/member/tiny/math/unittests/efq-test.cc714
-rw-r--r--epid/member/tiny/math/unittests/efq2-test.cc406
-rw-r--r--epid/member/tiny/math/unittests/fp-test.cc263
-rw-r--r--epid/member/tiny/math/unittests/fq-test.cc329
-rw-r--r--epid/member/tiny/math/unittests/fq12-test.cc1058
-rw-r--r--epid/member/tiny/math/unittests/fq2-test.cc352
-rw-r--r--epid/member/tiny/math/unittests/fq6-test.cc452
-rw-r--r--epid/member/tiny/math/unittests/internal/onetimepad-test.cc130
-rw-r--r--epid/member/tiny/math/unittests/main-testhelper.cc24
-rw-r--r--epid/member/tiny/math/unittests/onetimepad.h122
-rw-r--r--epid/member/tiny/math/unittests/pairing-test.cc79
-rw-r--r--epid/member/tiny/math/unittests/serialize-test.cc423
-rw-r--r--epid/member/tiny/math/unittests/sha256-test.cc350
-rw-r--r--epid/member/tiny/math/unittests/sha512-test.cc108
-rw-r--r--epid/member/tiny/math/unittests/utest.parts47
-rw-r--r--epid/member/tiny/math/unittests/vli-test.cc379
-rw-r--r--epid/member/tiny/math/vli.h196
-rw-r--r--epid/member/tiny/src/allowed_basenames.c76
-rw-r--r--epid/member/tiny/src/allowed_basenames.h46
-rw-r--r--epid/member/tiny/src/context.h75
-rw-r--r--epid/member/tiny/src/createjoinrequest.c121
-rw-r--r--epid/member/tiny/src/decompresskey.c29
-rw-r--r--epid/member/tiny/src/init.c94
-rw-r--r--epid/member/tiny/src/native_types.h64
-rw-r--r--epid/member/tiny/src/nrprove.c136
-rw-r--r--epid/member/tiny/src/nrprove.h66
-rw-r--r--epid/member/tiny/src/presig.c31
-rw-r--r--epid/member/tiny/src/presig_compute.c100
-rw-r--r--epid/member/tiny/src/presig_compute.h51
-rw-r--r--epid/member/tiny/src/provisioncompressed.c31
-rw-r--r--epid/member/tiny/src/provisioncredential.c81
-rw-r--r--epid/member/tiny/src/provisionkey.c90
-rw-r--r--epid/member/tiny/src/registerbasename.c47
-rw-r--r--epid/member/tiny/src/serialize.c141
-rw-r--r--epid/member/tiny/src/serialize.h98
-rw-r--r--epid/member/tiny/src/sethashalg.c33
-rw-r--r--epid/member/tiny/src/setsigrl.c79
-rw-r--r--epid/member/tiny/src/sign.c117
-rw-r--r--epid/member/tiny/src/signbasic.c159
-rw-r--r--epid/member/tiny/src/signbasic.h37
-rw-r--r--epid/member/tiny/src/startup.c27
-rw-r--r--epid/member/tiny/src/validate.c101
-rw-r--r--epid/member/tiny/src/validate.h86
-rw-r--r--epid/member/tiny/stdlib/endian.h38
-rw-r--r--epid/member/tiny/stdlib/src/tiny_stdlib.c46
-rw-r--r--epid/member/tiny/stdlib/tiny_stdlib.h64
-rw-r--r--epid/member/tiny/stdlib/tiny_stdlib.parts37
-rw-r--r--epid/member/tiny/unittests/allowed_basenames-test.cc117
-rw-r--r--epid/member/tiny/unittests/context-test.cc484
-rw-r--r--epid/member/tiny/unittests/decompress_privkey-test.cc99
-rw-r--r--epid/member/tiny/unittests/get_sigsize-test.cc94
-rw-r--r--epid/member/tiny/unittests/internal/nr_prove-test.cc181
-rw-r--r--epid/member/tiny/unittests/internal/presig_compute-test.cc44
-rw-r--r--epid/member/tiny/unittests/internal/serialize-test.cc409
-rw-r--r--epid/member/tiny/unittests/internal/signbasic-test.cc109
-rw-r--r--epid/member/tiny/unittests/internal/validate-test.cc317
-rw-r--r--epid/member/tiny/unittests/join_request-test.cc369
-rw-r--r--epid/member/tiny/unittests/main-testhelper.cc24
-rw-r--r--epid/member/tiny/unittests/member-testhelper.cc468
-rw-r--r--epid/member/tiny/unittests/member-testhelper.h119
-rw-r--r--epid/member/tiny/unittests/presig-test.cc117
-rw-r--r--epid/member/tiny/unittests/provision_compressed-test.cc176
-rw-r--r--epid/member/tiny/unittests/provision_credential-test.cc317
-rw-r--r--epid/member/tiny/unittests/provision_key-test.cc243
-rw-r--r--epid/member/tiny/unittests/sign-test.cc1082
-rw-r--r--epid/member/tiny/unittests/utest.parts64
-rw-r--r--epid/member/tinymember.parts98
-rw-r--r--epid/member/tpm2/unittests/createprimary-test.cc (renamed from epid/member/tpm2/unittests/createprimary-tss-test.cc)31
-rw-r--r--epid/member/unittests/context-test.cc249
-rw-r--r--epid/member/unittests/join_request-test.cc26
-rw-r--r--epid/member/unittests/member-testhelper.cc264
-rw-r--r--epid/member/unittests/member-testhelper.h53
-rw-r--r--epid/member/unittests/nr_prove-test.cc2
-rw-r--r--epid/member/unittests/provision_compressed-test.cc20
-rw-r--r--epid/member/unittests/provision_credential-test.cc51
-rw-r--r--epid/member/unittests/provision_key-test.cc37
-rw-r--r--epid/member/unittests/sign-test.cc30
-rw-r--r--epid/member/unittests/signbasic-test.cc42
-rw-r--r--epid/verifier/Makefile4
-rw-r--r--example/Makefile18
-rw-r--r--example/signmsg/signmsg.parts5
-rw-r--r--example/signmsg/src/main.c360
-rw-r--r--example/signmsg/src/signmsg.c17
-rw-r--r--example/util/util.parts3
-rw-r--r--example/verifysig/src/main.c398
-rw-r--r--example/verifysig/verifysig.parts4
-rw-r--r--ext/argtable3/LICENSE26
-rw-r--r--ext/argtable3/Makefile22
-rw-r--r--ext/argtable3/argtable3.c5062
-rw-r--r--ext/argtable3/argtable3.h305
-rw-r--r--ext/argtable3/argtable3.parts (renamed from ext/dropt/dropt.parts)36
-rw-r--r--ext/dropt/LICENSE22
-rw-r--r--ext/dropt/Makefile23
-rw-r--r--ext/dropt/include/dropt.h249
-rw-r--r--ext/dropt/include/dropt_string.h94
-rw-r--r--ext/dropt/src/dropt.c1562
-rw-r--r--ext/dropt/src/dropt_handlers.c438
-rw-r--r--ext/dropt/src/dropt_string.c690
-rw-r--r--ext/ipp/ippcp.parts4
-rw-r--r--ext/ipp/sources/ippcp/src/pcpbnca.c8
-rw-r--r--ext/ipp/sources/ippcp/src/pcpbnu32misc.c8
-rw-r--r--ext/ipp/sources/ippcp/src/pcpbnumisc.c8
-rw-r--r--ext/ipp/sources/ippcp/src/pcpgfpecpointstuff.c8
-rw-r--r--ext/ipp/sources/ippcp/src/pcpgfpxstuff.c8
-rw-r--r--parts-site/configurations/debug/gcc_win32-any.py (renamed from parts-site/configurations/debug/gcc_win32_any.py)0
-rw-r--r--parts-site/configurations/debug/intelc_win32-any_win32-x86.py2
-rw-r--r--parts-site/configurations/debug/intelc_win32-any_win32-x86_64.py2
-rw-r--r--parts-site/configurations/debug/msvc_win32-any_win32-x86.py2
-rw-r--r--parts-site/configurations/debug/msvc_win32-any_win32-x86_64.py2
-rw-r--r--parts-site/configurations/embedded/__init__.py (renamed from parts-site/configurations/size_optimized_release/__init__.py)4
-rw-r--r--parts-site/configurations/embedded/gcc.py72
-rw-r--r--parts-site/configurations/embedded/gcc_win32-any.py (renamed from parts-site/configurations/size_optimized_release/gcc_win32-any.py)54
-rw-r--r--parts-site/configurations/embedded/intelc_posix-any.py (renamed from parts-site/configurations/size_optimized_release/g++_win32-any.py)44
-rw-r--r--parts-site/configurations/embedded/intelc_win32-any.py69
-rw-r--r--parts-site/configurations/embedded/msvc_win32-any.py85
-rw-r--r--parts-site/configurations/release/intelc_win32-any_win32-x86.py5
-rw-r--r--parts-site/configurations/release/intelc_win32-any_win32-x86_64.py5
-rw-r--r--parts-site/configurations/release/msvc_win32-any_win32-x86.py5
-rw-r--r--parts-site/configurations/release/msvc_win32-any_win32-x86_64.py5
-rw-r--r--parts-site/configurations/size_optimized_release/g++.py57
-rw-r--r--parts-site/configurations/size_optimized_release/gcc.py65
-rw-r--r--parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86.py58
-rw-r--r--parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86_64.py59
-rw-r--r--parts-site/configurations/size_optimized_release/intelc_win32-any_win32-x86.py59
-rw-r--r--parts-site/configurations/size_optimized_release/intelc_win32-any_win32-x86_64.py58
-rw-r--r--parts-site/configurations/size_optimized_release/msvc_win32-any_win32-x86.py65
-rw-r--r--parts-site/configurations/size_optimized_release/msvc_win32-any_win32-x86_64.py64
-rw-r--r--tools/Makefile22
-rw-r--r--tools/extractgrps/extractgrps.parts4
-rw-r--r--tools/extractgrps/src/main.c167
-rw-r--r--tools/extractkeys/extractkeys.parts4
-rw-r--r--tools/extractkeys/src/main.c174
-rw-r--r--tools/revokegrp/revokegrp.parts4
-rw-r--r--tools/revokegrp/src/main.c204
-rw-r--r--tools/revokekey/revokekey.parts4
-rw-r--r--tools/revokekey/src/main.c180
-rw-r--r--tools/revokesig/revokesig.parts4
-rw-r--r--tools/revokesig/src/main.c235
485 files changed, 43259 insertions, 7702 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ec63ce5..a1bc22a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,59 +1,106 @@
# Intel(R) EPID SDK ChangeLog {#ChangeLog}
+## [6.0.0] - 2017-12-15
+
+### Added
+
+- The member can now be built with a substantially reduced code size
+ using a compilation option.
+
+- New context lifetime management APIs have been added to member to
+ give callers more control of memory allocation.
+
+- New member API `EpidClearRegisteredBasenames` has been added to
+ clear registered basenames without recreating the member.
+
+### Changed
+
+- `EpidRegisterBaseName` was renamed to `EpidRegisterBasename` because
+ basename is a single word.
+
+- Command-line parsing library used by samples and tools has been
+ replaced by Argtable3.
+
+
+### Deprecated
+
+- `EpidMemberCreate` has been deprecated. This API has been superseded
+ by `EpidMemberGetSize` and `EpidMemberInit`.
+
+- `EpidMemberDelete` has been deprecated. This API has been superseded
+ by `EpidMemberDeinit`.
+
+### Removed
+
+- `size_optimized_release` build configuration has been removed.
+ Use the compilation option to build member with reduced code size.
+
+### 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.
+
+- Scons build will not work natively on ARM. You can still build using
+ `make` or cross compile.
+
+
## [5.0.0] - 2017-09-15
### Added
-* The member implementation now has the option to support signing
+- 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
+- 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
+- `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
+- 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.
+- Basenames are limited to 124 bytes in TPM mode.
## [4.0.0] - 2017-04-25
### Added
-* The member implementation now provides an internal interface that
+- 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.
-* New member API `EpidAssemblePrivKey` was added to help assemble and
+- New member API `EpidAssemblePrivKey` was added to help assemble and
validate the new member private key that is created when a member
either joins a group (using the join protocol) or switches to a new
group (as the result of a performance rekey).
@@ -61,9 +108,9 @@
### Changed
-* Updated Intel(R) IPP Cryptography library to version 2017 (Update 2).
+- Updated Intel(R) IPP Cryptography library to version 2017 (Update 2).
-* The mechanism to set the signature based revocation list (SigRL)
+- The mechanism to set the signature based revocation list (SigRL)
used for signing was changed. `EpidMemberSetSigRl` must be used to
set the SigRL. The SigRL is no longer a parameter to `EpidSign`.
This better models typical use case where a device stores a
@@ -72,37 +119,37 @@
### Removed
-* Removed `EpidWritePreSigs` API. Serialization of pre-computed
+- Removed `EpidWritePreSigs` API. Serialization of pre-computed
signatures is a risky capability to provide, and simply expanding
the internal pool via `EpidAddPreSigs` still provides most of the
optimization benefits.
-* The `EpidIsPrivKeyInGroup` API is no longer exposed to clients. It
+- The `EpidIsPrivKeyInGroup` API is no longer exposed to clients. It
is no longer needed because the new member API `EpidAssemblePrivKey`
performs this check.
### Fixed
-* When building with commercial version of the Intel(R) IPP
+- When building with commercial version of the Intel(R) IPP
Cryptography library, optimized functions are now properly invoked,
making signing and verification operations ~2 times faster
-* SHA-512/256 hash algorithm is now supported.
+- SHA-512/256 hash algorithm is now supported.
-* README for compressed data now correctly documents the number of
+- README for compressed data now correctly documents the number of
entries in revocation lists.
-* The `verifysig` sample now reports a more clear error message for
+- The `verifysig` sample now reports a more clear error message for
mismatched SigRLs.
-* The default scons build will now build for a 32-bit target on a
+- The default scons build will now build for a 32-bit target on a
32-bit platform.
### Known Issues
-* Scons build will not work natively on ARM. You can still build using
+- Scons build will not work natively on ARM. You can still build using
`make` or cross compile.
@@ -110,16 +157,16 @@
### Added
-* Support for verification of Intel(R) EPID 1.1 members.
+- Support for verification of Intel(R) EPID 1.1 members.
-* Make-based build system support.
+- Make-based build system support.
-* Sample material includes compressed keys.
+- Sample material includes compressed keys.
-* Enhanced documentation, including step-by-step walkthroughs of
+- Enhanced documentation, including step-by-step walkthroughs of
example applications.
-* Validated on additional IoT platforms.
+- Validated on additional IoT platforms.
- Ostro Linux
@@ -128,11 +175,11 @@
### Changes
-* A new verifier API has been added to set the basename to be used for
+- A new verifier API has been added to set the basename to be used for
verification. Verifier APIs that used to accept basenames now use
the basename set via `EpidVerifierSetBasename`.
-* The verifier pre-computation structure has been changed to include
+- The verifier pre-computation structure has been changed to include
the group ID to allow detection of errors that result from providing
a pre-computation blob from a different group to
`EpidVerifierCreate`.
@@ -140,20 +187,20 @@
### Fixes
-* The kEpidxxxRevoked enums have been renamed to be consistent with
+- The kEpidxxxRevoked enums have been renamed to be consistent with
other result return values.
### Known Issues
-* SHA-512/256 hash algorithm is not supported.
+- SHA-512/256 hash algorithm is not supported.
## [2.0.0] - 2016-07-20
### Added
-* Signed binary issuer material support.
+- Signed binary issuer material support.
- Binary issuer material validation APIs.
@@ -161,9 +208,9 @@
- Updated samples that parse signed binary issuer material.
-* Compressed member private key support.
+- Compressed member private key support.
-* Validated on additional IoT platforms.
+- Validated on additional IoT platforms.
- Windows 10 IoT Core
@@ -172,23 +219,23 @@
### Changed
-* The default hash algorithm has changed. It is now SHA-512.
+- The default hash algorithm has changed. It is now SHA-512.
-* Functions that returned `EpidNullPtrErr` now return `EpidBadArgErr`
+- Functions that returned `EpidNullPtrErr` now return `EpidBadArgErr`
instead.
### Fixed
-* Updated build flags to work around GCC 4.8.5 defect.
+- Updated build flags to work around GCC 4.8.5 defect.
## [1.0.0] - 2016-03-03
### Added
-* Basic sign and verify functionality
+- Basic sign and verify functionality
-* Dynamic join support for member
+- Dynamic join support for member
-* Apache 2.0 License
+- Apache 2.0 License
diff --git a/LICENSE.txt b/LICENSE.txt
index cdce082..6af6000 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -220,6 +220,9 @@ The Intel(R) EPID SDK bundles portions of the following under the BSD
- Google Test (https://github.com/google/googletest)
Copyright 2008, Google Inc.
+ - Argtable3 (https://github.com/argtable/argtable3)
+ Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ <sheitmann@users.sourceforge.net>
All rights reserved.
@@ -248,34 +251,3 @@ 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.
-
-
------------------------------------------------------------------------
-zlib License
------------------------------------------------------------------------
-
-The Intel(R) EPID SDK bundles portions of the following under the zlib
-License:
-
-dropt
-Copyright (c) 2006-2012 James D. Lin <jameslin@cal.berkeley.edu>
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
-
-2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source distribution.
-
-<http://www.opensource.org/licenses/zlib-license.php>
diff --git a/Makefile.in b/Makefile.in
index 212be4a..1c96fc2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -9,21 +9,11 @@ CXX = @CXX@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
RANLIB = @RANLIB@
-CONFIG = @CONFIG@
+TSS_PATH = @TSS_PATH@
+TINY = @TINY@
#set performance affecting flags
-ifeq ($(CONFIG),release)
- SIZE_CFLAGS := -O2
-else
- SIZE_CFLAGS := -Os
- ifeq ($(findstring icc,$(CC)),icc)
- ifeq ($(findstring -m32,$(CFLAGS)),-m32)
- SIZE_CFLAGS := -O2
- endif
- endif
- SIZE_CFLAGS += -fdata-sections -ffunction-sections
- LDFLAGS += -Xlinker --gc-sections
-endif
+SIZE_CFLAGS := -O2
#gcc flags
CC_FLAGS := $(CFLAGS) $(SIZE_CFLAGS) -Werror -Wall -Wextra -Wno-missing-braces \
@@ -46,7 +36,7 @@ else
CXX11_FLAG = -std=gnu++11
EXE_EXTENSION = .exe
endif
-$(info $(EXE_EXTENSION))
+
#g++ flags
CXX_FLAGS := $(CC_FLAGS) $(CXX11_FLAG)
@@ -77,8 +67,7 @@ else
endif
#set ippflags
-IPP_FLAGS := -Wno-misleading-indentation -D_IPP_v50_ -D_IPP_DEBUG \
- -D_DISABLE_ALG_MD5_ -D_DISABLE_ALG_SM3_
+IPP_FLAGS := -D_IPP_v50_ -D_IPP_DEBUG -D_DISABLE_ALG_MD5_ -D_DISABLE_ALG_SM3_
#set tools and flags depending on specified compiler
ifeq ($(findstring icc,$(CC)),icc)
@@ -110,15 +99,16 @@ export AR RANLIB
export epidinstalldir
export GTEST_FLAGS GTEST_DEFINES IPP_FLAGS
export EXE_EXTENSION
+export TSS_PATH
+export TINY
-#just output
+#output of the main parameters
$(info $$ccompiler is [${CC}])
$(info $$cxxcompiler is [${CXX}])
$(info $$architecture is [${ARCH}])
-
#targets part
all:
- $(MAKE) ipp common member verifier dropt examples_util
+ $(MAKE) ipp common member verifier argtable3 examples_util
$(MAKE) examples epid_tools
clean:
@@ -131,7 +121,7 @@ clean:
$(MAKE) -C ./tools/ clean
$(MAKE) -C ./ext/gtest/ clean
$(MAKE) -C ./epid/common-testhelper/ clean
- $(MAKE) -C ./ext/dropt/ clean
+ $(MAKE) -C ./ext/argtable3/ clean
ifneq ("$(wildcard ./ext/google_benchmark)","")
$(MAKE) -C ./ext/google_benchmark/ clean
endif
@@ -178,8 +168,8 @@ verifier_utest:
gtest:
$(MAKE) -C ./ext/gtest/ all
-dropt:
- $(MAKE) -C ./ext/dropt/ all
+argtable3:
+ $(MAKE) -C ./ext/argtable3/ all
examples_util:
$(MAKE) -C ./example/util/ all
diff --git a/SConstruct b/SConstruct
index 3819297..08ac78d 100644
--- a/SConstruct
+++ b/SConstruct
@@ -151,7 +151,7 @@ common_parts = ['epid/common/common.parts']
member_parts = ['epid/member/member.parts']
verifier_parts = ['epid/verifier/verifier.parts']
util_parts = ['example/util/util.parts']
-example_parts = ['ext/dropt/dropt.parts',
+example_parts = ['ext/argtable3/argtable3.parts',
'example/verifysig/verifysig.parts',
'example/signmsg/signmsg.parts',
'example/data/data.parts',
@@ -184,7 +184,7 @@ package_parts = ['ext/gtest/gtest.parts',
'ext/ipp/ippcp.parts',
'package.parts']
memory_profiler_parts = ['tools/memory_profiler/memory_profiler.parts']
-internal_tools_parts = ['ext/dropt/dropt.parts',
+internal_tools_parts = ['ext/argtable3/argtable3.parts',
'tools/ikgfwrapper/ikgfwrapper.parts']
epid_data = ['test/epid_data/epid_data.parts']
perf_benchmark_parts = ['ext/google_benchmark/google_benchmark.parts',
@@ -197,7 +197,9 @@ product_variants = [
'internal-test',
'package-epid-sdk',
'internal-tools',
- 'benchmark'
+ 'benchmark',
+ 'tiny',
+ 'internal-test-tiny'
]
default_variant = 'production'
@@ -222,6 +224,12 @@ def is_package():
def is_benchmark():
return GetOption("product-variant") == 'benchmark'
+def is_tiny():
+ return GetOption("product-variant") == 'tiny'
+
+def is_internal_test_tiny():
+ return GetOption("product-variant") == 'internal-test-tiny'
+
def use_commercial_ipp():
return GetOption("use-commercial-ipp")
@@ -233,7 +241,7 @@ def use_tss():
def config_has_instrumentation():
return any(DefaultEnvironment().isConfigBasedOn(config_name)
- for config_name in ['instr_release', 'instr_size_optimized_release'])
+ for config_name in ['instr_release'])
def variant_dirname():
@@ -242,6 +250,8 @@ def variant_dirname():
return 'epid-sdk'
elif s == 'package-epid-sdk':
return 'epid-sdk'
+ elif s == 'tiny':
+ return 'epid-sdk'
else:
return s
@@ -271,6 +281,19 @@ AddOption("--ipp-shared",
action='store_true', dest='ipp-shared',
default=False)
+AddOption("--enable-sanitizers",
+ help=("Build with sanitizers (https://github.com/google/sanitizers)."),
+ action='store_true', dest='sanitizers',
+ default=False)
+
+AddOption("--sanitizers-recover",
+ help=("Configure sanititzers to recover and continue execution "
+ "on error found. Only applicable when sanitizers are enabled."
+ "See --enable-sanitizers option."),
+ action='store_true', dest='sanitizers-recover',
+ default=False)
+
+
SetOptionDefault("PRODUCT_VARIANT", variant_dirname())
######## End Commandline option setup ###################################
@@ -280,6 +303,48 @@ SetOptionDefault("PRODUCT_VARIANT", variant_dirname())
SetOptionDefault('PARTS_USE_SHORT_TOOL_NAMES', 1)
+def enable_sanitizers(recover):
+ """
+ Configures compiler to enable sanitizers.
+ Adds sanitizer options to default scons environment such
+ that it affects all parts.
+ Args:
+ recover: Enable sanitizers recovery from errors found when True.
+ """
+ env = DefaultEnvironment()
+ error_msg = None
+ try:
+ major = int(env.subst('$GCC_VERSION').partition('.')[0])
+ except ValueError:
+ major = 0
+
+ if major >= 6 and env['TARGET_OS'] == 'posix':
+ if 'INTELC_VERSION' not in env:
+ ccflags = ['-fsanitize=address,undefined', '-fno-sanitize=alignment',
+ '-fno-sanitize=shift', '-fno-omit-frame-pointer']
+ if recover:
+ ccflags = ccflags + ['-fsanitize-recover=all', '-fsanitize-recover=address']
+ else:
+ ccflags = ccflags + ['-fno-sanitize-recover']
+ # Extends default flags with sanitizer options
+ SetOptionDefault('CCFLAGS', ccflags)
+ SetOptionDefault('LIBS', ['asan', 'ubsan'])
+ else:
+ error_msg = """
+ Build with sanitizers is not supported for Intel(R) C++ Compiler.
+ Try scons --toolchain=gcc_6 --target=posix
+ """
+ else:
+ # User experience with sanitizers in GCC 4.8 is not great. Use at least GCC 6.x.
+ error_msg = """
+ Build with sanitizers is only supported for GCC version greater than
+ 6.x targeting posix OS. Current GCC version is "{0}" and OS target is "{1}".
+ Try scons --toolchain=gcc_6 --target=posix
+ """.format(env.get('GCC_VERSION', 'unknown'), env.get('TARGET_OS', 'unknown'))
+ if error_msg is not None:
+ env.PrintError(error_msg)
+
+
def set_default_production_options():
SetOptionDefault('CONFIG', 'release')
@@ -325,6 +390,9 @@ def set_default_production_options():
'{PRODUCT_VARIANT}')
+if GetOption("sanitizers"):
+ enable_sanitizers(GetOption("sanitizers-recover"))
+
if is_production():
set_default_production_options()
ipp_mode = ['install_lib']
@@ -394,19 +462,37 @@ if is_benchmark():
ipp_mode.append('build_ipp_shared')
SetOptionDefault('INSTALL_TEST_BIN',
'$INSTALL_ROOT/test_ipp_shared')
+ SetOptionDefault('INSTALL_LIB',
+ '$INSTALL_ROOT/lib_ipp_shared')
+ else:
+ SetOptionDefault('INSTALL_LIB',
+ '$INSTALL_ROOT/lib')
+
# do not allow file links to keep previous builds intact
SetOptionDefault('CCOPY_LOGIC', 'copy')
- include_parts(ipp_parts, mode=MODE+ipp_mode, INSTALL_BIN='${INSTALL_TEST_BIN}')
+ include_parts(ipp_parts, config_independent=True, mode=MODE + ipp_mode,
+ INSTALL_BIN='${INSTALL_TEST_BIN}')
include_parts(example_static_parts + utest_parts + perf_benchmark_parts +
- common_parts + member_parts + verifier_parts +
+ common_parts + verifier_parts +
sizing_parts + epid_data,
+ config_independent=True,
mode=MODE,
INSTALL_BIN='${INSTALL_TEST_BIN}')
- if 'use_memory_profiler' in MODE:
+
+ member_mode = ['install_lib']
+ member_cfg = ('embedded' if not DefaultEnvironment().isConfigBasedOn(
+ 'debug') and not config_has_instrumentation() else DefaultEnvironment().subst('$CONFIG'))
+ Part(parts_file='epid/common/tinycommon.parts', CONFIG=member_cfg)
+ Part(parts_file='epid/member/tinymember.parts', CONFIG=member_cfg,
+ config_independent=True, mode=MODE + member_mode, INSTALL_BIN='${INSTALL_TEST_BIN}')
+
+ if config_has_instrumentation():
include_parts(memory_benchmark_parts + memory_profiler_parts,
+ config_independent=True,
mode=MODE,
INSTALL_BIN='${INSTALL_TEST_BIN}')
+
Default('build::')
if is_package():
@@ -416,4 +502,65 @@ if is_package():
INSTALL_TOP_LEVEL='${PACKAGE_ROOT}')
Default('package')
+if is_tiny():
+ set_default_production_options()
+ ### Member
+ Part(parts_file='ext/gtest/gtest.parts')
+ member_mode = ['install_lib']
+ member_cfg = ('embedded'
+ if not DefaultEnvironment().isConfigBasedOn('debug')
+ else DefaultEnvironment().subst('$CONFIG'))
+ Part(parts_file='epid/common/tinycommon.parts', CONFIG=member_cfg)
+ Part(parts_file='epid/member/tinymember.parts', CONFIG=member_cfg,
+ config_independent=True, mode=member_mode)
+ Default('member::')
+ Default('run_utest::member::')
+ ### Verifier, samples and tools
+ verifier_mode = ['install_lib']
+ ipp_mode = ['install_lib']
+ if use_commercial_ipp():
+ ipp_mode.append('use_commercial_ipp')
+ if GetOption('ipp-shared'):
+ ipp_mode.append('build_ipp_shared')
+ include_parts(ipp_parts, mode=ipp_mode,
+ INSTALL_INCLUDE='${INSTALL_IPP_INCLUDE}')
+ Part(parts_file='epid/common-testhelper/common-testhelper.parts',
+ config_independent=True)
+ include_parts(common_parts + verifier_parts,
+ mode=verifier_mode,
+ INSTALL_INCLUDE='${INSTALL_EPID_INCLUDE}')
+ include_parts(util_parts + example_parts,
+ INSTALL_INCLUDE='${INSTALL_EPID_INCLUDE}',
+ INSTALL_BIN='${INSTALL_SAMPLE_BIN}',
+ INSTALL_DATA='${INSTALL_SAMPLE_DATA}')
+ include_parts(tools_parts,
+ INSTALL_BIN='${INSTALL_TOOLS_BIN}',
+ INSTALL_DATA='${INSTALL_TOOLS_DATA}')
+ Default('all')
+ Default('utest::')
+
+if is_internal_test_tiny():
+ set_default_production_options()
+ sdk_mode = []
+ ### Member
+ Part(parts_file='ext/gtest/gtest.parts')
+ member_cfg = ('embedded'
+ if not DefaultEnvironment().isConfigBasedOn('debug')
+ else DefaultEnvironment().subst('$CONFIG'))
+ Part(parts_file='epid/common/tinycommon.parts', CONFIG=member_cfg)
+ Part(parts_file='epid/member/tinymember.parts', CONFIG=member_cfg,
+ config_independent=True, mode=sdk_mode)
+ ### Verifier, samples and tools
+ include_parts(ipp_parts)
+ Part(parts_file='epid/common-testhelper/common-testhelper.parts',
+ config_independent=True)
+ include_parts(common_parts + verifier_parts,
+ mode=sdk_mode)
+ include_parts(util_parts + example_parts,
+ INSTALL_BIN='${INSTALL_SAMPLE_BIN}',
+ INSTALL_DATA='${INSTALL_SAMPLE_DATA}')
+ include_parts(tools_parts, INSTALL_BIN='${INSTALL_TOOLS_BIN}')
+ include_parts(testbot_test_parts)
+ Default('build::')
+
log_versions(DefaultEnvironment(), not is_package())
diff --git a/configure b/configure
index b098aea..a288104 100644
--- a/configure
+++ b/configure
@@ -584,7 +584,8 @@ PACKAGE_URL=''
ac_default_prefix=`pwd`/_install
ac_subst_vars='LTLIBOBJS
LIBOBJS
-CONFIG
+TINY
+TSS_PATH
RANLIB
ac_ct_CXX
CXXFLAGS
@@ -615,7 +616,6 @@ infodir
docdir
oldincludedir
includedir
-runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -638,7 +638,8 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
-with_config
+with_tss
+enable_tiny
'
ac_precious_vars='build_alias
host_alias
@@ -689,7 +690,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -942,15 +942,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
- -runstatedir | --runstatedir | --runstatedi | --runstated \
- | --runstate | --runstat | --runsta | --runst | --runs \
- | --run | --ru | --r)
- ac_prev=runstatedir ;;
- -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
- | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
- | --run=* | --ru=* | --r=*)
- runstatedir=$ac_optarg ;;
-
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1088,7 +1079,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir runstatedir
+ libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1241,7 +1232,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1268,13 +1258,18 @@ if test -n "$ac_init_help"; then
esac
cat <<\_ACEOF
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-tiny Build size optimized member. Mutually exclusive with
+ '--with-tss'
+
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --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-tss Link with TPM TSS. The TSSROOT environment variable
+ must be set.
Some influential environment variables:
CC C compiler command
@@ -2753,23 +2748,64 @@ CFLAGS="$CFLAGS_OLD"
CPPFLAGS="$CPPFLAGS_OLD"
-# Check whether --with-config was given.
-if test "${with_config+set}" = set; then :
- withval=$with_config;
+# Check whether --with-tss was given.
+if test "${with_tss+set}" = set; then :
+ withval=$with_tss;
else
- with_config=release
+ with_tss=no
+
+fi
+
+
+
+if test "x$with_tss" != "xno"; then :
+ as_ac_File=`$as_echo "ac_cv_file_$TSSROOT" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $TSSROOT" >&5
+$as_echo_n "checking for $TSSROOT... " >&6; }
+if eval \${$as_ac_File+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "$TSSROOT"; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
fi
+eval ac_res=\$$as_ac_File
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
+ TSS_PATH=$TSSROOT
+else
+
+ as_fn_error $? "Necessary environment variable not set or set incorrectly: 'TSSROOT'" "$LINENO" 5
+fi
-CONFIG="release"
+fi
-if test "x$with_config" != "xrelease"; then :
- CONFIG=size_optimized_release
+# Check whether --enable-tiny was given.
+if test "${enable_tiny+set}" = set; then :
+ enableval=$enable_tiny;
+else
+ enable_tiny=no
fi
+
+
+if test "x$enable_tiny" != "xno"; then :
+ if test "x$with_tss" != "xno"; then :
+
+ as_fn_error $? "Size optimized member can not link with TPM TSS" "$LINENO" 5
+
+fi
+ TINY=yes
+fi
# default install path is current directory
ac_config_files="$ac_config_files Makefile"
diff --git a/doc/html/1_81_2file__parser_8h.html b/doc/html/1_81_2file__parser_8h.html
index c0bdf3e..9d587bc 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/1_81_2types_8h.html b/doc/html/1_81_2types_8h.html
index eaad6be..3ae8225 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/Basenames.html b/doc/html/Basenames.html
index 2759709..176238a 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/BuildToolsInstallation.html b/doc/html/BuildToolsInstallation.html
index 8c8a243..78c8c64 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -76,7 +76,7 @@ $(document).ready(function(){initNavTree('BuildToolsInstallation.html','');});
<tr>
<td>SCons 2.4 </td><td><a href="http://www.scons.org">http://www.scons.org</a> </td><td><a href="http://prdownloads.sourceforge.net/scons/scons-2.4.1.zip">scons-2.4.1.zip</a> </td></tr>
<tr>
-<td>Parts 0.11 </td><td><a href="https://bitbucket.org/sconsparts/parts/downloads">https://bitbucket.org/sconsparts/parts/downloads</a> </td><td><a href="https://bitbucket.org/sconsparts/parts/downloads/parts-0.11.0.zip">parts-0.11.0.zip</a> </td></tr>
+<td>Parts 0.11 </td><td><a href="https://bitbucket.org/sconsparts/parts/downloads">https://bitbucket.org/sconsparts/parts/downloads</a> </td><td><a href="https://bitbucket.org/sconsparts/parts/get/v0.11.1.zip">parts-0.11.1.zip</a> </td></tr>
</table>
<p><br />
</p>
diff --git a/doc/html/BuildingSdk.html b/doc/html/BuildingSdk.html
index 75f2557..33a0cd8 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -64,9 +64,11 @@ $(document).ready(function(){initNavTree('BuildingSdk.html','');});
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#BuildingSdk_Prerequisites">Prerequisites</a></li>
<li class="level1"><a href="#BuildingSdk_Building_SCons">Building SDK with SCons</a></li>
-<li class="level1"><a href="#BuildingSdk_Building_Makefile">Alternate Makefile/Autoconf Based Build Approach</a></li>
+<li class="level1"><a href="#BuildingSdk_Building_Makefile">Alternate Makefile Based Build Approach</a></li>
<li class="level1"><a href="#BuildingSdk_CommercialIpp">Improving Performance with Commercial IPP</a></li>
-<li class="level1"><a href="#BuildingSdk_SizeOptimizedBuild">Optimizing Code Size over Performance</a></li>
+<li class="level1"><a href="#BuildingSdk_Tiny">Optimizing for Code Size</a><ul><li class="level2"><a href="#implementation_TinyLimitations">Limitations</a></li>
+</ul>
+</li>
<li class="level1"><a href="#BuildingSdk_Examples">Example Programs</a></li>
<li class="level1"><a href="#BuildingSdk_PortingBuildSystem">Building with Other Build Systems</a></li>
</ul>
@@ -106,8 +108,6 @@ scons
<tr>
<td><code>--cfg=release</code> </td><td>Build in release mode </td></tr>
<tr>
-<td><code>--cfg=size_optimized_release</code> </td><td>Build in release mode optimized for code size </td></tr>
-<tr>
<td><code>--target=x86</code> </td><td>Target x86 (i386) architecture </td></tr>
<tr>
<td><code>--target=x86_64</code> </td><td>Target x86-64 architecture </td></tr>
@@ -118,7 +118,7 @@ scons
<tr>
<td><code>--target=aarch64</code> </td><td>Target AArch64 (64-bit ARM) architecture </td></tr>
<tr>
-<td><code>--tc=cl</code> </td><td>Use MSVC to compile (Microsoft&reg;* C/C++ Optimizing Compiler) </td></tr>
+<td><code>--tc=cl</code> </td><td>Use MSVC to compile (Microsoft&reg;* C/C++ Compiler) </td></tr>
<tr>
<td><code>--tc=gcc</code> </td><td>Use GCC to compile (GNU* Compiler Collection) </td></tr>
<tr>
@@ -137,7 +137,7 @@ scons
<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>
+Alternate Makefile Based Build Approach</h1>
<p>You can build with the <code>make</code> command on platforms that support Make/Autoconf.</p>
<p>In the root directory of the SDK, run: </p><pre class="fragment">./configure
make all
@@ -164,12 +164,25 @@ Improving Performance with Commercial IPP</h1>
<dl class="section note"><dt>Note</dt><dd>The SDK has been validated with version 2017 (Update 2) of the cryptography library.</dd></dl>
<p>To build the SDK using a commercial Intel&reg; IPP installation, the <code>IPPROOT</code> environment variable must be properly configured to point to the IPP installation directory, as described in Setting Environment Variables* in the <a href="https://software.intel.com/sites/default/files/managed/11/66/ipp_devguide_0.pdf">Intel&reg; IPP Developer Guide</a> (PDF link).</p>
<p>Once the environment is configured, you can build using commercial IPP by specifying <code>--use-commercial-ipp</code> as a command line option.</p>
-<h1><a class="anchor" id="BuildingSdk_SizeOptimizedBuild"></a>
-Optimizing Code Size over Performance</h1>
-<p>To build the SDK with optimization for size you should specify <code>size_optimized_release</code> configuration.</p>
-<p>If you use scons to build the SDK use the command line option <code>config=size_optimized_release</code>.</p>
-<p>If you use a make build system, use <code>./configure --with-config=size_optimized_release</code>.</p>
-<p>This configuration will enable size reducing compiler options and other necessary optimizations that reduce the size needed to run the SDK, but may impact performance.</p>
+<h1><a class="anchor" id="BuildingSdk_Tiny"></a>
+Optimizing for Code Size</h1>
+<p>To build the SDK with a member with substantially reduced code size, you can use tiny mode.</p>
+<p>To build with SCons, go to the root directory of the SDK and run: </p><pre class="fragment">scons --prod-var=tiny
+</pre><p>To build with Make, go to the root directory of the SDK and run: </p><pre class="fragment">./configure --enable-tiny
+make all
+make check
+make install
+</pre><h2><a class="anchor" id="implementation_TinyLimitations"></a>
+Limitations</h2>
+<p>By design, a member built in tiny mode has the following limitations:</p>
+<ul>
+<li>TPM mode is not supported.</li>
+<li>Only SHA-256 and SHA-512 are supported.</li>
+<li>Signature pre-computation is not supported.</li>
+<li>Compressed keys are not supported.</li>
+<li>Commercial IPP cannot be used.</li>
+<li>The implementation prioritizes size over performance.</li>
+</ul>
<h1><a class="anchor" id="BuildingSdk_Examples"></a>
Example Programs</h1>
<p>The SDK includes several examples that show you different aspects of how the Intel&reg; EPID scheme works. In the SDK build, these examples are located in <code>_install/epid-sdk/example</code>.</p>
diff --git a/doc/html/ChangeLog.html b/doc/html/ChangeLog.html
index 6ea802d..43148da 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -61,7 +61,34 @@ $(document).ready(function(){initNavTree('ChangeLog.html','');});
<div class="title">What's New </div> </div>
</div><!--header-->
<div class="contents">
-<div class="textblock"><h2>[5.0.0] - 2017-09-15</h2>
+<div class="textblock"><h2>[6.0.0] - 2017-12-15</h2>
+<h3>Added</h3>
+<ul>
+<li>The member can now be built with a substantially reduced code size using a compilation option.</li>
+<li>New context lifetime management APIs have been added to member to give callers more control of memory allocation.</li>
+<li>New member API <code>EpidClearRegisteredBasenames</code> has been added to clear registered basenames without recreating the member.</li>
+</ul>
+<h3>Changed</h3>
+<ul>
+<li><code>EpidRegisterBaseName</code> was renamed to <code>EpidRegisterBasename</code> because basename is a single word.</li>
+<li>Command-line parsing library used by samples and tools has been replaced by Argtable3.</li>
+</ul>
+<h3>Deprecated</h3>
+<ul>
+<li><code>EpidMemberCreate</code> has been deprecated. This API has been superseded by <code>EpidMemberGetSize</code> and <code>EpidMemberInit</code>.</li>
+<li><code>EpidMemberDelete</code> has been deprecated. This API has been superseded by <code>EpidMemberDeinit</code>.</li>
+</ul>
+<h3>Removed</h3>
+<ul>
+<li><code>size_optimized_release</code> build configuration has been removed. Use the compilation option to build member with reduced code size.</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>
+<li>Scons build will not work natively on ARM. You can still build using <code>make</code> or cross compile.</li>
+</ul>
+<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>
diff --git a/doc/html/EpidOverview.html b/doc/html/EpidOverview.html
index cc62682..d42035d 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -110,17 +110,6 @@ Issuers</h2>
</p>
<ul>
<li>Creates and maintains group revocation lists.</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>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">
diff --git a/doc/html/Glossary.html b/doc/html/Glossary.html
index 85fb9c6..307aa29 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/HowValidated.html b/doc/html/HowValidated.html
index 35ced23..f920393 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -72,8 +72,6 @@ Tested Libraries and Compilers</h1>
<tr>
<td>glibc 2.23 </td><td>GCC 5.4.0 </td></tr>
<tr>
-<td>glibc 2.20 </td><td>GCC 4.9.1 </td></tr>
-<tr>
<td>glibc 2.23 </td><td>GCC 4.8.5 </td></tr>
<tr>
<td>glibc 2.23 </td><td>Intel&reg; C++ Compiler for Linux* (ICC) 17.0.1 with GCC 4.8.5 </td></tr>
@@ -88,6 +86,8 @@ Tested Libraries and Compilers</h1>
<tr>
<td>glibc 2.23 </td><td>ICC 16.0.3 with GCC 6.2.0 </td></tr>
<tr>
+<td>glibc 2.23 </td><td>ICC 15.0.7 with GCC 4.8.5 </td></tr>
+<tr>
<td>glibc 2.23 </td><td>ICC 15.0.7 with GCC 5.4.0 </td></tr>
<tr>
<td>glibc 2.23 </td><td>ICC 14.0.4 with GCC 4.8.5 </td></tr>
diff --git a/doc/html/ImplementationNotes.html b/doc/html/ImplementationNotes.html
index bfe4a21..6f4ff2d 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -62,14 +62,22 @@ $(document).ready(function(){initNavTree('ImplementationNotes.html','');});
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#ImplementationNotes_Prng">Random Number Generation</a></li>
+<ul><li class="level1"><a href="#implementationNotes_Members">Member Implementations</a></li>
+<li class="level1"><a href="#ImplementationNotes_Prng">Random Number Generation</a></li>
<li class="level1"><a href="#ImplementationNotes_ProtectingSecrets">Protecting Secrets</a></li>
<li class="level1"><a href="#ImplementationNotes_MathPrimitives">Replacing Math Primitives</a></li>
<li class="level1"><a href="#ImplementationNotes_SerializedTypes">Octstring/Buffer Types</a></li>
<li class="level1"><a href="#ImplementationNotes_FlexibleArrays">Flexible Arrays</a></li>
</ul>
</div>
-<div class="textblock"><p>This section is intended to provide additional guidance for users who want to modify the underlying code of the SDK. If you only want to call the SDK APIs without modifying them, you can safely ignore this section.</p>
+<div class="textblock"><h1><a class="anchor" id="implementationNotes_Members"></a>
+Member Implementations</h1>
+<p>There are three member implementations. You can use a specific compilation option to select the implementation that will be used at compile time. The implementations are:</p>
+<ol type="1">
+<li><b>Reference:</b> This default implementation gives guidance on partitioning member operations between highly sensitive ones that use the <code>f</code> value of the member private key, and less sensitive ones that can be performed in a host environment. To build in default mode, refer to <a class="el" href="BuildingSdk.html">Building from Source</a>.</li>
+<li><b>TPM:</b> This TPM member implementation uses the TPM for signing by linking to the IBM TSS. To build in TPM mode, refer to <a class="el" href="TpmConsiderations.html#TpmConsiderations_BuildingTpmMode">Building the SDK in TPM Mode</a>.</li>
+<li><b>Tiny:</b> This tiny implementation builds the SDK with a substantially reduced code size. To build in tiny mode, refer to <a class="el" href="BuildingSdk.html#BuildingSdk_Tiny">Optimizing for Code Size</a>.</li>
+</ol>
<h1><a class="anchor" id="ImplementationNotes_Prng"></a>
Random Number Generation</h1>
<p>Some SDK APIs require a random number data source. A <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c" title="Generates random data. ">BitSupplier</a> provides a source of random data. This function should be a cryptographically secure random number generator.</p>
@@ -95,7 +103,8 @@ Octstring/Buffer Types</h1>
Flexible Arrays</h1>
<p>A common idiom in the SDK is the use of flexible array types. These types are structs with the last element being an array of size 1 of some type. Flexible array types always have a size value embedded in the struct. The name of the count and array fields differs between flexible array types.</p>
<div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>Sample {</div><div class="line"> <a class="code" href="struct_oct_str32.html">OctStr32</a> data; </div><div class="line"> <a class="code" href="struct_oct_str32.html">OctStr32</a> count; </div><div class="line"> <a class="code" href="struct_g1_elem_str.html">G1ElemStr</a> array[1]; </div><div class="line">} Sample;</div></div><!-- fragment --><p>Flexible array types are expected to be in a buffer of size <code>sizeof(FA) + ((N-1) * sizeof(E))</code> where FA is the flexible array type, N is the number of elements in the array and E is the type of each element. Note that this may be smaller than <code>sizeof(FA)</code> if N is 0, in which case referencing any element is an error.</p>
-<div class="fragment"><div class="line">Sample* AllocSample(<span class="keywordtype">size_t</span> count) {</div><div class="line"> <span class="keywordflow">return</span> (Sample*)malloc(<span class="keyword">sizeof</span>(Sample)</div><div class="line"> + (count * <span class="keyword">sizeof</span>(<a class="code" href="struct_g1_elem_str.html">G1ElemStr</a>))</div><div class="line"> - <span class="keyword">sizeof</span>(<a class="code" href="struct_g1_elem_str.html">G1ElemStr</a>));</div><div class="line">}</div></div><!-- fragment --><p>In many cases, functions that accept flexible array types will also expect a buffer size that is compared against the computed size of the array as a sanity check. </p>
+<div class="fragment"><div class="line">Sample* AllocSample(<span class="keywordtype">size_t</span> count) {</div><div class="line"> <span class="keywordflow">return</span> (Sample*)malloc(<span class="keyword">sizeof</span>(Sample)</div><div class="line"> + (count * <span class="keyword">sizeof</span>(<a class="code" href="struct_g1_elem_str.html">G1ElemStr</a>))</div><div class="line"> - <span class="keyword">sizeof</span>(<a class="code" href="struct_g1_elem_str.html">G1ElemStr</a>));</div><div class="line">}</div></div><!-- fragment --><p>In many cases, functions that accept flexible array types will also expect a buffer size that is compared against the computed size of the array as a sanity check.</p>
+<p>*Other names and brands may be claimed as the property of others. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/IssuerMaterial.html b/doc/html/IssuerMaterial.html
index 5d3dd4c..b18b656 100644
--- a/doc/html/IssuerMaterial.html
+++ b/doc/html/IssuerMaterial.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/LegalInformation.html b/doc/html/LegalInformation.html
index f36d152..4f10133 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/Provisioning.html b/doc/html/Provisioning.html
index fc2ab11..3351774 100644
--- a/doc/html/Provisioning.html
+++ b/doc/html/Provisioning.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -100,7 +100,7 @@ Dynamic Provisioning</h1>
<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>Send the join request to the issuer.</b> 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>
diff --git a/doc/html/Revocation.html b/doc/html/Revocation.html
index 46ede3b..0903f93 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/SdkOverview.html b/doc/html/SdkOverview.html
index a0184fe..8bd1e32 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -62,12 +62,14 @@ $(document).ready(function(){initNavTree('SdkOverview.html','');});
</div><!--header-->
<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_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>
+<ul><li class="level1"><a href="#SdkOverview_Components">SDK Components</a><ul><li class="level2"><a href="#SdkOverview_Core">SDK Core</a></li>
+<li class="level2"><a href="#SdkOverview_Samples">Samples</a></li>
+<li class="level2"><a href="#SdkOverview_Tools">Tools</a></li>
+<li class="level2"><a href="#SdkOverview_BuildingAndValidation">Other Components</a></li>
+</ul>
+</li>
<li class="level1"><a href="#SdkOverview_Compatibility">Intel&reg; EPID 1.1 Compatibility</a></li>
+<li class="level1"><a href="#SdkOverview_TPM">Member Implementations</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>
@@ -84,8 +86,8 @@ SDK Components</h1>
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>
+<h2><a class="anchor" id="SdkOverview_Core"></a>
+SDK Core</h2>
<p>Components in the SDK Core implement the features of Intel&reg; EPID.</p>
<table class="doxtable">
<tr>
@@ -98,13 +100,11 @@ SDK Core</h1>
<td>common </td><td>Library containing common types and functions </td></tr>
<tr>
<td>math </td><td>Math primitives used by member and verifier </td></tr>
-<tr>
-<td>IPP </td><td>A C-only non-optimized subset of Intel&reg; IPP </td></tr>
</table>
<p><br />
</p>
-<h1><a class="anchor" id="SdkOverview_Samples"></a>
-Samples</h1>
+<h2><a class="anchor" id="SdkOverview_Samples"></a>
+Samples</h2>
<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">
@@ -121,8 +121,8 @@ Samples</h1>
</table>
<p><br />
</p>
-<h1><a class="anchor" id="SdkOverview_Tools"></a>
-Tools</h1>
+<h2><a class="anchor" id="SdkOverview_Tools"></a>
+Tools</h2>
<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>
@@ -140,8 +140,8 @@ Tools</h1>
</table>
<p><br />
</p>
-<h1><a class="anchor" id="SdkOverview_BuildingAndValidation"></a>
-Building and Validation</h1>
+<h2><a class="anchor" id="SdkOverview_BuildingAndValidation"></a>
+Other Components</h2>
<p>The SDK comes with a number of other components that support building and validating the code.</p>
<table class="doxtable">
<tr>
@@ -161,6 +161,17 @@ 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>Intel&reg; EPID 1.1 support</b></a> in the API Reference.</p>
+<h1><a class="anchor" id="SdkOverview_TPM"></a>
+Member Implementations</h1>
+<p>There are three member implementations. You can use a specific compilation option to select the implementation that will be used at compile time. The implementations are:</p>
+<ol type="1">
+<li><b>Reference:</b> This default implementation gives guidance on partitioning member operations between highly sensitive ones that use the <code>f</code> value of the member private key, and less sensitive ones that can be performed in a host environment. To build in default mode, refer to <a class="el" href="BuildingSdk.html">Building from Source</a>.</li>
+<li><b>TPM:</b> This TPM member implementation uses the TPM for signing by linking to the IBM TSS. To build in TPM mode, refer to <a class="el" href="TpmConsiderations.html#TpmConsiderations_BuildingTpmMode">Building the SDK in TPM Mode</a>.</li>
+<li><b>Tiny:</b> This tiny implementation builds the SDK with a substantially reduced code size. To build in tiny mode, refer to <a class="el" href="BuildingSdk.html#BuildingSdk_Tiny">Optimizing for Code Size</a>.</li>
+</ol>
+<div class="image">
+<img src="implementing_member.png" alt="implementing_member.png"/>
+</div>
<h1><a class="anchor" id="SdkOverview_Files"></a>
Folder Layout</h1>
<p>The Intel&reg; EPID SDK has two filesystem layouts: the Source Layout and the Install Layout.</p>
@@ -197,7 +208,7 @@ Source Layout</h2>
|__ ext/
| |__ dropt/ Third party library for parsing command-line options
| |__ gtest/ Third party gtest library
-| |__ ipp/ IPP library
+| |__ ipp/ Intel(R) Performance Primitives library
|
|__ parts-site/ Parts platform config scripts
|
@@ -216,10 +227,10 @@ Install Layout</h2>
|__ lib/
| |__ &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 -->
+ |__ 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 -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
diff --git a/doc/html/SignVerifyTutorial.html b/doc/html/SignVerifyTutorial.html
index 1d2e6cb..ccb403b 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -108,47 +108,22 @@ What Do You Need to Create a Signature?</h2>
Signing Example</h2>
<p>The signmsg command can be passed a number of options: </p><pre class="fragment">$ ./signmsg -h
Usage: signmsg [OPTION]...
-Create Intel(R) EPID signature of message
+Verify signature was created by group member in good standing
Options:
- --sig=FILE
- write signature to FILE (default: sig.dat)
-
- --msg=MESSAGE
- MESSAGE to sign
-
- --msgfile=FILE
- FILE containing message to sign
-
- --bsn=BASENAME
- BASENAME to sign with (default: random)
-
- --bsnfile=FILE
- FILE containing basename to sign with
-
- --sigrl=FILE
- load signature based revocation list from FILE
-
- --gpubkey=FILE
- load group public key from FILE (default: pubkey.bin)
-
- --mprivkey=FILE
- load member private key from FILE (default: mprivkey.dat)
-
- --mprecmpi=FILE
- load pre-computed member data from FILE
-
- --capubkey=FILE
- load IoT Issuing CA public key from FILE (default: cacert.bin)
-
- --hashalg={SHA-256 | SHA-384 | SHA-512 | SHA-512/256}
- use specified hash algorithm (default: SHA-512)
-
- -h, --help
- display this help and exit
-
- -v, --verbose
- print status messages to stdout
+ --sig=FILE write signature to FILE (default: sig.dat)
+ --msg=MESSAGE MESSAGE to sign
+ --msgfile=FILE FILE containing message to sign
+ --bsn=BASENAME BASENAME to sign with (default: random)
+ --bsnfile=FILE FILE containing basename to sign with
+ --sigrl=FILE load signature based revocation list from FILE
+ --gpubkey=FILE load group public key from FILE (default: pubkey.bin)
+ --mprivkey=FILE load member private key from FILE (default: mprivkey.dat)
+ --mprecmpi=FILE load pre-computed member data from FILE
+ --capubkey=FILE load IoT Issuing CA public key from FILE (default: cacert.bin)
+ --hashalg={SHA-256 | SHA-384 | SHA-512 | SHA-512/256} use specified hash algorithm (default: SHA-512)
+ --help display this help and exit
+ -v, --verbose print status messages to stdout
</pre><p>To sign a message, a group member in good standing uses the following command: </p><pre class="fragment">$ ./signmsg --msg="test0"
</pre><p>The above command signs a message "test0". <code>signmsg</code> uses default options for the group public key, member private key, hash algorithm and IoT Issuing CA public key. All other parameters that are not given are ignored. The command produces a signature file: <code>sig.dat</code></p>
<h1><a class="anchor" id="tutorial_verifysigOverview"></a>
@@ -175,58 +150,25 @@ What Do You Need to Verify a Signature?</h2>
Verification Example</h2>
<p>The verifysig command can be passed a number of options: </p><pre class="fragment">$ ./verifysig -h
Usage: verifysig [OPTION]...
-Verify signature was created by group member in good standing
+Create Intel(R) EPID signature of message
Options:
- --sig=FILE
- load signature from FILE (default: sig.dat)
-
- --msg=MESSAGE
- MESSAGE that was signed (default: empty)
-
- --msgfile=FILE
- FILE containing message that was signed
-
- --bsn=BASENAME
- BASENAME used in signature (default: random)
-
- --bsnfile=FILE
- FILE containing basename to sign with
-
- --privrl=FILE
- load private key revocation list from FILE
-
- --sigrl=FILE
- load signature based revocation list from FILE
-
- --grprl=FILE
- load group revocation list from FILE
- (default: grprl.bin)
-
- --verifierrl=FILE
- load verifier revocation list from FILE
-
- --gpubkey=FILE
- load group public key from FILE (default: pubkey.bin)
-
- --vprecmpi=FILE
- load pre-computed verifier data from FILE
-
- --vprecmpo=FILE
- write pre-computed verifier data to FILE
-
- --capubkey=FILE
- load IoT Issuing CA public key from FILE
- (default: cacert.bin)
-
- --hashalg={SHA-256 | SHA-384 | SHA-512 | SHA-512/256}
- use specified hash algorithm for 2.0 groups (default: SHA-512)
-
- -h, --help
- display this help and exit
-
- -v, --verbose
- print status messages to stdout
+ --sig=FILE load signature from FILE (default: sig.dat)
+ --msg=MESSAGE MESSAGE that was signed (default: empty)
+ --msgfile=FILE FILE containing message that was signed
+ --bsn=BASENAME BASENAME used in signature (default: random)
+ --bsnfile=FILE FILE containing basename used in signature
+ --privrl=FILE load private key revocation list from FILE
+ --sigrl=FILE load signature based revocation list from FILE
+ --grprl=FILE load group revocation list from FILE (default: grprl.bin)
+ --verifierrl=FILE load verifier revocation list from FILE
+ --gpubkey=FILE load group public key from FILE (default: pubkey.bin)
+ --vprecmpi=FILE load pre-computed verifier data from FILE
+ --vprecmpo=FILE write pre-computed verifier data to FILE
+ --capubkey=FILE load IoT Issuing CA public key from FILE (default: cacert.bin)
+ --hashalg={SHA-256 | SHA-384 | SHA-512 | SHA-512/256} use specified hash algorithm for 2.0 groups (default: SHA-512)
+ --help display this help and exit
+ -v, --verbose print status messages to stdout
</pre><p>To verify that a signature is from a member in good standing, the verifier uses the following command: </p><pre class="fragment">$ ./verifysig --msg="test0"
signature verified successfully
</pre><p>This verifies that the default signature file <code>sig.dat</code> is generated for the message "test0" by a member in good standing. The <code>verifysig</code> example uses default inputs for group public key, hash algorithm, and IoT Issuing CA public key. All other parameters are ignored. The output <code>verifysig: signature verified successfully</code> denotes that the verification is successful.</p>
diff --git a/doc/html/TpmConsiderations.html b/doc/html/TpmConsiderations.html
index 7bef89c..c0a0094 100644
--- a/doc/html/TpmConsiderations.html
+++ b/doc/html/TpmConsiderations.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -71,7 +71,7 @@ $(document).ready(function(){initNavTree('TpmConsiderations.html','');});
<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>
+<li class="level2"><a href="#TpmConsiderations_Signing">Intel&reg; EPID Signing and Verification with a TPM</a></li>
</ul>
</li>
</ul>
@@ -100,7 +100,7 @@ Provisioning TPM with Intel® EPID Key Material</h2>
</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>
+<p>For bulk-join, 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>
@@ -142,17 +142,18 @@ Mapping TPM Commands to Intel® EPID</h2>
</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>Unlike non-TPM device manufacturers, TPM manufacturers cannot use <a class="el" href="group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302" title="Provisions a member context from a private key. ">EpidProvisionKey</a>. 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#ga2b3c0cc1d8d4e50190ca94656fa36e24" title="Computes the size in bytes required for a member context. ">EpidMemberGetSize</a> and <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a> to create a new member context. Those functions take 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>
+<li>After receiving the membership credential (A, x), use <a class="el" href="group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140" title="Provisions a member context from a membership credential. ">EpidProvisionCredential</a> 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>
+<p>After the TPM device is provisioned with <a class="el" href="group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140" title="Provisions a member context from a membership credential. ">EpidProvisionCredential</a>, 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#ga2b3c0cc1d8d4e50190ca94656fa36e24" title="Computes the size in bytes required for a member context. ">EpidMemberGetSize</a>,</li>
+<li><a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a>,</li>
+<li><a class="el" href="group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6" title="Change member from setup state to normal operation. ">EpidMemberStartup</a>, 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>
@@ -187,10 +188,15 @@ Prerequisites to Build the SDK in TPM Mode</h2>
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><br />
+</p>
+<p>To build the SDK in TPM mode using <code>make</code> command, go to the SDK folder and build the SDK with the following commands: </p><pre class="fragment">&gt; ./configure CFLAGS=-m32 --with-tss
+&gt; make all
+&gt; make utest
+&gt; make install
</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>
+Intel® EPID Signing and Verification with a TPM</h2>
<ol type="1">
<li>Build the IBM TSS (see above).</li>
<li>Build the IBM TPM (see above).</li>
@@ -206,7 +212,7 @@ Intel® EPID Signing and Verification</h2>
<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>
+</pre><dl class="section warning"><dt>Warning</dt><dd>The samples use <code>LoadExternal</code> to load keys into the TPM. In a real TPM use case, <code>CreatePrimary</code> should 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-->
diff --git a/doc/html/UserManual_GeneratingAnIntelEpidSignature.html b/doc/html/UserManual_GeneratingAnIntelEpidSignature.html
index b08fac3..bb8369b 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -94,7 +94,7 @@ Signmsg Walkthrough</h1>
<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="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><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"> <span class="keywordtype">size_t</span> member_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>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>
@@ -117,8 +117,8 @@ 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#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>Now that the inputs have been prepared, we create a member context using <a class="el" href="group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24" title="Computes the size in bytes required for a member context. ">EpidMemberGetSize</a> and <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a>.</p>
+<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24">EpidMemberGetSize</a>(&amp;params, &amp;member_size);</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"> member = (<a class="code" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a>*)calloc(1, member_size);</div><div class="line"> <span class="keywordflow">if</span> (!member) {</div><div class="line"> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab7dfec784192a827a91a4b8a6054d01c">kEpidNoMemErr</a>;</div><div class="line"> <span class="keywordflow">break</span>;</div><div class="line"> }</div><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb">EpidMemberInit</a>(&amp;params, 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>
@@ -127,7 +127,7 @@ Signmsg Walkthrough</h1>
<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 provision either key or membership credential based on passed member private key.</p>
+<p>Next we provision either the member private key or the membership credential based on the 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 />
@@ -136,8 +136,8 @@ Signmsg Walkthrough</h1>
<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>
-<p><div class="fragment"><div class="line"> <span class="keywordflow">if</span> (0 != basename_len) {</div><div class="line"> sts = <a class="code" href="group___epid_member_module.html#gad92d3c3266ae1833ffb1dba9ad76035d">EpidRegisterBaseName</a>(member, basename, basename_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 class="line"> }</div></div><!-- fragment --></p>
+<p>Next, if a basename is specified, we register it with <a class="el" href="group___epid_member_module.html#ga8c6f097ba89542664375bd5e0f205220" title="Registers a basename with a member. ">EpidRegisterBasename</a> so that the member can use it.</p>
+<p><div class="fragment"><div class="line"> <span class="keywordflow">if</span> (0 != basename_len) {</div><div class="line"> sts = <a class="code" href="group___epid_member_module.html#ga8c6f097ba89542664375bd5e0f205220">EpidRegisterBasename</a>(member, basename, basename_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 class="line"> }</div></div><!-- fragment --></p>
<p>In a typical use case, to prevent loss of privacy, the member keeps a list of basenames that correspond 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><br />
@@ -163,9 +163,9 @@ Signmsg Walkthrough</h1>
<p><br />
</p>
<p>Finally, we clean up and exit.</p>
-<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a>;</div><div class="line"> } <span class="keywordflow">while</span> (0);</div><div class="line"></div><div class="line"> PrngDelete(&amp;prng);</div><div class="line"> <a class="code" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">EpidMemberDelete</a>(&amp;member);</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span> (sig_rl) free(sig_rl);</div><div class="line"></div><div class="line"> <span class="keywordflow">return</span> sts;</div><div class="line">}</div></div><!-- fragment --></p>
+<p><div class="fragment"><div class="line"> sts = <a class="code" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9">kEpidNoErr</a>;</div><div class="line"> } <span class="keywordflow">while</span> (0);</div><div class="line"></div><div class="line"> PrngDelete(&amp;prng);</div><div class="line"> <a class="code" href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d">EpidMemberDeinit</a>(member);</div><div class="line"> <span class="keywordflow">if</span> (member) free(member);</div><div class="line"></div><div class="line"> <span class="keywordflow">if</span> (sig_rl) free(sig_rl);</div><div class="line"></div><div class="line"> <span class="keywordflow">return</span> sts;</div><div class="line">}</div></div><!-- fragment --></p>
<p>If we made it past signing without an error, we set the return code appropriately and fall out of the do-while loop. If there was an error earlier, all breaks in the do-while loop bring us to this point with an error status.</p>
-<p>Next, we free the allocated resources. <a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6" title="Deletes an existing member context. ">EpidMemberDelete</a> deletes an existing member context.</p>
+<p>Next, we de-initialize the member context and free the allocated resources. <a class="el" href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d" title="De-initializes an existing member context buffer. ">EpidMemberDeinit</a> de-initializes an existing member context.</p>
<p>We return from SignMsg with the success or error status.</p>
<p><br />
</p>
diff --git a/doc/html/UserManual_VerifyingAnIntelEpidSignature.html b/doc/html/UserManual_VerifyingAnIntelEpidSignature.html
index 3e5de9b..0f34fdf 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/UsingiKGF.html b/doc/html/UsingiKGF.html
index bfd6f26..d5ca550 100644
--- a/doc/html/UsingiKGF.html
+++ b/doc/html/UsingiKGF.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/annotated.html b/doc/html/annotated.html
index f9507cf..74c2691 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -66,60 +66,74 @@ $(document).ready(function(){initNavTree('annotated.html','');});
<tr id="row_0_" 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_basic_signature.html" target="_self">BasicSignature</a></td><td class="desc">Intel(R) EPID 2.0 basic signature </td></tr>
<tr id="row_1_"><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_big_num_str.html" target="_self">BigNumStr</a></td><td class="desc">Serialized BigNum </td></tr>
<tr id="row_2_" 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_compressed_priv_key.html" target="_self">CompressedPrivKey</a></td><td class="desc">Compressed private key </td></tr>
-<tr id="row_3_"><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_ecdsa_private_key.html" target="_self">EcdsaPrivateKey</a></td><td class="desc">ECDSA Private Key </td></tr>
-<tr id="row_4_" 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_ecdsa_public_key.html" target="_self">EcdsaPublicKey</a></td><td class="desc">ECDSA Public Key </td></tr>
-<tr id="row_5_"><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_ecdsa_signature.html" target="_self">EcdsaSignature</a></td><td class="desc">ECDSA Signature using NIST 256-bit curve secp256r1 </td></tr>
-<tr id="row_6_" 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_epid11_basic_signature.html" target="_self">Epid11BasicSignature</a></td><td class="desc">Intel(R) EPID 1.1 basic signature </td></tr>
-<tr id="row_7_"><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_epid11_g2_elem_str.html" target="_self">Epid11G2ElemStr</a></td><td class="desc">Serialized Intel(R) EPID 1.1 G2 element </td></tr>
-<tr id="row_8_" 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_epid11_group_pub_key.html" target="_self">Epid11GroupPubKey</a></td><td class="desc">Intel(R) EPID 1.1 group public key </td></tr>
-<tr id="row_9_"><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_epid11_group_rl.html" target="_self">Epid11GroupRl</a></td><td class="desc">Intel(R) EPID 1.1 group revocation list </td></tr>
-<tr id="row_10_" 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_epid11_gt_elem_str.html" target="_self">Epid11GtElemStr</a></td><td class="desc">Serialized Intel(R) EPID 1.1 GT element </td></tr>
-<tr id="row_11_"><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_epid11_nr_proof.html" target="_self">Epid11NrProof</a></td><td class="desc">Intel(R) EPID 1.1 non-revoked Proof </td></tr>
-<tr id="row_12_" 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_epid11_params.html" target="_self">Epid11Params</a></td><td class="desc">Intel(R) EPID 1.1 Parameters </td></tr>
-<tr id="row_13_"><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_epid11_priv_rl.html" target="_self">Epid11PrivRl</a></td><td class="desc">Intel(R) EPID 1.1 private-key based revocation list </td></tr>
-<tr id="row_14_" 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_epid11_signature.html" target="_self">Epid11Signature</a></td><td class="desc">Intel(R) EPID 1.1 Signature </td></tr>
-<tr id="row_15_"><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_epid11_sig_rl.html" target="_self">Epid11SigRl</a></td><td class="desc">Intel(R) EPID 1.1 signature based revocation list </td></tr>
-<tr id="row_16_" 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_epid11_sig_rl_entry.html" target="_self">Epid11SigRlEntry</a></td><td class="desc">Intel(R) EPID 1.1 entry in SigRL (B,K) </td></tr>
-<tr id="row_17_"><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_epid11_verifier_precomp.html" target="_self">Epid11VerifierPrecomp</a></td><td class="desc">Intel(R) EPID 1.1 Pre-computed verifier settings </td></tr>
-<tr id="row_18_" 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_epid2_params.html" target="_self">Epid2Params</a></td><td class="desc">Intel(R) EPID 2.0 Parameters </td></tr>
-<tr id="row_19_"><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_epid_ca_certificate.html" target="_self">EpidCaCertificate</a></td><td class="desc">IoT CA Certificate binary format </td></tr>
-<tr id="row_20_" 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_epid_file_header.html" target="_self">EpidFileHeader</a></td><td class="desc">Intel(R) EPID binary file header </td></tr>
-<tr id="row_21_"><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_epid_signature.html" target="_self">EpidSignature</a></td><td class="desc">Intel(R) EPID 2.0 Signature </td></tr>
-<tr id="row_22_" 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_fp_elem_str.html" target="_self">FpElemStr</a></td><td class="desc">Number in [0, p-1] </td></tr>
-<tr id="row_23_"><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_fq12_elem_str.html" target="_self">Fq12ElemStr</a></td><td class="desc">Serialized Fq2^3^2 element </td></tr>
-<tr id="row_24_" 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_fq2_elem_str.html" target="_self">Fq2ElemStr</a></td><td class="desc">Serialized Fq2 element </td></tr>
-<tr id="row_25_"><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_fq3_elem_str.html" target="_self">Fq3ElemStr</a></td><td class="desc">Serialized Fq3 element </td></tr>
-<tr id="row_26_" 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_fq6_elem_str.html" target="_self">Fq6ElemStr</a></td><td class="desc">Serialized Fq2^3 element </td></tr>
-<tr id="row_27_"><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_fq_elem_str.html" target="_self">FqElemStr</a></td><td class="desc">Number in [0, q-1] </td></tr>
-<tr id="row_28_" 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_g1_elem_str.html" target="_self">G1ElemStr</a></td><td class="desc">Serialized G1 element </td></tr>
-<tr id="row_29_"><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_g2_elem_str.html" target="_self">G2ElemStr</a></td><td class="desc">Serialized G2 element </td></tr>
-<tr id="row_30_" 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_group_pub_key.html" target="_self">GroupPubKey</a></td><td class="desc">Intel(R) EPID 2.0 group public key </td></tr>
-<tr id="row_31_"><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_group_rl.html" target="_self">GroupRl</a></td><td class="desc">Group revocation list </td></tr>
-<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_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>
-<tr id="row_42_" 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_str32.html" target="_self">OctStr32</a></td><td class="desc">32 bit octet string </td></tr>
-<tr id="row_43_"><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_str512.html" target="_self">OctStr512</a></td><td class="desc">512 bit octet string </td></tr>
-<tr id="row_44_" 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_str600.html" target="_self">OctStr600</a></td><td class="desc">600 bit octet string </td></tr>
-<tr id="row_45_"><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_str64.html" target="_self">OctStr64</a></td><td class="desc">64 bit octet string </td></tr>
-<tr id="row_46_" 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_str768.html" target="_self">OctStr768</a></td><td class="desc">768 bit octet string </td></tr>
-<tr id="row_47_"><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_str8.html" target="_self">OctStr8</a></td><td class="desc">8 bit octet string </td></tr>
-<tr id="row_48_" 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_str80.html" target="_self">OctStr80</a></td><td class="desc">80 bit octet string </td></tr>
-<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_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>
+<tr id="row_3_"><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_ecc_point_fq.html" target="_self">EccPointFq</a></td><td class="desc">Point in EFq </td></tr>
+<tr id="row_4_" 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_ecc_point_fq2.html" target="_self">EccPointFq2</a></td><td class="desc">Point in EFq2 </td></tr>
+<tr id="row_5_"><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_ecc_point_jacobi_fq.html" target="_self">EccPointJacobiFq</a></td><td class="desc">Element of EFq in Jacobi format </td></tr>
+<tr id="row_6_" 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_ecc_point_jacobi_fq2.html" target="_self">EccPointJacobiFq2</a></td><td class="desc">Element of EFq2 in Jacobi format </td></tr>
+<tr id="row_7_"><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_ecdsa_private_key.html" target="_self">EcdsaPrivateKey</a></td><td class="desc">ECDSA Private Key </td></tr>
+<tr id="row_8_" 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_ecdsa_public_key.html" target="_self">EcdsaPublicKey</a></td><td class="desc">ECDSA Public Key </td></tr>
+<tr id="row_9_"><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_ecdsa_signature.html" target="_self">EcdsaSignature</a></td><td class="desc">ECDSA Signature using NIST 256-bit curve secp256r1 </td></tr>
+<tr id="row_10_" 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_epid11_basic_signature.html" target="_self">Epid11BasicSignature</a></td><td class="desc">Intel(R) EPID 1.1 basic signature </td></tr>
+<tr id="row_11_"><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_epid11_g2_elem_str.html" target="_self">Epid11G2ElemStr</a></td><td class="desc">Serialized Intel(R) EPID 1.1 G2 element </td></tr>
+<tr id="row_12_" 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_epid11_group_pub_key.html" target="_self">Epid11GroupPubKey</a></td><td class="desc">Intel(R) EPID 1.1 group public key </td></tr>
+<tr id="row_13_"><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_epid11_group_rl.html" target="_self">Epid11GroupRl</a></td><td class="desc">Intel(R) EPID 1.1 group revocation list </td></tr>
+<tr id="row_14_" 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_epid11_gt_elem_str.html" target="_self">Epid11GtElemStr</a></td><td class="desc">Serialized Intel(R) EPID 1.1 GT element </td></tr>
+<tr id="row_15_"><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_epid11_nr_proof.html" target="_self">Epid11NrProof</a></td><td class="desc">Intel(R) EPID 1.1 non-revoked Proof </td></tr>
+<tr id="row_16_" 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_epid11_params.html" target="_self">Epid11Params</a></td><td class="desc">Intel(R) EPID 1.1 Parameters </td></tr>
+<tr id="row_17_"><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_epid11_priv_rl.html" target="_self">Epid11PrivRl</a></td><td class="desc">Intel(R) EPID 1.1 private-key based revocation list </td></tr>
+<tr id="row_18_" 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_epid11_signature.html" target="_self">Epid11Signature</a></td><td class="desc">Intel(R) EPID 1.1 Signature </td></tr>
+<tr id="row_19_"><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_epid11_sig_rl.html" target="_self">Epid11SigRl</a></td><td class="desc">Intel(R) EPID 1.1 signature based revocation list </td></tr>
+<tr id="row_20_" 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_epid11_sig_rl_entry.html" target="_self">Epid11SigRlEntry</a></td><td class="desc">Intel(R) EPID 1.1 entry in SigRL (B,K) </td></tr>
+<tr id="row_21_"><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_epid11_verifier_precomp.html" target="_self">Epid11VerifierPrecomp</a></td><td class="desc">Intel(R) EPID 1.1 Pre-computed verifier settings </td></tr>
+<tr id="row_22_" 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_epid2_params.html" target="_self">Epid2Params</a></td><td class="desc">Intel(R) EPID 2.0 Parameters </td></tr>
+<tr id="row_23_"><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_epid_ca_certificate.html" target="_self">EpidCaCertificate</a></td><td class="desc">IoT CA Certificate binary format </td></tr>
+<tr id="row_24_" 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_epid_file_header.html" target="_self">EpidFileHeader</a></td><td class="desc">Intel(R) EPID binary file header </td></tr>
+<tr id="row_25_"><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_epid_signature.html" target="_self">EpidSignature</a></td><td class="desc">Intel(R) EPID 2.0 Signature </td></tr>
+<tr id="row_26_" 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_fp_elem.html" target="_self">FpElem</a></td><td class="desc">Element of Fp </td></tr>
+<tr id="row_27_"><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_fp_elem_str.html" target="_self">FpElemStr</a></td><td class="desc">Number in [0, p-1] </td></tr>
+<tr id="row_28_" 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_fq12_elem.html" target="_self">Fq12Elem</a></td><td class="desc">Element of Fq12 </td></tr>
+<tr id="row_29_"><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_fq12_elem_str.html" target="_self">Fq12ElemStr</a></td><td class="desc">Serialized Fq2^3^2 element </td></tr>
+<tr id="row_30_" 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_fq2_elem.html" target="_self">Fq2Elem</a></td><td class="desc">Element of Fq2 </td></tr>
+<tr id="row_31_"><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_fq2_elem_str.html" target="_self">Fq2ElemStr</a></td><td class="desc">Serialized Fq2 element </td></tr>
+<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_fq3_elem_str.html" target="_self">Fq3ElemStr</a></td><td class="desc">Serialized Fq3 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_fq6_elem.html" target="_self">Fq6Elem</a></td><td class="desc">Element of Fq6 </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_fq6_elem_str.html" target="_self">Fq6ElemStr</a></td><td class="desc">Serialized Fq2^3 element </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_fq_elem.html" target="_self">FqElem</a></td><td class="desc">Element of Fq </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_fq_elem_str.html" target="_self">FqElemStr</a></td><td class="desc">Number in [0, q-1] </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_g1_elem_str.html" target="_self">G1ElemStr</a></td><td class="desc">Serialized G1 element </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_g2_elem_str.html" target="_self">G2ElemStr</a></td><td class="desc">Serialized G2 element </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_group_pub_key.html" target="_self">GroupPubKey</a></td><td class="desc">Intel(R) EPID 2.0 group public key </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_group_rl.html" target="_self">GroupRl</a></td><td class="desc">Group revocation list </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_gt_elem_str.html" target="_self">GtElemStr</a></td><td class="desc">Serialized GT element </td></tr>
+<tr id="row_42_" 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_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_43_"><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_44_" 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_params.html" target="_self">MemberParams</a></td><td class="desc">Software only specific member parameters </td></tr>
+<tr id="row_45_"><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_46_" 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_47_"><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_48_" 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_str128.html" target="_self">OctStr128</a></td><td class="desc">128 bit octet string </td></tr>
+<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_oct_str16.html" target="_self">OctStr16</a></td><td class="desc">16 bit octet string </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_oct_str256.html" target="_self">OctStr256</a></td><td class="desc">256 bit octet string </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_oct_str32.html" target="_self">OctStr32</a></td><td class="desc">32 bit octet string </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_oct_str512.html" target="_self">OctStr512</a></td><td class="desc">512 bit octet string </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_oct_str600.html" target="_self">OctStr600</a></td><td class="desc">600 bit octet string </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_oct_str64.html" target="_self">OctStr64</a></td><td class="desc">64 bit octet string </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_oct_str768.html" target="_self">OctStr768</a></td><td class="desc">768 bit octet string </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_oct_str8.html" target="_self">OctStr8</a></td><td class="desc">8 bit octet string </td></tr>
+<tr id="row_57_"><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_str80.html" target="_self">OctStr80</a></td><td class="desc">80 bit octet string </td></tr>
+<tr id="row_58_" 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_pairing_state.html" target="_self">PairingState</a></td><td class="desc">A scratch buffer for stateful pairing calls </td></tr>
+<tr id="row_59_"><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_60_" 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_61_"><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_62_" 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="unionsha__digest.html" target="_self">sha_digest</a></td><td class="desc">Sha Digest Element </td></tr>
+<tr id="row_63_"><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_64_" 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_65_"><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="structtiny__sha.html" target="_self">tiny_sha</a></td><td class="desc">Tiny Sha wrapper Element </td></tr>
+<tr id="row_66_" 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_67_"><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_68_" 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>
+<tr id="row_69_"><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_very_large_int.html" target="_self">VeryLargeInt</a></td><td class="desc">Large integer </td></tr>
+<tr id="row_70_" 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_very_large_int_product.html" target="_self">VeryLargeIntProduct</a></td><td class="desc">Used for multiplication </td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
diff --git a/doc/html/basenames_8dox.html b/doc/html/basenames_8dox.html
index 6532fad..820b8dd 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/bignum_8h.html b/doc/html/bignum_8h.html
index e85fbd8..0b0471d 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/bitsupplier_8h.html b/doc/html/bitsupplier_8h.html
index dfe0bf3..5cfc922 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">5.0.0</span>
+&#160;<span id="projectnumber">6.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 fa2b11e..fcac39b 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/building__sdk_8dox.html b/doc/html/building__sdk_8dox.html
index 659ba68..ff7f689 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/classes.html b/doc/html/classes.html
index 35696eb..9ab3156 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -64,37 +64,43 @@ $(document).ready(function(){initNavTree('classes.html','');});
<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_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><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_member_precomp.html">MemberPrecomp</a>&#160;&#160;&#160;</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_epid11_nr_proof.html">Epid11NrProof</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_membership_credential.html">MembershipCredential</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_basic_signature.html">BasicSignature</a>&#160;&#160;&#160;</td><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_fq6_elem_str.html">Fq6ElemStr</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 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_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_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_priv_rl.html">Epid11PrivRl</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fq_elem.html">FqElem</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_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><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_fq_elem_str.html">FqElemStr</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_sha256_digest.html">Sha256Digest</a>&#160;&#160;&#160;</td></tr>
+<tr><td valign="top"><a class="el" href="struct_epid11_sig_rl.html">Epid11SigRl</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_O"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;O&#160;&#160;</div></td></tr></table>
+</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_compressed_priv_key.html">CompressedPrivKey</a>&#160;&#160;&#160;</td><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_sig_rl_entry.html">SigRlEntry</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_epid11_verifier_precomp.html">Epid11VerifierPrecomp</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_oct_str128.html">OctStr128</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_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>
+<tr><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_g2_elem_str.html">G2ElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str16.html">OctStr16</a>&#160;&#160;&#160;</td></tr>
+<tr><td valign="top"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a>&#160;&#160;&#160;</td><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_group_pub_key.html">GroupPubKey</a>&#160;&#160;&#160;</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_tpm2_ctx.html">Tpm2Ctx</a>&#160;&#160;&#160;</td></tr>
+<tr><td valign="top"><a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_epid_file_header.html">EpidFileHeader</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_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></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_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 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>
+<tr><td valign="top"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</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_gt_elem_str.html">GtElemStr</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str512.html">OctStr512</a>&#160;&#160;&#160;</td></tr>
+<tr><td valign="top"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</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 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_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_ecdsa_private_key.html">EcdsaPrivateKey</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_ecdsa_public_key.html">EcdsaPublicKey</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_fp_elem.html">FpElem</a>&#160;&#160;&#160;</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_str768.html">OctStr768</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_very_large_int.html">VeryLargeInt</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 valign="top"><a class="el" href="struct_fp_elem_str.html">FpElemStr</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_str8.html">OctStr8</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_very_large_int_product.html">VeryLargeIntProduct</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 valign="top"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="struct_oct_str80.html">OctStr80</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_g2_elem_str.html">Epid11G2ElemStr</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 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_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><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 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>
+<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_fq2_elem.html">Fq2Elem</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="unionsha__digest.html">sha_digest</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 valign="top"><a class="el" href="struct_pairing_state.html">PairingState</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_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 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_params.html">MemberParams</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></tr>
+<tr><td></td><td></td><td></td><td></td><td valign="top"><a class="el" href="structtiny__sha.html">tiny_sha</a>&#160;&#160;&#160;</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_T">T</a>&#160;|&#160;<a class="qindex" href="#letter_V">V</a></div>
diff --git a/doc/html/commit_8c.html b/doc/html/commit_8c.html
index ea3720e..0ffead9 100644
--- a/doc/html/commit_8c.html
+++ b/doc/html/commit_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/commit_8h.html b/doc/html/commit_8h.html
index 50f1bbc..59f222f 100644
--- a/doc/html/commit_8h.html
+++ b/doc/html/commit_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/pairing_8h.html b/doc/html/common_2math_2pairing_8h.html
index 4dbfd07..26c3d34 100644
--- a/doc/html/pairing_8h.html
+++ b/doc/html/common_2math_2pairing_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -53,12 +53,11 @@
</div>
</div>
<script type="text/javascript">
-$(document).ready(function(){initNavTree('pairing_8h.html','');});
+$(document).ready(function(){initNavTree('common_2math_2pairing_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
-<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">pairing.h File Reference</div> </div>
@@ -72,22 +71,15 @@ $(document).ready(function(){initNavTree('pairing_8h.html','');});
<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>
-<tr class="memitem:ga3f1fa61d25487f96dfb0ffef4ad35607"><td class="memItemLeft" align="right" valign="top">
-typedef struct <a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a></td></tr>
-<tr class="memdesc:ga3f1fa61d25487f96dfb0ffef4ad35607"><td class="mdescLeft">&#160;</td><td class="mdescRight">A pairing. <br /></td></tr>
-<tr class="separator:ga3f1fa61d25487f96dfb0ffef4ad35607"><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:ga29f79a645871830754d396b9b4a2a0cc"><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___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc">NewPairingState</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *ga, <a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *gb, <a class="el" href="group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e">FiniteField</a> *ff, <a class="el" href="struct_big_num_str.html">BigNumStr</a> const *t, <a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> neg, <a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> **ps)</td></tr>
+<tr class="memitem:ga29f79a645871830754d396b9b4a2a0cc"><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___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc">NewPairingState</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *ga, <a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *gb, <a class="el" href="group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e">FiniteField</a> *ff, <a class="el" href="struct_big_num_str.html">BigNumStr</a> const *t, <a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> neg, <a class="el" href="struct_pairing_state.html">PairingState</a> **ps)</td></tr>
<tr class="memdesc:ga29f79a645871830754d396b9b4a2a0cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new pairing state. <a href="group___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc">More...</a><br /></td></tr>
<tr class="separator:ga29f79a645871830754d396b9b4a2a0cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gad54aebdc331d39b73000fdca9e04f94d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d">DeletePairingState</a> (<a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> **ps)</td></tr>
-<tr class="memdesc:gad54aebdc331d39b73000fdca9e04f94d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees a previously allocated by PairingState. <a href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d">More...</a><br /></td></tr>
+<tr class="memitem:gad54aebdc331d39b73000fdca9e04f94d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d">DeletePairingState</a> (<a class="el" href="struct_pairing_state.html">PairingState</a> **ps)</td></tr>
+<tr class="memdesc:gad54aebdc331d39b73000fdca9e04f94d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees a previously allocated by <a class="el" href="struct_pairing_state.html" title="A scratch buffer for stateful pairing calls. ">PairingState</a>. <a href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d">More...</a><br /></td></tr>
<tr class="separator:gad54aebdc331d39b73000fdca9e04f94d"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga58a9d3cb6129274a04c72a35a52f768d"><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___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d">Pairing</a> (<a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> *ps, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *a, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *b, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *d)</td></tr>
+<tr class="memitem:ga58a9d3cb6129274a04c72a35a52f768d"><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___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d">Pairing</a> (<a class="el" href="struct_pairing_state.html">PairingState</a> *ps, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *a, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *b, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *d)</td></tr>
<tr class="memdesc:ga58a9d3cb6129274a04c72a35a52f768d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes an Optimal Ate Pairing for two parameters. <a href="group___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d">More...</a><br /></td></tr>
<tr class="separator:ga58a9d3cb6129274a04c72a35a52f768d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
@@ -99,7 +91,7 @@ Functions</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_f6bef457d5f671b6e774bfccc16651f6.html">common</a></li><li class="navelem"><a class="el" href="dir_f169ebf8da29290a918fa4b3f7151050.html">math</a></li><li class="navelem"><a class="el" href="pairing_8h.html">pairing.h</a></li>
+ <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_f6bef457d5f671b6e774bfccc16651f6.html">common</a></li><li class="navelem"><a class="el" href="dir_f169ebf8da29290a918fa4b3f7151050.html">math</a></li><li class="navelem"><a class="el" href="common_2math_2pairing_8h.html">pairing.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
index aa3313a..bb765f5 100644
--- a/doc/html/context_8c.html
+++ b/doc/html/context_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/context_8h.html b/doc/html/context_8h.html
index 178a3cd..7457b80 100644
--- a/doc/html/context_8h.html
+++ b/doc/html/context_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/conversion_8c.html b/doc/html/conversion_8c.html
index 888bfff..0c9a246 100644
--- a/doc/html/conversion_8c.html
+++ b/doc/html/conversion_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/conversion_8h.html b/doc/html/conversion_8h.html
index 8b4b160..f2b58fc 100644
--- a/doc/html/conversion_8h.html
+++ b/doc/html/conversion_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/createprimary_8c.html b/doc/html/createprimary_8c.html
index 4203ca8..478c86c 100644
--- a/doc/html/createprimary_8c.html
+++ b/doc/html/createprimary_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/createprimary_8h.html b/doc/html/createprimary_8h.html
index 42ff953..f73617b 100644
--- a/doc/html/createprimary_8h.html
+++ b/doc/html/createprimary_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/deprecated.html b/doc/html/deprecated.html
new file mode 100644
index 0000000..a35a900
--- /dev/null
+++ b/doc/html/deprecated.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: Deprecated List</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">6.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('deprecated.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">Deprecated List </div> </div>
+</div><!--header-->
+<div class="contents">
+<div class="textblock"><dl class="reflist">
+<dt><a class="anchor" id="_deprecated000001"></a>Global <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7">EpidMemberCreate</a> (<a class="el" href="struct_member_params.html" title="Software only specific member parameters. ">MemberParams</a> const *params, MemberCtx **ctx)</dt>
+<dd>This API has been superseded by <a class="el" href="group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24" title="Computes the size in bytes required for a member context. ">EpidMemberGetSize</a> and <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a>. </dd>
+<dt><a class="anchor" id="_deprecated000002"></a>Global <a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">EpidMemberDelete</a> (MemberCtx **ctx)</dt>
+<dd>This API has been superseded by <a class="el" href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d" title="De-initializes an existing member context buffer. ">EpidMemberDeinit</a>.</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/dir_02c945662023679b89476bd7126bc985.html b/doc/html/dir_02c945662023679b89476bd7126bc985.html
index f31adf0..7adf3a9 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_0d59f1b8006345e373e07b4691e0da76.html b/doc/html/dir_0d59f1b8006345e373e07b4691e0da76.html
index 4e64a72..511e696 100644
--- a/doc/html/dir_0d59f1b8006345e373e07b4691e0da76.html
+++ b/doc/html/dir_0d59f1b8006345e373e07b4691e0da76.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_12b90d9c027aaf878a834df729679a56.html b/doc/html/dir_12b90d9c027aaf878a834df729679a56.html
index a25a280..efd48b7 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_512d3e62841a8535b716ec4cf8b9e950.html b/doc/html/dir_512d3e62841a8535b716ec4cf8b9e950.html
index b40409f..3be24a4 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html b/doc/html/dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html
new file mode 100644
index 0000000..46e4fd3
--- /dev/null
+++ b/doc/html/dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html
@@ -0,0 +1,126 @@
+<!-- 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/tiny/math 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">6.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_5f2fc2cf41db41de2b55e03ffa7a1d16.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">math 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:efq_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html">efq.h</a></td></tr>
+<tr class="memdesc:efq_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of EFq math. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:efq2_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html">efq2.h</a></td></tr>
+<tr class="memdesc:efq2_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of EFq2 math. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:fp_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html">fp.h</a></td></tr>
+<tr class="memdesc:fp_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of Fp math. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:fq_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html">fq.h</a></td></tr>
+<tr class="memdesc:fq_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of Fq math. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:fq12_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html">fq12.h</a></td></tr>
+<tr class="memdesc:fq12_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of Fq12 math. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:fq2_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html">fq2.h</a></td></tr>
+<tr class="memdesc:fq2_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of Fq2 math. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:fq6_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html">fq6.h</a></td></tr>
+<tr class="memdesc:fq6_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of Fq6 math. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:hashwrap_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hashwrap_8h.html">hashwrap.h</a></td></tr>
+<tr class="memdesc:hashwrap_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decleration of hash wrap function. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:mathdefs_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathdefs_8h.html">mathdefs.h</a></td></tr>
+<tr class="memdesc:mathdefs_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Common public definitions for math headers. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:mathtypes_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathtypes_8h.html">mathtypes.h</a></td></tr>
+<tr class="memdesc:mathtypes_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of math types in tiny Intel(R) EPID. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:member_2tiny_2math_2pairing_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="member_2tiny_2math_2pairing_8h.html">pairing.h</a></td></tr>
+<tr class="memdesc:member_2tiny_2math_2pairing_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of pairing math. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:serialize_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html">serialize.h</a></td></tr>
+<tr class="memdesc:serialize_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of de/serialize functionality. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:sha256_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha256_8h.html">sha256.h</a></td></tr>
+<tr class="memdesc:sha256_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interface to a SHA-256 implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:sha512_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha512_8h.html">sha512.h</a></td></tr>
+<tr class="memdesc:sha512_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interface to a SHA-512 implementation. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:vli_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html">vli.h</a></td></tr>
+<tr class="memdesc:vli_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Definition of Large Integer math. <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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/dir_a32be19bc88f3d7aac6b7249da379f26.html b/doc/html/dir_a32be19bc88f3d7aac6b7249da379f26.html
index e8d531a..782386d 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_a6a596e2b2b50fb0973c7fe0b17a09e5.html b/doc/html/dir_a6a596e2b2b50fb0973c7fe0b17a09e5.html
new file mode 100644
index 0000000..1b8da58
--- /dev/null
+++ b/doc/html/dir_a6a596e2b2b50fb0973c7fe0b17a09e5.html
@@ -0,0 +1,87 @@
+<!-- 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/tiny/stdlib 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">6.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_a6a596e2b2b50fb0973c7fe0b17a09e5.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">stdlib 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:endian_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="endian_8h.html">endian.h</a></td></tr>
+<tr class="memdesc:endian_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert values between host and big-/little-endian byte order. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:tiny__stdlib_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tiny__stdlib_8h.html">tiny_stdlib.h</a></td></tr>
+<tr class="memdesc:tiny__stdlib_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tiny portable implementations of standard library functions. <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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_a6a596e2b2b50fb0973c7fe0b17a09e5.html">stdlib</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html b/doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html
index ad2ce28..e200c77 100644
--- a/doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html
+++ b/doc/html/dir_b7525369f2fbc378c6814b573b9a2bc3.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_ea12d375fc1eb79df248c0adf953af4f.html b/doc/html/dir_ea12d375fc1eb79df248c0adf953af4f.html
new file mode 100644
index 0000000..38183f2
--- /dev/null
+++ b/doc/html/dir_ea12d375fc1eb79df248c0adf953af4f.html
@@ -0,0 +1,81 @@
+<!-- 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/tiny 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">6.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_ea12d375fc1eb79df248c0adf953af4f.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="headertitle">
+<div class="title">tiny 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>
+</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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</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 86e2dfc..813a0b5 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/dir_f169ebf8da29290a918fa4b3f7151050.html b/doc/html/dir_f169ebf8da29290a918fa4b3f7151050.html
index 75d4c5c..80a9438 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -83,8 +83,8 @@ Files</h2></td></tr>
<tr class="memitem:hash_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hash_8h.html">hash.h</a></td></tr>
<tr class="memdesc:hash_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hash primitives. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:pairing_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pairing_8h.html">pairing.h</a></td></tr>
-<tr class="memdesc:pairing_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pairing interface. <br /></td></tr>
+<tr class="memitem:common_2math_2pairing_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="common_2math_2pairing_8h.html">pairing.h</a></td></tr>
+<tr class="memdesc:common_2math_2pairing_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pairing interface. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:printutils_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printutils_8h.html">printutils.h</a></td></tr>
<tr class="memdesc:printutils_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print helper interface. <br /></td></tr>
diff --git a/doc/html/dir_f6bef457d5f671b6e774bfccc16651f6.html b/doc/html/dir_f6bef457d5f671b6e774bfccc16651f6.html
index b36f7fb..d5135ee 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -77,6 +77,9 @@ Files</h2></td></tr>
<tr class="memitem:bitsupplier_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bitsupplier_8h.html">bitsupplier.h</a></td></tr>
<tr class="memdesc:bitsupplier_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Random data supplier interface. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:epiddefs_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="epiddefs_8h.html">epiddefs.h</a></td></tr>
+<tr class="memdesc:epiddefs_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Common SDK macro definitions. <br /></td></tr>
+<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:errors_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="errors_8h.html">errors.h</a></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>
diff --git a/doc/html/ecdsa_8h.html b/doc/html/ecdsa_8h.html
index b5a47cd..c8bb739 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/ecgroup_8h.html b/doc/html/ecgroup_8h.html
index 4647db2..4acef96 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/efq2_8h.html b/doc/html/efq2_8h.html
new file mode 100644
index 0000000..9ead524
--- /dev/null
+++ b/doc/html/efq2_8h.html
@@ -0,0 +1,428 @@
+<!-- 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/tiny/math/efq2.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">6.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('efq2_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">efq2.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of EFq2 math.
+<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:a9181b09474d800c65fd89aee2c28ebab"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#a9181b09474d800c65fd89aee2c28ebab">EFq2IsInf</a> (<a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *in)</td></tr>
+<tr class="memdesc:a9181b09474d800c65fd89aee2c28ebab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if a point is infinity. <a href="#a9181b09474d800c65fd89aee2c28ebab">More...</a><br /></td></tr>
+<tr class="separator:a9181b09474d800c65fd89aee2c28ebab"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:af1da3e171d605db6f5ea0a70dc01ac27"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#af1da3e171d605db6f5ea0a70dc01ac27">EFq2FromAffine</a> (<a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *result, <a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> const *in)</td></tr>
+<tr class="memdesc:af1da3e171d605db6f5ea0a70dc01ac27"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a point from Affine to Jacobi representation. <a href="#af1da3e171d605db6f5ea0a70dc01ac27">More...</a><br /></td></tr>
+<tr class="separator:af1da3e171d605db6f5ea0a70dc01ac27"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a484e6af5efc2042d865999dac9489684"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#a484e6af5efc2042d865999dac9489684">EFq2ToAffine</a> (<a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *in)</td></tr>
+<tr class="memdesc:a484e6af5efc2042d865999dac9489684"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a point from Jacobi to Affine representation. <a href="#a484e6af5efc2042d865999dac9489684">More...</a><br /></td></tr>
+<tr class="separator:a484e6af5efc2042d865999dac9489684"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a1db50d99360ed019ca4dcd2f9bcf210a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#a1db50d99360ed019ca4dcd2f9bcf210a">EFq2Dbl</a> (<a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *in)</td></tr>
+<tr class="memdesc:a1db50d99360ed019ca4dcd2f9bcf210a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Double a point in EFq2. <a href="#a1db50d99360ed019ca4dcd2f9bcf210a">More...</a><br /></td></tr>
+<tr class="separator:a1db50d99360ed019ca4dcd2f9bcf210a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a6cbfb24b20b29b2e678e259aa6c0e2db"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#a6cbfb24b20b29b2e678e259aa6c0e2db">EFq2Add</a> (<a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *left, <a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *right)</td></tr>
+<tr class="memdesc:a6cbfb24b20b29b2e678e259aa6c0e2db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two points in EFq2. <a href="#a6cbfb24b20b29b2e678e259aa6c0e2db">More...</a><br /></td></tr>
+<tr class="separator:a6cbfb24b20b29b2e678e259aa6c0e2db"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a977bd074ed0dec943ad0cf19a01c0cf7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#a977bd074ed0dec943ad0cf19a01c0cf7">EFq2Neg</a> (<a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *in)</td></tr>
+<tr class="memdesc:a977bd074ed0dec943ad0cf19a01c0cf7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negate a point on EFq2. <a href="#a977bd074ed0dec943ad0cf19a01c0cf7">More...</a><br /></td></tr>
+<tr class="separator:a977bd074ed0dec943ad0cf19a01c0cf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a3ad678e3701e1211fa01ddc54f2bc5e4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#a3ad678e3701e1211fa01ddc54f2bc5e4">EFq2MulSSCM</a> (<a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *left, <a class="el" href="struct_fp_elem.html">FpElem</a> const *right)</td></tr>
+<tr class="memdesc:a3ad678e3701e1211fa01ddc54f2bc5e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two points in EFq. <a href="#a3ad678e3701e1211fa01ddc54f2bc5e4">More...</a><br /></td></tr>
+<tr class="separator:a3ad678e3701e1211fa01ddc54f2bc5e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a2064ea9b48565a164314da4b487aaabd"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#a2064ea9b48565a164314da4b487aaabd">EFq2Eq</a> (<a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *left, <a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *right)</td></tr>
+<tr class="memdesc:a2064ea9b48565a164314da4b487aaabd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if two points on EFq2 are equal. <a href="#a2064ea9b48565a164314da4b487aaabd">More...</a><br /></td></tr>
+<tr class="separator:a2064ea9b48565a164314da4b487aaabd"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a26c35eefbd1ee11a5d078c44d295ff5a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq2_8h.html#a26c35eefbd1ee11a5d078c44d295ff5a">EFq2OnCurve</a> (<a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> const *in)</td></tr>
+<tr class="memdesc:a26c35eefbd1ee11a5d078c44d295ff5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if a point is in EFq2. <a href="#a26c35eefbd1ee11a5d078c44d295ff5a">More...</a><br /></td></tr>
+<tr class="separator:a26c35eefbd1ee11a5d078c44d295ff5a"><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>Definition of EFq2 math. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a6cbfb24b20b29b2e678e259aa6c0e2db"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFq2Add </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two points in EFq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of adding left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a1db50d99360ed019ca4dcd2f9bcf210a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFq2Dbl </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Double a point in EFq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the value to double. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a2064ea9b48565a164314da4b487aaabd"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFq2Eq </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if two points on EFq2 are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be tested. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be tested. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="af1da3e171d605db6f5ea0a70dc01ac27"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFq2FromAffine </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Convert a point from Affine to Jacobi representation. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a9181b09474d800c65fd89aee2c28ebab"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFq2IsInf </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if a point is infinity. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the point to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) indeed the value is infinity. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a3ad678e3701e1211fa01ddc54f2bc5e4"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFq2MulSSCM </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two points in EFq. </p>
+<p>This function is mitigated against software side-channel attacks.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a977bd074ed0dec943ad0cf19a01c0cf7"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFq2Neg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Negate a point on EFq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the negative of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to negate. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a26c35eefbd1ee11a5d078c44d295ff5a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFq2OnCurve </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if a point is in EFq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the point to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) indeed the point is on the curve. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a484e6af5efc2042d865999dac9489684"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFq2ToAffine </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Convert a point from Jacobi to Affine representation. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>1 on success, 0 on failure </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="efq2_8h.html">efq2.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/efq_8h.html b/doc/html/efq_8h.html
new file mode 100644
index 0000000..89d995f
--- /dev/null
+++ b/doc/html/efq_8h.html
@@ -0,0 +1,1096 @@
+<!-- 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/tiny/math/efq.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">6.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('efq_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">efq.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of EFq math.
+<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="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:a84e5231cee67eeba5b2a0f99088bc70e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a84e5231cee67eeba5b2a0f99088bc70e">EFqMulSSCM</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *base, <a class="el" href="struct_fp_elem.html">FpElem</a> const *exp)</td></tr>
+<tr class="memdesc:a84e5231cee67eeba5b2a0f99088bc70e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two points in EFq. <a href="#a84e5231cee67eeba5b2a0f99088bc70e">More...</a><br /></td></tr>
+<tr class="separator:a84e5231cee67eeba5b2a0f99088bc70e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a8990ca0e19d8ed7b78958963e60948e2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a8990ca0e19d8ed7b78958963e60948e2">EFqAffineExp</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *result, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *base, <a class="el" href="struct_fp_elem.html">FpElem</a> const *exp)</td></tr>
+<tr class="memdesc:a8990ca0e19d8ed7b78958963e60948e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exponentiate a point in EFq by an element of Fp. <a href="#a8990ca0e19d8ed7b78958963e60948e2">More...</a><br /></td></tr>
+<tr class="separator:a8990ca0e19d8ed7b78958963e60948e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a2618ae4b4fc8f2838a6550abfb4448ca"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a2618ae4b4fc8f2838a6550abfb4448ca">EFqAffineMultiExp</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *result, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *base0, <a class="el" href="struct_fp_elem.html">FpElem</a> const *exp0, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *base1, <a class="el" href="struct_fp_elem.html">FpElem</a> const *exp1)</td></tr>
+<tr class="memdesc:a2618ae4b4fc8f2838a6550abfb4448ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sum the results of exponentiating two points in EFq by elements of Fp. <a href="#a2618ae4b4fc8f2838a6550abfb4448ca">More...</a><br /></td></tr>
+<tr class="separator:a2618ae4b4fc8f2838a6550abfb4448ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:abbcd39b964e4fd685d1dba73ec110c86"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#abbcd39b964e4fd685d1dba73ec110c86">EFqMultiExp</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *base0, <a class="el" href="struct_fp_elem.html">FpElem</a> const *exp0, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *base1, <a class="el" href="struct_fp_elem.html">FpElem</a> const *exp1)</td></tr>
+<tr class="memdesc:abbcd39b964e4fd685d1dba73ec110c86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sum the results of exponentiating two points in EFq by elements of Fp. <a href="#abbcd39b964e4fd685d1dba73ec110c86">More...</a><br /></td></tr>
+<tr class="separator:abbcd39b964e4fd685d1dba73ec110c86"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a6cf130d65a5f35237a88046faad43c0a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a6cf130d65a5f35237a88046faad43c0a">EFqAffineAdd</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *result, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *left, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *right)</td></tr>
+<tr class="memdesc:a6cf130d65a5f35237a88046faad43c0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two points in EFq. <a href="#a6cf130d65a5f35237a88046faad43c0a">More...</a><br /></td></tr>
+<tr class="separator:a6cf130d65a5f35237a88046faad43c0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a975f92abdaf431f2fb152fca84d468b3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a975f92abdaf431f2fb152fca84d468b3">EFqAffineDbl</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *result, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *in)</td></tr>
+<tr class="memdesc:a975f92abdaf431f2fb152fca84d468b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Double a point in EFq. <a href="#a975f92abdaf431f2fb152fca84d468b3">More...</a><br /></td></tr>
+<tr class="separator:a975f92abdaf431f2fb152fca84d468b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a23b6331263b002e6e07d2be5216fd6e8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a23b6331263b002e6e07d2be5216fd6e8">EFqDbl</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *in)</td></tr>
+<tr class="memdesc:a23b6331263b002e6e07d2be5216fd6e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Double a point in EFq. <a href="#a23b6331263b002e6e07d2be5216fd6e8">More...</a><br /></td></tr>
+<tr class="separator:a23b6331263b002e6e07d2be5216fd6e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:abf04f5ec866fc77d0203beb8a8991f25"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#abf04f5ec866fc77d0203beb8a8991f25">EFqAdd</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *left, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *right)</td></tr>
+<tr class="memdesc:abf04f5ec866fc77d0203beb8a8991f25"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two points in EFq. <a href="#abf04f5ec866fc77d0203beb8a8991f25">More...</a><br /></td></tr>
+<tr class="separator:abf04f5ec866fc77d0203beb8a8991f25"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a40588e2618ed9a38043532785a8d5785"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a40588e2618ed9a38043532785a8d5785">EFqRand</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *result, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param)</td></tr>
+<tr class="memdesc:a40588e2618ed9a38043532785a8d5785"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate a random point in EFq. <a href="#a40588e2618ed9a38043532785a8d5785">More...</a><br /></td></tr>
+<tr class="separator:a40588e2618ed9a38043532785a8d5785"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7d1841f9e29bc604054536de7a4a861d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a7d1841f9e29bc604054536de7a4a861d">EFqSet</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *x, <a class="el" href="struct_fq_elem.html">FqElem</a> const *y)</td></tr>
+<tr class="memdesc:a7d1841f9e29bc604054536de7a4a861d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a point's value. <a href="#a7d1841f9e29bc604054536de7a4a861d">More...</a><br /></td></tr>
+<tr class="separator:a7d1841f9e29bc604054536de7a4a861d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ae38257cf97872a4fa855033ad44e2e10"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#ae38257cf97872a4fa855033ad44e2e10">EFqIsInf</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *in)</td></tr>
+<tr class="memdesc:ae38257cf97872a4fa855033ad44e2e10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if a point is infinity. <a href="#ae38257cf97872a4fa855033ad44e2e10">More...</a><br /></td></tr>
+<tr class="separator:ae38257cf97872a4fa855033ad44e2e10"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a97ce025667b076986a6d92b3d41a7827"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a97ce025667b076986a6d92b3d41a7827">EFqFromAffine</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *in)</td></tr>
+<tr class="memdesc:a97ce025667b076986a6d92b3d41a7827"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a point from Affine to Jacobi representation. <a href="#a97ce025667b076986a6d92b3d41a7827">More...</a><br /></td></tr>
+<tr class="separator:a97ce025667b076986a6d92b3d41a7827"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aaf3f26e855b85e869cb80fae780a4e6a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#aaf3f26e855b85e869cb80fae780a4e6a">EFqToAffine</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *in)</td></tr>
+<tr class="memdesc:aaf3f26e855b85e869cb80fae780a4e6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a point from Jacobi to Affine representation. <a href="#aaf3f26e855b85e869cb80fae780a4e6a">More...</a><br /></td></tr>
+<tr class="separator:aaf3f26e855b85e869cb80fae780a4e6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a0f7309ab07d4d3e0556a32f1839ae6fe"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a0f7309ab07d4d3e0556a32f1839ae6fe">EFqNeg</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *in)</td></tr>
+<tr class="memdesc:a0f7309ab07d4d3e0556a32f1839ae6fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negate a point on EFq. <a href="#a0f7309ab07d4d3e0556a32f1839ae6fe">More...</a><br /></td></tr>
+<tr class="separator:a0f7309ab07d4d3e0556a32f1839ae6fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7fbfe9d25cf08f4dcbd950cfb07471ff"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a7fbfe9d25cf08f4dcbd950cfb07471ff">EFqEq</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *left, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *right)</td></tr>
+<tr class="memdesc:a7fbfe9d25cf08f4dcbd950cfb07471ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if two points on EFq are equal. <a href="#a7fbfe9d25cf08f4dcbd950cfb07471ff">More...</a><br /></td></tr>
+<tr class="separator:a7fbfe9d25cf08f4dcbd950cfb07471ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:abf80ad8b8e3e506f4c46ec57de1c4846"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#abf80ad8b8e3e506f4c46ec57de1c4846">EFqHash</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *result, unsigned char const *msg, size_t len, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hashalg)</td></tr>
+<tr class="memdesc:abf80ad8b8e3e506f4c46ec57de1c4846"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes an arbitrary message to a point on EFq. <a href="#abf80ad8b8e3e506f4c46ec57de1c4846">More...</a><br /></td></tr>
+<tr class="separator:abf80ad8b8e3e506f4c46ec57de1c4846"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7a7863639a5b96d44522d579d7d32e40"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a7a7863639a5b96d44522d579d7d32e40">EFqCp</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *result, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *in)</td></tr>
+<tr class="memdesc:a7a7863639a5b96d44522d579d7d32e40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy a point's value. <a href="#a7a7863639a5b96d44522d579d7d32e40">More...</a><br /></td></tr>
+<tr class="separator:a7a7863639a5b96d44522d579d7d32e40"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:acfc458ea689ea3aa637c9c817dfa44c5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#acfc458ea689ea3aa637c9c817dfa44c5">EFqEqAffine</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *left, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *right)</td></tr>
+<tr class="memdesc:acfc458ea689ea3aa637c9c817dfa44c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if two points on EFq are equal. <a href="#acfc458ea689ea3aa637c9c817dfa44c5">More...</a><br /></td></tr>
+<tr class="separator:acfc458ea689ea3aa637c9c817dfa44c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9b2fcab6bc74601f9c302c5b34400ae4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a9b2fcab6bc74601f9c302c5b34400ae4">EFqCondSet</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *true_val, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *false_val, int truth_val)</td></tr>
+<tr class="memdesc:a9b2fcab6bc74601f9c302c5b34400ae4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Conditionally Set a point's value to one of two values. <a href="#a9b2fcab6bc74601f9c302c5b34400ae4">More...</a><br /></td></tr>
+<tr class="separator:a9b2fcab6bc74601f9c302c5b34400ae4"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a1a31d069739c4da17011280a8ae6354a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a1a31d069739c4da17011280a8ae6354a">EFqJCp</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *in)</td></tr>
+<tr class="memdesc:a1a31d069739c4da17011280a8ae6354a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy a point's value. <a href="#a1a31d069739c4da17011280a8ae6354a">More...</a><br /></td></tr>
+<tr class="separator:a1a31d069739c4da17011280a8ae6354a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a73fd77b7cc14c0decd95fd294b5b250c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a73fd77b7cc14c0decd95fd294b5b250c">EFqInf</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result)</td></tr>
+<tr class="memdesc:a73fd77b7cc14c0decd95fd294b5b250c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set an element's value to infinity. <a href="#a73fd77b7cc14c0decd95fd294b5b250c">More...</a><br /></td></tr>
+<tr class="separator:a73fd77b7cc14c0decd95fd294b5b250c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a81470fed188d5043f89b6b8ab6031a42"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a81470fed188d5043f89b6b8ab6031a42">EFqOnCurve</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *in)</td></tr>
+<tr class="memdesc:a81470fed188d5043f89b6b8ab6031a42"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if a point is on EFq. <a href="#a81470fed188d5043f89b6b8ab6031a42">More...</a><br /></td></tr>
+<tr class="separator:a81470fed188d5043f89b6b8ab6031a42"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ada751265a36ee3236fce90105a62909e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#ada751265a36ee3236fce90105a62909e">EFqJOnCurve</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *in)</td></tr>
+<tr class="memdesc:ada751265a36ee3236fce90105a62909e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if a point is on EFq. <a href="#ada751265a36ee3236fce90105a62909e">More...</a><br /></td></tr>
+<tr class="separator:ada751265a36ee3236fce90105a62909e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a15bda5d411f7c6d602994e6444034414"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="efq_8h.html#a15bda5d411f7c6d602994e6444034414">EFqJRand</a> (<a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *result, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param)</td></tr>
+<tr class="memdesc:a15bda5d411f7c6d602994e6444034414"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate a random point in EFq. <a href="#a15bda5d411f7c6d602994e6444034414">More...</a><br /></td></tr>
+<tr class="separator:a15bda5d411f7c6d602994e6444034414"><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>Definition of EFq math. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="abf04f5ec866fc77d0203beb8a8991f25"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqAdd </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two points in EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of adding left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a6cf130d65a5f35237a88046faad43c0a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqAffineAdd </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two points in EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of adding left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a975f92abdaf431f2fb152fca84d468b3"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqAffineDbl </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Double a point in EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the value to double. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a8990ca0e19d8ed7b78958963e60948e2"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqAffineExp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>base</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>exp</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Exponentiate a point in EFq by an element of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp</td><td>the exponent. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise.</dd>
+<dd>
+1 on success, 0 on failure </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a2618ae4b4fc8f2838a6550abfb4448ca"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqAffineMultiExp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>base0</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>exp0</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>base1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>exp1</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sum the results of exponentiating two points in EFq by elements of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base0</td><td>the first base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp0</td><td>the first exponent. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base1</td><td>the second base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp1</td><td>the second exponent. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a9b2fcab6bc74601f9c302c5b34400ae4"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqCondSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>true_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>false_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int&#160;</td>
+ <td class="paramname"><em>truth_val</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Conditionally Set a point's value to one of two values. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">true_val</td><td>value to set if condition is true. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">false_val</td><td>value to set if condition is false. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">truth_val</td><td>value of condition. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a7a7863639a5b96d44522d579d7d32e40"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqCp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Copy a point's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>copy target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>copy source. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a23b6331263b002e6e07d2be5216fd6e8"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqDbl </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Double a point in EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the value to double. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a7fbfe9d25cf08f4dcbd950cfb07471ff"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqEq </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if two points on EFq are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be tested. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be tested. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="acfc458ea689ea3aa637c9c817dfa44c5"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqEqAffine </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if two points on EFq are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be tested. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be tested. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a97ce025667b076986a6d92b3d41a7827"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqFromAffine </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Convert a point from Affine to Jacobi representation. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="abf80ad8b8e3e506f4c46ec57de1c4846"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqHash </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">unsigned char 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>len</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>hashalg</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Hashes an arbitrary message to a point on EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">msg</td><td>buffer to reinterpret. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>length of msg in bytes. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">hashalg</td><td>hash algorithm to use. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a73fd77b7cc14c0decd95fd294b5b250c"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqInf </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Set an element's value to infinity. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>element to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ae38257cf97872a4fa855033ad44e2e10"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqIsInf </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if a point is infinity. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the point to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) indeed the value is infinity. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a1a31d069739c4da17011280a8ae6354a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqJCp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Copy a point's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>copy target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>copy source. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ada751265a36ee3236fce90105a62909e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqJOnCurve </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if a point is on EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the point to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) indeed the point is on the curve. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a15bda5d411f7c6d602994e6444034414"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqJRand </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</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>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Generate a random point in EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>the random value. </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>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a84e5231cee67eeba5b2a0f99088bc70e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqMulSSCM </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>base</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>exp</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two points in EFq. </p>
+<p>This function is mitigated against software side-channel attacks.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="abbcd39b964e4fd685d1dba73ec110c86"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqMultiExp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>base0</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>exp0</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>base1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>exp1</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sum the results of exponentiating two points in EFq by elements of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base0</td><td>the first base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp0</td><td>the first exponent. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base1</td><td>the second base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp1</td><td>the second exponent. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>1 on success, 0 on failure </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a0f7309ab07d4d3e0556a32f1839ae6fe"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqNeg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Negate a point on EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the negative of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to negate. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a81470fed188d5043f89b6b8ab6031a42"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqOnCurve </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if a point is on EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the point to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) indeed the point is on the curve. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a40588e2618ed9a38043532785a8d5785"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqRand </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>result</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>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Generate a random point in EFq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>the random value. </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>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a7d1841f9e29bc604054536de7a4a861d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EFqSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>x</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>y</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Set a point's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">x</td><td>value to set. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">y</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aaf3f26e855b85e869cb80fae780a4e6a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int EFqToAffine </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_jacobi_fq.html">EccPointJacobiFq</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Convert a point from Jacobi to Affine representation. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="efq_8h.html">efq.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/endian_8h.html b/doc/html/endian_8h.html
new file mode 100644
index 0000000..64949f9
--- /dev/null
+++ b/doc/html/endian_8h.html
@@ -0,0 +1,132 @@
+<!-- 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/tiny/stdlib/endian.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">6.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('endian_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#define-members">Macros</a> </div>
+ <div class="headertitle">
+<div class="title">endian.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Convert values between host and big-/little-endian byte order.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;stdint.h&gt;</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:a48127d3bd550dacd707b58a637b05393"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="endian_8h.html#a48127d3bd550dacd707b58a637b05393">be32toh</a>(big_endian_32bits)</td></tr>
+<tr class="memdesc:a48127d3bd550dacd707b58a637b05393"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transform big endian uint32_t to host uint32_t. <a href="#a48127d3bd550dacd707b58a637b05393">More...</a><br /></td></tr>
+<tr class="separator:a48127d3bd550dacd707b58a637b05393"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab004b68a63ea32dcd67fbe597263120b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="endian_8h.html#ab004b68a63ea32dcd67fbe597263120b">htobe32</a>(host_32bits)</td></tr>
+<tr class="memdesc:ab004b68a63ea32dcd67fbe597263120b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transform host uint32_t to big endian uint32_t. <a href="#ab004b68a63ea32dcd67fbe597263120b">More...</a><br /></td></tr>
+<tr class="separator:ab004b68a63ea32dcd67fbe597263120b"><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>Convert values between host and big-/little-endian byte order. </p>
+</div><h2 class="groupheader">Macro Definition Documentation</h2>
+<a class="anchor" id="a48127d3bd550dacd707b58a637b05393"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define be32toh</td>
+ <td>(</td>
+ <td class="paramtype">&#160;</td>
+ <td class="paramname">big_endian_32bits</td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line">((uint32_t)(((((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)&amp;(big_endian_32bits))[0]) &lt;&lt; 24) + \</div><div class="line"> ((((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)&amp;(big_endian_32bits))[1]) &lt;&lt; 16) + \</div><div class="line"> ((((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)&amp;(big_endian_32bits))[2]) &lt;&lt; 8) + \</div><div class="line"> (((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)&amp;(big_endian_32bits))[3])))</div></div><!-- fragment -->
+<p>Transform big endian uint32_t to host uint32_t. </p>
+
+</div>
+</div>
+<a class="anchor" id="ab004b68a63ea32dcd67fbe597263120b"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">#define htobe32</td>
+ <td>(</td>
+ <td class="paramtype">&#160;</td>
+ <td class="paramname">host_32bits</td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+<b>Value:</b><div class="fragment"><div class="line">(uint32_t)(((((uint32_t)(host_32bits)) &amp; 0xFF) &lt;&lt; 24) | \</div><div class="line"> ((((uint32_t)(host_32bits)) &amp; 0xFF00) &lt;&lt; 8) | \</div><div class="line"> ((((uint32_t)(host_32bits)) &amp; 0xFF0000) &gt;&gt; 8) | \</div><div class="line"> ((((uint32_t)(host_32bits)) &amp; 0xFF000000) &gt;&gt; 24))</div></div><!-- fragment -->
+<p>Transform host uint32_t to big endian uint32_t. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_a6a596e2b2b50fb0973c7fe0b17a09e5.html">stdlib</a></li><li class="navelem"><a class="el" href="endian_8h.html">endian.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/epid__overview_8dox.html b/doc/html/epid__overview_8dox.html
index 0d6c128..92e09ba 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/epiddefs_8h.html b/doc/html/epiddefs_8h.html
new file mode 100644
index 0000000..fa31755
--- /dev/null
+++ b/doc/html/epiddefs_8h.html
@@ -0,0 +1,84 @@
+<!-- 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/common/epiddefs.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">6.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('epiddefs_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#define-members">Macros</a> </div>
+ <div class="headertitle">
+<div class="title">epiddefs.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Common SDK macro definitions.
+<a href="#details">More...</a></p>
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>Common SDK macro definitions. </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_f6bef457d5f671b6e774bfccc16651f6.html">common</a></li><li class="navelem"><a class="el" href="epiddefs_8h.html">epiddefs.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/errors_8h.html b/doc/html/errors_8h.html
index ffcf85b..bb215b9 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/examples.html b/doc/html/examples.html
index b114cb9..e13497e 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/examples_8dox.html b/doc/html/examples_8dox.html
index 671ec28..9855d4f 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/file__parser_8h.html b/doc/html/file__parser_8h.html
index 0387fae..3fe89ce 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/files.html b/doc/html/files.html
index 82c4335..5ff012a 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -74,43 +74,64 @@ $(document).ready(function(){initNavTree('files.html','');});
<tr id="row_0_0_1_2_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="ecgroup_8h.html" target="_self">ecgroup.h</a></td><td class="desc">Elliptic curve group interface </td></tr>
<tr id="row_0_0_1_3_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="finitefield_8h.html" target="_self">finitefield.h</a></td><td class="desc">Finite field interface </td></tr>
<tr id="row_0_0_1_4_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="hash_8h.html" target="_self">hash.h</a></td><td class="desc">Hash primitives </td></tr>
-<tr id="row_0_0_1_5_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="pairing_8h.html" target="_self">pairing.h</a></td><td class="desc">Pairing interface </td></tr>
+<tr id="row_0_0_1_5_"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="common_2math_2pairing_8h.html" target="_self">pairing.h</a></td><td class="desc">Pairing interface </td></tr>
<tr id="row_0_0_1_6_" class="even"><td class="entry"><span style="width:64px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="printutils_8h.html" target="_self">printutils.h</a></td><td class="desc">Print helper interface </td></tr>
<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">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_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>
-<tr id="row_0_2_1_"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="verifier_2api_8h.html" target="_self">api.h</a></td><td class="desc">Intel(R) EPID SDK verifier API </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="epiddefs_8h.html" target="_self">epiddefs.h</a></td><td class="desc">Common SDK macro definitions </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="errors_8h.html" target="_self">errors.h</a></td><td class="desc">Error reporting </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="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_6_" class="even"><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_7_"><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_" 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><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_"><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_ea12d375fc1eb79df248c0adf953af4f.html" target="_self">tiny</a></td><td class="desc"></td></tr>
+<tr id="row_0_1_0_0_" class="even"><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_5f2fc2cf41db41de2b55e03ffa7a1d16.html" target="_self">math</a></td><td class="desc"></td></tr>
+<tr id="row_0_1_0_0_0_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="efq_8h.html" target="_self">efq.h</a></td><td class="desc">Definition of EFq math </td></tr>
+<tr id="row_0_1_0_0_1_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="efq2_8h.html" target="_self">efq2.h</a></td><td class="desc">Definition of EFq2 math </td></tr>
+<tr id="row_0_1_0_0_2_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="fp_8h.html" target="_self">fp.h</a></td><td class="desc">Definition of Fp math </td></tr>
+<tr id="row_0_1_0_0_3_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="fq_8h.html" target="_self">fq.h</a></td><td class="desc">Definition of Fq math </td></tr>
+<tr id="row_0_1_0_0_4_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="fq12_8h.html" target="_self">fq12.h</a></td><td class="desc">Definition of Fq12 math </td></tr>
+<tr id="row_0_1_0_0_5_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="fq2_8h.html" target="_self">fq2.h</a></td><td class="desc">Definition of Fq2 math </td></tr>
+<tr id="row_0_1_0_0_6_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="fq6_8h.html" target="_self">fq6.h</a></td><td class="desc">Definition of Fq6 math </td></tr>
+<tr id="row_0_1_0_0_7_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="hashwrap_8h.html" target="_self">hashwrap.h</a></td><td class="desc">Decleration of hash wrap function </td></tr>
+<tr id="row_0_1_0_0_8_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="mathdefs_8h.html" target="_self">mathdefs.h</a></td><td class="desc">Common public definitions for math headers </td></tr>
+<tr id="row_0_1_0_0_9_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="mathtypes_8h.html" target="_self">mathtypes.h</a></td><td class="desc">Definition of math types in tiny Intel(R) EPID </td></tr>
+<tr id="row_0_1_0_0_10_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="member_2tiny_2math_2pairing_8h.html" target="_self">pairing.h</a></td><td class="desc">Definition of pairing math </td></tr>
+<tr id="row_0_1_0_0_11_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="serialize_8h.html" target="_self">serialize.h</a></td><td class="desc">Definition of de/serialize functionality </td></tr>
+<tr id="row_0_1_0_0_12_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="sha256_8h.html" target="_self">sha256.h</a></td><td class="desc">Interface to a SHA-256 implementation </td></tr>
+<tr id="row_0_1_0_0_13_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="sha512_8h.html" target="_self">sha512.h</a></td><td class="desc">Interface to a SHA-512 implementation </td></tr>
+<tr id="row_0_1_0_0_14_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="vli_8h.html" target="_self">vli.h</a></td><td class="desc">Definition of Large Integer math </td></tr>
+<tr id="row_0_1_0_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span id="arr_0_1_0_1_" class="arrow" onclick="toggleFolder('0_1_0_1_')">&#9660;</span><span id="img_0_1_0_1_" class="iconfopen" onclick="toggleFolder('0_1_0_1_')">&#160;</span><a class="el" href="dir_a6a596e2b2b50fb0973c7fe0b17a09e5.html" target="_self">stdlib</a></td><td class="desc"></td></tr>
+<tr id="row_0_1_0_1_0_"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="endian_8h.html" target="_self">endian.h</a></td><td class="desc">Convert values between host and big-/little-endian byte order </td></tr>
+<tr id="row_0_1_0_1_1_" class="even"><td class="entry"><span style="width:80px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="tiny__stdlib_8h.html" target="_self">tiny_stdlib.h</a></td><td class="desc">Tiny portable implementations of standard library functions </td></tr>
+<tr id="row_0_1_1_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span id="arr_0_1_1_" class="arrow" onclick="toggleFolder('0_1_1_')">&#9660;</span><span id="img_0_1_1_" class="iconfopen" onclick="toggleFolder('0_1_1_')">&#160;</span><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html" target="_self">tpm2</a></td><td class="desc"></td></tr>
+<tr id="row_0_1_1_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span id="arr_0_1_1_0_" class="arrow" onclick="toggleFolder('0_1_1_0_')">&#9660;</span><span id="img_0_1_1_0_" class="iconfopen" onclick="toggleFolder('0_1_1_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_1_0_0_"><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_1_0_1_" class="even"><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_1_0_2_"><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_1_0_3_" class="even"><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_1_0_4_"><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_1_0_5_" class="even"><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_1_0_6_"><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_1_0_7_" class="even"><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_1_0_8_"><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_1_0_9_" class="even"><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_1_0_10_"><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_1_0_11_" class="even"><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_1_1_"><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_1_2_" class="even"><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_1_3_"><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_1_4_" class="even"><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_1_5_"><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_1_6_" class="even"><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_1_7_"><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_2_" class="even"><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_3_"><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_4_" class="even"><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_"><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_" class="even"><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_"><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>
+<tr id="row_0_2_1_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icondoc"></span><a class="el" href="verifier_2api_8h.html" target="_self">api.h</a></td><td class="desc">Intel(R) EPID SDK verifier API </td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
diff --git a/doc/html/finitefield_8h.html b/doc/html/finitefield_8h.html
index 65a85c6..6f85d38 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/fp_8h.html b/doc/html/fp_8h.html
new file mode 100644
index 0000000..9030def
--- /dev/null
+++ b/doc/html/fp_8h.html
@@ -0,0 +1,617 @@
+<!-- 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/tiny/math/fp.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">6.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('fp_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">fp.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of Fp math.
+<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="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>
+<tr class="memitem:ac2eab44a7aa9679d107667ffc035ee0a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#ac2eab44a7aa9679d107667ffc035ee0a">FpInField</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> const *in)</td></tr>
+<tr class="memdesc:ac2eab44a7aa9679d107667ffc035ee0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if an element is in Fp. <a href="#ac2eab44a7aa9679d107667ffc035ee0a">More...</a><br /></td></tr>
+<tr class="separator:ac2eab44a7aa9679d107667ffc035ee0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a55152abe8b866eba5a0c83cfb1bbe5f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a55152abe8b866eba5a0c83cfb1bbe5f6">FpAdd</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, <a class="el" href="struct_fp_elem.html">FpElem</a> const *left, <a class="el" href="struct_fp_elem.html">FpElem</a> const *right)</td></tr>
+<tr class="memdesc:a55152abe8b866eba5a0c83cfb1bbe5f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two elements of Fp. <a href="#a55152abe8b866eba5a0c83cfb1bbe5f6">More...</a><br /></td></tr>
+<tr class="separator:a55152abe8b866eba5a0c83cfb1bbe5f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9392597a6fe50e5c102ce21b8a1ae6c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a9392597a6fe50e5c102ce21b8a1ae6c2">FpMul</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, <a class="el" href="struct_fp_elem.html">FpElem</a> const *left, <a class="el" href="struct_fp_elem.html">FpElem</a> const *right)</td></tr>
+<tr class="memdesc:a9392597a6fe50e5c102ce21b8a1ae6c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two elements of Fp. <a href="#a9392597a6fe50e5c102ce21b8a1ae6c2">More...</a><br /></td></tr>
+<tr class="separator:a9392597a6fe50e5c102ce21b8a1ae6c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aa9cc9f5e33bba75420b83cb2d49ca280"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#aa9cc9f5e33bba75420b83cb2d49ca280">FpSub</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, <a class="el" href="struct_fp_elem.html">FpElem</a> const *left, <a class="el" href="struct_fp_elem.html">FpElem</a> const *right)</td></tr>
+<tr class="memdesc:aa9cc9f5e33bba75420b83cb2d49ca280"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtract two elements of Fp. <a href="#aa9cc9f5e33bba75420b83cb2d49ca280">More...</a><br /></td></tr>
+<tr class="separator:aa9cc9f5e33bba75420b83cb2d49ca280"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab06b1b1a59f1138aa6c4d746ab707f86"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#ab06b1b1a59f1138aa6c4d746ab707f86">FpExp</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, <a class="el" href="struct_fp_elem.html">FpElem</a> const *base, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp)</td></tr>
+<tr class="memdesc:ab06b1b1a59f1138aa6c4d746ab707f86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exponentiate an element of Fp by a large integer. <a href="#ab06b1b1a59f1138aa6c4d746ab707f86">More...</a><br /></td></tr>
+<tr class="separator:ab06b1b1a59f1138aa6c4d746ab707f86"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a0524fd074857712ea61ea5717ff54fd3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a0524fd074857712ea61ea5717ff54fd3">FpNeg</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, <a class="el" href="struct_fp_elem.html">FpElem</a> const *in)</td></tr>
+<tr class="memdesc:a0524fd074857712ea61ea5717ff54fd3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negate an element of Fp. <a href="#a0524fd074857712ea61ea5717ff54fd3">More...</a><br /></td></tr>
+<tr class="separator:a0524fd074857712ea61ea5717ff54fd3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7bb685bd810368d8077f638ffcab2554"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a7bb685bd810368d8077f638ffcab2554">FpEq</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> const *left, <a class="el" href="struct_fp_elem.html">FpElem</a> const *right)</td></tr>
+<tr class="memdesc:a7bb685bd810368d8077f638ffcab2554"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if two elements in Fp are equal. <a href="#a7bb685bd810368d8077f638ffcab2554">More...</a><br /></td></tr>
+<tr class="separator:a7bb685bd810368d8077f638ffcab2554"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9e7500fe8ee73592b002ed675d1758b3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a9e7500fe8ee73592b002ed675d1758b3">FpInv</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, <a class="el" href="struct_fp_elem.html">FpElem</a> const *in)</td></tr>
+<tr class="memdesc:a9e7500fe8ee73592b002ed675d1758b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invert an element of Fp. <a href="#a9e7500fe8ee73592b002ed675d1758b3">More...</a><br /></td></tr>
+<tr class="separator:a9e7500fe8ee73592b002ed675d1758b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a6c06b175fd82b5db555508f2d26713f8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a6c06b175fd82b5db555508f2d26713f8">FpRand</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param)</td></tr>
+<tr class="memdesc:a6c06b175fd82b5db555508f2d26713f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate a random element of Fp. <a href="#a6c06b175fd82b5db555508f2d26713f8">More...</a><br /></td></tr>
+<tr class="separator:a6c06b175fd82b5db555508f2d26713f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a54743809639797b4d4445c221291048b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a54743809639797b4d4445c221291048b">FpRandNonzero</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param)</td></tr>
+<tr class="memdesc:a54743809639797b4d4445c221291048b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate a non-zero random element of Fp. <a href="#a54743809639797b4d4445c221291048b">More...</a><br /></td></tr>
+<tr class="separator:a54743809639797b4d4445c221291048b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:adf010ec5710d4013e33efd7e5ba8f9ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#adf010ec5710d4013e33efd7e5ba8f9ad">FpClear</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result)</td></tr>
+<tr class="memdesc:adf010ec5710d4013e33efd7e5ba8f9ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear an element of Fp. <a href="#adf010ec5710d4013e33efd7e5ba8f9ad">More...</a><br /></td></tr>
+<tr class="separator:adf010ec5710d4013e33efd7e5ba8f9ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a23bf42c7024a318970a6b60c02d9a08d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a23bf42c7024a318970a6b60c02d9a08d">FpSet</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, uint32_t in)</td></tr>
+<tr class="memdesc:a23bf42c7024a318970a6b60c02d9a08d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a element of Fp's value. <a href="#a23bf42c7024a318970a6b60c02d9a08d">More...</a><br /></td></tr>
+<tr class="separator:a23bf42c7024a318970a6b60c02d9a08d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a472b0a9229b0eff0ca445f158efa1175"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fp_8h.html#a472b0a9229b0eff0ca445f158efa1175">FpFromHash</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *result, unsigned char const *hash, size_t len)</td></tr>
+<tr class="memdesc:a472b0a9229b0eff0ca445f158efa1175"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reinterpret a buffer as an element of Fp. <a href="#a472b0a9229b0eff0ca445f158efa1175">More...</a><br /></td></tr>
+<tr class="separator:a472b0a9229b0eff0ca445f158efa1175"><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>Definition of Fp math. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a55152abe8b866eba5a0c83cfb1bbe5f6"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpAdd </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two elements of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of adding left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="adf010ec5710d4013e33efd7e5ba8f9ad"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpClear </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Clear an element of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>value to clear. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a7bb685bd810368d8077f638ffcab2554"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FpEq </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if two elements in Fp are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be tested. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be tested. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ab06b1b1a59f1138aa6c4d746ab707f86"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpExp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>base</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Exponentiate an element of Fp by a large integer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp</td><td>the exponent. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a472b0a9229b0eff0ca445f158efa1175"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpFromHash </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">unsigned char const *&#160;</td>
+ <td class="paramname"><em>hash</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>len</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Reinterpret a buffer as an element of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">hash</td><td>buffer to reinterpret. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>length of hash in bytes. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ac2eab44a7aa9679d107667ffc035ee0a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FpInField </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if an element is in Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to test </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) indeed the value is in the field. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a9e7500fe8ee73592b002ed675d1758b3"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpInv </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Invert an element of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the value to invert. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a9392597a6fe50e5c102ce21b8a1ae6c2"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpMul </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two elements of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a0524fd074857712ea61ea5717ff54fd3"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpNeg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Negate an element of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the value to negate. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a6c06b175fd82b5db555508f2d26713f8"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FpRand </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</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>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Generate a random element of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>the random value. </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>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a54743809639797b4d4445c221291048b"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FpRandNonzero </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</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>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Generate a non-zero random element of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>the random value. </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>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a23bf42c7024a318970a6b60c02d9a08d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Set a element of Fp's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aa9cc9f5e33bba75420b83cb2d49ca280"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FpSub </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Subtract two elements of Fp. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of subtracting left from right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The operand to be subtracted from. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The operand to subtract. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="fp_8h.html">fp.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/fq12_8h.html b/doc/html/fq12_8h.html
new file mode 100644
index 0000000..6fe2cf1
--- /dev/null
+++ b/doc/html/fq12_8h.html
@@ -0,0 +1,780 @@
+<!-- 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/tiny/math/fq12.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">6.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('fq12_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">fq12.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of Fq12 math.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;stdint.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:aa4a17bfa56644ab615c60bd7ec900821"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#aa4a17bfa56644ab615c60bd7ec900821">Fq12Add</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *left, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *right)</td></tr>
+<tr class="memdesc:aa4a17bfa56644ab615c60bd7ec900821"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two elements of Fq12. <a href="#aa4a17bfa56644ab615c60bd7ec900821">More...</a><br /></td></tr>
+<tr class="separator:aa4a17bfa56644ab615c60bd7ec900821"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a80c3da69a0991423a728e9b74a2dfe15"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#a80c3da69a0991423a728e9b74a2dfe15">Fq12Sub</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *left, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *right)</td></tr>
+<tr class="memdesc:a80c3da69a0991423a728e9b74a2dfe15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtract two elements of Fq12. <a href="#a80c3da69a0991423a728e9b74a2dfe15">More...</a><br /></td></tr>
+<tr class="separator:a80c3da69a0991423a728e9b74a2dfe15"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a12e88a0bbfcc24b1863754f5e027d28e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#a12e88a0bbfcc24b1863754f5e027d28e">Fq12Square</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *in)</td></tr>
+<tr class="memdesc:a12e88a0bbfcc24b1863754f5e027d28e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Square an element of Fq12. <a href="#a12e88a0bbfcc24b1863754f5e027d28e">More...</a><br /></td></tr>
+<tr class="separator:a12e88a0bbfcc24b1863754f5e027d28e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aec7e0ce55e01ab48c0c6315cb9e5b47d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#aec7e0ce55e01ab48c0c6315cb9e5b47d">Fq12Mul</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *left, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *right)</td></tr>
+<tr class="memdesc:aec7e0ce55e01ab48c0c6315cb9e5b47d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two elements of Fq12. <a href="#aec7e0ce55e01ab48c0c6315cb9e5b47d">More...</a><br /></td></tr>
+<tr class="separator:aec7e0ce55e01ab48c0c6315cb9e5b47d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:afd089e0cb6e4ec68a3a3062f26d4430d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#afd089e0cb6e4ec68a3a3062f26d4430d">Fq12Inv</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *in)</td></tr>
+<tr class="memdesc:afd089e0cb6e4ec68a3a3062f26d4430d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invert an element of Fq12. <a href="#afd089e0cb6e4ec68a3a3062f26d4430d">More...</a><br /></td></tr>
+<tr class="separator:afd089e0cb6e4ec68a3a3062f26d4430d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:af3fd9055d559c592eb5715bb261c072b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#af3fd9055d559c592eb5715bb261c072b">Fq12Neg</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *in)</td></tr>
+<tr class="memdesc:af3fd9055d559c592eb5715bb261c072b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negate an element of Fq12. <a href="#af3fd9055d559c592eb5715bb261c072b">More...</a><br /></td></tr>
+<tr class="separator:af3fd9055d559c592eb5715bb261c072b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:acd16f86f83021d44d25389ad9f701597"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#acd16f86f83021d44d25389ad9f701597">Fq12Set</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, uint32_t val)</td></tr>
+<tr class="memdesc:acd16f86f83021d44d25389ad9f701597"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set an element's value. <a href="#acd16f86f83021d44d25389ad9f701597">More...</a><br /></td></tr>
+<tr class="separator:acd16f86f83021d44d25389ad9f701597"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a3bf52e5b01103632fa429927e5a07b1d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#a3bf52e5b01103632fa429927e5a07b1d">Fq12Exp</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *base, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp)</td></tr>
+<tr class="memdesc:a3bf52e5b01103632fa429927e5a07b1d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exponentiate an element of Fq12 by a large integer. <a href="#a3bf52e5b01103632fa429927e5a07b1d">More...</a><br /></td></tr>
+<tr class="separator:a3bf52e5b01103632fa429927e5a07b1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ae88eb95c37c9db2e37e14d8a9304fadd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#ae88eb95c37c9db2e37e14d8a9304fadd">Fq12MultiExp</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *base0, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp0, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *base1, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp1, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *base2, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp2, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *base3, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp3)</td></tr>
+<tr class="memdesc:ae88eb95c37c9db2e37e14d8a9304fadd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply of exponentiation of elements of Fq12 by a large integers. <a href="#ae88eb95c37c9db2e37e14d8a9304fadd">More...</a><br /></td></tr>
+<tr class="separator:ae88eb95c37c9db2e37e14d8a9304fadd"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a08b50a1f5fe19c78a19f1f4a457b9a39"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#a08b50a1f5fe19c78a19f1f4a457b9a39">Fq12Eq</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *left, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *right)</td></tr>
+<tr class="memdesc:a08b50a1f5fe19c78a19f1f4a457b9a39"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if two elements in Fq12 are equal. <a href="#a08b50a1f5fe19c78a19f1f4a457b9a39">More...</a><br /></td></tr>
+<tr class="separator:a08b50a1f5fe19c78a19f1f4a457b9a39"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a33a3bb0f378ac008cde38b88a39ea79c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#a33a3bb0f378ac008cde38b88a39ea79c">Fq12Conj</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *in)</td></tr>
+<tr class="memdesc:a33a3bb0f378ac008cde38b88a39ea79c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the conjugate of an element of Fq2. <a href="#a33a3bb0f378ac008cde38b88a39ea79c">More...</a><br /></td></tr>
+<tr class="separator:a33a3bb0f378ac008cde38b88a39ea79c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a65ad8c0f4aa0859593aab885066c5025"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#a65ad8c0f4aa0859593aab885066c5025">Fq12ExpCyc</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *in, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *t)</td></tr>
+<tr class="memdesc:a65ad8c0f4aa0859593aab885066c5025"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the cyclotomic exponentiation of an element of Fq12 by another element of Fq12. <a href="#a65ad8c0f4aa0859593aab885066c5025">More...</a><br /></td></tr>
+<tr class="separator:a65ad8c0f4aa0859593aab885066c5025"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a1ad8710126bb4906d6170dd8ab30e43a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#a1ad8710126bb4906d6170dd8ab30e43a">Fq12SqCyc</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *in)</td></tr>
+<tr class="memdesc:a1ad8710126bb4906d6170dd8ab30e43a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the cyclotomic square of an element of fq12. <a href="#a1ad8710126bb4906d6170dd8ab30e43a">More...</a><br /></td></tr>
+<tr class="separator:a1ad8710126bb4906d6170dd8ab30e43a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac1b44bbceb1c648b2b880871c8b52195"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#ac1b44bbceb1c648b2b880871c8b52195">Fq12MulSpecial</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *left, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *right)</td></tr>
+<tr class="memdesc:ac1b44bbceb1c648b2b880871c8b52195"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two elements of Fq12. <a href="#ac1b44bbceb1c648b2b880871c8b52195">More...</a><br /></td></tr>
+<tr class="separator:ac1b44bbceb1c648b2b880871c8b52195"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad739d6a59a3f7ed0c0117c7486d06290"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#ad739d6a59a3f7ed0c0117c7486d06290">Fq12Cp</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *in)</td></tr>
+<tr class="memdesc:ad739d6a59a3f7ed0c0117c7486d06290"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy an element's value. <a href="#ad739d6a59a3f7ed0c0117c7486d06290">More...</a><br /></td></tr>
+<tr class="separator:ad739d6a59a3f7ed0c0117c7486d06290"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aaeb34cf6f4d176674fc300d7e7fc57f1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq12_8h.html#aaeb34cf6f4d176674fc300d7e7fc57f1">Fq12Clear</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *result)</td></tr>
+<tr class="memdesc:aaeb34cf6f4d176674fc300d7e7fc57f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear an element's value. <a href="#aaeb34cf6f4d176674fc300d7e7fc57f1">More...</a><br /></td></tr>
+<tr class="separator:aaeb34cf6f4d176674fc300d7e7fc57f1"><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>Definition of Fq12 math. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="aa4a17bfa56644ab615c60bd7ec900821"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Add </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two elements of Fq12. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of adding left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aaeb34cf6f4d176674fc300d7e7fc57f1"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Clear </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Clear an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>element to clear. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a33a3bb0f378ac008cde38b88a39ea79c"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Conj </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Calculate the conjugate of an element of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the conjugate of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ad739d6a59a3f7ed0c0117c7486d06290"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Cp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Copy an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>copy target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>copy source. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a08b50a1f5fe19c78a19f1f4a457b9a39"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int Fq12Eq </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if two elements in Fq12 are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be tested. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be tested. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a3bf52e5b01103632fa429927e5a07b1d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Exp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>base</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Exponentiate an element of Fq12 by a large integer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp</td><td>the exponent. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a65ad8c0f4aa0859593aab885066c5025"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12ExpCyc </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>t</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Calculate the cyclotomic exponentiation of an element of Fq12 by another element of Fq12. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">result</td><td>the base of the exponentiation. This will receive the result. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the exponent. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">t</td><td>pairing parameter t </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="afd089e0cb6e4ec68a3a3062f26d4430d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Inv </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Invert an element of Fq12. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the inverse of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to invert. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aec7e0ce55e01ab48c0c6315cb9e5b47d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Mul </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two elements of Fq12. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ac1b44bbceb1c648b2b880871c8b52195"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12MulSpecial </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two elements of Fq12. </p>
+<p>Requires that b[2] = b[4] = b[5] = 0. where right = ((b[0], b[2], b[4]), (b[1], b[3], b[5]))</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ae88eb95c37c9db2e37e14d8a9304fadd"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12MultiExp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>base0</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp0</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>base1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>base2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>base3</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp3</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply of exponentiation of elements of Fq12 by a large integers. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base0</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp0</td><td>the exponent. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base1</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp1</td><td>the exponent. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base2</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp2</td><td>the exponent. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base3</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp3</td><td>the exponent. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="af3fd9055d559c592eb5715bb261c072b"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Neg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Negate an element of Fq12. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the negative of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to negate. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="acd16f86f83021d44d25389ad9f701597"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Set </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>val</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Set an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a1ad8710126bb4906d6170dd8ab30e43a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12SqCyc </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Calculate the cyclotomic square of an element of fq12. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">result</td><td>result of the cyclotomic square. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the base. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a12e88a0bbfcc24b1863754f5e027d28e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Square </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Square an element of Fq12. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the square of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to square. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a80c3da69a0991423a728e9b74a2dfe15"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq12Sub </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Subtract two elements of Fq12. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of subtracting left from right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The operand to be subtracted from. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The operand to subtract. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="fq12_8h.html">fq12.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/fq2_8h.html b/doc/html/fq2_8h.html
new file mode 100644
index 0000000..e04b535
--- /dev/null
+++ b/doc/html/fq2_8h.html
@@ -0,0 +1,728 @@
+<!-- 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/tiny/math/fq2.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">6.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('fq2_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">fq2.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of Fq2 math.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;stdint.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:a6c67364f78e6946a7ad3af2c86baf1a5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a6c67364f78e6946a7ad3af2c86baf1a5">Fq2Cp</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *in)</td></tr>
+<tr class="memdesc:a6c67364f78e6946a7ad3af2c86baf1a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy an element's value. <a href="#a6c67364f78e6946a7ad3af2c86baf1a5">More...</a><br /></td></tr>
+<tr class="separator:a6c67364f78e6946a7ad3af2c86baf1a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9165c1d2deef46ceb9af238928b2ec5c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a9165c1d2deef46ceb9af238928b2ec5c">Fq2Set</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, uint32_t in)</td></tr>
+<tr class="memdesc:a9165c1d2deef46ceb9af238928b2ec5c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set an element's value. <a href="#a9165c1d2deef46ceb9af238928b2ec5c">More...</a><br /></td></tr>
+<tr class="separator:a9165c1d2deef46ceb9af238928b2ec5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a59d3d8212ffd5bf75f9b6fd85b896654"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a59d3d8212ffd5bf75f9b6fd85b896654">Fq2Clear</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result)</td></tr>
+<tr class="memdesc:a59d3d8212ffd5bf75f9b6fd85b896654"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear an element's value. <a href="#a59d3d8212ffd5bf75f9b6fd85b896654">More...</a><br /></td></tr>
+<tr class="separator:a59d3d8212ffd5bf75f9b6fd85b896654"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:afcaaf75460f36b85386cd1959b904f57"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#afcaaf75460f36b85386cd1959b904f57">Fq2Add</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *left, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *right)</td></tr>
+<tr class="memdesc:afcaaf75460f36b85386cd1959b904f57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two elements of Fq2. <a href="#afcaaf75460f36b85386cd1959b904f57">More...</a><br /></td></tr>
+<tr class="separator:afcaaf75460f36b85386cd1959b904f57"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:acecbff7a5a8cec15e24c47663957c05a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#acecbff7a5a8cec15e24c47663957c05a">Fq2Exp</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *base, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp)</td></tr>
+<tr class="memdesc:acecbff7a5a8cec15e24c47663957c05a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exponentiate an element of Fq2 by a large integer. <a href="#acecbff7a5a8cec15e24c47663957c05a">More...</a><br /></td></tr>
+<tr class="separator:acecbff7a5a8cec15e24c47663957c05a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ae27a9400b5d8fbd0b720a449c60ad146"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#ae27a9400b5d8fbd0b720a449c60ad146">Fq2Sub</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *left, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *right)</td></tr>
+<tr class="memdesc:ae27a9400b5d8fbd0b720a449c60ad146"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtract two elements of Fq2. <a href="#ae27a9400b5d8fbd0b720a449c60ad146">More...</a><br /></td></tr>
+<tr class="separator:ae27a9400b5d8fbd0b720a449c60ad146"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a876f870f84cd8ab697176dbb42591565"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a876f870f84cd8ab697176dbb42591565">Fq2Mul</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *left, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *right)</td></tr>
+<tr class="memdesc:a876f870f84cd8ab697176dbb42591565"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two elements of Fq2. <a href="#a876f870f84cd8ab697176dbb42591565">More...</a><br /></td></tr>
+<tr class="separator:a876f870f84cd8ab697176dbb42591565"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a756666161516fe541b26a4082f69343d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a756666161516fe541b26a4082f69343d">Fq2Inv</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *in)</td></tr>
+<tr class="memdesc:a756666161516fe541b26a4082f69343d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invert an element of Fq2. <a href="#a756666161516fe541b26a4082f69343d">More...</a><br /></td></tr>
+<tr class="separator:a756666161516fe541b26a4082f69343d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a5d523d5d6d4159c71f58945af82a7936"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a5d523d5d6d4159c71f58945af82a7936">Fq2Neg</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *in)</td></tr>
+<tr class="memdesc:a5d523d5d6d4159c71f58945af82a7936"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negate an element of Fq2. <a href="#a5d523d5d6d4159c71f58945af82a7936">More...</a><br /></td></tr>
+<tr class="separator:a5d523d5d6d4159c71f58945af82a7936"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:adc0d02ddec564ca86b0ef53d7ff79864"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#adc0d02ddec564ca86b0ef53d7ff79864">Fq2Conj</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *in)</td></tr>
+<tr class="memdesc:adc0d02ddec564ca86b0ef53d7ff79864"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the conjugate of an element of Fq2. <a href="#adc0d02ddec564ca86b0ef53d7ff79864">More...</a><br /></td></tr>
+<tr class="separator:adc0d02ddec564ca86b0ef53d7ff79864"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a3c6583dd519a3dd7efb26db5e9a59036"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a3c6583dd519a3dd7efb26db5e9a59036">Fq2Square</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *in)</td></tr>
+<tr class="memdesc:a3c6583dd519a3dd7efb26db5e9a59036"><td class="mdescLeft">&#160;</td><td class="mdescRight">Square an element of Fq2. <a href="#a3c6583dd519a3dd7efb26db5e9a59036">More...</a><br /></td></tr>
+<tr class="separator:a3c6583dd519a3dd7efb26db5e9a59036"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:af45903d791794faabedb00f760885e8c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#af45903d791794faabedb00f760885e8c">Fq2MulScalar</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *left, <a class="el" href="struct_fq_elem.html">FqElem</a> const *right)</td></tr>
+<tr class="memdesc:af45903d791794faabedb00f760885e8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply an element of Fq2 by and element of Fq. <a href="#af45903d791794faabedb00f760885e8c">More...</a><br /></td></tr>
+<tr class="separator:af45903d791794faabedb00f760885e8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad94b155025e7a11b9c5b60032fde4491"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#ad94b155025e7a11b9c5b60032fde4491">Fq2CondSet</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *true_val, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *false_val, int truth_val)</td></tr>
+<tr class="memdesc:ad94b155025e7a11b9c5b60032fde4491"><td class="mdescLeft">&#160;</td><td class="mdescRight">Conditionally Set an element's value to one of two values. <a href="#ad94b155025e7a11b9c5b60032fde4491">More...</a><br /></td></tr>
+<tr class="separator:ad94b155025e7a11b9c5b60032fde4491"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a3dc330cff53539b51183c43085275f97"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a3dc330cff53539b51183c43085275f97">Fq2Eq</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *left, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *right)</td></tr>
+<tr class="memdesc:a3dc330cff53539b51183c43085275f97"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if two elements in Fq2 are equal. <a href="#a3dc330cff53539b51183c43085275f97">More...</a><br /></td></tr>
+<tr class="separator:a3dc330cff53539b51183c43085275f97"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:afeeb4e14ddf9f39f860661c599923c58"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#afeeb4e14ddf9f39f860661c599923c58">Fq2MulXi</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *result, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *in)</td></tr>
+<tr class="memdesc:afeeb4e14ddf9f39f860661c599923c58"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply an element of Fq2 by xi. <a href="#afeeb4e14ddf9f39f860661c599923c58">More...</a><br /></td></tr>
+<tr class="separator:afeeb4e14ddf9f39f860661c599923c58"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a610c9d7c2afa63b1d48da30c684d6e27"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq2_8h.html#a610c9d7c2afa63b1d48da30c684d6e27">Fq2IsZero</a> (<a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *value)</td></tr>
+<tr class="memdesc:a610c9d7c2afa63b1d48da30c684d6e27"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if an element is zero. <a href="#a610c9d7c2afa63b1d48da30c684d6e27">More...</a><br /></td></tr>
+<tr class="separator:a610c9d7c2afa63b1d48da30c684d6e27"><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>Definition of Fq2 math. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="afcaaf75460f36b85386cd1959b904f57"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Add </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two elements of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of adding left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a59d3d8212ffd5bf75f9b6fd85b896654"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Clear </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Clear an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>element to clear. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ad94b155025e7a11b9c5b60032fde4491"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2CondSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>true_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>false_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int&#160;</td>
+ <td class="paramname"><em>truth_val</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Conditionally Set an element's value to one of two values. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">true_val</td><td>value to set if condition is true. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">false_val</td><td>value to set if condition is false. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">truth_val</td><td>value of condition. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="adc0d02ddec564ca86b0ef53d7ff79864"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Conj </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Calculate the conjugate of an element of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the conjugate of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a6c67364f78e6946a7ad3af2c86baf1a5"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Cp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Copy an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>copy target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>copy source. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a3dc330cff53539b51183c43085275f97"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int Fq2Eq </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if two elements in Fq2 are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be tested. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be tested. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="acecbff7a5a8cec15e24c47663957c05a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Exp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>base</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Exponentiate an element of Fq2 by a large integer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp</td><td>the exponent. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a756666161516fe541b26a4082f69343d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Inv </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Invert an element of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the inverse of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to invert. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a610c9d7c2afa63b1d48da30c684d6e27"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int Fq2IsZero </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>value</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if an element is zero. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>the element to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the value is zero. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a876f870f84cd8ab697176dbb42591565"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Mul </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two elements of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="af45903d791794faabedb00f760885e8c"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2MulScalar </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply an element of Fq2 by and element of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="afeeb4e14ddf9f39f860661c599923c58"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2MulXi </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply an element of Fq2 by xi. </p>
+<p>This function was formerly called as Fq2Const.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying in by xi. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>The first operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a5d523d5d6d4159c71f58945af82a7936"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Neg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Negate an element of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the negative of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to negate. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a9165c1d2deef46ceb9af238928b2ec5c"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Set </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Set an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a3c6583dd519a3dd7efb26db5e9a59036"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Square </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Square an element of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the square of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to square. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ae27a9400b5d8fbd0b720a449c60ad146"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq2Sub </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Subtract two elements of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of subtracting left from right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The operand to be subtracted from. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The operand to subtract. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="fq2_8h.html">fq2.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/fq6_8h.html b/doc/html/fq6_8h.html
new file mode 100644
index 0000000..ca144cd
--- /dev/null
+++ b/doc/html/fq6_8h.html
@@ -0,0 +1,645 @@
+<!-- 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/tiny/math/fq6.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">6.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('fq6_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">fq6.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of Fq6 math.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;stdint.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:a0607ab44e53c7a16f8e1b2746d250a7c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a0607ab44e53c7a16f8e1b2746d250a7c">Fq6Add</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *left, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *right)</td></tr>
+<tr class="memdesc:a0607ab44e53c7a16f8e1b2746d250a7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two elements of Fq6. <a href="#a0607ab44e53c7a16f8e1b2746d250a7c">More...</a><br /></td></tr>
+<tr class="separator:a0607ab44e53c7a16f8e1b2746d250a7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a87d07ab842862a482410a838516ad0c7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a87d07ab842862a482410a838516ad0c7">Fq6Sub</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *left, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *right)</td></tr>
+<tr class="memdesc:a87d07ab842862a482410a838516ad0c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtract two elements of Fq6. <a href="#a87d07ab842862a482410a838516ad0c7">More...</a><br /></td></tr>
+<tr class="separator:a87d07ab842862a482410a838516ad0c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad1e1cac423a2c3c69a4f3629d33faaf1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#ad1e1cac423a2c3c69a4f3629d33faaf1">Fq6Mul</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *left, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *right)</td></tr>
+<tr class="memdesc:ad1e1cac423a2c3c69a4f3629d33faaf1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two elements of Fq6. <a href="#ad1e1cac423a2c3c69a4f3629d33faaf1">More...</a><br /></td></tr>
+<tr class="separator:ad1e1cac423a2c3c69a4f3629d33faaf1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a5f4708ca109578527afd8cda99acd6ee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a5f4708ca109578527afd8cda99acd6ee">Fq6Inv</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *in)</td></tr>
+<tr class="memdesc:a5f4708ca109578527afd8cda99acd6ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invert an element of Fq6. <a href="#a5f4708ca109578527afd8cda99acd6ee">More...</a><br /></td></tr>
+<tr class="separator:a5f4708ca109578527afd8cda99acd6ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9a5ddbf8f16b48030209b172079d22a6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a9a5ddbf8f16b48030209b172079d22a6">Fq6Neg</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *in)</td></tr>
+<tr class="memdesc:a9a5ddbf8f16b48030209b172079d22a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negate an element of Fq6. <a href="#a9a5ddbf8f16b48030209b172079d22a6">More...</a><br /></td></tr>
+<tr class="separator:a9a5ddbf8f16b48030209b172079d22a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7c77a862223f577e11e595332c9fb272"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a7c77a862223f577e11e595332c9fb272">Fq6Clear</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result)</td></tr>
+<tr class="memdesc:a7c77a862223f577e11e595332c9fb272"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear an element's value. <a href="#a7c77a862223f577e11e595332c9fb272">More...</a><br /></td></tr>
+<tr class="separator:a7c77a862223f577e11e595332c9fb272"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a701d89b5c73ba67a2f765d49f5d5ae4e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a701d89b5c73ba67a2f765d49f5d5ae4e">Fq6MulScalar</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *in, <a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *scalar)</td></tr>
+<tr class="memdesc:a701d89b5c73ba67a2f765d49f5d5ae4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply an element of Fq6 by and element of Fq2. <a href="#a701d89b5c73ba67a2f765d49f5d5ae4e">More...</a><br /></td></tr>
+<tr class="separator:a701d89b5c73ba67a2f765d49f5d5ae4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad30bd276a4e2e9df3613072c38ec13ae"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#ad30bd276a4e2e9df3613072c38ec13ae">Fq6MulV</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *in)</td></tr>
+<tr class="memdesc:ad30bd276a4e2e9df3613072c38ec13ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply an element of Fq6 by V. <a href="#ad30bd276a4e2e9df3613072c38ec13ae">More...</a><br /></td></tr>
+<tr class="separator:ad30bd276a4e2e9df3613072c38ec13ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aaf54d03c0afdb6eeced6ddad1237c2e4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#aaf54d03c0afdb6eeced6ddad1237c2e4">Fq6Eq</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *left, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *right)</td></tr>
+<tr class="memdesc:aaf54d03c0afdb6eeced6ddad1237c2e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if two elements in Fq6 are equal. <a href="#aaf54d03c0afdb6eeced6ddad1237c2e4">More...</a><br /></td></tr>
+<tr class="separator:aaf54d03c0afdb6eeced6ddad1237c2e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a634aab5dc04177587a22324352ff91e5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a634aab5dc04177587a22324352ff91e5">Fq6IsZero</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *in)</td></tr>
+<tr class="memdesc:a634aab5dc04177587a22324352ff91e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if an element is zero. <a href="#a634aab5dc04177587a22324352ff91e5">More...</a><br /></td></tr>
+<tr class="separator:a634aab5dc04177587a22324352ff91e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a58e5b68a86b776d82ade8307046e2375"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a58e5b68a86b776d82ade8307046e2375">Fq6Square</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *in)</td></tr>
+<tr class="memdesc:a58e5b68a86b776d82ade8307046e2375"><td class="mdescLeft">&#160;</td><td class="mdescRight">Square an element of Fq6. <a href="#a58e5b68a86b776d82ade8307046e2375">More...</a><br /></td></tr>
+<tr class="separator:a58e5b68a86b776d82ade8307046e2375"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a36bd769bc95b887f75bb60c2f7a45e17"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a36bd769bc95b887f75bb60c2f7a45e17">Fq6Cp</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *in)</td></tr>
+<tr class="memdesc:a36bd769bc95b887f75bb60c2f7a45e17"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy an element's value. <a href="#a36bd769bc95b887f75bb60c2f7a45e17">More...</a><br /></td></tr>
+<tr class="separator:a36bd769bc95b887f75bb60c2f7a45e17"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aa0c82e905ee190ad2187b89e464466d4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#aa0c82e905ee190ad2187b89e464466d4">Fq6CondSet</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *true_val, <a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *false_val, int truth_val)</td></tr>
+<tr class="memdesc:aa0c82e905ee190ad2187b89e464466d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Conditionally Set an element's value to one of two values. <a href="#aa0c82e905ee190ad2187b89e464466d4">More...</a><br /></td></tr>
+<tr class="separator:aa0c82e905ee190ad2187b89e464466d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a06b8c3988c3782fda22c9ffb47b5180b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq6_8h.html#a06b8c3988c3782fda22c9ffb47b5180b">Fq6Set</a> (<a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *result, uint32_t in)</td></tr>
+<tr class="memdesc:a06b8c3988c3782fda22c9ffb47b5180b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set an element's value. <a href="#a06b8c3988c3782fda22c9ffb47b5180b">More...</a><br /></td></tr>
+<tr class="separator:a06b8c3988c3782fda22c9ffb47b5180b"><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>Definition of Fq6 math. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a0607ab44e53c7a16f8e1b2746d250a7c"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Add </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two elements of Fq6. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of adding left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a7c77a862223f577e11e595332c9fb272"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Clear </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Clear an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>element to clear. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aa0c82e905ee190ad2187b89e464466d4"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6CondSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>true_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>false_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int&#160;</td>
+ <td class="paramname"><em>truth_val</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Conditionally Set an element's value to one of two values. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">true_val</td><td>value to set if condition is true. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">false_val</td><td>value to set if condition is false. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">truth_val</td><td>value of condition. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a36bd769bc95b887f75bb60c2f7a45e17"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Cp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Copy an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>copy target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>copy source. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aaf54d03c0afdb6eeced6ddad1237c2e4"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int Fq6Eq </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if two elements in Fq6 are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be tested. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be tested. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a5f4708ca109578527afd8cda99acd6ee"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Inv </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Invert an element of Fq6. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the inverse of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to invert. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a634aab5dc04177587a22324352ff91e5"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int Fq6IsZero </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if an element is zero. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the value is zero. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ad1e1cac423a2c3c69a4f3629d33faaf1"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Mul </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two elements of Fq6. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a701d89b5c73ba67a2f765d49f5d5ae4e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6MulScalar </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq2_elem.html">Fq2Elem</a> const *&#160;</td>
+ <td class="paramname"><em>scalar</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply an element of Fq6 by and element of Fq2. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">scalar</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ad30bd276a4e2e9df3613072c38ec13ae"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6MulV </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply an element of Fq6 by V. </p>
+<p>This function was formerly called as Fq2Const.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying in and V. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>The first operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a9a5ddbf8f16b48030209b172079d22a6"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Neg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Negate an element of Fq6. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the negative of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to negate. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a06b8c3988c3782fda22c9ffb47b5180b"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Set </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Set an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a58e5b68a86b776d82ade8307046e2375"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Square </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Square an element of Fq6. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the square of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to square. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a87d07ab842862a482410a838516ad0c7"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void Fq6Sub </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq6_elem.html">Fq6Elem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Subtract two elements of Fq6. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of subtracting left from right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The operand to be subtracted from. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The operand to subtract. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="fq6_8h.html">fq6.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/fq_8h.html b/doc/html/fq_8h.html
new file mode 100644
index 0000000..0c4432e
--- /dev/null
+++ b/doc/html/fq_8h.html
@@ -0,0 +1,767 @@
+<!-- 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/tiny/math/fq.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">6.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('fq_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">fq.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of Fq math.
+<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="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>
+<tr class="memitem:aceb37a8f5538fe9ca682058ff0e36091"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#aceb37a8f5538fe9ca682058ff0e36091">FqInField</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> const *in)</td></tr>
+<tr class="memdesc:aceb37a8f5538fe9ca682058ff0e36091"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if an element is in Fq. <a href="#aceb37a8f5538fe9ca682058ff0e36091">More...</a><br /></td></tr>
+<tr class="separator:aceb37a8f5538fe9ca682058ff0e36091"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab52f69c761454d976c3fc56a26549419"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#ab52f69c761454d976c3fc56a26549419">FqAdd</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *left, <a class="el" href="struct_fq_elem.html">FqElem</a> const *right)</td></tr>
+<tr class="memdesc:ab52f69c761454d976c3fc56a26549419"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two elements of Fq. <a href="#ab52f69c761454d976c3fc56a26549419">More...</a><br /></td></tr>
+<tr class="separator:ab52f69c761454d976c3fc56a26549419"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a5148f610202ae759aafb197cb52137f1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#a5148f610202ae759aafb197cb52137f1">FqSub</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *left, <a class="el" href="struct_fq_elem.html">FqElem</a> const *right)</td></tr>
+<tr class="memdesc:a5148f610202ae759aafb197cb52137f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtract two elements of Fq. <a href="#a5148f610202ae759aafb197cb52137f1">More...</a><br /></td></tr>
+<tr class="separator:a5148f610202ae759aafb197cb52137f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab0bf77a97fb3a12292886bef3abcf9bd"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#ab0bf77a97fb3a12292886bef3abcf9bd">FqMul</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *left, <a class="el" href="struct_fq_elem.html">FqElem</a> const *right)</td></tr>
+<tr class="memdesc:ab0bf77a97fb3a12292886bef3abcf9bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two elements of Fq. <a href="#ab0bf77a97fb3a12292886bef3abcf9bd">More...</a><br /></td></tr>
+<tr class="separator:ab0bf77a97fb3a12292886bef3abcf9bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a276d3747aefdac5503982f2aa5eccbf8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#a276d3747aefdac5503982f2aa5eccbf8">FqExp</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *base, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp)</td></tr>
+<tr class="memdesc:a276d3747aefdac5503982f2aa5eccbf8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exponentiate an element of Fq by a large integer. <a href="#a276d3747aefdac5503982f2aa5eccbf8">More...</a><br /></td></tr>
+<tr class="separator:a276d3747aefdac5503982f2aa5eccbf8"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a17133e5b777baa8c745b7dfcf1c8ad8d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#a17133e5b777baa8c745b7dfcf1c8ad8d">FqCp</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *in)</td></tr>
+<tr class="memdesc:a17133e5b777baa8c745b7dfcf1c8ad8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy an element's value. <a href="#a17133e5b777baa8c745b7dfcf1c8ad8d">More...</a><br /></td></tr>
+<tr class="separator:a17133e5b777baa8c745b7dfcf1c8ad8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac08ca8c781cd18cbadabbeeb85722e49"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#ac08ca8c781cd18cbadabbeeb85722e49">FqIsZero</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> const *value)</td></tr>
+<tr class="memdesc:ac08ca8c781cd18cbadabbeeb85722e49"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if an element is zero. <a href="#ac08ca8c781cd18cbadabbeeb85722e49">More...</a><br /></td></tr>
+<tr class="separator:ac08ca8c781cd18cbadabbeeb85722e49"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7b60a8996973d474d2fb7a31838c6d8c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#a7b60a8996973d474d2fb7a31838c6d8c">FqInv</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *in)</td></tr>
+<tr class="memdesc:a7b60a8996973d474d2fb7a31838c6d8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invert an element of Fq. <a href="#a7b60a8996973d474d2fb7a31838c6d8c">More...</a><br /></td></tr>
+<tr class="separator:a7b60a8996973d474d2fb7a31838c6d8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ae8379530cca959e7e36446b2979d8af4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#ae8379530cca959e7e36446b2979d8af4">FqNeg</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *in)</td></tr>
+<tr class="memdesc:ae8379530cca959e7e36446b2979d8af4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Negate an element of Fq. <a href="#ae8379530cca959e7e36446b2979d8af4">More...</a><br /></td></tr>
+<tr class="separator:ae8379530cca959e7e36446b2979d8af4"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab62c8f43f78a0c4f830c9ed65048b8f9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#ab62c8f43f78a0c4f830c9ed65048b8f9">FqSquare</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *in)</td></tr>
+<tr class="memdesc:ab62c8f43f78a0c4f830c9ed65048b8f9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Square an element of Fq. <a href="#ab62c8f43f78a0c4f830c9ed65048b8f9">More...</a><br /></td></tr>
+<tr class="separator:ab62c8f43f78a0c4f830c9ed65048b8f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac85eb642d3b3973477749769e04d45af"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#ac85eb642d3b3973477749769e04d45af">FqClear</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result)</td></tr>
+<tr class="memdesc:ac85eb642d3b3973477749769e04d45af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear an element's value. <a href="#ac85eb642d3b3973477749769e04d45af">More...</a><br /></td></tr>
+<tr class="separator:ac85eb642d3b3973477749769e04d45af"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab28f9df688a669a64dc04fa33f4cbb64"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#ab28f9df688a669a64dc04fa33f4cbb64">FqSet</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, uint32_t in)</td></tr>
+<tr class="memdesc:ab28f9df688a669a64dc04fa33f4cbb64"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set an element's value. <a href="#ab28f9df688a669a64dc04fa33f4cbb64">More...</a><br /></td></tr>
+<tr class="separator:ab28f9df688a669a64dc04fa33f4cbb64"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:abd40d255e0094f7156092db44a3b90fa"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#abd40d255e0094f7156092db44a3b90fa">FqEq</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> const *left, <a class="el" href="struct_fq_elem.html">FqElem</a> const *right)</td></tr>
+<tr class="memdesc:abd40d255e0094f7156092db44a3b90fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if two elements in Fq are equal. <a href="#abd40d255e0094f7156092db44a3b90fa">More...</a><br /></td></tr>
+<tr class="separator:abd40d255e0094f7156092db44a3b90fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:afbb0976ef343b14c66305db0a48647ca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#afbb0976ef343b14c66305db0a48647ca">FqCondSet</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *true_val, <a class="el" href="struct_fq_elem.html">FqElem</a> const *false_val, int truth_val)</td></tr>
+<tr class="memdesc:afbb0976ef343b14c66305db0a48647ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Conditionally Set an element's value to one of two values. <a href="#afbb0976ef343b14c66305db0a48647ca">More...</a><br /></td></tr>
+<tr class="separator:afbb0976ef343b14c66305db0a48647ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a0cbded46e28a1e6f641c5c0ae37fd744"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#a0cbded46e28a1e6f641c5c0ae37fd744">FqSqrt</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="struct_fq_elem.html">FqElem</a> const *in)</td></tr>
+<tr class="memdesc:a0cbded46e28a1e6f641c5c0ae37fd744"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the Square root of an element of Fq. <a href="#a0cbded46e28a1e6f641c5c0ae37fd744">More...</a><br /></td></tr>
+<tr class="separator:a0cbded46e28a1e6f641c5c0ae37fd744"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a5cc7d7d7640cd0bbcb635e95be3ed8a3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#a5cc7d7d7640cd0bbcb635e95be3ed8a3">FqRand</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param)</td></tr>
+<tr class="memdesc:a5cc7d7d7640cd0bbcb635e95be3ed8a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate a random element of Fq. <a href="#a5cc7d7d7640cd0bbcb635e95be3ed8a3">More...</a><br /></td></tr>
+<tr class="separator:a5cc7d7d7640cd0bbcb635e95be3ed8a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7794f72bcc506f8d8a60dbfae1a70ed0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="fq_8h.html#a7794f72bcc506f8d8a60dbfae1a70ed0">FqFromHash</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *result, unsigned char const *hash, size_t len)</td></tr>
+<tr class="memdesc:a7794f72bcc506f8d8a60dbfae1a70ed0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reinterpret a buffer as an element of Fq. <a href="#a7794f72bcc506f8d8a60dbfae1a70ed0">More...</a><br /></td></tr>
+<tr class="separator:a7794f72bcc506f8d8a60dbfae1a70ed0"><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>Definition of Fq math. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ab52f69c761454d976c3fc56a26549419"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqAdd </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two elements of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of adding left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ac85eb642d3b3973477749769e04d45af"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqClear </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Clear an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>element to clear. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="afbb0976ef343b14c66305db0a48647ca"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqCondSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>true_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>false_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int&#160;</td>
+ <td class="paramname"><em>truth_val</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Conditionally Set an element's value to one of two values. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">true_val</td><td>value to set if condition is true. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">false_val</td><td>value to set if condition is false. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">truth_val</td><td>value of condition. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a17133e5b777baa8c745b7dfcf1c8ad8d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqCp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Copy an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>copy target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>copy source. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="abd40d255e0094f7156092db44a3b90fa"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FqEq </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if two elements in Fq are equal. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be tested. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be tested. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the values are equal. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a276d3747aefdac5503982f2aa5eccbf8"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqExp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>base</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Exponentiate an element of Fq by a large integer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp</td><td>the exponent. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a7794f72bcc506f8d8a60dbfae1a70ed0"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqFromHash </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">unsigned char const *&#160;</td>
+ <td class="paramname"><em>hash</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>len</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Reinterpret a buffer as an element of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">hash</td><td>buffer to reinterpret. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>length of hash in bytes. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aceb37a8f5538fe9ca682058ff0e36091"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FqInField </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if an element is in Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) indeed the value is in the field. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a7b60a8996973d474d2fb7a31838c6d8c"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqInv </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Invert an element of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the inverse of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to invert. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ac08ca8c781cd18cbadabbeeb85722e49"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FqIsZero </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>value</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if an element is zero. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>the element to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the value is zero. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ab0bf77a97fb3a12292886bef3abcf9bd"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqMul </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two elements of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ae8379530cca959e7e36446b2979d8af4"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqNeg </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Negate an element of Fq. </p>
+<p>This function was formerly called as FqConst.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the negative of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to negate. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a5cc7d7d7640cd0bbcb635e95be3ed8a3"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FqRand </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</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>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Generate a random element of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>the random value. </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>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ab28f9df688a669a64dc04fa33f4cbb64"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Set an element's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a0cbded46e28a1e6f641c5c0ae37fd744"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int FqSqrt </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Compute the Square root of an element of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the square root of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to find the square root of. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if the square root exists. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ab62c8f43f78a0c4f830c9ed65048b8f9"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqSquare </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Square an element of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the square of the element. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the element to square. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a5148f610202ae759aafb197cb52137f1"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void FqSub </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Subtract two elements of Fq. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of subtracting left from right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The operand to be subtracted from. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The operand to subtract. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="fq_8h.html">fq.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions.html b/doc/html/functions.html
index 342d76d..564987a 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -80,405 +80,6 @@ $(document).ready(function(){initNavTree('functions.html','');});
: <a class="el" href="struct_compressed_priv_key.html#a0b0535f0567eb0e48f799d27991d0f66">CompressedPrivKey</a>
</li>
</ul>
-
-
-<h3><a class="anchor" id="index_b"></a>- b -</h3><ul>
-<li>B
-: <a class="el" href="struct_basic_signature.html#ae90cb6af66b010ae39913f033c1e65ac">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a27fd7ae99d1ada652e21e7508a467c0b">Epid11BasicSignature</a>
-</li>
-<li>b
-: <a class="el" href="struct_epid11_params.html#a27b45ed7771a3024d1d059b4b4ff6eae">Epid11Params</a>
-, <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>
-, <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>
-</li>
-<li>b_tick
-: <a class="el" href="struct_epid11_params.html#ade3f88ce73d7de656ec67d9fdb0719d7">Epid11Params</a>
-</li>
-<li>beta
-: <a class="el" href="struct_epid2_params.html#ac2d7507c6f58c3451beacacb91b52695">Epid2Params</a>
-</li>
-<li>bk
-: <a class="el" href="struct_epid11_sig_rl.html#a6473f8a98f76c9f82183041ea5ae17e3">Epid11SigRl</a>
-, <a class="el" href="struct_sig_rl.html#ac23a919993d99d24a5150302f1778102">SigRl</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
-<li>c
-: <a class="el" href="struct_basic_signature.html#a4daa94db5068db3f10960f3dd178d603">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a9cc6efcd3d7270022779bd16776168ed">Epid11BasicSignature</a>
-, <a class="el" href="struct_epid11_nr_proof.html#a2e5ee8dc25d296538dce935397a93d68">Epid11NrProof</a>
-, <a class="el" href="struct_join_request.html#a55e30a274e83b808db6fbab5ae6c6cb8">JoinRequest</a>
-, <a class="el" href="struct_nr_proof.html#a0de1aa69acf3d93da34cf4a613b359a1">NrProof</a>
-</li>
-<li>coeff
-: <a class="el" href="struct_epid11_params.html#aacc39ebe0cc625321039ffb6be0b0e87">Epid11Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
-<li>data
-: <a class="el" href="struct_big_num_str.html#a442dcf33889b4f85c5b1228d2c8e6838">BigNumStr</a>
-, <a class="el" href="struct_ecdsa_private_key.html#a97efee9b4079f95d94a104f9a6d8c96d">EcdsaPrivateKey</a>
-, <a class="el" href="struct_fp_elem_str.html#a5ddb96a5567750f2834335851c906c45">FpElemStr</a>
-, <a class="el" href="struct_fq_elem_str.html#aac1a876b51a8d2c6d1510e4df2fd3f14">FqElemStr</a>
-, <a class="el" href="struct_oct_str128.html#a7482aa9b0b580fdd50bd65419d52d4b9">OctStr128</a>
-, <a class="el" href="struct_oct_str16.html#a86ed6671693a3f60ec4ff7de2c1206c3">OctStr16</a>
-, <a class="el" href="struct_oct_str256.html#a359781bb84f5717a16094583a00ef14e">OctStr256</a>
-, <a class="el" href="struct_oct_str32.html#a5588a7e70f3d73f6ce58b567a9f5c5c8">OctStr32</a>
-, <a class="el" href="struct_oct_str512.html#abd4d1b97fe49321571da86de1aeac653">OctStr512</a>
-, <a class="el" href="struct_oct_str600.html#a06d53af92a06e1decc6062fd16c43a59">OctStr600</a>
-, <a class="el" href="struct_oct_str64.html#a0e107d78192a5ae0b48ed9e5c4eab0fc">OctStr64</a>
-, <a class="el" href="struct_oct_str768.html#ae45eea89259bd22e60a8d960063921cc">OctStr768</a>
-, <a class="el" href="struct_oct_str80.html#af80e2b81554109d9a41c5e771aceb8c9">OctStr80</a>
-, <a class="el" href="struct_oct_str8.html#a5e6c56fda48c88b419e621b464b03bef">OctStr8</a>
-, <a class="el" href="struct_sha256_digest.html#a4b6462ddd3f89e4c40220ceb6b1c7f28">Sha256Digest</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
-<li>e12
-: <a class="el" href="struct_epid11_verifier_precomp.html#a0a980adb039089263ec59a995600ee91">Epid11VerifierPrecomp</a>
-, <a class="el" href="struct_member_precomp.html#a55e5c4b25c8f0f426969a8d745260fe5">MemberPrecomp</a>
-, <a class="el" href="struct_verifier_precomp.html#ad1106376f12772942af0331eb74de6e5">VerifierPrecomp</a>
-</li>
-<li>e22
-: <a class="el" href="struct_epid11_verifier_precomp.html#ad0ff2a13c2c87460296900dde72a2f30">Epid11VerifierPrecomp</a>
-, <a class="el" href="struct_member_precomp.html#a4e7412969bed3964f813b093b948e7b4">MemberPrecomp</a>
-, <a class="el" href="struct_verifier_precomp.html#af8fd90f3a5a2be932a97dcd86099d5b2">VerifierPrecomp</a>
-</li>
-<li>e2w
-: <a class="el" href="struct_epid11_verifier_precomp.html#a14ebadf105aff085edb9a817a2d1db89">Epid11VerifierPrecomp</a>
-, <a class="el" href="struct_member_precomp.html#a879d5a7b0c30088b23f6e5c5fc62f834">MemberPrecomp</a>
-, <a class="el" href="struct_verifier_precomp.html#a8caf79578e3c0baf91921460391103ca">VerifierPrecomp</a>
-</li>
-<li>ea2
-: <a class="el" href="struct_member_precomp.html#a573551f6494e372f44fd3bdf5b02aeda">MemberPrecomp</a>
-</li>
-<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>
-</ul>
-
-
-<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
-<li>f
-: <a class="el" href="struct_epid11_priv_rl.html#abbb75fee81aecb2dde7e2daab895ad3b">Epid11PrivRl</a>
-</li>
-<li>F
-: <a class="el" href="struct_join_request.html#a005651506fd4511e8a3537f6c3634532">JoinRequest</a>
-</li>
-<li>f
-: <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
-: <a class="el" href="struct_epid_file_header.html#af5d48c739cc6c00c6e1ce35abf4f1473">EpidFileHeader</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
-<li>g1
-: <a class="el" href="struct_epid11_params.html#a835e70da717cd5b0c94e242a6418a287">Epid11Params</a>
-, <a class="el" href="struct_epid2_params.html#a4c5195b4fa9393a07a121336202531ad">Epid2Params</a>
-</li>
-<li>g2
-: <a class="el" href="struct_epid11_params.html#a1c6bbc4e066449d9c329f88cb653ef7c">Epid11Params</a>
-, <a class="el" href="struct_epid2_params.html#a609b0aac17fca34fe39bee29676a9618">Epid2Params</a>
-</li>
-<li>g3
-: <a class="el" href="struct_epid11_params.html#a7eb9a1371d7187ae81bccfa8d5595033">Epid11Params</a>
-</li>
-<li>gamma
-: <a class="el" href="struct_i_priv_key.html#a6d484175317aef09fb959c3ca55fc70a">IPrivKey</a>
-</li>
-<li>gid
-: <a class="el" href="struct_compressed_priv_key.html#ac6689899f1d9a6a8c5e4915563679840">CompressedPrivKey</a>
-, <a class="el" href="struct_epid11_group_pub_key.html#a964344b3c595bdd585bb9b5d9d0ea762">Epid11GroupPubKey</a>
-, <a class="el" href="struct_epid11_group_rl.html#a97f165c59bc447e3ca3c2148a096710f">Epid11GroupRl</a>
-, <a class="el" href="struct_epid11_priv_rl.html#aa8945d81e30674b52a6d0900b64feb3c">Epid11PrivRl</a>
-, <a class="el" href="struct_epid11_sig_rl.html#ad45b0e3e1be59649150dd34c104000ac">Epid11SigRl</a>
-, <a class="el" href="struct_epid11_verifier_precomp.html#a03138e937f4488bdbc52ed473dc313da">Epid11VerifierPrecomp</a>
-, <a class="el" href="struct_group_pub_key.html#ae8e77ab4d5eb3c8e566c24a64cce56ee">GroupPubKey</a>
-, <a class="el" href="struct_group_rl.html#a51022e172ab8b945efc69f1e63170107">GroupRl</a>
-, <a class="el" href="struct_i_priv_key.html#ad400a4237b6d50855538fd40580eb1bb">IPrivKey</a>
-, <a class="el" href="struct_membership_credential.html#afbff64ec55888c7e2a658eabb5e16671">MembershipCredential</a>
-, <a class="el" href="struct_priv_key.html#ab416dcb4366427c24b44c2a02e4ae7c8">PrivKey</a>
-, <a class="el" href="struct_priv_rl.html#af7317529b8e55476bd06b66ed8131d64">PrivRl</a>
-, <a class="el" href="struct_sig_rl.html#a12757d30fcccd310716433948e0b603e">SigRl</a>
-, <a class="el" href="struct_verifier_precomp.html#afc3e29a325c95c62bb192d5f8cdd5c1c">VerifierPrecomp</a>
-, <a class="el" href="struct_verifier_rl.html#ab85c4666d16145ff16443e84468d2d7d">VerifierRl</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
-<li>h
-: <a class="el" href="struct_epid11_params.html#ae2d1dc635d9d7cba496c3d64fb6f9d5b">Epid11Params</a>
-</li>
-<li>h1
-: <a class="el" href="struct_epid11_group_pub_key.html#a36f688472e2655052d485eac67d8c362">Epid11GroupPubKey</a>
-, <a class="el" href="struct_group_pub_key.html#a8c22c758ea186f95e3bf4b2ef8451da5">GroupPubKey</a>
-</li>
-<li>h2
-: <a class="el" href="struct_epid11_group_pub_key.html#aa724e9d2f0cb6019c05547d76a13b72a">Epid11GroupPubKey</a>
-, <a class="el" href="struct_group_pub_key.html#a2a4320ec99fd1a15df412fbf2a8d49f1">GroupPubKey</a>
-</li>
-<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>
-</ul>
-
-
-<h3><a class="anchor" id="index_k"></a>- k -</h3><ul>
-<li>K
-: <a class="el" href="struct_basic_signature.html#a0078cc83ecf6c7e31f96b7d44aa60e21">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a5882fcbfd272774e12e50a2d77f0b139">Epid11BasicSignature</a>
-</li>
-<li>k
-: <a class="el" href="struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a">Epid11SigRlEntry</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>
-
-
-<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
-<li>n1
-: <a class="el" href="struct_epid11_priv_rl.html#ad95f880f40e2f40c723f5bdbd22ecfa2">Epid11PrivRl</a>
-, <a class="el" href="struct_priv_rl.html#a6da9639ec4061689d1c30a58e0befd14">PrivRl</a>
-</li>
-<li>n2
-: <a class="el" href="struct_epid11_signature.html#ad25c277223a5210063163ea554d08ad4">Epid11Signature</a>
-, <a class="el" href="struct_epid11_sig_rl.html#a8c654d43df132db7874f4c84c177dc12">Epid11SigRl</a>
-, <a class="el" href="struct_epid_signature.html#a62a6b0ffcd5f68dd3d2786a58fe43017">EpidSignature</a>
-, <a class="el" href="struct_sig_rl.html#a9dfb6b508db9051f4dc480a51d702af2">SigRl</a>
-</li>
-<li>n3
-: <a class="el" href="struct_epid11_group_rl.html#a35cb954f598d4006b0f047cde77010a5">Epid11GroupRl</a>
-, <a class="el" href="struct_group_rl.html#a9067f01c63cdefbc8e23c3cf67a10172">GroupRl</a>
-</li>
-<li>n4
-: <a class="el" href="struct_verifier_rl.html#a1e3f84b873bccc0c882aa6432c42d2f7">VerifierRl</a>
-</li>
-<li>nd
-: <a class="el" href="struct_epid11_basic_signature.html#af18200712d2cf3ed3ccaee328e8a4e0f">Epid11BasicSignature</a>
-</li>
-<li>neg
-: <a class="el" href="struct_epid2_params.html#af23f07fb0e1745c0ad14aceeaa946928">Epid2Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
-<li>orderG2
-: <a class="el" href="struct_epid11_params.html#a02bd6fa2ab256e3a07533e947ab0101e">Epid11Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
-<li>p
-: <a class="el" href="struct_epid11_params.html#a2aa4d8a2ebe0dfeb6d930fd7b39f9d1a">Epid11Params</a>
-, <a class="el" href="struct_epid2_params.html#ac0e0dad45b10927860cd5fa4f8101f08">Epid2Params</a>
-</li>
-<li>p_tick
-: <a class="el" href="struct_epid11_params.html#a77a8350b97a7afb584a46eb5b32f03bf">Epid11Params</a>
-</li>
-<li>prime
-: <a class="el" href="struct_epid_ca_certificate.html#a3a44e8050ca2f5085652b2b4e15b779c">EpidCaCertificate</a>
-</li>
-<li>pubkey
-: <a class="el" href="struct_epid_ca_certificate.html#a9d2fc21f46cf9fc96e2ea557b70e5356">EpidCaCertificate</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_q"></a>- q -</h3><ul>
-<li>q
-: <a class="el" href="struct_epid11_params.html#aad03fd1cc3955bb8879535fa7298123f">Epid11Params</a>
-, <a class="el" href="struct_epid2_params.html#a023603228fed2854ddae2e228938940f">Epid2Params</a>
-</li>
-<li>q_tick
-: <a class="el" href="struct_epid11_params.html#a49462f35596d07a456a731d0690fdd83">Epid11Params</a>
-</li>
-<li>qnr
-: <a class="el" href="struct_epid11_params.html#af22cfcd6c7ec0e7e7369b79554b963bd">Epid11Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
-<li>r
-: <a class="el" href="struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2">EpidCaCertificate</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>
-
-
-<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
-<li>s
-: <a class="el" href="struct_join_request.html#a73bf8989df5f90eb3d06e7a42ad74d1d">JoinRequest</a>
-</li>
-<li>sa
-: <a class="el" href="struct_basic_signature.html#a69115a4776d15b48411dd6c3a76d0f3d">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#aeb221cf52bc2b1a9bf6e0a9779bfd20f">Epid11BasicSignature</a>
-</li>
-<li>salpha
-: <a class="el" href="struct_epid11_basic_signature.html#a1a73fc922f69e2499643dd4c53d0d42d">Epid11BasicSignature</a>
-</li>
-<li>sb
-: <a class="el" href="struct_basic_signature.html#a91daebc5b577688afeed2a7ee7913245">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a29a700f3bec251600e18b2292081df4b">Epid11BasicSignature</a>
-</li>
-<li>sbeta
-: <a class="el" href="struct_epid11_basic_signature.html#afe28bad6328f81e6f7af011cc96ac2e5">Epid11BasicSignature</a>
-</li>
-<li>seed
-: <a class="el" href="struct_compressed_priv_key.html#a54b9af7699f517bbaef3d52d03e3fed8">CompressedPrivKey</a>
-</li>
-<li>sf
-: <a class="el" href="struct_basic_signature.html#a79d8dec8c5da176e497abf22e4c43adb">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#ae17b45194997a6fa13c6014a51ec711c">Epid11BasicSignature</a>
-</li>
-<li>sigma
-: <a class="el" href="struct_epid11_signature.html#abf24a8df563ba3f535486d8dad7384f4">Epid11Signature</a>
-, <a class="el" href="struct_epid_signature.html#a89d2e38223944310b6eeeadf6061a2dd">EpidSignature</a>
-</li>
-<li>sigma0
-: <a class="el" href="struct_epid11_signature.html#a48526e73f02ad3f1544c4c71c481f153">Epid11Signature</a>
-, <a class="el" href="struct_epid_signature.html#ab0fe5f98bff737fcfbfe0b4d658e83f2">EpidSignature</a>
-</li>
-<li>signature
-: <a class="el" href="struct_epid_ca_certificate.html#a2f8f09ae02919c379c38386668b47418">EpidCaCertificate</a>
-</li>
-<li>smu
-: <a class="el" href="struct_epid11_nr_proof.html#a1ad7fe6b32c09f2504ee49731c0ad145">Epid11NrProof</a>
-, <a class="el" href="struct_nr_proof.html#a717ec36a6c91acd01d9b642bb20fc178">NrProof</a>
-</li>
-<li>snu
-: <a class="el" href="struct_epid11_nr_proof.html#aa8406e938b2f87bded9e374e93a8ee5d">Epid11NrProof</a>
-, <a class="el" href="struct_nr_proof.html#ae2e9f22089793a4d44a0f7f5cdb78a0c">NrProof</a>
-</li>
-<li>sx
-: <a class="el" href="struct_basic_signature.html#a0e8ea6a2cd3af10e9b59d96d7d06bc69">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a2718346665210b7e26521bf4a15cb3bd">Epid11BasicSignature</a>
-</li>
-<li>sy
-: <a class="el" href="struct_epid11_basic_signature.html#a911441845fc9b82d514133371b5ba87c">Epid11BasicSignature</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
-<li>T
-: <a class="el" href="struct_basic_signature.html#a730f74d85cfb4fa4089d43c87b97a624">BasicSignature</a>
-, <a class="el" href="struct_epid11_nr_proof.html#a5ad9ba3bfac4eac37fd4a4e33ea65ddc">Epid11NrProof</a>
-</li>
-<li>t
-: <a class="el" href="struct_epid2_params.html#a200a0cba1c9e4ad512bece23f2461a5f">Epid2Params</a>
-</li>
-<li>T
-: <a class="el" href="struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3">NrProof</a>
-</li>
-<li>T1
-: <a class="el" href="struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b">Epid11BasicSignature</a>
-</li>
-<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>
-
-
-<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
-<li>version
-: <a class="el" href="struct_epid11_group_rl.html#a63afa9863e8dcb63ff884e6e4093c481">Epid11GroupRl</a>
-, <a class="el" href="struct_epid11_priv_rl.html#a2b3899f5a35bf64f860d6d91bccb03c8">Epid11PrivRl</a>
-, <a class="el" href="struct_epid11_sig_rl.html#aa38674729293f4879ff94328dd3c59b1">Epid11SigRl</a>
-, <a class="el" href="struct_group_rl.html#a69c41d99cdfc5b6ece7442f466f7ec3f">GroupRl</a>
-, <a class="el" href="struct_priv_rl.html#a4c6b51cec760f7e81ca8635422ac6a50">PrivRl</a>
-, <a class="el" href="struct_sig_rl.html#ac9d4c343c539dba799e1f42eb38b351f">SigRl</a>
-, <a class="el" href="struct_verifier_rl.html#afa44ab69ffff5a3508366aeb2131fdaa">VerifierRl</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_w"></a>- w -</h3><ul>
-<li>w
-: <a class="el" href="struct_epid11_group_pub_key.html#a056c7138246e2bdcd47eaad501b756bb">Epid11GroupPubKey</a>
-, <a class="el" href="struct_group_pub_key.html#a86be439104fb60b324784baf24a943f9">GroupPubKey</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_x"></a>- x -</h3><ul>
-<li>x
-: <a class="el" href="struct_ecdsa_public_key.html#a37c51614faf022eec491b4de8f3a13e1">EcdsaPublicKey</a>
-, <a class="el" href="struct_ecdsa_signature.html#a64b623605a55a267a36df18f29142d0d">EcdsaSignature</a>
-, <a class="el" href="struct_epid11_g2_elem_str.html#af28558484298f4f56377ededf57a4a04">Epid11G2ElemStr</a>
-, <a class="el" href="struct_epid_ca_certificate.html#a4f77996f90ed7da1d0503c4236b2c9d1">EpidCaCertificate</a>
-, <a class="el" href="struct_g1_elem_str.html#a3b0e658d6e5697763ad9c633c11d4ec4">G1ElemStr</a>
-, <a class="el" href="struct_g2_elem_str.html#a145ec5b20a6f4f00b080e11c8680afc3">G2ElemStr</a>
-, <a class="el" href="struct_gt_elem_str.html#aeaeb0e9e1c6efd378a475eb9a6c42132">GtElemStr</a>
-, <a class="el" href="struct_membership_credential.html#a2c5c0d22999d6917fea5ad6618883bcf">MembershipCredential</a>
-, <a class="el" href="struct_priv_key.html#aa805f9e124f05bdb733c85cb93614cbd">PrivKey</a>
-</li>
-<li>xi
-: <a class="el" href="struct_epid2_params.html#ae1d8f5d6036a82064e91bc137b278e74">Epid2Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_y"></a>- y -</h3><ul>
-<li>y
-: <a class="el" href="struct_ecdsa_public_key.html#a4503c4613386cbc78add1dc245c99284">EcdsaPublicKey</a>
-, <a class="el" href="struct_ecdsa_signature.html#a2efd6bf37b12f35135bf325fa491b029">EcdsaSignature</a>
-, <a class="el" href="struct_epid11_g2_elem_str.html#a9e8984e479bcbe8bd36c65e80c340032">Epid11G2ElemStr</a>
-, <a class="el" href="struct_epid_ca_certificate.html#abd69cce8d5e3940787ee0d17f72184ab">EpidCaCertificate</a>
-, <a class="el" href="struct_g1_elem_str.html#a8f2455ca314e885ea180dadf84bf27c3">G1ElemStr</a>
-, <a class="el" href="struct_g2_elem_str.html#a43141b2458aecceed8ee2748270f7908">G2ElemStr</a>
-</li>
-</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/functions_b.html b/doc/html/functions_b.html
new file mode 100644
index 0000000..fcb3c9f
--- /dev/null
+++ b/doc/html/functions_b.html
@@ -0,0 +1,100 @@
+<!-- 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: Data Fields</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">6.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('functions_b.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_b"></a>- b -</h3><ul>
+<li>B
+: <a class="el" href="struct_basic_signature.html#ae90cb6af66b010ae39913f033c1e65ac">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a27fd7ae99d1ada652e21e7508a467c0b">Epid11BasicSignature</a>
+</li>
+<li>b
+: <a class="el" href="struct_epid11_params.html#a27b45ed7771a3024d1d059b4b4ff6eae">Epid11Params</a>
+, <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>
+, <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>
+</li>
+<li>b_tick
+: <a class="el" href="struct_epid11_params.html#ade3f88ce73d7de656ec67d9fdb0719d7">Epid11Params</a>
+</li>
+<li>beta
+: <a class="el" href="struct_epid2_params.html#ac2d7507c6f58c3451beacacb91b52695">Epid2Params</a>
+</li>
+<li>bk
+: <a class="el" href="struct_epid11_sig_rl.html#a6473f8a98f76c9f82183041ea5ae17e3">Epid11SigRl</a>
+, <a class="el" href="struct_sig_rl.html#ac23a919993d99d24a5150302f1778102">SigRl</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_c.html b/doc/html/functions_c.html
new file mode 100644
index 0000000..9bee9bc
--- /dev/null
+++ b/doc/html/functions_c.html
@@ -0,0 +1,86 @@
+<!-- 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: Data Fields</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">6.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('functions_c.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
+<li>c
+: <a class="el" href="struct_basic_signature.html#a4daa94db5068db3f10960f3dd178d603">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a9cc6efcd3d7270022779bd16776168ed">Epid11BasicSignature</a>
+, <a class="el" href="struct_epid11_nr_proof.html#a2e5ee8dc25d296538dce935397a93d68">Epid11NrProof</a>
+, <a class="el" href="struct_join_request.html#a55e30a274e83b808db6fbab5ae6c6cb8">JoinRequest</a>
+, <a class="el" href="struct_nr_proof.html#a0de1aa69acf3d93da34cf4a613b359a1">NrProof</a>
+</li>
+<li>coeff
+: <a class="el" href="struct_epid11_params.html#aacc39ebe0cc625321039ffb6be0b0e87">Epid11Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_d.html b/doc/html/functions_d.html
new file mode 100644
index 0000000..2f86c31
--- /dev/null
+++ b/doc/html/functions_d.html
@@ -0,0 +1,96 @@
+<!-- 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: Data Fields</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">6.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('functions_d.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
+<li>data
+: <a class="el" href="struct_big_num_str.html#a442dcf33889b4f85c5b1228d2c8e6838">BigNumStr</a>
+, <a class="el" href="struct_ecdsa_private_key.html#a97efee9b4079f95d94a104f9a6d8c96d">EcdsaPrivateKey</a>
+, <a class="el" href="struct_fp_elem_str.html#a5ddb96a5567750f2834335851c906c45">FpElemStr</a>
+, <a class="el" href="struct_fq_elem_str.html#aac1a876b51a8d2c6d1510e4df2fd3f14">FqElemStr</a>
+, <a class="el" href="struct_oct_str128.html#a7482aa9b0b580fdd50bd65419d52d4b9">OctStr128</a>
+, <a class="el" href="struct_oct_str16.html#a86ed6671693a3f60ec4ff7de2c1206c3">OctStr16</a>
+, <a class="el" href="struct_oct_str256.html#a359781bb84f5717a16094583a00ef14e">OctStr256</a>
+, <a class="el" href="struct_oct_str32.html#a5588a7e70f3d73f6ce58b567a9f5c5c8">OctStr32</a>
+, <a class="el" href="struct_oct_str512.html#abd4d1b97fe49321571da86de1aeac653">OctStr512</a>
+, <a class="el" href="struct_oct_str600.html#a06d53af92a06e1decc6062fd16c43a59">OctStr600</a>
+, <a class="el" href="struct_oct_str64.html#a0e107d78192a5ae0b48ed9e5c4eab0fc">OctStr64</a>
+, <a class="el" href="struct_oct_str768.html#ae45eea89259bd22e60a8d960063921cc">OctStr768</a>
+, <a class="el" href="struct_oct_str80.html#af80e2b81554109d9a41c5e771aceb8c9">OctStr80</a>
+, <a class="el" href="struct_oct_str8.html#a5e6c56fda48c88b419e621b464b03bef">OctStr8</a>
+, <a class="el" href="struct_sha256_digest.html#a4b6462ddd3f89e4c40220ceb6b1c7f28">Sha256Digest</a>
+</li>
+<li>digest
+: <a class="el" href="unionsha__digest.html#a182db3a17879fc1fb95c018044533060">sha_digest</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_e.html b/doc/html/functions_e.html
new file mode 100644
index 0000000..5faa027
--- /dev/null
+++ b/doc/html/functions_e.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: Data Fields</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">6.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('functions_e.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
+<li>e12
+: <a class="el" href="struct_epid11_verifier_precomp.html#a0a980adb039089263ec59a995600ee91">Epid11VerifierPrecomp</a>
+, <a class="el" href="struct_member_precomp.html#a55e5c4b25c8f0f426969a8d745260fe5">MemberPrecomp</a>
+, <a class="el" href="struct_verifier_precomp.html#ad1106376f12772942af0331eb74de6e5">VerifierPrecomp</a>
+</li>
+<li>e22
+: <a class="el" href="struct_epid11_verifier_precomp.html#ad0ff2a13c2c87460296900dde72a2f30">Epid11VerifierPrecomp</a>
+, <a class="el" href="struct_member_precomp.html#a4e7412969bed3964f813b093b948e7b4">MemberPrecomp</a>
+, <a class="el" href="struct_verifier_precomp.html#af8fd90f3a5a2be932a97dcd86099d5b2">VerifierPrecomp</a>
+</li>
+<li>e2w
+: <a class="el" href="struct_epid11_verifier_precomp.html#a14ebadf105aff085edb9a817a2d1db89">Epid11VerifierPrecomp</a>
+, <a class="el" href="struct_member_precomp.html#a879d5a7b0c30088b23f6e5c5fc62f834">MemberPrecomp</a>
+, <a class="el" href="struct_verifier_precomp.html#a8caf79578e3c0baf91921460391103ca">VerifierPrecomp</a>
+</li>
+<li>ea2
+: <a class="el" href="struct_member_precomp.html#a573551f6494e372f44fd3bdf5b02aeda">MemberPrecomp</a>
+</li>
+<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>
+</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_f.html b/doc/html/functions_f.html
new file mode 100644
index 0000000..77a56dc
--- /dev/null
+++ b/doc/html/functions_f.html
@@ -0,0 +1,90 @@
+<!-- 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: Data Fields</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">6.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('functions_f.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
+<li>f
+: <a class="el" href="struct_epid11_priv_rl.html#abbb75fee81aecb2dde7e2daab895ad3b">Epid11PrivRl</a>
+</li>
+<li>F
+: <a class="el" href="struct_join_request.html#a005651506fd4511e8a3537f6c3634532">JoinRequest</a>
+</li>
+<li>f
+: <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
+: <a class="el" href="struct_epid_file_header.html#af5d48c739cc6c00c6e1ce35abf4f1473">EpidFileHeader</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_g.html b/doc/html/functions_g.html
new file mode 100644
index 0000000..5ea9ac4
--- /dev/null
+++ b/doc/html/functions_g.html
@@ -0,0 +1,110 @@
+<!-- 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: Data Fields</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">6.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('functions_g.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
+<li>g
+: <a class="el" href="struct_pairing_state.html#a0e19d5e16a81645aca678e04b88758da">PairingState</a>
+</li>
+<li>g1
+: <a class="el" href="struct_epid11_params.html#a835e70da717cd5b0c94e242a6418a287">Epid11Params</a>
+, <a class="el" href="struct_epid2_params.html#a4c5195b4fa9393a07a121336202531ad">Epid2Params</a>
+</li>
+<li>g2
+: <a class="el" href="struct_epid11_params.html#a1c6bbc4e066449d9c329f88cb653ef7c">Epid11Params</a>
+, <a class="el" href="struct_epid2_params.html#a609b0aac17fca34fe39bee29676a9618">Epid2Params</a>
+</li>
+<li>g3
+: <a class="el" href="struct_epid11_params.html#a7eb9a1371d7187ae81bccfa8d5595033">Epid11Params</a>
+</li>
+<li>gamma
+: <a class="el" href="struct_i_priv_key.html#a6d484175317aef09fb959c3ca55fc70a">IPrivKey</a>
+</li>
+<li>gid
+: <a class="el" href="struct_compressed_priv_key.html#ac6689899f1d9a6a8c5e4915563679840">CompressedPrivKey</a>
+, <a class="el" href="struct_epid11_group_pub_key.html#a964344b3c595bdd585bb9b5d9d0ea762">Epid11GroupPubKey</a>
+, <a class="el" href="struct_epid11_group_rl.html#a97f165c59bc447e3ca3c2148a096710f">Epid11GroupRl</a>
+, <a class="el" href="struct_epid11_priv_rl.html#aa8945d81e30674b52a6d0900b64feb3c">Epid11PrivRl</a>
+, <a class="el" href="struct_epid11_sig_rl.html#ad45b0e3e1be59649150dd34c104000ac">Epid11SigRl</a>
+, <a class="el" href="struct_epid11_verifier_precomp.html#a03138e937f4488bdbc52ed473dc313da">Epid11VerifierPrecomp</a>
+, <a class="el" href="struct_group_pub_key.html#ae8e77ab4d5eb3c8e566c24a64cce56ee">GroupPubKey</a>
+, <a class="el" href="struct_group_rl.html#a51022e172ab8b945efc69f1e63170107">GroupRl</a>
+, <a class="el" href="struct_i_priv_key.html#ad400a4237b6d50855538fd40580eb1bb">IPrivKey</a>
+, <a class="el" href="struct_membership_credential.html#afbff64ec55888c7e2a658eabb5e16671">MembershipCredential</a>
+, <a class="el" href="struct_priv_key.html#ab416dcb4366427c24b44c2a02e4ae7c8">PrivKey</a>
+, <a class="el" href="struct_priv_rl.html#af7317529b8e55476bd06b66ed8131d64">PrivRl</a>
+, <a class="el" href="struct_sig_rl.html#a12757d30fcccd310716433948e0b603e">SigRl</a>
+, <a class="el" href="struct_verifier_precomp.html#afc3e29a325c95c62bb192d5f8cdd5c1c">VerifierPrecomp</a>
+, <a class="el" href="struct_verifier_rl.html#ab85c4666d16145ff16443e84468d2d7d">VerifierRl</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_h.html b/doc/html/functions_h.html
new file mode 100644
index 0000000..8d312cd
--- /dev/null
+++ b/doc/html/functions_h.html
@@ -0,0 +1,97 @@
+<!-- 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: Data Fields</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">6.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('functions_h.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
+<li>h
+: <a class="el" href="struct_epid11_params.html#ae2d1dc635d9d7cba496c3d64fb6f9d5b">Epid11Params</a>
+</li>
+<li>h1
+: <a class="el" href="struct_epid11_group_pub_key.html#a36f688472e2655052d485eac67d8c362">Epid11GroupPubKey</a>
+, <a class="el" href="struct_group_pub_key.html#a8c22c758ea186f95e3bf4b2ef8451da5">GroupPubKey</a>
+</li>
+<li>h2
+: <a class="el" href="struct_epid11_group_pub_key.html#aa724e9d2f0cb6019c05547d76a13b72a">Epid11GroupPubKey</a>
+, <a class="el" href="struct_group_pub_key.html#a2a4320ec99fd1a15df412fbf2a8d49f1">GroupPubKey</a>
+</li>
+<li>h_tick
+: <a class="el" href="struct_epid11_params.html#a0fe238db4ebc0225899dc2dac97d11c0">Epid11Params</a>
+</li>
+<li>hash_alg
+: <a class="el" href="structtiny__sha.html#acc38b88204bd86b40f1f1de557b247c4">tiny_sha</a>
+, <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>
+</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_k.html b/doc/html/functions_k.html
new file mode 100644
index 0000000..352b321
--- /dev/null
+++ b/doc/html/functions_k.html
@@ -0,0 +1,90 @@
+<!-- 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: Data Fields</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">6.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('functions_k.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_k"></a>- k -</h3><ul>
+<li>K
+: <a class="el" href="struct_basic_signature.html#a0078cc83ecf6c7e31f96b7d44aa60e21">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a5882fcbfd272774e12e50a2d77f0b139">Epid11BasicSignature</a>
+</li>
+<li>k
+: <a class="el" href="struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a">Epid11SigRlEntry</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>
+</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/functions_l.html b/doc/html/functions_l.html
new file mode 100644
index 0000000..6fa4a6b
--- /dev/null
+++ b/doc/html/functions_l.html
@@ -0,0 +1,80 @@
+<!-- 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: Data Fields</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">6.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('functions_l.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
+<li>limbs
+: <a class="el" href="struct_fp_elem.html#a755a581a230c169e36985fb0301f2a28">FpElem</a>
+, <a class="el" href="struct_fq_elem.html#ad7d9feb0b777d58abfa9a31d6ddc466f">FqElem</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_n.html b/doc/html/functions_n.html
new file mode 100644
index 0000000..7e69f4f
--- /dev/null
+++ b/doc/html/functions_n.html
@@ -0,0 +1,99 @@
+<!-- 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: Data Fields</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">6.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('functions_n.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
+<li>n1
+: <a class="el" href="struct_epid11_priv_rl.html#ad95f880f40e2f40c723f5bdbd22ecfa2">Epid11PrivRl</a>
+, <a class="el" href="struct_priv_rl.html#a6da9639ec4061689d1c30a58e0befd14">PrivRl</a>
+</li>
+<li>n2
+: <a class="el" href="struct_epid11_signature.html#ad25c277223a5210063163ea554d08ad4">Epid11Signature</a>
+, <a class="el" href="struct_epid11_sig_rl.html#a8c654d43df132db7874f4c84c177dc12">Epid11SigRl</a>
+, <a class="el" href="struct_epid_signature.html#a62a6b0ffcd5f68dd3d2786a58fe43017">EpidSignature</a>
+, <a class="el" href="struct_sig_rl.html#a9dfb6b508db9051f4dc480a51d702af2">SigRl</a>
+</li>
+<li>n3
+: <a class="el" href="struct_epid11_group_rl.html#a35cb954f598d4006b0f047cde77010a5">Epid11GroupRl</a>
+, <a class="el" href="struct_group_rl.html#a9067f01c63cdefbc8e23c3cf67a10172">GroupRl</a>
+</li>
+<li>n4
+: <a class="el" href="struct_verifier_rl.html#a1e3f84b873bccc0c882aa6432c42d2f7">VerifierRl</a>
+</li>
+<li>nd
+: <a class="el" href="struct_epid11_basic_signature.html#af18200712d2cf3ed3ccaee328e8a4e0f">Epid11BasicSignature</a>
+</li>
+<li>neg
+: <a class="el" href="struct_epid2_params.html#af23f07fb0e1745c0ad14aceeaa946928">Epid2Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_o.html b/doc/html/functions_o.html
new file mode 100644
index 0000000..872d272
--- /dev/null
+++ b/doc/html/functions_o.html
@@ -0,0 +1,79 @@
+<!-- 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: Data Fields</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">6.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('functions_o.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
+<li>orderG2
+: <a class="el" href="struct_epid11_params.html#a02bd6fa2ab256e3a07533e947ab0101e">Epid11Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_p.html b/doc/html/functions_p.html
new file mode 100644
index 0000000..640afec
--- /dev/null
+++ b/doc/html/functions_p.html
@@ -0,0 +1,89 @@
+<!-- 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: Data Fields</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">6.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('functions_p.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
+<li>p
+: <a class="el" href="struct_epid11_params.html#a2aa4d8a2ebe0dfeb6d930fd7b39f9d1a">Epid11Params</a>
+, <a class="el" href="struct_epid2_params.html#ac0e0dad45b10927860cd5fa4f8101f08">Epid2Params</a>
+</li>
+<li>p_tick
+: <a class="el" href="struct_epid11_params.html#a77a8350b97a7afb584a46eb5b32f03bf">Epid11Params</a>
+</li>
+<li>prime
+: <a class="el" href="struct_epid_ca_certificate.html#a3a44e8050ca2f5085652b2b4e15b779c">EpidCaCertificate</a>
+</li>
+<li>pubkey
+: <a class="el" href="struct_epid_ca_certificate.html#a9d2fc21f46cf9fc96e2ea557b70e5356">EpidCaCertificate</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_q.html b/doc/html/functions_q.html
new file mode 100644
index 0000000..7f6872f
--- /dev/null
+++ b/doc/html/functions_q.html
@@ -0,0 +1,86 @@
+<!-- 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: Data Fields</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">6.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('functions_q.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_q"></a>- q -</h3><ul>
+<li>q
+: <a class="el" href="struct_epid11_params.html#aad03fd1cc3955bb8879535fa7298123f">Epid11Params</a>
+, <a class="el" href="struct_epid2_params.html#a023603228fed2854ddae2e228938940f">Epid2Params</a>
+</li>
+<li>q_tick
+: <a class="el" href="struct_epid11_params.html#a49462f35596d07a456a731d0690fdd83">Epid11Params</a>
+</li>
+<li>qnr
+: <a class="el" href="struct_epid11_params.html#af22cfcd6c7ec0e7e7369b79554b963bd">Epid11Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_r.html b/doc/html/functions_r.html
new file mode 100644
index 0000000..447f6e6
--- /dev/null
+++ b/doc/html/functions_r.html
@@ -0,0 +1,89 @@
+<!-- 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: Data Fields</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">6.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('functions_r.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
+<li>r
+: <a class="el" href="struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2">EpidCaCertificate</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>
+</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/functions_s.html b/doc/html/functions_s.html
new file mode 100644
index 0000000..f76b347
--- /dev/null
+++ b/doc/html/functions_s.html
@@ -0,0 +1,141 @@
+<!-- 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: Data Fields</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">6.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('functions_s.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
+<li>s
+: <a class="el" href="struct_join_request.html#a73bf8989df5f90eb3d06e7a42ad74d1d">JoinRequest</a>
+</li>
+<li>sa
+: <a class="el" href="struct_basic_signature.html#a69115a4776d15b48411dd6c3a76d0f3d">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#aeb221cf52bc2b1a9bf6e0a9779bfd20f">Epid11BasicSignature</a>
+</li>
+<li>salpha
+: <a class="el" href="struct_epid11_basic_signature.html#a1a73fc922f69e2499643dd4c53d0d42d">Epid11BasicSignature</a>
+</li>
+<li>sb
+: <a class="el" href="struct_basic_signature.html#a91daebc5b577688afeed2a7ee7913245">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a29a700f3bec251600e18b2292081df4b">Epid11BasicSignature</a>
+</li>
+<li>sbeta
+: <a class="el" href="struct_epid11_basic_signature.html#afe28bad6328f81e6f7af011cc96ac2e5">Epid11BasicSignature</a>
+</li>
+<li>seed
+: <a class="el" href="struct_compressed_priv_key.html#a54b9af7699f517bbaef3d52d03e3fed8">CompressedPrivKey</a>
+</li>
+<li>sf
+: <a class="el" href="struct_basic_signature.html#a79d8dec8c5da176e497abf22e4c43adb">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#ae17b45194997a6fa13c6014a51ec711c">Epid11BasicSignature</a>
+</li>
+<li>sha256_digest
+: <a class="el" href="unionsha__digest.html#a2d79411c2115953d2c5fa50c176dda8d">sha_digest</a>
+</li>
+<li>sha256s
+: <a class="el" href="structtiny__sha.html#a40fd76fa2a0395295d4747ce2cb80888">tiny_sha</a>
+</li>
+<li>sha512_digest
+: <a class="el" href="unionsha__digest.html#a2c5fa88c4f65cc62d1839bd9a166b843">sha_digest</a>
+</li>
+<li>sha512s
+: <a class="el" href="structtiny__sha.html#a10addc820d663785aa5dd90c572bf953">tiny_sha</a>
+</li>
+<li>sha_state_t
+: <a class="el" href="structtiny__sha.html#a414a745937e610b84c0f6942470b531c">tiny_sha</a>
+</li>
+<li>sigma
+: <a class="el" href="struct_epid11_signature.html#abf24a8df563ba3f535486d8dad7384f4">Epid11Signature</a>
+, <a class="el" href="struct_epid_signature.html#a89d2e38223944310b6eeeadf6061a2dd">EpidSignature</a>
+</li>
+<li>sigma0
+: <a class="el" href="struct_epid11_signature.html#a48526e73f02ad3f1544c4c71c481f153">Epid11Signature</a>
+, <a class="el" href="struct_epid_signature.html#ab0fe5f98bff737fcfbfe0b4d658e83f2">EpidSignature</a>
+</li>
+<li>signature
+: <a class="el" href="struct_epid_ca_certificate.html#a2f8f09ae02919c379c38386668b47418">EpidCaCertificate</a>
+</li>
+<li>smu
+: <a class="el" href="struct_epid11_nr_proof.html#a1ad7fe6b32c09f2504ee49731c0ad145">Epid11NrProof</a>
+, <a class="el" href="struct_nr_proof.html#a717ec36a6c91acd01d9b642bb20fc178">NrProof</a>
+</li>
+<li>snu
+: <a class="el" href="struct_epid11_nr_proof.html#aa8406e938b2f87bded9e374e93a8ee5d">Epid11NrProof</a>
+, <a class="el" href="struct_nr_proof.html#ae2e9f22089793a4d44a0f7f5cdb78a0c">NrProof</a>
+</li>
+<li>sx
+: <a class="el" href="struct_basic_signature.html#a0e8ea6a2cd3af10e9b59d96d7d06bc69">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a2718346665210b7e26521bf4a15cb3bd">Epid11BasicSignature</a>
+</li>
+<li>sy
+: <a class="el" href="struct_epid11_basic_signature.html#a911441845fc9b82d514133371b5ba87c">Epid11BasicSignature</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_t.html b/doc/html/functions_t.html
new file mode 100644
index 0000000..e435f36
--- /dev/null
+++ b/doc/html/functions_t.html
@@ -0,0 +1,95 @@
+<!-- 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: Data Fields</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">6.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('functions_t.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
+<li>T
+: <a class="el" href="struct_basic_signature.html#a730f74d85cfb4fa4089d43c87b97a624">BasicSignature</a>
+, <a class="el" href="struct_epid11_nr_proof.html#a5ad9ba3bfac4eac37fd4a4e33ea65ddc">Epid11NrProof</a>
+</li>
+<li>t
+: <a class="el" href="struct_epid2_params.html#a200a0cba1c9e4ad512bece23f2461a5f">Epid2Params</a>
+</li>
+<li>T
+: <a class="el" href="struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3">NrProof</a>
+</li>
+<li>T1
+: <a class="el" href="struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b">Epid11BasicSignature</a>
+</li>
+<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>
+</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/functions_v.html b/doc/html/functions_v.html
new file mode 100644
index 0000000..183e950
--- /dev/null
+++ b/doc/html/functions_v.html
@@ -0,0 +1,85 @@
+<!-- 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: Data Fields</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">6.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('functions_v.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
+<li>version
+: <a class="el" href="struct_epid11_group_rl.html#a63afa9863e8dcb63ff884e6e4093c481">Epid11GroupRl</a>
+, <a class="el" href="struct_epid11_priv_rl.html#a2b3899f5a35bf64f860d6d91bccb03c8">Epid11PrivRl</a>
+, <a class="el" href="struct_epid11_sig_rl.html#aa38674729293f4879ff94328dd3c59b1">Epid11SigRl</a>
+, <a class="el" href="struct_group_rl.html#a69c41d99cdfc5b6ece7442f466f7ec3f">GroupRl</a>
+, <a class="el" href="struct_priv_rl.html#a4c6b51cec760f7e81ca8635422ac6a50">PrivRl</a>
+, <a class="el" href="struct_sig_rl.html#ac9d4c343c539dba799e1f42eb38b351f">SigRl</a>
+, <a class="el" href="struct_verifier_rl.html#afa44ab69ffff5a3508366aeb2131fdaa">VerifierRl</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars.html b/doc/html/functions_vars.html
index 7005ce0..41a11f4 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -80,405 +80,6 @@ $(document).ready(function(){initNavTree('functions_vars.html','');});
: <a class="el" href="struct_compressed_priv_key.html#a0b0535f0567eb0e48f799d27991d0f66">CompressedPrivKey</a>
</li>
</ul>
-
-
-<h3><a class="anchor" id="index_b"></a>- b -</h3><ul>
-<li>B
-: <a class="el" href="struct_basic_signature.html#ae90cb6af66b010ae39913f033c1e65ac">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a27fd7ae99d1ada652e21e7508a467c0b">Epid11BasicSignature</a>
-</li>
-<li>b
-: <a class="el" href="struct_epid11_params.html#a27b45ed7771a3024d1d059b4b4ff6eae">Epid11Params</a>
-, <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>
-, <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>
-</li>
-<li>b_tick
-: <a class="el" href="struct_epid11_params.html#ade3f88ce73d7de656ec67d9fdb0719d7">Epid11Params</a>
-</li>
-<li>beta
-: <a class="el" href="struct_epid2_params.html#ac2d7507c6f58c3451beacacb91b52695">Epid2Params</a>
-</li>
-<li>bk
-: <a class="el" href="struct_epid11_sig_rl.html#a6473f8a98f76c9f82183041ea5ae17e3">Epid11SigRl</a>
-, <a class="el" href="struct_sig_rl.html#ac23a919993d99d24a5150302f1778102">SigRl</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
-<li>c
-: <a class="el" href="struct_basic_signature.html#a4daa94db5068db3f10960f3dd178d603">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a9cc6efcd3d7270022779bd16776168ed">Epid11BasicSignature</a>
-, <a class="el" href="struct_epid11_nr_proof.html#a2e5ee8dc25d296538dce935397a93d68">Epid11NrProof</a>
-, <a class="el" href="struct_join_request.html#a55e30a274e83b808db6fbab5ae6c6cb8">JoinRequest</a>
-, <a class="el" href="struct_nr_proof.html#a0de1aa69acf3d93da34cf4a613b359a1">NrProof</a>
-</li>
-<li>coeff
-: <a class="el" href="struct_epid11_params.html#aacc39ebe0cc625321039ffb6be0b0e87">Epid11Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
-<li>data
-: <a class="el" href="struct_big_num_str.html#a442dcf33889b4f85c5b1228d2c8e6838">BigNumStr</a>
-, <a class="el" href="struct_ecdsa_private_key.html#a97efee9b4079f95d94a104f9a6d8c96d">EcdsaPrivateKey</a>
-, <a class="el" href="struct_fp_elem_str.html#a5ddb96a5567750f2834335851c906c45">FpElemStr</a>
-, <a class="el" href="struct_fq_elem_str.html#aac1a876b51a8d2c6d1510e4df2fd3f14">FqElemStr</a>
-, <a class="el" href="struct_oct_str128.html#a7482aa9b0b580fdd50bd65419d52d4b9">OctStr128</a>
-, <a class="el" href="struct_oct_str16.html#a86ed6671693a3f60ec4ff7de2c1206c3">OctStr16</a>
-, <a class="el" href="struct_oct_str256.html#a359781bb84f5717a16094583a00ef14e">OctStr256</a>
-, <a class="el" href="struct_oct_str32.html#a5588a7e70f3d73f6ce58b567a9f5c5c8">OctStr32</a>
-, <a class="el" href="struct_oct_str512.html#abd4d1b97fe49321571da86de1aeac653">OctStr512</a>
-, <a class="el" href="struct_oct_str600.html#a06d53af92a06e1decc6062fd16c43a59">OctStr600</a>
-, <a class="el" href="struct_oct_str64.html#a0e107d78192a5ae0b48ed9e5c4eab0fc">OctStr64</a>
-, <a class="el" href="struct_oct_str768.html#ae45eea89259bd22e60a8d960063921cc">OctStr768</a>
-, <a class="el" href="struct_oct_str80.html#af80e2b81554109d9a41c5e771aceb8c9">OctStr80</a>
-, <a class="el" href="struct_oct_str8.html#a5e6c56fda48c88b419e621b464b03bef">OctStr8</a>
-, <a class="el" href="struct_sha256_digest.html#a4b6462ddd3f89e4c40220ceb6b1c7f28">Sha256Digest</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
-<li>e12
-: <a class="el" href="struct_epid11_verifier_precomp.html#a0a980adb039089263ec59a995600ee91">Epid11VerifierPrecomp</a>
-, <a class="el" href="struct_member_precomp.html#a55e5c4b25c8f0f426969a8d745260fe5">MemberPrecomp</a>
-, <a class="el" href="struct_verifier_precomp.html#ad1106376f12772942af0331eb74de6e5">VerifierPrecomp</a>
-</li>
-<li>e22
-: <a class="el" href="struct_epid11_verifier_precomp.html#ad0ff2a13c2c87460296900dde72a2f30">Epid11VerifierPrecomp</a>
-, <a class="el" href="struct_member_precomp.html#a4e7412969bed3964f813b093b948e7b4">MemberPrecomp</a>
-, <a class="el" href="struct_verifier_precomp.html#af8fd90f3a5a2be932a97dcd86099d5b2">VerifierPrecomp</a>
-</li>
-<li>e2w
-: <a class="el" href="struct_epid11_verifier_precomp.html#a14ebadf105aff085edb9a817a2d1db89">Epid11VerifierPrecomp</a>
-, <a class="el" href="struct_member_precomp.html#a879d5a7b0c30088b23f6e5c5fc62f834">MemberPrecomp</a>
-, <a class="el" href="struct_verifier_precomp.html#a8caf79578e3c0baf91921460391103ca">VerifierPrecomp</a>
-</li>
-<li>ea2
-: <a class="el" href="struct_member_precomp.html#a573551f6494e372f44fd3bdf5b02aeda">MemberPrecomp</a>
-</li>
-<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>
-</ul>
-
-
-<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
-<li>f
-: <a class="el" href="struct_epid11_priv_rl.html#abbb75fee81aecb2dde7e2daab895ad3b">Epid11PrivRl</a>
-</li>
-<li>F
-: <a class="el" href="struct_join_request.html#a005651506fd4511e8a3537f6c3634532">JoinRequest</a>
-</li>
-<li>f
-: <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
-: <a class="el" href="struct_epid_file_header.html#af5d48c739cc6c00c6e1ce35abf4f1473">EpidFileHeader</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
-<li>g1
-: <a class="el" href="struct_epid11_params.html#a835e70da717cd5b0c94e242a6418a287">Epid11Params</a>
-, <a class="el" href="struct_epid2_params.html#a4c5195b4fa9393a07a121336202531ad">Epid2Params</a>
-</li>
-<li>g2
-: <a class="el" href="struct_epid11_params.html#a1c6bbc4e066449d9c329f88cb653ef7c">Epid11Params</a>
-, <a class="el" href="struct_epid2_params.html#a609b0aac17fca34fe39bee29676a9618">Epid2Params</a>
-</li>
-<li>g3
-: <a class="el" href="struct_epid11_params.html#a7eb9a1371d7187ae81bccfa8d5595033">Epid11Params</a>
-</li>
-<li>gamma
-: <a class="el" href="struct_i_priv_key.html#a6d484175317aef09fb959c3ca55fc70a">IPrivKey</a>
-</li>
-<li>gid
-: <a class="el" href="struct_compressed_priv_key.html#ac6689899f1d9a6a8c5e4915563679840">CompressedPrivKey</a>
-, <a class="el" href="struct_epid11_group_pub_key.html#a964344b3c595bdd585bb9b5d9d0ea762">Epid11GroupPubKey</a>
-, <a class="el" href="struct_epid11_group_rl.html#a97f165c59bc447e3ca3c2148a096710f">Epid11GroupRl</a>
-, <a class="el" href="struct_epid11_priv_rl.html#aa8945d81e30674b52a6d0900b64feb3c">Epid11PrivRl</a>
-, <a class="el" href="struct_epid11_sig_rl.html#ad45b0e3e1be59649150dd34c104000ac">Epid11SigRl</a>
-, <a class="el" href="struct_epid11_verifier_precomp.html#a03138e937f4488bdbc52ed473dc313da">Epid11VerifierPrecomp</a>
-, <a class="el" href="struct_group_pub_key.html#ae8e77ab4d5eb3c8e566c24a64cce56ee">GroupPubKey</a>
-, <a class="el" href="struct_group_rl.html#a51022e172ab8b945efc69f1e63170107">GroupRl</a>
-, <a class="el" href="struct_i_priv_key.html#ad400a4237b6d50855538fd40580eb1bb">IPrivKey</a>
-, <a class="el" href="struct_membership_credential.html#afbff64ec55888c7e2a658eabb5e16671">MembershipCredential</a>
-, <a class="el" href="struct_priv_key.html#ab416dcb4366427c24b44c2a02e4ae7c8">PrivKey</a>
-, <a class="el" href="struct_priv_rl.html#af7317529b8e55476bd06b66ed8131d64">PrivRl</a>
-, <a class="el" href="struct_sig_rl.html#a12757d30fcccd310716433948e0b603e">SigRl</a>
-, <a class="el" href="struct_verifier_precomp.html#afc3e29a325c95c62bb192d5f8cdd5c1c">VerifierPrecomp</a>
-, <a class="el" href="struct_verifier_rl.html#ab85c4666d16145ff16443e84468d2d7d">VerifierRl</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
-<li>h
-: <a class="el" href="struct_epid11_params.html#ae2d1dc635d9d7cba496c3d64fb6f9d5b">Epid11Params</a>
-</li>
-<li>h1
-: <a class="el" href="struct_epid11_group_pub_key.html#a36f688472e2655052d485eac67d8c362">Epid11GroupPubKey</a>
-, <a class="el" href="struct_group_pub_key.html#a8c22c758ea186f95e3bf4b2ef8451da5">GroupPubKey</a>
-</li>
-<li>h2
-: <a class="el" href="struct_epid11_group_pub_key.html#aa724e9d2f0cb6019c05547d76a13b72a">Epid11GroupPubKey</a>
-, <a class="el" href="struct_group_pub_key.html#a2a4320ec99fd1a15df412fbf2a8d49f1">GroupPubKey</a>
-</li>
-<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>
-</ul>
-
-
-<h3><a class="anchor" id="index_k"></a>- k -</h3><ul>
-<li>K
-: <a class="el" href="struct_basic_signature.html#a0078cc83ecf6c7e31f96b7d44aa60e21">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a5882fcbfd272774e12e50a2d77f0b139">Epid11BasicSignature</a>
-</li>
-<li>k
-: <a class="el" href="struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a">Epid11SigRlEntry</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>
-
-
-<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
-<li>n1
-: <a class="el" href="struct_epid11_priv_rl.html#ad95f880f40e2f40c723f5bdbd22ecfa2">Epid11PrivRl</a>
-, <a class="el" href="struct_priv_rl.html#a6da9639ec4061689d1c30a58e0befd14">PrivRl</a>
-</li>
-<li>n2
-: <a class="el" href="struct_epid11_signature.html#ad25c277223a5210063163ea554d08ad4">Epid11Signature</a>
-, <a class="el" href="struct_epid11_sig_rl.html#a8c654d43df132db7874f4c84c177dc12">Epid11SigRl</a>
-, <a class="el" href="struct_epid_signature.html#a62a6b0ffcd5f68dd3d2786a58fe43017">EpidSignature</a>
-, <a class="el" href="struct_sig_rl.html#a9dfb6b508db9051f4dc480a51d702af2">SigRl</a>
-</li>
-<li>n3
-: <a class="el" href="struct_epid11_group_rl.html#a35cb954f598d4006b0f047cde77010a5">Epid11GroupRl</a>
-, <a class="el" href="struct_group_rl.html#a9067f01c63cdefbc8e23c3cf67a10172">GroupRl</a>
-</li>
-<li>n4
-: <a class="el" href="struct_verifier_rl.html#a1e3f84b873bccc0c882aa6432c42d2f7">VerifierRl</a>
-</li>
-<li>nd
-: <a class="el" href="struct_epid11_basic_signature.html#af18200712d2cf3ed3ccaee328e8a4e0f">Epid11BasicSignature</a>
-</li>
-<li>neg
-: <a class="el" href="struct_epid2_params.html#af23f07fb0e1745c0ad14aceeaa946928">Epid2Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
-<li>orderG2
-: <a class="el" href="struct_epid11_params.html#a02bd6fa2ab256e3a07533e947ab0101e">Epid11Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
-<li>p
-: <a class="el" href="struct_epid11_params.html#a2aa4d8a2ebe0dfeb6d930fd7b39f9d1a">Epid11Params</a>
-, <a class="el" href="struct_epid2_params.html#ac0e0dad45b10927860cd5fa4f8101f08">Epid2Params</a>
-</li>
-<li>p_tick
-: <a class="el" href="struct_epid11_params.html#a77a8350b97a7afb584a46eb5b32f03bf">Epid11Params</a>
-</li>
-<li>prime
-: <a class="el" href="struct_epid_ca_certificate.html#a3a44e8050ca2f5085652b2b4e15b779c">EpidCaCertificate</a>
-</li>
-<li>pubkey
-: <a class="el" href="struct_epid_ca_certificate.html#a9d2fc21f46cf9fc96e2ea557b70e5356">EpidCaCertificate</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_q"></a>- q -</h3><ul>
-<li>q
-: <a class="el" href="struct_epid11_params.html#aad03fd1cc3955bb8879535fa7298123f">Epid11Params</a>
-, <a class="el" href="struct_epid2_params.html#a023603228fed2854ddae2e228938940f">Epid2Params</a>
-</li>
-<li>q_tick
-: <a class="el" href="struct_epid11_params.html#a49462f35596d07a456a731d0690fdd83">Epid11Params</a>
-</li>
-<li>qnr
-: <a class="el" href="struct_epid11_params.html#af22cfcd6c7ec0e7e7369b79554b963bd">Epid11Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
-<li>r
-: <a class="el" href="struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2">EpidCaCertificate</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>
-
-
-<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
-<li>s
-: <a class="el" href="struct_join_request.html#a73bf8989df5f90eb3d06e7a42ad74d1d">JoinRequest</a>
-</li>
-<li>sa
-: <a class="el" href="struct_basic_signature.html#a69115a4776d15b48411dd6c3a76d0f3d">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#aeb221cf52bc2b1a9bf6e0a9779bfd20f">Epid11BasicSignature</a>
-</li>
-<li>salpha
-: <a class="el" href="struct_epid11_basic_signature.html#a1a73fc922f69e2499643dd4c53d0d42d">Epid11BasicSignature</a>
-</li>
-<li>sb
-: <a class="el" href="struct_basic_signature.html#a91daebc5b577688afeed2a7ee7913245">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a29a700f3bec251600e18b2292081df4b">Epid11BasicSignature</a>
-</li>
-<li>sbeta
-: <a class="el" href="struct_epid11_basic_signature.html#afe28bad6328f81e6f7af011cc96ac2e5">Epid11BasicSignature</a>
-</li>
-<li>seed
-: <a class="el" href="struct_compressed_priv_key.html#a54b9af7699f517bbaef3d52d03e3fed8">CompressedPrivKey</a>
-</li>
-<li>sf
-: <a class="el" href="struct_basic_signature.html#a79d8dec8c5da176e497abf22e4c43adb">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#ae17b45194997a6fa13c6014a51ec711c">Epid11BasicSignature</a>
-</li>
-<li>sigma
-: <a class="el" href="struct_epid11_signature.html#abf24a8df563ba3f535486d8dad7384f4">Epid11Signature</a>
-, <a class="el" href="struct_epid_signature.html#a89d2e38223944310b6eeeadf6061a2dd">EpidSignature</a>
-</li>
-<li>sigma0
-: <a class="el" href="struct_epid11_signature.html#a48526e73f02ad3f1544c4c71c481f153">Epid11Signature</a>
-, <a class="el" href="struct_epid_signature.html#ab0fe5f98bff737fcfbfe0b4d658e83f2">EpidSignature</a>
-</li>
-<li>signature
-: <a class="el" href="struct_epid_ca_certificate.html#a2f8f09ae02919c379c38386668b47418">EpidCaCertificate</a>
-</li>
-<li>smu
-: <a class="el" href="struct_epid11_nr_proof.html#a1ad7fe6b32c09f2504ee49731c0ad145">Epid11NrProof</a>
-, <a class="el" href="struct_nr_proof.html#a717ec36a6c91acd01d9b642bb20fc178">NrProof</a>
-</li>
-<li>snu
-: <a class="el" href="struct_epid11_nr_proof.html#aa8406e938b2f87bded9e374e93a8ee5d">Epid11NrProof</a>
-, <a class="el" href="struct_nr_proof.html#ae2e9f22089793a4d44a0f7f5cdb78a0c">NrProof</a>
-</li>
-<li>sx
-: <a class="el" href="struct_basic_signature.html#a0e8ea6a2cd3af10e9b59d96d7d06bc69">BasicSignature</a>
-, <a class="el" href="struct_epid11_basic_signature.html#a2718346665210b7e26521bf4a15cb3bd">Epid11BasicSignature</a>
-</li>
-<li>sy
-: <a class="el" href="struct_epid11_basic_signature.html#a911441845fc9b82d514133371b5ba87c">Epid11BasicSignature</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
-<li>T
-: <a class="el" href="struct_basic_signature.html#a730f74d85cfb4fa4089d43c87b97a624">BasicSignature</a>
-, <a class="el" href="struct_epid11_nr_proof.html#a5ad9ba3bfac4eac37fd4a4e33ea65ddc">Epid11NrProof</a>
-</li>
-<li>t
-: <a class="el" href="struct_epid2_params.html#a200a0cba1c9e4ad512bece23f2461a5f">Epid2Params</a>
-</li>
-<li>T
-: <a class="el" href="struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3">NrProof</a>
-</li>
-<li>T1
-: <a class="el" href="struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b">Epid11BasicSignature</a>
-</li>
-<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>
-
-
-<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
-<li>version
-: <a class="el" href="struct_epid11_group_rl.html#a63afa9863e8dcb63ff884e6e4093c481">Epid11GroupRl</a>
-, <a class="el" href="struct_epid11_priv_rl.html#a2b3899f5a35bf64f860d6d91bccb03c8">Epid11PrivRl</a>
-, <a class="el" href="struct_epid11_sig_rl.html#aa38674729293f4879ff94328dd3c59b1">Epid11SigRl</a>
-, <a class="el" href="struct_group_rl.html#a69c41d99cdfc5b6ece7442f466f7ec3f">GroupRl</a>
-, <a class="el" href="struct_priv_rl.html#a4c6b51cec760f7e81ca8635422ac6a50">PrivRl</a>
-, <a class="el" href="struct_sig_rl.html#ac9d4c343c539dba799e1f42eb38b351f">SigRl</a>
-, <a class="el" href="struct_verifier_rl.html#afa44ab69ffff5a3508366aeb2131fdaa">VerifierRl</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_w"></a>- w -</h3><ul>
-<li>w
-: <a class="el" href="struct_epid11_group_pub_key.html#a056c7138246e2bdcd47eaad501b756bb">Epid11GroupPubKey</a>
-, <a class="el" href="struct_group_pub_key.html#a86be439104fb60b324784baf24a943f9">GroupPubKey</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_x"></a>- x -</h3><ul>
-<li>x
-: <a class="el" href="struct_ecdsa_public_key.html#a37c51614faf022eec491b4de8f3a13e1">EcdsaPublicKey</a>
-, <a class="el" href="struct_ecdsa_signature.html#a64b623605a55a267a36df18f29142d0d">EcdsaSignature</a>
-, <a class="el" href="struct_epid11_g2_elem_str.html#af28558484298f4f56377ededf57a4a04">Epid11G2ElemStr</a>
-, <a class="el" href="struct_epid_ca_certificate.html#a4f77996f90ed7da1d0503c4236b2c9d1">EpidCaCertificate</a>
-, <a class="el" href="struct_g1_elem_str.html#a3b0e658d6e5697763ad9c633c11d4ec4">G1ElemStr</a>
-, <a class="el" href="struct_g2_elem_str.html#a145ec5b20a6f4f00b080e11c8680afc3">G2ElemStr</a>
-, <a class="el" href="struct_gt_elem_str.html#aeaeb0e9e1c6efd378a475eb9a6c42132">GtElemStr</a>
-, <a class="el" href="struct_membership_credential.html#a2c5c0d22999d6917fea5ad6618883bcf">MembershipCredential</a>
-, <a class="el" href="struct_priv_key.html#aa805f9e124f05bdb733c85cb93614cbd">PrivKey</a>
-</li>
-<li>xi
-: <a class="el" href="struct_epid2_params.html#ae1d8f5d6036a82064e91bc137b278e74">Epid2Params</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_y"></a>- y -</h3><ul>
-<li>y
-: <a class="el" href="struct_ecdsa_public_key.html#a4503c4613386cbc78add1dc245c99284">EcdsaPublicKey</a>
-, <a class="el" href="struct_ecdsa_signature.html#a2efd6bf37b12f35135bf325fa491b029">EcdsaSignature</a>
-, <a class="el" href="struct_epid11_g2_elem_str.html#a9e8984e479bcbe8bd36c65e80c340032">Epid11G2ElemStr</a>
-, <a class="el" href="struct_epid_ca_certificate.html#abd69cce8d5e3940787ee0d17f72184ab">EpidCaCertificate</a>
-, <a class="el" href="struct_g1_elem_str.html#a8f2455ca314e885ea180dadf84bf27c3">G1ElemStr</a>
-, <a class="el" href="struct_g2_elem_str.html#a43141b2458aecceed8ee2748270f7908">G2ElemStr</a>
-</li>
-</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/functions_vars_b.html b/doc/html/functions_vars_b.html
new file mode 100644
index 0000000..fe9972e
--- /dev/null
+++ b/doc/html/functions_vars_b.html
@@ -0,0 +1,100 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_b.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_b"></a>- b -</h3><ul>
+<li>B
+: <a class="el" href="struct_basic_signature.html#ae90cb6af66b010ae39913f033c1e65ac">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a27fd7ae99d1ada652e21e7508a467c0b">Epid11BasicSignature</a>
+</li>
+<li>b
+: <a class="el" href="struct_epid11_params.html#a27b45ed7771a3024d1d059b4b4ff6eae">Epid11Params</a>
+, <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>
+, <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>
+</li>
+<li>b_tick
+: <a class="el" href="struct_epid11_params.html#ade3f88ce73d7de656ec67d9fdb0719d7">Epid11Params</a>
+</li>
+<li>beta
+: <a class="el" href="struct_epid2_params.html#ac2d7507c6f58c3451beacacb91b52695">Epid2Params</a>
+</li>
+<li>bk
+: <a class="el" href="struct_epid11_sig_rl.html#a6473f8a98f76c9f82183041ea5ae17e3">Epid11SigRl</a>
+, <a class="el" href="struct_sig_rl.html#ac23a919993d99d24a5150302f1778102">SigRl</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_c.html b/doc/html/functions_vars_c.html
new file mode 100644
index 0000000..e466157
--- /dev/null
+++ b/doc/html/functions_vars_c.html
@@ -0,0 +1,86 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_c.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_c"></a>- c -</h3><ul>
+<li>c
+: <a class="el" href="struct_basic_signature.html#a4daa94db5068db3f10960f3dd178d603">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a9cc6efcd3d7270022779bd16776168ed">Epid11BasicSignature</a>
+, <a class="el" href="struct_epid11_nr_proof.html#a2e5ee8dc25d296538dce935397a93d68">Epid11NrProof</a>
+, <a class="el" href="struct_join_request.html#a55e30a274e83b808db6fbab5ae6c6cb8">JoinRequest</a>
+, <a class="el" href="struct_nr_proof.html#a0de1aa69acf3d93da34cf4a613b359a1">NrProof</a>
+</li>
+<li>coeff
+: <a class="el" href="struct_epid11_params.html#aacc39ebe0cc625321039ffb6be0b0e87">Epid11Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_d.html b/doc/html/functions_vars_d.html
new file mode 100644
index 0000000..796ea86
--- /dev/null
+++ b/doc/html/functions_vars_d.html
@@ -0,0 +1,96 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_d.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
+<li>data
+: <a class="el" href="struct_big_num_str.html#a442dcf33889b4f85c5b1228d2c8e6838">BigNumStr</a>
+, <a class="el" href="struct_ecdsa_private_key.html#a97efee9b4079f95d94a104f9a6d8c96d">EcdsaPrivateKey</a>
+, <a class="el" href="struct_fp_elem_str.html#a5ddb96a5567750f2834335851c906c45">FpElemStr</a>
+, <a class="el" href="struct_fq_elem_str.html#aac1a876b51a8d2c6d1510e4df2fd3f14">FqElemStr</a>
+, <a class="el" href="struct_oct_str128.html#a7482aa9b0b580fdd50bd65419d52d4b9">OctStr128</a>
+, <a class="el" href="struct_oct_str16.html#a86ed6671693a3f60ec4ff7de2c1206c3">OctStr16</a>
+, <a class="el" href="struct_oct_str256.html#a359781bb84f5717a16094583a00ef14e">OctStr256</a>
+, <a class="el" href="struct_oct_str32.html#a5588a7e70f3d73f6ce58b567a9f5c5c8">OctStr32</a>
+, <a class="el" href="struct_oct_str512.html#abd4d1b97fe49321571da86de1aeac653">OctStr512</a>
+, <a class="el" href="struct_oct_str600.html#a06d53af92a06e1decc6062fd16c43a59">OctStr600</a>
+, <a class="el" href="struct_oct_str64.html#a0e107d78192a5ae0b48ed9e5c4eab0fc">OctStr64</a>
+, <a class="el" href="struct_oct_str768.html#ae45eea89259bd22e60a8d960063921cc">OctStr768</a>
+, <a class="el" href="struct_oct_str80.html#af80e2b81554109d9a41c5e771aceb8c9">OctStr80</a>
+, <a class="el" href="struct_oct_str8.html#a5e6c56fda48c88b419e621b464b03bef">OctStr8</a>
+, <a class="el" href="struct_sha256_digest.html#a4b6462ddd3f89e4c40220ceb6b1c7f28">Sha256Digest</a>
+</li>
+<li>digest
+: <a class="el" href="unionsha__digest.html#a182db3a17879fc1fb95c018044533060">sha_digest</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_e.html b/doc/html/functions_vars_e.html
new file mode 100644
index 0000000..fa701b8
--- /dev/null
+++ b/doc/html/functions_vars_e.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: Data Fields - Variables</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">6.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('functions_vars_e.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
+<li>e12
+: <a class="el" href="struct_epid11_verifier_precomp.html#a0a980adb039089263ec59a995600ee91">Epid11VerifierPrecomp</a>
+, <a class="el" href="struct_member_precomp.html#a55e5c4b25c8f0f426969a8d745260fe5">MemberPrecomp</a>
+, <a class="el" href="struct_verifier_precomp.html#ad1106376f12772942af0331eb74de6e5">VerifierPrecomp</a>
+</li>
+<li>e22
+: <a class="el" href="struct_epid11_verifier_precomp.html#ad0ff2a13c2c87460296900dde72a2f30">Epid11VerifierPrecomp</a>
+, <a class="el" href="struct_member_precomp.html#a4e7412969bed3964f813b093b948e7b4">MemberPrecomp</a>
+, <a class="el" href="struct_verifier_precomp.html#af8fd90f3a5a2be932a97dcd86099d5b2">VerifierPrecomp</a>
+</li>
+<li>e2w
+: <a class="el" href="struct_epid11_verifier_precomp.html#a14ebadf105aff085edb9a817a2d1db89">Epid11VerifierPrecomp</a>
+, <a class="el" href="struct_member_precomp.html#a879d5a7b0c30088b23f6e5c5fc62f834">MemberPrecomp</a>
+, <a class="el" href="struct_verifier_precomp.html#a8caf79578e3c0baf91921460391103ca">VerifierPrecomp</a>
+</li>
+<li>ea2
+: <a class="el" href="struct_member_precomp.html#a573551f6494e372f44fd3bdf5b02aeda">MemberPrecomp</a>
+</li>
+<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>
+</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_f.html b/doc/html/functions_vars_f.html
new file mode 100644
index 0000000..3a20053
--- /dev/null
+++ b/doc/html/functions_vars_f.html
@@ -0,0 +1,90 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_f.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
+<li>f
+: <a class="el" href="struct_epid11_priv_rl.html#abbb75fee81aecb2dde7e2daab895ad3b">Epid11PrivRl</a>
+</li>
+<li>F
+: <a class="el" href="struct_join_request.html#a005651506fd4511e8a3537f6c3634532">JoinRequest</a>
+</li>
+<li>f
+: <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
+: <a class="el" href="struct_epid_file_header.html#af5d48c739cc6c00c6e1ce35abf4f1473">EpidFileHeader</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_g.html b/doc/html/functions_vars_g.html
new file mode 100644
index 0000000..594a59c
--- /dev/null
+++ b/doc/html/functions_vars_g.html
@@ -0,0 +1,110 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_g.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_g"></a>- g -</h3><ul>
+<li>g
+: <a class="el" href="struct_pairing_state.html#a0e19d5e16a81645aca678e04b88758da">PairingState</a>
+</li>
+<li>g1
+: <a class="el" href="struct_epid11_params.html#a835e70da717cd5b0c94e242a6418a287">Epid11Params</a>
+, <a class="el" href="struct_epid2_params.html#a4c5195b4fa9393a07a121336202531ad">Epid2Params</a>
+</li>
+<li>g2
+: <a class="el" href="struct_epid11_params.html#a1c6bbc4e066449d9c329f88cb653ef7c">Epid11Params</a>
+, <a class="el" href="struct_epid2_params.html#a609b0aac17fca34fe39bee29676a9618">Epid2Params</a>
+</li>
+<li>g3
+: <a class="el" href="struct_epid11_params.html#a7eb9a1371d7187ae81bccfa8d5595033">Epid11Params</a>
+</li>
+<li>gamma
+: <a class="el" href="struct_i_priv_key.html#a6d484175317aef09fb959c3ca55fc70a">IPrivKey</a>
+</li>
+<li>gid
+: <a class="el" href="struct_compressed_priv_key.html#ac6689899f1d9a6a8c5e4915563679840">CompressedPrivKey</a>
+, <a class="el" href="struct_epid11_group_pub_key.html#a964344b3c595bdd585bb9b5d9d0ea762">Epid11GroupPubKey</a>
+, <a class="el" href="struct_epid11_group_rl.html#a97f165c59bc447e3ca3c2148a096710f">Epid11GroupRl</a>
+, <a class="el" href="struct_epid11_priv_rl.html#aa8945d81e30674b52a6d0900b64feb3c">Epid11PrivRl</a>
+, <a class="el" href="struct_epid11_sig_rl.html#ad45b0e3e1be59649150dd34c104000ac">Epid11SigRl</a>
+, <a class="el" href="struct_epid11_verifier_precomp.html#a03138e937f4488bdbc52ed473dc313da">Epid11VerifierPrecomp</a>
+, <a class="el" href="struct_group_pub_key.html#ae8e77ab4d5eb3c8e566c24a64cce56ee">GroupPubKey</a>
+, <a class="el" href="struct_group_rl.html#a51022e172ab8b945efc69f1e63170107">GroupRl</a>
+, <a class="el" href="struct_i_priv_key.html#ad400a4237b6d50855538fd40580eb1bb">IPrivKey</a>
+, <a class="el" href="struct_membership_credential.html#afbff64ec55888c7e2a658eabb5e16671">MembershipCredential</a>
+, <a class="el" href="struct_priv_key.html#ab416dcb4366427c24b44c2a02e4ae7c8">PrivKey</a>
+, <a class="el" href="struct_priv_rl.html#af7317529b8e55476bd06b66ed8131d64">PrivRl</a>
+, <a class="el" href="struct_sig_rl.html#a12757d30fcccd310716433948e0b603e">SigRl</a>
+, <a class="el" href="struct_verifier_precomp.html#afc3e29a325c95c62bb192d5f8cdd5c1c">VerifierPrecomp</a>
+, <a class="el" href="struct_verifier_rl.html#ab85c4666d16145ff16443e84468d2d7d">VerifierRl</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_h.html b/doc/html/functions_vars_h.html
new file mode 100644
index 0000000..d4863eb
--- /dev/null
+++ b/doc/html/functions_vars_h.html
@@ -0,0 +1,97 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_h.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
+<li>h
+: <a class="el" href="struct_epid11_params.html#ae2d1dc635d9d7cba496c3d64fb6f9d5b">Epid11Params</a>
+</li>
+<li>h1
+: <a class="el" href="struct_epid11_group_pub_key.html#a36f688472e2655052d485eac67d8c362">Epid11GroupPubKey</a>
+, <a class="el" href="struct_group_pub_key.html#a8c22c758ea186f95e3bf4b2ef8451da5">GroupPubKey</a>
+</li>
+<li>h2
+: <a class="el" href="struct_epid11_group_pub_key.html#aa724e9d2f0cb6019c05547d76a13b72a">Epid11GroupPubKey</a>
+, <a class="el" href="struct_group_pub_key.html#a2a4320ec99fd1a15df412fbf2a8d49f1">GroupPubKey</a>
+</li>
+<li>h_tick
+: <a class="el" href="struct_epid11_params.html#a0fe238db4ebc0225899dc2dac97d11c0">Epid11Params</a>
+</li>
+<li>hash_alg
+: <a class="el" href="structtiny__sha.html#acc38b88204bd86b40f1f1de557b247c4">tiny_sha</a>
+, <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>
+</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_k.html b/doc/html/functions_vars_k.html
new file mode 100644
index 0000000..d4a8099
--- /dev/null
+++ b/doc/html/functions_vars_k.html
@@ -0,0 +1,90 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_k.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_k"></a>- k -</h3><ul>
+<li>K
+: <a class="el" href="struct_basic_signature.html#a0078cc83ecf6c7e31f96b7d44aa60e21">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a5882fcbfd272774e12e50a2d77f0b139">Epid11BasicSignature</a>
+</li>
+<li>k
+: <a class="el" href="struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a">Epid11SigRlEntry</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>
+</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/functions_vars_l.html b/doc/html/functions_vars_l.html
new file mode 100644
index 0000000..5d8cf43
--- /dev/null
+++ b/doc/html/functions_vars_l.html
@@ -0,0 +1,80 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_l.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_l"></a>- l -</h3><ul>
+<li>limbs
+: <a class="el" href="struct_fp_elem.html#a755a581a230c169e36985fb0301f2a28">FpElem</a>
+, <a class="el" href="struct_fq_elem.html#ad7d9feb0b777d58abfa9a31d6ddc466f">FqElem</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_n.html b/doc/html/functions_vars_n.html
new file mode 100644
index 0000000..ad7d2a9
--- /dev/null
+++ b/doc/html/functions_vars_n.html
@@ -0,0 +1,99 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_n.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
+<li>n1
+: <a class="el" href="struct_epid11_priv_rl.html#ad95f880f40e2f40c723f5bdbd22ecfa2">Epid11PrivRl</a>
+, <a class="el" href="struct_priv_rl.html#a6da9639ec4061689d1c30a58e0befd14">PrivRl</a>
+</li>
+<li>n2
+: <a class="el" href="struct_epid11_signature.html#ad25c277223a5210063163ea554d08ad4">Epid11Signature</a>
+, <a class="el" href="struct_epid11_sig_rl.html#a8c654d43df132db7874f4c84c177dc12">Epid11SigRl</a>
+, <a class="el" href="struct_epid_signature.html#a62a6b0ffcd5f68dd3d2786a58fe43017">EpidSignature</a>
+, <a class="el" href="struct_sig_rl.html#a9dfb6b508db9051f4dc480a51d702af2">SigRl</a>
+</li>
+<li>n3
+: <a class="el" href="struct_epid11_group_rl.html#a35cb954f598d4006b0f047cde77010a5">Epid11GroupRl</a>
+, <a class="el" href="struct_group_rl.html#a9067f01c63cdefbc8e23c3cf67a10172">GroupRl</a>
+</li>
+<li>n4
+: <a class="el" href="struct_verifier_rl.html#a1e3f84b873bccc0c882aa6432c42d2f7">VerifierRl</a>
+</li>
+<li>nd
+: <a class="el" href="struct_epid11_basic_signature.html#af18200712d2cf3ed3ccaee328e8a4e0f">Epid11BasicSignature</a>
+</li>
+<li>neg
+: <a class="el" href="struct_epid2_params.html#af23f07fb0e1745c0ad14aceeaa946928">Epid2Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_o.html b/doc/html/functions_vars_o.html
new file mode 100644
index 0000000..0f8ba9a
--- /dev/null
+++ b/doc/html/functions_vars_o.html
@@ -0,0 +1,79 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_o.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_o"></a>- o -</h3><ul>
+<li>orderG2
+: <a class="el" href="struct_epid11_params.html#a02bd6fa2ab256e3a07533e947ab0101e">Epid11Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_p.html b/doc/html/functions_vars_p.html
new file mode 100644
index 0000000..d68dc5f
--- /dev/null
+++ b/doc/html/functions_vars_p.html
@@ -0,0 +1,89 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_p.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
+<li>p
+: <a class="el" href="struct_epid11_params.html#a2aa4d8a2ebe0dfeb6d930fd7b39f9d1a">Epid11Params</a>
+, <a class="el" href="struct_epid2_params.html#ac0e0dad45b10927860cd5fa4f8101f08">Epid2Params</a>
+</li>
+<li>p_tick
+: <a class="el" href="struct_epid11_params.html#a77a8350b97a7afb584a46eb5b32f03bf">Epid11Params</a>
+</li>
+<li>prime
+: <a class="el" href="struct_epid_ca_certificate.html#a3a44e8050ca2f5085652b2b4e15b779c">EpidCaCertificate</a>
+</li>
+<li>pubkey
+: <a class="el" href="struct_epid_ca_certificate.html#a9d2fc21f46cf9fc96e2ea557b70e5356">EpidCaCertificate</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_q.html b/doc/html/functions_vars_q.html
new file mode 100644
index 0000000..02311f7
--- /dev/null
+++ b/doc/html/functions_vars_q.html
@@ -0,0 +1,86 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_q.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_q"></a>- q -</h3><ul>
+<li>q
+: <a class="el" href="struct_epid11_params.html#aad03fd1cc3955bb8879535fa7298123f">Epid11Params</a>
+, <a class="el" href="struct_epid2_params.html#a023603228fed2854ddae2e228938940f">Epid2Params</a>
+</li>
+<li>q_tick
+: <a class="el" href="struct_epid11_params.html#a49462f35596d07a456a731d0690fdd83">Epid11Params</a>
+</li>
+<li>qnr
+: <a class="el" href="struct_epid11_params.html#af22cfcd6c7ec0e7e7369b79554b963bd">Epid11Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_r.html b/doc/html/functions_vars_r.html
new file mode 100644
index 0000000..e12f4ac
--- /dev/null
+++ b/doc/html/functions_vars_r.html
@@ -0,0 +1,89 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_r.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
+<li>r
+: <a class="el" href="struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2">EpidCaCertificate</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>
+</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/functions_vars_s.html b/doc/html/functions_vars_s.html
new file mode 100644
index 0000000..3006e95
--- /dev/null
+++ b/doc/html/functions_vars_s.html
@@ -0,0 +1,141 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_s.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
+<li>s
+: <a class="el" href="struct_join_request.html#a73bf8989df5f90eb3d06e7a42ad74d1d">JoinRequest</a>
+</li>
+<li>sa
+: <a class="el" href="struct_basic_signature.html#a69115a4776d15b48411dd6c3a76d0f3d">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#aeb221cf52bc2b1a9bf6e0a9779bfd20f">Epid11BasicSignature</a>
+</li>
+<li>salpha
+: <a class="el" href="struct_epid11_basic_signature.html#a1a73fc922f69e2499643dd4c53d0d42d">Epid11BasicSignature</a>
+</li>
+<li>sb
+: <a class="el" href="struct_basic_signature.html#a91daebc5b577688afeed2a7ee7913245">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a29a700f3bec251600e18b2292081df4b">Epid11BasicSignature</a>
+</li>
+<li>sbeta
+: <a class="el" href="struct_epid11_basic_signature.html#afe28bad6328f81e6f7af011cc96ac2e5">Epid11BasicSignature</a>
+</li>
+<li>seed
+: <a class="el" href="struct_compressed_priv_key.html#a54b9af7699f517bbaef3d52d03e3fed8">CompressedPrivKey</a>
+</li>
+<li>sf
+: <a class="el" href="struct_basic_signature.html#a79d8dec8c5da176e497abf22e4c43adb">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#ae17b45194997a6fa13c6014a51ec711c">Epid11BasicSignature</a>
+</li>
+<li>sha256_digest
+: <a class="el" href="unionsha__digest.html#a2d79411c2115953d2c5fa50c176dda8d">sha_digest</a>
+</li>
+<li>sha256s
+: <a class="el" href="structtiny__sha.html#a40fd76fa2a0395295d4747ce2cb80888">tiny_sha</a>
+</li>
+<li>sha512_digest
+: <a class="el" href="unionsha__digest.html#a2c5fa88c4f65cc62d1839bd9a166b843">sha_digest</a>
+</li>
+<li>sha512s
+: <a class="el" href="structtiny__sha.html#a10addc820d663785aa5dd90c572bf953">tiny_sha</a>
+</li>
+<li>sha_state_t
+: <a class="el" href="structtiny__sha.html#a414a745937e610b84c0f6942470b531c">tiny_sha</a>
+</li>
+<li>sigma
+: <a class="el" href="struct_epid11_signature.html#abf24a8df563ba3f535486d8dad7384f4">Epid11Signature</a>
+, <a class="el" href="struct_epid_signature.html#a89d2e38223944310b6eeeadf6061a2dd">EpidSignature</a>
+</li>
+<li>sigma0
+: <a class="el" href="struct_epid11_signature.html#a48526e73f02ad3f1544c4c71c481f153">Epid11Signature</a>
+, <a class="el" href="struct_epid_signature.html#ab0fe5f98bff737fcfbfe0b4d658e83f2">EpidSignature</a>
+</li>
+<li>signature
+: <a class="el" href="struct_epid_ca_certificate.html#a2f8f09ae02919c379c38386668b47418">EpidCaCertificate</a>
+</li>
+<li>smu
+: <a class="el" href="struct_epid11_nr_proof.html#a1ad7fe6b32c09f2504ee49731c0ad145">Epid11NrProof</a>
+, <a class="el" href="struct_nr_proof.html#a717ec36a6c91acd01d9b642bb20fc178">NrProof</a>
+</li>
+<li>snu
+: <a class="el" href="struct_epid11_nr_proof.html#aa8406e938b2f87bded9e374e93a8ee5d">Epid11NrProof</a>
+, <a class="el" href="struct_nr_proof.html#ae2e9f22089793a4d44a0f7f5cdb78a0c">NrProof</a>
+</li>
+<li>sx
+: <a class="el" href="struct_basic_signature.html#a0e8ea6a2cd3af10e9b59d96d7d06bc69">BasicSignature</a>
+, <a class="el" href="struct_epid11_basic_signature.html#a2718346665210b7e26521bf4a15cb3bd">Epid11BasicSignature</a>
+</li>
+<li>sy
+: <a class="el" href="struct_epid11_basic_signature.html#a911441845fc9b82d514133371b5ba87c">Epid11BasicSignature</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_t.html b/doc/html/functions_vars_t.html
new file mode 100644
index 0000000..2734b96
--- /dev/null
+++ b/doc/html/functions_vars_t.html
@@ -0,0 +1,95 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_t.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
+<li>T
+: <a class="el" href="struct_basic_signature.html#a730f74d85cfb4fa4089d43c87b97a624">BasicSignature</a>
+, <a class="el" href="struct_epid11_nr_proof.html#a5ad9ba3bfac4eac37fd4a4e33ea65ddc">Epid11NrProof</a>
+</li>
+<li>t
+: <a class="el" href="struct_epid2_params.html#a200a0cba1c9e4ad512bece23f2461a5f">Epid2Params</a>
+</li>
+<li>T
+: <a class="el" href="struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3">NrProof</a>
+</li>
+<li>T1
+: <a class="el" href="struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b">Epid11BasicSignature</a>
+</li>
+<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>
+</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/functions_vars_v.html b/doc/html/functions_vars_v.html
new file mode 100644
index 0000000..6bf2fc5
--- /dev/null
+++ b/doc/html/functions_vars_v.html
@@ -0,0 +1,85 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_v.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
+<li>version
+: <a class="el" href="struct_epid11_group_rl.html#a63afa9863e8dcb63ff884e6e4093c481">Epid11GroupRl</a>
+, <a class="el" href="struct_epid11_priv_rl.html#a2b3899f5a35bf64f860d6d91bccb03c8">Epid11PrivRl</a>
+, <a class="el" href="struct_epid11_sig_rl.html#aa38674729293f4879ff94328dd3c59b1">Epid11SigRl</a>
+, <a class="el" href="struct_group_rl.html#a69c41d99cdfc5b6ece7442f466f7ec3f">GroupRl</a>
+, <a class="el" href="struct_priv_rl.html#a4c6b51cec760f7e81ca8635422ac6a50">PrivRl</a>
+, <a class="el" href="struct_sig_rl.html#ac9d4c343c539dba799e1f42eb38b351f">SigRl</a>
+, <a class="el" href="struct_verifier_rl.html#afa44ab69ffff5a3508366aeb2131fdaa">VerifierRl</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_w.html b/doc/html/functions_vars_w.html
new file mode 100644
index 0000000..89482e3
--- /dev/null
+++ b/doc/html/functions_vars_w.html
@@ -0,0 +1,84 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_w.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_w"></a>- w -</h3><ul>
+<li>w
+: <a class="el" href="struct_epid11_group_pub_key.html#a056c7138246e2bdcd47eaad501b756bb">Epid11GroupPubKey</a>
+, <a class="el" href="struct_group_pub_key.html#a86be439104fb60b324784baf24a943f9">GroupPubKey</a>
+</li>
+<li>word
+: <a class="el" href="struct_very_large_int.html#a42fb1bb370910b7fadf474b421b29eb8">VeryLargeInt</a>
+, <a class="el" href="struct_very_large_int_product.html#a02a4e20db872ec6264e614ac0f1438be">VeryLargeIntProduct</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_x.html b/doc/html/functions_vars_x.html
new file mode 100644
index 0000000..1d6f110
--- /dev/null
+++ b/doc/html/functions_vars_x.html
@@ -0,0 +1,104 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_x.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_x"></a>- x -</h3><ul>
+<li>x
+: <a class="el" href="struct_ecc_point_fq2.html#ac1c2f9e66988d12c61bd1ffd4975eb7d">EccPointFq2</a>
+, <a class="el" href="struct_ecc_point_fq.html#a50491ef33f641fa3e81d58bdc906b258">EccPointFq</a>
+</li>
+<li>X
+: <a class="el" href="struct_ecc_point_jacobi_fq2.html#aa540cd77c703ba538b245897009076a7">EccPointJacobiFq2</a>
+, <a class="el" href="struct_ecc_point_jacobi_fq.html#a281019c17dd470ab6b5a763efc23fa1b">EccPointJacobiFq</a>
+</li>
+<li>x
+: <a class="el" href="struct_ecdsa_public_key.html#a37c51614faf022eec491b4de8f3a13e1">EcdsaPublicKey</a>
+, <a class="el" href="struct_ecdsa_signature.html#a64b623605a55a267a36df18f29142d0d">EcdsaSignature</a>
+, <a class="el" href="struct_epid11_g2_elem_str.html#af28558484298f4f56377ededf57a4a04">Epid11G2ElemStr</a>
+, <a class="el" href="struct_epid_ca_certificate.html#a4f77996f90ed7da1d0503c4236b2c9d1">EpidCaCertificate</a>
+, <a class="el" href="struct_g1_elem_str.html#a3b0e658d6e5697763ad9c633c11d4ec4">G1ElemStr</a>
+, <a class="el" href="struct_g2_elem_str.html#a145ec5b20a6f4f00b080e11c8680afc3">G2ElemStr</a>
+, <a class="el" href="struct_gt_elem_str.html#aeaeb0e9e1c6efd378a475eb9a6c42132">GtElemStr</a>
+, <a class="el" href="struct_membership_credential.html#a2c5c0d22999d6917fea5ad6618883bcf">MembershipCredential</a>
+, <a class="el" href="struct_priv_key.html#aa805f9e124f05bdb733c85cb93614cbd">PrivKey</a>
+</li>
+<li>x0
+: <a class="el" href="struct_fq2_elem.html#a3e0e0c995074a18ca1e234fd99f90b3d">Fq2Elem</a>
+</li>
+<li>x1
+: <a class="el" href="struct_fq2_elem.html#a4f48b8d7f1d6bac1579c1fad81ef4a02">Fq2Elem</a>
+</li>
+<li>xi
+: <a class="el" href="struct_epid2_params.html#ae1d8f5d6036a82064e91bc137b278e74">Epid2Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_y.html b/doc/html/functions_vars_y.html
new file mode 100644
index 0000000..8dbd578
--- /dev/null
+++ b/doc/html/functions_vars_y.html
@@ -0,0 +1,101 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_y.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_y"></a>- y -</h3><ul>
+<li>y
+: <a class="el" href="struct_ecc_point_fq2.html#a137a9467dc77df97319c88880d13ea48">EccPointFq2</a>
+, <a class="el" href="struct_ecc_point_fq.html#abd3c36cb29db82a73ba89e9e15739b5a">EccPointFq</a>
+</li>
+<li>Y
+: <a class="el" href="struct_ecc_point_jacobi_fq2.html#adc2fa4757b5091e7927daae3452ee739">EccPointJacobiFq2</a>
+, <a class="el" href="struct_ecc_point_jacobi_fq.html#ad86b6242f7c242107f7af9a37fad2a74">EccPointJacobiFq</a>
+</li>
+<li>y
+: <a class="el" href="struct_ecdsa_public_key.html#a4503c4613386cbc78add1dc245c99284">EcdsaPublicKey</a>
+, <a class="el" href="struct_ecdsa_signature.html#a2efd6bf37b12f35135bf325fa491b029">EcdsaSignature</a>
+, <a class="el" href="struct_epid11_g2_elem_str.html#a9e8984e479bcbe8bd36c65e80c340032">Epid11G2ElemStr</a>
+, <a class="el" href="struct_epid_ca_certificate.html#abd69cce8d5e3940787ee0d17f72184ab">EpidCaCertificate</a>
+, <a class="el" href="struct_g1_elem_str.html#a8f2455ca314e885ea180dadf84bf27c3">G1ElemStr</a>
+, <a class="el" href="struct_g2_elem_str.html#a43141b2458aecceed8ee2748270f7908">G2ElemStr</a>
+</li>
+<li>y0
+: <a class="el" href="struct_fq6_elem.html#a84522e736d8b9fb706c90aeef5e0fda2">Fq6Elem</a>
+</li>
+<li>y1
+: <a class="el" href="struct_fq6_elem.html#ac35469120214ab7d75767a8adeb9c0f6">Fq6Elem</a>
+</li>
+<li>y2
+: <a class="el" href="struct_fq6_elem.html#a1753ef18695535ada56e337e8f6f7280">Fq6Elem</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_vars_z.html b/doc/html/functions_vars_z.html
new file mode 100644
index 0000000..416bc4c
--- /dev/null
+++ b/doc/html/functions_vars_z.html
@@ -0,0 +1,86 @@
+<!-- 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: Data Fields - Variables</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">6.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('functions_vars_z.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_z"></a>- z -</h3><ul>
+<li>Z
+: <a class="el" href="struct_ecc_point_jacobi_fq2.html#aea8a3a5b2bd2fce104e75cfe21615619">EccPointJacobiFq2</a>
+, <a class="el" href="struct_ecc_point_jacobi_fq.html#afe6154e547f9c3908a8ce801a14afeca">EccPointJacobiFq</a>
+</li>
+<li>z0
+: <a class="el" href="struct_fq12_elem.html#a2f33b78b0e6f4c720f481aac8f82d938">Fq12Elem</a>
+</li>
+<li>z1
+: <a class="el" href="struct_fq12_elem.html#a53a5954433b4c4df1fda6dcb08f54c7b">Fq12Elem</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_w.html b/doc/html/functions_w.html
new file mode 100644
index 0000000..e6d0519
--- /dev/null
+++ b/doc/html/functions_w.html
@@ -0,0 +1,84 @@
+<!-- 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: Data Fields</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">6.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('functions_w.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_w"></a>- w -</h3><ul>
+<li>w
+: <a class="el" href="struct_epid11_group_pub_key.html#a056c7138246e2bdcd47eaad501b756bb">Epid11GroupPubKey</a>
+, <a class="el" href="struct_group_pub_key.html#a86be439104fb60b324784baf24a943f9">GroupPubKey</a>
+</li>
+<li>word
+: <a class="el" href="struct_very_large_int.html#a42fb1bb370910b7fadf474b421b29eb8">VeryLargeInt</a>
+, <a class="el" href="struct_very_large_int_product.html#a02a4e20db872ec6264e614ac0f1438be">VeryLargeIntProduct</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_x.html b/doc/html/functions_x.html
new file mode 100644
index 0000000..a5bcda6
--- /dev/null
+++ b/doc/html/functions_x.html
@@ -0,0 +1,104 @@
+<!-- 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: Data Fields</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">6.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('functions_x.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_x"></a>- x -</h3><ul>
+<li>x
+: <a class="el" href="struct_ecc_point_fq2.html#ac1c2f9e66988d12c61bd1ffd4975eb7d">EccPointFq2</a>
+, <a class="el" href="struct_ecc_point_fq.html#a50491ef33f641fa3e81d58bdc906b258">EccPointFq</a>
+</li>
+<li>X
+: <a class="el" href="struct_ecc_point_jacobi_fq2.html#aa540cd77c703ba538b245897009076a7">EccPointJacobiFq2</a>
+, <a class="el" href="struct_ecc_point_jacobi_fq.html#a281019c17dd470ab6b5a763efc23fa1b">EccPointJacobiFq</a>
+</li>
+<li>x
+: <a class="el" href="struct_ecdsa_public_key.html#a37c51614faf022eec491b4de8f3a13e1">EcdsaPublicKey</a>
+, <a class="el" href="struct_ecdsa_signature.html#a64b623605a55a267a36df18f29142d0d">EcdsaSignature</a>
+, <a class="el" href="struct_epid11_g2_elem_str.html#af28558484298f4f56377ededf57a4a04">Epid11G2ElemStr</a>
+, <a class="el" href="struct_epid_ca_certificate.html#a4f77996f90ed7da1d0503c4236b2c9d1">EpidCaCertificate</a>
+, <a class="el" href="struct_g1_elem_str.html#a3b0e658d6e5697763ad9c633c11d4ec4">G1ElemStr</a>
+, <a class="el" href="struct_g2_elem_str.html#a145ec5b20a6f4f00b080e11c8680afc3">G2ElemStr</a>
+, <a class="el" href="struct_gt_elem_str.html#aeaeb0e9e1c6efd378a475eb9a6c42132">GtElemStr</a>
+, <a class="el" href="struct_membership_credential.html#a2c5c0d22999d6917fea5ad6618883bcf">MembershipCredential</a>
+, <a class="el" href="struct_priv_key.html#aa805f9e124f05bdb733c85cb93614cbd">PrivKey</a>
+</li>
+<li>x0
+: <a class="el" href="struct_fq2_elem.html#a3e0e0c995074a18ca1e234fd99f90b3d">Fq2Elem</a>
+</li>
+<li>x1
+: <a class="el" href="struct_fq2_elem.html#a4f48b8d7f1d6bac1579c1fad81ef4a02">Fq2Elem</a>
+</li>
+<li>xi
+: <a class="el" href="struct_epid2_params.html#ae1d8f5d6036a82064e91bc137b278e74">Epid2Params</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_y.html b/doc/html/functions_y.html
new file mode 100644
index 0000000..00e8eb5
--- /dev/null
+++ b/doc/html/functions_y.html
@@ -0,0 +1,101 @@
+<!-- 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: Data Fields</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">6.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('functions_y.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_y"></a>- y -</h3><ul>
+<li>y
+: <a class="el" href="struct_ecc_point_fq2.html#a137a9467dc77df97319c88880d13ea48">EccPointFq2</a>
+, <a class="el" href="struct_ecc_point_fq.html#abd3c36cb29db82a73ba89e9e15739b5a">EccPointFq</a>
+</li>
+<li>Y
+: <a class="el" href="struct_ecc_point_jacobi_fq2.html#adc2fa4757b5091e7927daae3452ee739">EccPointJacobiFq2</a>
+, <a class="el" href="struct_ecc_point_jacobi_fq.html#ad86b6242f7c242107f7af9a37fad2a74">EccPointJacobiFq</a>
+</li>
+<li>y
+: <a class="el" href="struct_ecdsa_public_key.html#a4503c4613386cbc78add1dc245c99284">EcdsaPublicKey</a>
+, <a class="el" href="struct_ecdsa_signature.html#a2efd6bf37b12f35135bf325fa491b029">EcdsaSignature</a>
+, <a class="el" href="struct_epid11_g2_elem_str.html#a9e8984e479bcbe8bd36c65e80c340032">Epid11G2ElemStr</a>
+, <a class="el" href="struct_epid_ca_certificate.html#abd69cce8d5e3940787ee0d17f72184ab">EpidCaCertificate</a>
+, <a class="el" href="struct_g1_elem_str.html#a8f2455ca314e885ea180dadf84bf27c3">G1ElemStr</a>
+, <a class="el" href="struct_g2_elem_str.html#a43141b2458aecceed8ee2748270f7908">G2ElemStr</a>
+</li>
+<li>y0
+: <a class="el" href="struct_fq6_elem.html#a84522e736d8b9fb706c90aeef5e0fda2">Fq6Elem</a>
+</li>
+<li>y1
+: <a class="el" href="struct_fq6_elem.html#ac35469120214ab7d75767a8adeb9c0f6">Fq6Elem</a>
+</li>
+<li>y2
+: <a class="el" href="struct_fq6_elem.html#a1753ef18695535ada56e337e8f6f7280">Fq6Elem</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/functions_z.html b/doc/html/functions_z.html
new file mode 100644
index 0000000..bad6586
--- /dev/null
+++ b/doc/html/functions_z.html
@@ -0,0 +1,86 @@
+<!-- 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: Data Fields</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">6.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('functions_z.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<div class="textblock">Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:</div>
+
+<h3><a class="anchor" id="index_z"></a>- z -</h3><ul>
+<li>Z
+: <a class="el" href="struct_ecc_point_jacobi_fq2.html#aea8a3a5b2bd2fce104e75cfe21615619">EccPointJacobiFq2</a>
+, <a class="el" href="struct_ecc_point_jacobi_fq.html#afe6154e547f9c3908a8ce801a14afeca">EccPointJacobiFq</a>
+</li>
+<li>z0
+: <a class="el" href="struct_fq12_elem.html#a2f33b78b0e6f4c720f481aac8f82d938">Fq12Elem</a>
+</li>
+<li>z1
+: <a class="el" href="struct_fq12_elem.html#a53a5954433b4c4df1fda6dcb08f54c7b">Fq12Elem</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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/getrandom_8c.html b/doc/html/getrandom_8c.html
index cb9a5ef..5a5fd4f 100644
--- a/doc/html/getrandom_8c.html
+++ b/doc/html/getrandom_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/getrandom_8h.html b/doc/html/getrandom_8h.html
index 780b90b..1e08f01 100644
--- a/doc/html/getrandom_8h.html
+++ b/doc/html/getrandom_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals.html b/doc/html/globals.html
index c3c10a1..f3e4e37 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_b.html b/doc/html/globals_b.html
index e6bf056..fda9a24 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -60,6 +60,9 @@ $(document).ready(function(){initNavTree('globals_b.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_b"></a>- b -</h3><ul>
+<li>be32toh
+: <a class="el" href="endian_8h.html#a48127d3bd550dacd707b58a637b05393">endian.h</a>
+</li>
<li>BigNum
: <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">bignum.h</a>
</li>
@@ -103,9 +106,9 @@ $(document).ready(function(){initNavTree('globals_b.html','');});
</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>
+, <a class="el" href="sign_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">sign.c</a>
+, <a class="el" href="context_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">context.c</a>
</li>
</ul>
</div><!-- contents -->
diff --git a/doc/html/globals_c.html b/doc/html/globals_c.html
index 6823c50..7b6de3c 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_d.html b/doc/html/globals_d.html
index a95b29f..0f78755 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_defs.html b/doc/html/globals_defs.html
index 4f38aa8..41c8bcf 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -61,6 +61,9 @@ $(document).ready(function(){initNavTree('globals_defs.html','');});
<li>_Bool
: <a class="el" href="stdtypes_8h.html#aeaff0db5524987a2f50d71ac0162ceb2">stdtypes.h</a>
</li>
+<li>be32toh
+: <a class="el" href="endian_8h.html#a48127d3bd550dacd707b58a637b05393">endian.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>
@@ -70,14 +73,44 @@ $(document).ready(function(){initNavTree('globals_defs.html','');});
, <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="sign_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">sign.c</a>
+, <a class="el" href="commit_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">commit.c</a>
, <a class="el" href="load__external_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">load_external.c</a>
+, <a class="el" href="context_8c.html#a5638f861b82f1746ea1af0b384ef8ff1">context.c</a>
</li>
<li>false
: <a class="el" href="stdtypes_8h.html#a65e9886d74aaee76545e83dd09011727">stdtypes.h</a>
</li>
+<li>htobe32
+: <a class="el" href="endian_8h.html#ab004b68a63ea32dcd67fbe597263120b">endian.h</a>
+</li>
+<li>MATH_FAIL
+: <a class="el" href="mathdefs_8h.html#a1a994bd1e283835646241e53b6728cee">mathdefs.h</a>
+</li>
+<li>MATH_SUCCESS
+: <a class="el" href="mathdefs_8h.html#a352e5652c4f35088eba5f769a5d7993f">mathdefs.h</a>
+</li>
+<li>NUM_ECC_DIGITS
+: <a class="el" href="mathtypes_8h.html#a94d0ffa1ccb9d2f09d1ada23a5807021">mathtypes.h</a>
+</li>
+<li>SHA256_BLOCK_SIZE
+: <a class="el" href="sha256_8h.html#a9c1fe69ad43d4ca74b84303a0ed64f2f">sha256.h</a>
+</li>
+<li>SHA256_DIGEST_SIZE
+: <a class="el" href="sha256_8h.html#a81efbc0fc101b06a914f7ff9e2fbc0e9">sha256.h</a>
+</li>
+<li>SHA256_STATE_BLOCKS
+: <a class="el" href="sha256_8h.html#a0558ee82699b60132c23e0a049ab7a56">sha256.h</a>
+</li>
+<li>SHA512_BLOCK_SIZE
+: <a class="el" href="sha512_8h.html#ac7071364cb94c9fcce009ba16a4bdca1">sha512.h</a>
+</li>
+<li>SHA512_DIGEST_SIZE
+: <a class="el" href="sha512_8h.html#a67f489f3eee39c447a6db3ba34ef75f2">sha512.h</a>
+</li>
+<li>SHA512_DIGEST_WORDS
+: <a class="el" href="sha512_8h.html#ab16e074d262ae09949e0bf222f95f5be">sha512.h</a>
+</li>
<li>TPM_ALG_NULL
: <a class="el" href="conversion_8h.html#a3622ddd0080bf63059d26887b6ee90ac">conversion.h</a>
</li>
diff --git a/doc/html/globals_e.html b/doc/html/globals_e.html
index f877740..ea5c7c0 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -111,6 +111,117 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
<li>EcSscmMultiExp()
: <a class="el" href="group___ec_group_primitives.html#ga40e3431d3dbe8cf7a65ada7b7811cba4">ecgroup.h</a>
</li>
+<li>EFq2Add()
+: <a class="el" href="efq2_8h.html#a6cbfb24b20b29b2e678e259aa6c0e2db">efq2.h</a>
+</li>
+<li>EFq2Dbl()
+: <a class="el" href="efq2_8h.html#a1db50d99360ed019ca4dcd2f9bcf210a">efq2.h</a>
+</li>
+<li>EFq2Deserialize()
+: <a class="el" href="serialize_8h.html#a393c9cf42edef41aa28449a0d321a57e">serialize.h</a>
+</li>
+<li>EFq2Eq()
+: <a class="el" href="efq2_8h.html#a2064ea9b48565a164314da4b487aaabd">efq2.h</a>
+</li>
+<li>EFq2FromAffine()
+: <a class="el" href="efq2_8h.html#af1da3e171d605db6f5ea0a70dc01ac27">efq2.h</a>
+</li>
+<li>EFq2IsInf()
+: <a class="el" href="efq2_8h.html#a9181b09474d800c65fd89aee2c28ebab">efq2.h</a>
+</li>
+<li>EFq2MulSSCM()
+: <a class="el" href="efq2_8h.html#a3ad678e3701e1211fa01ddc54f2bc5e4">efq2.h</a>
+</li>
+<li>EFq2Neg()
+: <a class="el" href="efq2_8h.html#a977bd074ed0dec943ad0cf19a01c0cf7">efq2.h</a>
+</li>
+<li>EFq2OnCurve()
+: <a class="el" href="efq2_8h.html#a26c35eefbd1ee11a5d078c44d295ff5a">efq2.h</a>
+</li>
+<li>EFq2Serialize()
+: <a class="el" href="serialize_8h.html#aa53e1c30fa109e586fa90a3a4cf3d0ac">serialize.h</a>
+</li>
+<li>EFq2ToAffine()
+: <a class="el" href="efq2_8h.html#a484e6af5efc2042d865999dac9489684">efq2.h</a>
+</li>
+<li>EFqAdd()
+: <a class="el" href="efq_8h.html#abf04f5ec866fc77d0203beb8a8991f25">efq.h</a>
+</li>
+<li>EFqAffineAdd()
+: <a class="el" href="efq_8h.html#a6cf130d65a5f35237a88046faad43c0a">efq.h</a>
+</li>
+<li>EFqAffineDbl()
+: <a class="el" href="efq_8h.html#a975f92abdaf431f2fb152fca84d468b3">efq.h</a>
+</li>
+<li>EFqAffineExp()
+: <a class="el" href="efq_8h.html#a8990ca0e19d8ed7b78958963e60948e2">efq.h</a>
+</li>
+<li>EFqAffineMultiExp()
+: <a class="el" href="efq_8h.html#a2618ae4b4fc8f2838a6550abfb4448ca">efq.h</a>
+</li>
+<li>EFqCondSet()
+: <a class="el" href="efq_8h.html#a9b2fcab6bc74601f9c302c5b34400ae4">efq.h</a>
+</li>
+<li>EFqCp()
+: <a class="el" href="efq_8h.html#a7a7863639a5b96d44522d579d7d32e40">efq.h</a>
+</li>
+<li>EFqDbl()
+: <a class="el" href="efq_8h.html#a23b6331263b002e6e07d2be5216fd6e8">efq.h</a>
+</li>
+<li>EFqDeserialize()
+: <a class="el" href="serialize_8h.html#af7f9b8ffdf1bb18bc156a4f80fc32419">serialize.h</a>
+</li>
+<li>EFqEq()
+: <a class="el" href="efq_8h.html#a7fbfe9d25cf08f4dcbd950cfb07471ff">efq.h</a>
+</li>
+<li>EFqEqAffine()
+: <a class="el" href="efq_8h.html#acfc458ea689ea3aa637c9c817dfa44c5">efq.h</a>
+</li>
+<li>EFqFromAffine()
+: <a class="el" href="efq_8h.html#a97ce025667b076986a6d92b3d41a7827">efq.h</a>
+</li>
+<li>EFqHash()
+: <a class="el" href="efq_8h.html#abf80ad8b8e3e506f4c46ec57de1c4846">efq.h</a>
+</li>
+<li>EFqInf()
+: <a class="el" href="efq_8h.html#a73fd77b7cc14c0decd95fd294b5b250c">efq.h</a>
+</li>
+<li>EFqIsInf()
+: <a class="el" href="efq_8h.html#ae38257cf97872a4fa855033ad44e2e10">efq.h</a>
+</li>
+<li>EFqJCp()
+: <a class="el" href="efq_8h.html#a1a31d069739c4da17011280a8ae6354a">efq.h</a>
+</li>
+<li>EFqJOnCurve()
+: <a class="el" href="efq_8h.html#ada751265a36ee3236fce90105a62909e">efq.h</a>
+</li>
+<li>EFqJRand()
+: <a class="el" href="efq_8h.html#a15bda5d411f7c6d602994e6444034414">efq.h</a>
+</li>
+<li>EFqMulSSCM()
+: <a class="el" href="efq_8h.html#a84e5231cee67eeba5b2a0f99088bc70e">efq.h</a>
+</li>
+<li>EFqMultiExp()
+: <a class="el" href="efq_8h.html#abbcd39b964e4fd685d1dba73ec110c86">efq.h</a>
+</li>
+<li>EFqNeg()
+: <a class="el" href="efq_8h.html#a0f7309ab07d4d3e0556a32f1839ae6fe">efq.h</a>
+</li>
+<li>EFqOnCurve()
+: <a class="el" href="efq_8h.html#a81470fed188d5043f89b6b8ab6031a42">efq.h</a>
+</li>
+<li>EFqRand()
+: <a class="el" href="efq_8h.html#a40588e2618ed9a38043532785a8d5785">efq.h</a>
+</li>
+<li>EFqSerialize()
+: <a class="el" href="serialize_8h.html#a81b7bcb69d6ea28ebb3e3520c7d0eeb5">serialize.h</a>
+</li>
+<li>EFqSet()
+: <a class="el" href="efq_8h.html#a7d1841f9e29bc604054536de7a4a861d">efq.h</a>
+</li>
+<li>EFqToAffine()
+: <a class="el" href="efq_8h.html#aaf3f26e855b85e869cb80fae780a4e6a">efq.h</a>
+</li>
<li>Epid11AreSigsLinked()
: <a class="el" href="group___epid11_verifier_module.html#gab0b6560b226a37321f5ca5d4fb55eba7">api.h</a>
</li>
@@ -192,6 +303,9 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
<li>EpidCheckPrivRlEntry()
: <a class="el" href="group___epid_verifier_module.html#gaeb05e6faea6f09c0665b13adc6e7ddea">api.h</a>
</li>
+<li>EpidClearRegisteredBasenames()
+: <a class="el" href="group___epid_member_module.html#ga4f3a464f14581ef3e5a50719cb4709c3">api.h</a>
+</li>
<li>EpidCreateJoinRequest()
: <a class="el" href="group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3">api.h</a>
</li>
@@ -213,9 +327,18 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
<li>EpidMemberCreate()
: <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7">api.h</a>
</li>
+<li>EpidMemberDeinit()
+: <a class="el" href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d">api.h</a>
+</li>
<li>EpidMemberDelete()
: <a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">api.h</a>
</li>
+<li>EpidMemberGetSize()
+: <a class="el" href="group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24">api.h</a>
+</li>
+<li>EpidMemberInit()
+: <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb">api.h</a>
+</li>
<li>EpidMemberSetHashAlg()
: <a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">api.h</a>
</li>
@@ -252,8 +375,8 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
<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>EpidRegisterBasename()
+: <a class="el" href="group___epid_member_module.html#ga8c6f097ba89542664375bd5e0f205220">api.h</a>
</li>
<li>EpidSign()
: <a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">api.h</a>
@@ -265,8 +388,8 @@ $(document).ready(function(){initNavTree('globals_e.html','');});
: <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>
+: <a class="el" href="conversion_8c.html#ad08628a6bf33154c1029a32e8b83325f">conversion.c</a>
+, <a class="el" href="conversion_8h.html#ad08628a6bf33154c1029a32e8b83325f">conversion.h</a>
</li>
<li>EpidVerifierCreate()
: <a class="el" href="group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70">api.h</a>
diff --git a/doc/html/globals_enum.html b/doc/html/globals_enum.html
index 6771fec..43bfd26 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_eval.html b/doc/html/globals_eval.html
index 0923fa4..604f0a6 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_f.html b/doc/html/globals_f.html
index 01cb71b..09fa934 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -111,6 +111,252 @@ $(document).ready(function(){initNavTree('globals_f.html','');});
<li>FiniteField
: <a class="el" href="group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e">finitefield.h</a>
</li>
+<li>FpAdd()
+: <a class="el" href="fp_8h.html#a55152abe8b866eba5a0c83cfb1bbe5f6">fp.h</a>
+</li>
+<li>FpClear()
+: <a class="el" href="fp_8h.html#adf010ec5710d4013e33efd7e5ba8f9ad">fp.h</a>
+</li>
+<li>FpDeserialize()
+: <a class="el" href="serialize_8h.html#ac49c8bd07a7f09aadd08c58c362cf3af">serialize.h</a>
+</li>
+<li>FpEq()
+: <a class="el" href="fp_8h.html#a7bb685bd810368d8077f638ffcab2554">fp.h</a>
+</li>
+<li>FpExp()
+: <a class="el" href="fp_8h.html#ab06b1b1a59f1138aa6c4d746ab707f86">fp.h</a>
+</li>
+<li>FpFromHash()
+: <a class="el" href="fp_8h.html#a472b0a9229b0eff0ca445f158efa1175">fp.h</a>
+</li>
+<li>FpInField()
+: <a class="el" href="fp_8h.html#ac2eab44a7aa9679d107667ffc035ee0a">fp.h</a>
+</li>
+<li>FpInv()
+: <a class="el" href="fp_8h.html#a9e7500fe8ee73592b002ed675d1758b3">fp.h</a>
+</li>
+<li>FpMul()
+: <a class="el" href="fp_8h.html#a9392597a6fe50e5c102ce21b8a1ae6c2">fp.h</a>
+</li>
+<li>FpNeg()
+: <a class="el" href="fp_8h.html#a0524fd074857712ea61ea5717ff54fd3">fp.h</a>
+</li>
+<li>FpRand()
+: <a class="el" href="fp_8h.html#a6c06b175fd82b5db555508f2d26713f8">fp.h</a>
+</li>
+<li>FpRandNonzero()
+: <a class="el" href="fp_8h.html#a54743809639797b4d4445c221291048b">fp.h</a>
+</li>
+<li>FpSerialize()
+: <a class="el" href="serialize_8h.html#a57237335a24f8a9b2a151a2141ec5917">serialize.h</a>
+</li>
+<li>FpSet()
+: <a class="el" href="fp_8h.html#a23bf42c7024a318970a6b60c02d9a08d">fp.h</a>
+</li>
+<li>FpSub()
+: <a class="el" href="fp_8h.html#aa9cc9f5e33bba75420b83cb2d49ca280">fp.h</a>
+</li>
+<li>Fq12Add()
+: <a class="el" href="fq12_8h.html#aa4a17bfa56644ab615c60bd7ec900821">fq12.h</a>
+</li>
+<li>Fq12Clear()
+: <a class="el" href="fq12_8h.html#aaeb34cf6f4d176674fc300d7e7fc57f1">fq12.h</a>
+</li>
+<li>Fq12Conj()
+: <a class="el" href="fq12_8h.html#a33a3bb0f378ac008cde38b88a39ea79c">fq12.h</a>
+</li>
+<li>Fq12Cp()
+: <a class="el" href="fq12_8h.html#ad739d6a59a3f7ed0c0117c7486d06290">fq12.h</a>
+</li>
+<li>Fq12Deserialize()
+: <a class="el" href="serialize_8h.html#a2f5ba336b7da938e92dad848e00ad157">serialize.h</a>
+</li>
+<li>Fq12Eq()
+: <a class="el" href="fq12_8h.html#a08b50a1f5fe19c78a19f1f4a457b9a39">fq12.h</a>
+</li>
+<li>Fq12Exp()
+: <a class="el" href="fq12_8h.html#a3bf52e5b01103632fa429927e5a07b1d">fq12.h</a>
+</li>
+<li>Fq12ExpCyc()
+: <a class="el" href="fq12_8h.html#a65ad8c0f4aa0859593aab885066c5025">fq12.h</a>
+</li>
+<li>Fq12Inv()
+: <a class="el" href="fq12_8h.html#afd089e0cb6e4ec68a3a3062f26d4430d">fq12.h</a>
+</li>
+<li>Fq12Mul()
+: <a class="el" href="fq12_8h.html#aec7e0ce55e01ab48c0c6315cb9e5b47d">fq12.h</a>
+</li>
+<li>Fq12MulSpecial()
+: <a class="el" href="fq12_8h.html#ac1b44bbceb1c648b2b880871c8b52195">fq12.h</a>
+</li>
+<li>Fq12MultiExp()
+: <a class="el" href="fq12_8h.html#ae88eb95c37c9db2e37e14d8a9304fadd">fq12.h</a>
+</li>
+<li>Fq12Neg()
+: <a class="el" href="fq12_8h.html#af3fd9055d559c592eb5715bb261c072b">fq12.h</a>
+</li>
+<li>Fq12Serialize()
+: <a class="el" href="serialize_8h.html#ad0de690fc04ff307fa64575f9033c4d7">serialize.h</a>
+</li>
+<li>Fq12Set()
+: <a class="el" href="fq12_8h.html#acd16f86f83021d44d25389ad9f701597">fq12.h</a>
+</li>
+<li>Fq12SqCyc()
+: <a class="el" href="fq12_8h.html#a1ad8710126bb4906d6170dd8ab30e43a">fq12.h</a>
+</li>
+<li>Fq12Square()
+: <a class="el" href="fq12_8h.html#a12e88a0bbfcc24b1863754f5e027d28e">fq12.h</a>
+</li>
+<li>Fq12Sub()
+: <a class="el" href="fq12_8h.html#a80c3da69a0991423a728e9b74a2dfe15">fq12.h</a>
+</li>
+<li>Fq2Add()
+: <a class="el" href="fq2_8h.html#afcaaf75460f36b85386cd1959b904f57">fq2.h</a>
+</li>
+<li>Fq2Clear()
+: <a class="el" href="fq2_8h.html#a59d3d8212ffd5bf75f9b6fd85b896654">fq2.h</a>
+</li>
+<li>Fq2CondSet()
+: <a class="el" href="fq2_8h.html#ad94b155025e7a11b9c5b60032fde4491">fq2.h</a>
+</li>
+<li>Fq2Conj()
+: <a class="el" href="fq2_8h.html#adc0d02ddec564ca86b0ef53d7ff79864">fq2.h</a>
+</li>
+<li>Fq2Cp()
+: <a class="el" href="fq2_8h.html#a6c67364f78e6946a7ad3af2c86baf1a5">fq2.h</a>
+</li>
+<li>Fq2Eq()
+: <a class="el" href="fq2_8h.html#a3dc330cff53539b51183c43085275f97">fq2.h</a>
+</li>
+<li>Fq2Exp()
+: <a class="el" href="fq2_8h.html#acecbff7a5a8cec15e24c47663957c05a">fq2.h</a>
+</li>
+<li>Fq2Inv()
+: <a class="el" href="fq2_8h.html#a756666161516fe541b26a4082f69343d">fq2.h</a>
+</li>
+<li>Fq2IsZero()
+: <a class="el" href="fq2_8h.html#a610c9d7c2afa63b1d48da30c684d6e27">fq2.h</a>
+</li>
+<li>Fq2Mul()
+: <a class="el" href="fq2_8h.html#a876f870f84cd8ab697176dbb42591565">fq2.h</a>
+</li>
+<li>Fq2MulScalar()
+: <a class="el" href="fq2_8h.html#af45903d791794faabedb00f760885e8c">fq2.h</a>
+</li>
+<li>Fq2MulXi()
+: <a class="el" href="fq2_8h.html#afeeb4e14ddf9f39f860661c599923c58">fq2.h</a>
+</li>
+<li>Fq2Neg()
+: <a class="el" href="fq2_8h.html#a5d523d5d6d4159c71f58945af82a7936">fq2.h</a>
+</li>
+<li>Fq2Set()
+: <a class="el" href="fq2_8h.html#a9165c1d2deef46ceb9af238928b2ec5c">fq2.h</a>
+</li>
+<li>Fq2Square()
+: <a class="el" href="fq2_8h.html#a3c6583dd519a3dd7efb26db5e9a59036">fq2.h</a>
+</li>
+<li>Fq2Sub()
+: <a class="el" href="fq2_8h.html#ae27a9400b5d8fbd0b720a449c60ad146">fq2.h</a>
+</li>
+<li>Fq6Add()
+: <a class="el" href="fq6_8h.html#a0607ab44e53c7a16f8e1b2746d250a7c">fq6.h</a>
+</li>
+<li>Fq6Clear()
+: <a class="el" href="fq6_8h.html#a7c77a862223f577e11e595332c9fb272">fq6.h</a>
+</li>
+<li>Fq6CondSet()
+: <a class="el" href="fq6_8h.html#aa0c82e905ee190ad2187b89e464466d4">fq6.h</a>
+</li>
+<li>Fq6Cp()
+: <a class="el" href="fq6_8h.html#a36bd769bc95b887f75bb60c2f7a45e17">fq6.h</a>
+</li>
+<li>Fq6Eq()
+: <a class="el" href="fq6_8h.html#aaf54d03c0afdb6eeced6ddad1237c2e4">fq6.h</a>
+</li>
+<li>Fq6Inv()
+: <a class="el" href="fq6_8h.html#a5f4708ca109578527afd8cda99acd6ee">fq6.h</a>
+</li>
+<li>Fq6IsZero()
+: <a class="el" href="fq6_8h.html#a634aab5dc04177587a22324352ff91e5">fq6.h</a>
+</li>
+<li>Fq6Mul()
+: <a class="el" href="fq6_8h.html#ad1e1cac423a2c3c69a4f3629d33faaf1">fq6.h</a>
+</li>
+<li>Fq6MulScalar()
+: <a class="el" href="fq6_8h.html#a701d89b5c73ba67a2f765d49f5d5ae4e">fq6.h</a>
+</li>
+<li>Fq6MulV()
+: <a class="el" href="fq6_8h.html#ad30bd276a4e2e9df3613072c38ec13ae">fq6.h</a>
+</li>
+<li>Fq6Neg()
+: <a class="el" href="fq6_8h.html#a9a5ddbf8f16b48030209b172079d22a6">fq6.h</a>
+</li>
+<li>Fq6Set()
+: <a class="el" href="fq6_8h.html#a06b8c3988c3782fda22c9ffb47b5180b">fq6.h</a>
+</li>
+<li>Fq6Square()
+: <a class="el" href="fq6_8h.html#a58e5b68a86b776d82ade8307046e2375">fq6.h</a>
+</li>
+<li>Fq6Sub()
+: <a class="el" href="fq6_8h.html#a87d07ab842862a482410a838516ad0c7">fq6.h</a>
+</li>
+<li>FqAdd()
+: <a class="el" href="fq_8h.html#ab52f69c761454d976c3fc56a26549419">fq.h</a>
+</li>
+<li>FqClear()
+: <a class="el" href="fq_8h.html#ac85eb642d3b3973477749769e04d45af">fq.h</a>
+</li>
+<li>FqCondSet()
+: <a class="el" href="fq_8h.html#afbb0976ef343b14c66305db0a48647ca">fq.h</a>
+</li>
+<li>FqCp()
+: <a class="el" href="fq_8h.html#a17133e5b777baa8c745b7dfcf1c8ad8d">fq.h</a>
+</li>
+<li>FqDeserialize()
+: <a class="el" href="serialize_8h.html#a051985a737e59da22d04dfcc5112ec77">serialize.h</a>
+</li>
+<li>FqEq()
+: <a class="el" href="fq_8h.html#abd40d255e0094f7156092db44a3b90fa">fq.h</a>
+</li>
+<li>FqExp()
+: <a class="el" href="fq_8h.html#a276d3747aefdac5503982f2aa5eccbf8">fq.h</a>
+</li>
+<li>FqFromHash()
+: <a class="el" href="fq_8h.html#a7794f72bcc506f8d8a60dbfae1a70ed0">fq.h</a>
+</li>
+<li>FqInField()
+: <a class="el" href="fq_8h.html#aceb37a8f5538fe9ca682058ff0e36091">fq.h</a>
+</li>
+<li>FqInv()
+: <a class="el" href="fq_8h.html#a7b60a8996973d474d2fb7a31838c6d8c">fq.h</a>
+</li>
+<li>FqIsZero()
+: <a class="el" href="fq_8h.html#ac08ca8c781cd18cbadabbeeb85722e49">fq.h</a>
+</li>
+<li>FqMul()
+: <a class="el" href="fq_8h.html#ab0bf77a97fb3a12292886bef3abcf9bd">fq.h</a>
+</li>
+<li>FqNeg()
+: <a class="el" href="fq_8h.html#ae8379530cca959e7e36446b2979d8af4">fq.h</a>
+</li>
+<li>FqRand()
+: <a class="el" href="fq_8h.html#a5cc7d7d7640cd0bbcb635e95be3ed8a3">fq.h</a>
+</li>
+<li>FqSerialize()
+: <a class="el" href="serialize_8h.html#a1fe8ff2aa7f73b807a7f5f5cdd8eba94">serialize.h</a>
+</li>
+<li>FqSet()
+: <a class="el" href="fq_8h.html#ab28f9df688a669a64dc04fa33f4cbb64">fq.h</a>
+</li>
+<li>FqSqrt()
+: <a class="el" href="fq_8h.html#a0cbded46e28a1e6f641c5c0ae37fd744">fq.h</a>
+</li>
+<li>FqSquare()
+: <a class="el" href="fq_8h.html#ab62c8f43f78a0c4f830c9ed65048b8f9">fq.h</a>
+</li>
+<li>FqSub()
+: <a class="el" href="fq_8h.html#a5148f610202ae759aafb197cb52137f1">fq.h</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/globals_func.html b/doc/html/globals_func.html
index 33a6d04..1121632 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -85,499 +85,6 @@ $(document).ready(function(){initNavTree('globals_func.html','');});
: <a class="el" href="group___big_num_primitives.html#gacbec9669ab0fe768e2be74dcaca397ea">bignum.h</a>
</li>
</ul>
-
-
-<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
-<li>DeleteBigNum()
-: <a class="el" href="group___big_num_primitives.html#ga2d17600068b1d94000635c6644258a03">bignum.h</a>
-</li>
-<li>DeleteEcGroup()
-: <a class="el" href="group___ec_group_primitives.html#gab7af276256c27610eda85ff432b846ea">ecgroup.h</a>
-</li>
-<li>DeleteEcPoint()
-: <a class="el" href="group___ec_group_primitives.html#ga8cb086d792bffb79b3ca07e6ca4ce0e7">ecgroup.h</a>
-</li>
-<li>DeleteEpid11PairingState()
-: <a class="el" href="group___epid11_pairing_primitives.html#gaa3457d6f85889bc714910252fd21c758">tatepairing.h</a>
-</li>
-<li>DeleteFfElement()
-: <a class="el" href="group___finite_field_primitives.html#ga1bad3c6945d1d709fceb07a1dd03000e">finitefield.h</a>
-</li>
-<li>DeleteFiniteField()
-: <a class="el" href="group___finite_field_primitives.html#gacbdd2871ecf93dadaac9d2c5b16e1e5f">finitefield.h</a>
-</li>
-<li>DeletePairingState()
-: <a class="el" href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d">pairing.h</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
-<li>EcdsaSignBuffer()
-: <a class="el" href="group___ecdsa_primitives.html#gaef0e8a31e830fe9285b43a0969e6611a">ecdsa.h</a>
-</li>
-<li>EcdsaVerifyBuffer()
-: <a class="el" href="group___ecdsa_primitives.html#ga07e4ebd3423e1f6f9ae35f0608dde7c0">ecdsa.h</a>
-</li>
-<li>EcExp()
-: <a class="el" href="group___ec_group_primitives.html#ga01bf8d6fa60a2e445490966b3a06c270">ecgroup.h</a>
-</li>
-<li>EcGetRandom()
-: <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#gac3067cc899e65e647390bb3bd1cabe4c">ecgroup.h</a>
-</li>
-<li>EcInGroup()
-: <a class="el" href="group___ec_group_primitives.html#ga48ec5ae951c9f49d8d7d983234eea921">ecgroup.h</a>
-</li>
-<li>EcInverse()
-: <a class="el" href="group___ec_group_primitives.html#ga0b6d7a3398251e9352fb29ef4abef466">ecgroup.h</a>
-</li>
-<li>EcIsEqual()
-: <a class="el" href="group___ec_group_primitives.html#gad3b3c63c48fa24e8dea07837b05bc061">ecgroup.h</a>
-</li>
-<li>EcIsIdentity()
-: <a class="el" href="group___ec_group_primitives.html#ga9cf15b34bc4ff12e58b169dd989d8210">ecgroup.h</a>
-</li>
-<li>EcMakePoint()
-: <a class="el" href="group___ec_group_primitives.html#ga8a6114a48214a327d4ec04fd25e5940e">ecgroup.h</a>
-</li>
-<li>EcMul()
-: <a class="el" href="group___ec_group_primitives.html#ga25c9013cc76907d73765eb7a96aa8c96">ecgroup.h</a>
-</li>
-<li>EcMultiExp()
-: <a class="el" href="group___ec_group_primitives.html#gae96c38e004ccd2211290ad6e66415ec4">ecgroup.h</a>
-</li>
-<li>EcMultiExpBn()
-: <a class="el" href="group___ec_group_primitives.html#ga76d24378455eb96a3257fe8045c0993a">ecgroup.h</a>
-</li>
-<li>EcSscmExp()
-: <a class="el" href="group___ec_group_primitives.html#gaf3b6a548aa6f0d4f028a14feca251f57">ecgroup.h</a>
-</li>
-<li>EcSscmMultiExp()
-: <a class="el" href="group___ec_group_primitives.html#ga40e3431d3dbe8cf7a65ada7b7811cba4">ecgroup.h</a>
-</li>
-<li>Epid11AreSigsLinked()
-: <a class="el" href="group___epid11_verifier_module.html#gab0b6560b226a37321f5ca5d4fb55eba7">api.h</a>
-</li>
-<li>Epid11CheckPrivRlEntry()
-: <a class="el" href="group___epid11_verifier_module.html#ga0b79c79d09e3551158e1c38c7c335929">api.h</a>
-</li>
-<li>Epid11EcHash()
-: <a class="el" href="group___ec_group_primitives.html#gaad96a1498b85d28f71514b8f7b154d82">ecgroup.h</a>
-</li>
-<li>Epid11NrVerify()
-: <a class="el" href="group___epid11_verifier_module.html#ga3a2e320d7de6156b2ce9d73e9cdce813">api.h</a>
-</li>
-<li>Epid11Pairing()
-: <a class="el" href="group___epid11_pairing_primitives.html#gaa4076dfe25e8e61ac6753333a322c059">tatepairing.h</a>
-</li>
-<li>Epid11ParseGroupPubKeyFile()
-: <a class="el" href="group___epid11_file_parser_module.html#ga1f92d1cb6bd7d9815711fde515b40a4c">file_parser.h</a>
-</li>
-<li>Epid11ParseGroupRlFile()
-: <a class="el" href="group___epid11_file_parser_module.html#gae28a844eb68828480b2a76fcb7d252a3">file_parser.h</a>
-</li>
-<li>Epid11ParsePrivRlFile()
-: <a class="el" href="group___epid11_file_parser_module.html#gae682077d315c39ed298ef198fd738546">file_parser.h</a>
-</li>
-<li>Epid11ParseSigRlFile()
-: <a class="el" href="group___epid11_file_parser_module.html#gac3f6daaa5333627d4efe5438c1fe8868">file_parser.h</a>
-</li>
-<li>Epid11VerifierCreate()
-: <a class="el" href="group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8">api.h</a>
-</li>
-<li>Epid11VerifierDelete()
-: <a class="el" href="group___epid11_verifier_module.html#ga63cae8d5abcf4d7e3af4157de18998f1">api.h</a>
-</li>
-<li>Epid11VerifierSetBasename()
-: <a class="el" href="group___epid11_verifier_module.html#ga0cb6d30df527ee0d8f0a1b68d2b7c0c0">api.h</a>
-</li>
-<li>Epid11VerifierSetGroupRl()
-: <a class="el" href="group___epid11_verifier_module.html#ga809c777908b2f9d029062d9424cb5f65">api.h</a>
-</li>
-<li>Epid11VerifierSetPrivRl()
-: <a class="el" href="group___epid11_verifier_module.html#gaffbe6ac2bc7236ad65126a17ebdceb14">api.h</a>
-</li>
-<li>Epid11VerifierSetSigRl()
-: <a class="el" href="group___epid11_verifier_module.html#gaff5a014b0334be7e8583f0f99cb5e9b8">api.h</a>
-</li>
-<li>Epid11VerifierWritePrecomp()
-: <a class="el" href="group___epid11_verifier_module.html#ga241520cb925e5be89893a2037451cf1c">api.h</a>
-</li>
-<li>Epid11Verify()
-: <a class="el" href="group___epid11_verifier_module.html#gafe5ad6bde38ad0c3e0a9960975fd5216">api.h</a>
-</li>
-<li>Epid11VerifyBasicSig()
-: <a class="el" href="group___epid11_verifier_module.html#ga7b5d19277da043c2b79721975d7bd070">api.h</a>
-</li>
-<li>EpidAddPreSigs()
-: <a class="el" href="group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78">api.h</a>
-</li>
-<li>EpidAreSigsLinked()
-: <a class="el" href="group___epid_verifier_module.html#gae44bd8acbc1e7205aeedff0c7e2632a8">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>
-<li>EpidGetNumPreSigs()
-: <a class="el" href="group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075">api.h</a>
-</li>
-<li>EpidGetSigSize()
-: <a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000">api.h</a>
-</li>
-<li>EpidGetVerifierRlSize()
-: <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#gae7a7b01bc0a84c44c9d14e6c311c1ba7">api.h</a>
-</li>
-<li>EpidMemberDelete()
-: <a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">api.h</a>
-</li>
-<li>EpidMemberSetHashAlg()
-: <a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">api.h</a>
-</li>
-<li>EpidMemberSetSigRl()
-: <a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">api.h</a>
-</li>
-<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>
-</li>
-<li>EpidParseFileHeader()
-: <a class="el" href="group___file_parser.html#ga8e38d1102eb1dd9b5af2e2f79236da55">file_parser.h</a>
-</li>
-<li>EpidParseGroupPubKeyFile()
-: <a class="el" href="group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb">file_parser.h</a>
-</li>
-<li>EpidParseGroupRlFile()
-: <a class="el" href="group___file_parser.html#gad767f72dc55307b872a8b5600da3fd6f">file_parser.h</a>
-</li>
-<li>EpidParsePrivRlFile()
-: <a class="el" href="group___file_parser.html#gadc033fb23e3cbda56aa7e3d412060b7e">file_parser.h</a>
-</li>
-<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>EpidSign()
-: <a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">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>
-<li>EpidVerifierDelete()
-: <a class="el" href="group___epid_verifier_module.html#ga6707e691f4b3916f9c684d5bbd463d12">api.h</a>
-</li>
-<li>EpidVerifierSetBasename()
-: <a class="el" href="group___epid_verifier_module.html#ga1c3810ef361da678a1f77823bd9c37a6">api.h</a>
-</li>
-<li>EpidVerifierSetGroupRl()
-: <a class="el" href="group___epid_verifier_module.html#ga1d41d6ef4dabbc30ec28452edd6baffb">api.h</a>
-</li>
-<li>EpidVerifierSetHashAlg()
-: <a class="el" href="group___epid_verifier_module.html#ga97b58b2382f24756b66a357f1e825c92">api.h</a>
-</li>
-<li>EpidVerifierSetPrivRl()
-: <a class="el" href="group___epid_verifier_module.html#gafab08180a43b58ce2e1d56c4b070bb0e">api.h</a>
-</li>
-<li>EpidVerifierSetSigRl()
-: <a class="el" href="group___epid_verifier_module.html#ga4c7c9820409ee06f30bb8dc75fdd5dcf">api.h</a>
-</li>
-<li>EpidVerifierSetVerifierRl()
-: <a class="el" href="group___epid_verifier_module.html#ga0909703a0a4dfe080374d0d99077465a">api.h</a>
-</li>
-<li>EpidVerifierWritePrecomp()
-: <a class="el" href="group___epid_verifier_module.html#ga92df4d00ea4ee59d7bfd35b23da03392">api.h</a>
-</li>
-<li>EpidVerify()
-: <a class="el" href="group___epid_verifier_module.html#gae3f9c37628e18b880d8bbee3e7f55064">api.h</a>
-</li>
-<li>EpidVerifyBasicSig()
-: <a class="el" href="group___epid_verifier_module.html#gac3b1f1a2bdba8eeeebbf1e0c8c00862e">api.h</a>
-</li>
-<li>EpidWriteVerifierRl()
-: <a class="el" href="group___epid_verifier_module.html#gac857bff47e7d80363eac15285471fe81">api.h</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
-<li>FfAdd()
-: <a class="el" href="group___finite_field_primitives.html#ga1a6e6d3c2319bb24eae8670b021e223b">finitefield.h</a>
-</li>
-<li>FfExp()
-: <a class="el" href="group___finite_field_primitives.html#gaf0ddbc1bad048d67771cba119eb44a6c">finitefield.h</a>
-</li>
-<li>FfGetRandom()
-: <a class="el" href="group___finite_field_primitives.html#ga6622db072782fd9e53b4d59dd3dbd8e8">finitefield.h</a>
-</li>
-<li>FfHash()
-: <a class="el" href="group___finite_field_primitives.html#gabd511d79d9cbd1899e59258f149102c5">finitefield.h</a>
-</li>
-<li>FfInv()
-: <a class="el" href="group___finite_field_primitives.html#ga26069d035d0f6ade33af2b5d5c14949a">finitefield.h</a>
-</li>
-<li>FfIsEqual()
-: <a class="el" href="group___finite_field_primitives.html#gaed2acb8583e9c9f6b49fdb660c672625">finitefield.h</a>
-</li>
-<li>FfIsZero()
-: <a class="el" href="group___finite_field_primitives.html#ga20d9140e5670d679ef8183d9b5115f53">finitefield.h</a>
-</li>
-<li>FfMul()
-: <a class="el" href="group___finite_field_primitives.html#ga4613a75bd001a974b3e3e494c3a112a5">finitefield.h</a>
-</li>
-<li>FfMultiExp()
-: <a class="el" href="group___finite_field_primitives.html#ga84d21decc1c957bcf6e98e1492eb2ac3">finitefield.h</a>
-</li>
-<li>FfMultiExpBn()
-: <a class="el" href="group___finite_field_primitives.html#ga1ef46fc83f9c11263a2aa1ec906c9144">finitefield.h</a>
-</li>
-<li>FfNeg()
-: <a class="el" href="group___finite_field_primitives.html#gae7a8c7503b6fc7a41bcaab4d45ca37b2">finitefield.h</a>
-</li>
-<li>FfSqrt()
-: <a class="el" href="group___finite_field_primitives.html#ga39892fe2ab431e166dbbcf57756660f6">finitefield.h</a>
-</li>
-<li>FfSscmMultiExp()
-: <a class="el" href="group___finite_field_primitives.html#ga0d0c31a22bbfb665a16b2d25b0cd2634">finitefield.h</a>
-</li>
-<li>FfSub()
-: <a class="el" href="group___finite_field_primitives.html#ga59d20610f245ff4bc3a17b7bfe289991">finitefield.h</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
-<li>InitFfElementFromBn()
-: <a class="el" href="group___finite_field_primitives.html#ga90b2c192708973b54b7a3e82b34536ed">finitefield.h</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
-<li>NewBigNum()
-: <a class="el" href="group___big_num_primitives.html#gad5f6f262bfd780fed3678bcee16f0aed">bignum.h</a>
-</li>
-<li>NewEcGroup()
-: <a class="el" href="group___ec_group_primitives.html#gaf4e23677dd378ef2e0cf55df79cbdb62">ecgroup.h</a>
-</li>
-<li>NewEcPoint()
-: <a class="el" href="group___ec_group_primitives.html#ga6417b0ce72ba96de00c329e322fec7fb">ecgroup.h</a>
-</li>
-<li>NewEpid11PairingState()
-: <a class="el" href="group___epid11_pairing_primitives.html#ga0ee658e26e9f933ba2ffbf2504dfae7e">tatepairing.h</a>
-</li>
-<li>NewFfElement()
-: <a class="el" href="group___finite_field_primitives.html#gacc54f315ede2dbeb8c5990c024a0de6c">finitefield.h</a>
-</li>
-<li>NewFiniteField()
-: <a class="el" href="group___finite_field_primitives.html#ga7d99fdc5e4573668a5744e49df7ab67c">finitefield.h</a>
-</li>
-<li>NewFiniteFieldViaBinomalExtension()
-: <a class="el" href="group___finite_field_primitives.html#ga83041e3be9984a4bd8f1021934bfa3a2">finitefield.h</a>
-</li>
-<li>NewFiniteFieldViaPolynomialExtension()
-: <a class="el" href="group___finite_field_primitives.html#gae69af62a03179718cac81b004549c598">finitefield.h</a>
-</li>
-<li>NewPairingState()
-: <a class="el" href="group___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc">pairing.h</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
-<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>
-<li>PrintBigNumStr()
-: <a class="el" href="group___epid_print.html#ga5f249c594ed12e4a9b11b7bc101da85d">printutils.h</a>
-</li>
-<li>PrintEcPoint()
-: <a class="el" href="group___epid_print.html#ga0d6377d9c1651d0101ec6b61feaa78ca">printutils.h</a>
-</li>
-<li>PrintFfElement()
-: <a class="el" href="group___epid_print.html#gaa3b1cbbfc6f78562658953113e5798cf">printutils.h</a>
-</li>
-<li>PrintFpElemStr()
-: <a class="el" href="group___epid_print.html#gae553c3a156a0e4968b89635ab0757580">printutils.h</a>
-</li>
-<li>PrintFq12ElemStr()
-: <a class="el" href="group___epid_print.html#gaf185fe3df270cd8b4a2969bf3cfc5d5f">printutils.h</a>
-</li>
-<li>PrintFq2ElemStr()
-: <a class="el" href="group___epid_print.html#ga883a834ab1703365bb0bca4abd3104de">printutils.h</a>
-</li>
-<li>PrintFq6ElemStr()
-: <a class="el" href="group___epid_print.html#ga3f2961ef6b4c44a6205d422d8a293476">printutils.h</a>
-</li>
-<li>PrintFqElemStr()
-: <a class="el" href="group___epid_print.html#ga6c9fea48fa0477f4a98abb50f891a5e4">printutils.h</a>
-</li>
-<li>PrintG1ElemStr()
-: <a class="el" href="group___epid_print.html#ga87168a3ce5306f9839b8e8d6c9a5f84f">printutils.h</a>
-</li>
-<li>PrintG2ElemStr()
-: <a class="el" href="group___epid_print.html#gab76a4cf0385dc4a76bb56ee9f0e3e87a">printutils.h</a>
-</li>
-<li>PrintGtElemStr()
-: <a class="el" href="group___epid_print.html#ga138cd388247a58680d4701d59d6976d2">printutils.h</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
-<li>ReadBigNum()
-: <a class="el" href="group___big_num_primitives.html#gabe8e39d5788423f41770a71a4c911fbe">bignum.h</a>
-</li>
-<li>ReadEcPoint()
-: <a class="el" href="group___ec_group_primitives.html#gad495a9f91b79984f7533c8ea4f92b3cb">ecgroup.h</a>
-</li>
-<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>
-
-
-<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
-<li>Sha256MessageDigest()
-: <a class="el" href="group___hash_primitives.html#ga86d62aac9efd7445acee311b41846c6c">hash.h</a>
-</li>
-</ul>
-
-
-<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
-<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>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>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>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>Tpm2FlushKey()
-: <a class="el" href="context_8c.html#a7f547c0068dc63f0a6b76ad15b1b9675">context.c</a>
-</li>
-<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>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>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>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>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>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>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>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>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>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>
-
-
-<h3><a class="anchor" id="index_w"></a>- w -</h3><ul>
-<li>WriteBigNum()
-: <a class="el" href="group___big_num_primitives.html#ga904c16cc020e7196f22ac9abdc31b41f">bignum.h</a>
-</li>
-<li>WriteEcPoint()
-: <a class="el" href="group___ec_group_primitives.html#ga7a8bdb9782d065bc32fd102e0ae73ccb">ecgroup.h</a>
-</li>
-<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 -->
<!-- HTML footer for doxygen 1.8.10-->
diff --git a/doc/html/globals_func_d.html b/doc/html/globals_func_d.html
new file mode 100644
index 0000000..29ddda8
--- /dev/null
+++ b/doc/html/globals_func_d.html
@@ -0,0 +1,97 @@
+<!-- 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: Globals</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">6.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('globals_func_d.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_d"></a>- d -</h3><ul>
+<li>DeleteBigNum()
+: <a class="el" href="group___big_num_primitives.html#ga2d17600068b1d94000635c6644258a03">bignum.h</a>
+</li>
+<li>DeleteEcGroup()
+: <a class="el" href="group___ec_group_primitives.html#gab7af276256c27610eda85ff432b846ea">ecgroup.h</a>
+</li>
+<li>DeleteEcPoint()
+: <a class="el" href="group___ec_group_primitives.html#ga8cb086d792bffb79b3ca07e6ca4ce0e7">ecgroup.h</a>
+</li>
+<li>DeleteEpid11PairingState()
+: <a class="el" href="group___epid11_pairing_primitives.html#gaa3457d6f85889bc714910252fd21c758">tatepairing.h</a>
+</li>
+<li>DeleteFfElement()
+: <a class="el" href="group___finite_field_primitives.html#ga1bad3c6945d1d709fceb07a1dd03000e">finitefield.h</a>
+</li>
+<li>DeleteFiniteField()
+: <a class="el" href="group___finite_field_primitives.html#gacbdd2871ecf93dadaac9d2c5b16e1e5f">finitefield.h</a>
+</li>
+<li>DeletePairingState()
+: <a class="el" href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d">pairing.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_e.html b/doc/html/globals_func_e.html
new file mode 100644
index 0000000..3228f6f
--- /dev/null
+++ b/doc/html/globals_func_e.html
@@ -0,0 +1,416 @@
+<!-- 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: Globals</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">6.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('globals_func_e.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
+<li>EcdsaSignBuffer()
+: <a class="el" href="group___ecdsa_primitives.html#gaef0e8a31e830fe9285b43a0969e6611a">ecdsa.h</a>
+</li>
+<li>EcdsaVerifyBuffer()
+: <a class="el" href="group___ecdsa_primitives.html#ga07e4ebd3423e1f6f9ae35f0608dde7c0">ecdsa.h</a>
+</li>
+<li>EcExp()
+: <a class="el" href="group___ec_group_primitives.html#ga01bf8d6fa60a2e445490966b3a06c270">ecgroup.h</a>
+</li>
+<li>EcGetRandom()
+: <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#gac3067cc899e65e647390bb3bd1cabe4c">ecgroup.h</a>
+</li>
+<li>EcInGroup()
+: <a class="el" href="group___ec_group_primitives.html#ga48ec5ae951c9f49d8d7d983234eea921">ecgroup.h</a>
+</li>
+<li>EcInverse()
+: <a class="el" href="group___ec_group_primitives.html#ga0b6d7a3398251e9352fb29ef4abef466">ecgroup.h</a>
+</li>
+<li>EcIsEqual()
+: <a class="el" href="group___ec_group_primitives.html#gad3b3c63c48fa24e8dea07837b05bc061">ecgroup.h</a>
+</li>
+<li>EcIsIdentity()
+: <a class="el" href="group___ec_group_primitives.html#ga9cf15b34bc4ff12e58b169dd989d8210">ecgroup.h</a>
+</li>
+<li>EcMakePoint()
+: <a class="el" href="group___ec_group_primitives.html#ga8a6114a48214a327d4ec04fd25e5940e">ecgroup.h</a>
+</li>
+<li>EcMul()
+: <a class="el" href="group___ec_group_primitives.html#ga25c9013cc76907d73765eb7a96aa8c96">ecgroup.h</a>
+</li>
+<li>EcMultiExp()
+: <a class="el" href="group___ec_group_primitives.html#gae96c38e004ccd2211290ad6e66415ec4">ecgroup.h</a>
+</li>
+<li>EcMultiExpBn()
+: <a class="el" href="group___ec_group_primitives.html#ga76d24378455eb96a3257fe8045c0993a">ecgroup.h</a>
+</li>
+<li>EcSscmExp()
+: <a class="el" href="group___ec_group_primitives.html#gaf3b6a548aa6f0d4f028a14feca251f57">ecgroup.h</a>
+</li>
+<li>EcSscmMultiExp()
+: <a class="el" href="group___ec_group_primitives.html#ga40e3431d3dbe8cf7a65ada7b7811cba4">ecgroup.h</a>
+</li>
+<li>EFq2Add()
+: <a class="el" href="efq2_8h.html#a6cbfb24b20b29b2e678e259aa6c0e2db">efq2.h</a>
+</li>
+<li>EFq2Dbl()
+: <a class="el" href="efq2_8h.html#a1db50d99360ed019ca4dcd2f9bcf210a">efq2.h</a>
+</li>
+<li>EFq2Deserialize()
+: <a class="el" href="serialize_8h.html#a393c9cf42edef41aa28449a0d321a57e">serialize.h</a>
+</li>
+<li>EFq2Eq()
+: <a class="el" href="efq2_8h.html#a2064ea9b48565a164314da4b487aaabd">efq2.h</a>
+</li>
+<li>EFq2FromAffine()
+: <a class="el" href="efq2_8h.html#af1da3e171d605db6f5ea0a70dc01ac27">efq2.h</a>
+</li>
+<li>EFq2IsInf()
+: <a class="el" href="efq2_8h.html#a9181b09474d800c65fd89aee2c28ebab">efq2.h</a>
+</li>
+<li>EFq2MulSSCM()
+: <a class="el" href="efq2_8h.html#a3ad678e3701e1211fa01ddc54f2bc5e4">efq2.h</a>
+</li>
+<li>EFq2Neg()
+: <a class="el" href="efq2_8h.html#a977bd074ed0dec943ad0cf19a01c0cf7">efq2.h</a>
+</li>
+<li>EFq2OnCurve()
+: <a class="el" href="efq2_8h.html#a26c35eefbd1ee11a5d078c44d295ff5a">efq2.h</a>
+</li>
+<li>EFq2Serialize()
+: <a class="el" href="serialize_8h.html#aa53e1c30fa109e586fa90a3a4cf3d0ac">serialize.h</a>
+</li>
+<li>EFq2ToAffine()
+: <a class="el" href="efq2_8h.html#a484e6af5efc2042d865999dac9489684">efq2.h</a>
+</li>
+<li>EFqAdd()
+: <a class="el" href="efq_8h.html#abf04f5ec866fc77d0203beb8a8991f25">efq.h</a>
+</li>
+<li>EFqAffineAdd()
+: <a class="el" href="efq_8h.html#a6cf130d65a5f35237a88046faad43c0a">efq.h</a>
+</li>
+<li>EFqAffineDbl()
+: <a class="el" href="efq_8h.html#a975f92abdaf431f2fb152fca84d468b3">efq.h</a>
+</li>
+<li>EFqAffineExp()
+: <a class="el" href="efq_8h.html#a8990ca0e19d8ed7b78958963e60948e2">efq.h</a>
+</li>
+<li>EFqAffineMultiExp()
+: <a class="el" href="efq_8h.html#a2618ae4b4fc8f2838a6550abfb4448ca">efq.h</a>
+</li>
+<li>EFqCondSet()
+: <a class="el" href="efq_8h.html#a9b2fcab6bc74601f9c302c5b34400ae4">efq.h</a>
+</li>
+<li>EFqCp()
+: <a class="el" href="efq_8h.html#a7a7863639a5b96d44522d579d7d32e40">efq.h</a>
+</li>
+<li>EFqDbl()
+: <a class="el" href="efq_8h.html#a23b6331263b002e6e07d2be5216fd6e8">efq.h</a>
+</li>
+<li>EFqDeserialize()
+: <a class="el" href="serialize_8h.html#af7f9b8ffdf1bb18bc156a4f80fc32419">serialize.h</a>
+</li>
+<li>EFqEq()
+: <a class="el" href="efq_8h.html#a7fbfe9d25cf08f4dcbd950cfb07471ff">efq.h</a>
+</li>
+<li>EFqEqAffine()
+: <a class="el" href="efq_8h.html#acfc458ea689ea3aa637c9c817dfa44c5">efq.h</a>
+</li>
+<li>EFqFromAffine()
+: <a class="el" href="efq_8h.html#a97ce025667b076986a6d92b3d41a7827">efq.h</a>
+</li>
+<li>EFqHash()
+: <a class="el" href="efq_8h.html#abf80ad8b8e3e506f4c46ec57de1c4846">efq.h</a>
+</li>
+<li>EFqInf()
+: <a class="el" href="efq_8h.html#a73fd77b7cc14c0decd95fd294b5b250c">efq.h</a>
+</li>
+<li>EFqIsInf()
+: <a class="el" href="efq_8h.html#ae38257cf97872a4fa855033ad44e2e10">efq.h</a>
+</li>
+<li>EFqJCp()
+: <a class="el" href="efq_8h.html#a1a31d069739c4da17011280a8ae6354a">efq.h</a>
+</li>
+<li>EFqJOnCurve()
+: <a class="el" href="efq_8h.html#ada751265a36ee3236fce90105a62909e">efq.h</a>
+</li>
+<li>EFqJRand()
+: <a class="el" href="efq_8h.html#a15bda5d411f7c6d602994e6444034414">efq.h</a>
+</li>
+<li>EFqMulSSCM()
+: <a class="el" href="efq_8h.html#a84e5231cee67eeba5b2a0f99088bc70e">efq.h</a>
+</li>
+<li>EFqMultiExp()
+: <a class="el" href="efq_8h.html#abbcd39b964e4fd685d1dba73ec110c86">efq.h</a>
+</li>
+<li>EFqNeg()
+: <a class="el" href="efq_8h.html#a0f7309ab07d4d3e0556a32f1839ae6fe">efq.h</a>
+</li>
+<li>EFqOnCurve()
+: <a class="el" href="efq_8h.html#a81470fed188d5043f89b6b8ab6031a42">efq.h</a>
+</li>
+<li>EFqRand()
+: <a class="el" href="efq_8h.html#a40588e2618ed9a38043532785a8d5785">efq.h</a>
+</li>
+<li>EFqSerialize()
+: <a class="el" href="serialize_8h.html#a81b7bcb69d6ea28ebb3e3520c7d0eeb5">serialize.h</a>
+</li>
+<li>EFqSet()
+: <a class="el" href="efq_8h.html#a7d1841f9e29bc604054536de7a4a861d">efq.h</a>
+</li>
+<li>EFqToAffine()
+: <a class="el" href="efq_8h.html#aaf3f26e855b85e869cb80fae780a4e6a">efq.h</a>
+</li>
+<li>Epid11AreSigsLinked()
+: <a class="el" href="group___epid11_verifier_module.html#gab0b6560b226a37321f5ca5d4fb55eba7">api.h</a>
+</li>
+<li>Epid11CheckPrivRlEntry()
+: <a class="el" href="group___epid11_verifier_module.html#ga0b79c79d09e3551158e1c38c7c335929">api.h</a>
+</li>
+<li>Epid11EcHash()
+: <a class="el" href="group___ec_group_primitives.html#gaad96a1498b85d28f71514b8f7b154d82">ecgroup.h</a>
+</li>
+<li>Epid11NrVerify()
+: <a class="el" href="group___epid11_verifier_module.html#ga3a2e320d7de6156b2ce9d73e9cdce813">api.h</a>
+</li>
+<li>Epid11Pairing()
+: <a class="el" href="group___epid11_pairing_primitives.html#gaa4076dfe25e8e61ac6753333a322c059">tatepairing.h</a>
+</li>
+<li>Epid11ParseGroupPubKeyFile()
+: <a class="el" href="group___epid11_file_parser_module.html#ga1f92d1cb6bd7d9815711fde515b40a4c">file_parser.h</a>
+</li>
+<li>Epid11ParseGroupRlFile()
+: <a class="el" href="group___epid11_file_parser_module.html#gae28a844eb68828480b2a76fcb7d252a3">file_parser.h</a>
+</li>
+<li>Epid11ParsePrivRlFile()
+: <a class="el" href="group___epid11_file_parser_module.html#gae682077d315c39ed298ef198fd738546">file_parser.h</a>
+</li>
+<li>Epid11ParseSigRlFile()
+: <a class="el" href="group___epid11_file_parser_module.html#gac3f6daaa5333627d4efe5438c1fe8868">file_parser.h</a>
+</li>
+<li>Epid11VerifierCreate()
+: <a class="el" href="group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8">api.h</a>
+</li>
+<li>Epid11VerifierDelete()
+: <a class="el" href="group___epid11_verifier_module.html#ga63cae8d5abcf4d7e3af4157de18998f1">api.h</a>
+</li>
+<li>Epid11VerifierSetBasename()
+: <a class="el" href="group___epid11_verifier_module.html#ga0cb6d30df527ee0d8f0a1b68d2b7c0c0">api.h</a>
+</li>
+<li>Epid11VerifierSetGroupRl()
+: <a class="el" href="group___epid11_verifier_module.html#ga809c777908b2f9d029062d9424cb5f65">api.h</a>
+</li>
+<li>Epid11VerifierSetPrivRl()
+: <a class="el" href="group___epid11_verifier_module.html#gaffbe6ac2bc7236ad65126a17ebdceb14">api.h</a>
+</li>
+<li>Epid11VerifierSetSigRl()
+: <a class="el" href="group___epid11_verifier_module.html#gaff5a014b0334be7e8583f0f99cb5e9b8">api.h</a>
+</li>
+<li>Epid11VerifierWritePrecomp()
+: <a class="el" href="group___epid11_verifier_module.html#ga241520cb925e5be89893a2037451cf1c">api.h</a>
+</li>
+<li>Epid11Verify()
+: <a class="el" href="group___epid11_verifier_module.html#gafe5ad6bde38ad0c3e0a9960975fd5216">api.h</a>
+</li>
+<li>Epid11VerifyBasicSig()
+: <a class="el" href="group___epid11_verifier_module.html#ga7b5d19277da043c2b79721975d7bd070">api.h</a>
+</li>
+<li>EpidAddPreSigs()
+: <a class="el" href="group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78">api.h</a>
+</li>
+<li>EpidAreSigsLinked()
+: <a class="el" href="group___epid_verifier_module.html#gae44bd8acbc1e7205aeedff0c7e2632a8">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>EpidClearRegisteredBasenames()
+: <a class="el" href="group___epid_member_module.html#ga4f3a464f14581ef3e5a50719cb4709c3">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>
+<li>EpidGetNumPreSigs()
+: <a class="el" href="group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075">api.h</a>
+</li>
+<li>EpidGetSigSize()
+: <a class="el" href="group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000">api.h</a>
+</li>
+<li>EpidGetVerifierRlSize()
+: <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#gae7a7b01bc0a84c44c9d14e6c311c1ba7">api.h</a>
+</li>
+<li>EpidMemberDeinit()
+: <a class="el" href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d">api.h</a>
+</li>
+<li>EpidMemberDelete()
+: <a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6">api.h</a>
+</li>
+<li>EpidMemberGetSize()
+: <a class="el" href="group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24">api.h</a>
+</li>
+<li>EpidMemberInit()
+: <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb">api.h</a>
+</li>
+<li>EpidMemberSetHashAlg()
+: <a class="el" href="group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf">api.h</a>
+</li>
+<li>EpidMemberSetSigRl()
+: <a class="el" href="group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4">api.h</a>
+</li>
+<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>
+</li>
+<li>EpidParseFileHeader()
+: <a class="el" href="group___file_parser.html#ga8e38d1102eb1dd9b5af2e2f79236da55">file_parser.h</a>
+</li>
+<li>EpidParseGroupPubKeyFile()
+: <a class="el" href="group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb">file_parser.h</a>
+</li>
+<li>EpidParseGroupRlFile()
+: <a class="el" href="group___file_parser.html#gad767f72dc55307b872a8b5600da3fd6f">file_parser.h</a>
+</li>
+<li>EpidParsePrivRlFile()
+: <a class="el" href="group___file_parser.html#gadc033fb23e3cbda56aa7e3d412060b7e">file_parser.h</a>
+</li>
+<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#ga8c6f097ba89542664375bd5e0f205220">api.h</a>
+</li>
+<li>EpidSign()
+: <a class="el" href="group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f">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_8c.html#ad08628a6bf33154c1029a32e8b83325f">conversion.c</a>
+, <a class="el" href="conversion_8h.html#ad08628a6bf33154c1029a32e8b83325f">conversion.h</a>
+</li>
+<li>EpidVerifierCreate()
+: <a class="el" href="group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70">api.h</a>
+</li>
+<li>EpidVerifierDelete()
+: <a class="el" href="group___epid_verifier_module.html#ga6707e691f4b3916f9c684d5bbd463d12">api.h</a>
+</li>
+<li>EpidVerifierSetBasename()
+: <a class="el" href="group___epid_verifier_module.html#ga1c3810ef361da678a1f77823bd9c37a6">api.h</a>
+</li>
+<li>EpidVerifierSetGroupRl()
+: <a class="el" href="group___epid_verifier_module.html#ga1d41d6ef4dabbc30ec28452edd6baffb">api.h</a>
+</li>
+<li>EpidVerifierSetHashAlg()
+: <a class="el" href="group___epid_verifier_module.html#ga97b58b2382f24756b66a357f1e825c92">api.h</a>
+</li>
+<li>EpidVerifierSetPrivRl()
+: <a class="el" href="group___epid_verifier_module.html#gafab08180a43b58ce2e1d56c4b070bb0e">api.h</a>
+</li>
+<li>EpidVerifierSetSigRl()
+: <a class="el" href="group___epid_verifier_module.html#ga4c7c9820409ee06f30bb8dc75fdd5dcf">api.h</a>
+</li>
+<li>EpidVerifierSetVerifierRl()
+: <a class="el" href="group___epid_verifier_module.html#ga0909703a0a4dfe080374d0d99077465a">api.h</a>
+</li>
+<li>EpidVerifierWritePrecomp()
+: <a class="el" href="group___epid_verifier_module.html#ga92df4d00ea4ee59d7bfd35b23da03392">api.h</a>
+</li>
+<li>EpidVerify()
+: <a class="el" href="group___epid_verifier_module.html#gae3f9c37628e18b880d8bbee3e7f55064">api.h</a>
+</li>
+<li>EpidVerifyBasicSig()
+: <a class="el" href="group___epid_verifier_module.html#gac3b1f1a2bdba8eeeebbf1e0c8c00862e">api.h</a>
+</li>
+<li>EpidWriteVerifierRl()
+: <a class="el" href="group___epid_verifier_module.html#gac857bff47e7d80363eac15285471fe81">api.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_f.html b/doc/html/globals_func_f.html
new file mode 100644
index 0000000..6d66bc9
--- /dev/null
+++ b/doc/html/globals_func_f.html
@@ -0,0 +1,364 @@
+<!-- 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: Globals</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">6.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('globals_func_f.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_f"></a>- f -</h3><ul>
+<li>FfAdd()
+: <a class="el" href="group___finite_field_primitives.html#ga1a6e6d3c2319bb24eae8670b021e223b">finitefield.h</a>
+</li>
+<li>FfExp()
+: <a class="el" href="group___finite_field_primitives.html#gaf0ddbc1bad048d67771cba119eb44a6c">finitefield.h</a>
+</li>
+<li>FfGetRandom()
+: <a class="el" href="group___finite_field_primitives.html#ga6622db072782fd9e53b4d59dd3dbd8e8">finitefield.h</a>
+</li>
+<li>FfHash()
+: <a class="el" href="group___finite_field_primitives.html#gabd511d79d9cbd1899e59258f149102c5">finitefield.h</a>
+</li>
+<li>FfInv()
+: <a class="el" href="group___finite_field_primitives.html#ga26069d035d0f6ade33af2b5d5c14949a">finitefield.h</a>
+</li>
+<li>FfIsEqual()
+: <a class="el" href="group___finite_field_primitives.html#gaed2acb8583e9c9f6b49fdb660c672625">finitefield.h</a>
+</li>
+<li>FfIsZero()
+: <a class="el" href="group___finite_field_primitives.html#ga20d9140e5670d679ef8183d9b5115f53">finitefield.h</a>
+</li>
+<li>FfMul()
+: <a class="el" href="group___finite_field_primitives.html#ga4613a75bd001a974b3e3e494c3a112a5">finitefield.h</a>
+</li>
+<li>FfMultiExp()
+: <a class="el" href="group___finite_field_primitives.html#ga84d21decc1c957bcf6e98e1492eb2ac3">finitefield.h</a>
+</li>
+<li>FfMultiExpBn()
+: <a class="el" href="group___finite_field_primitives.html#ga1ef46fc83f9c11263a2aa1ec906c9144">finitefield.h</a>
+</li>
+<li>FfNeg()
+: <a class="el" href="group___finite_field_primitives.html#gae7a8c7503b6fc7a41bcaab4d45ca37b2">finitefield.h</a>
+</li>
+<li>FfSqrt()
+: <a class="el" href="group___finite_field_primitives.html#ga39892fe2ab431e166dbbcf57756660f6">finitefield.h</a>
+</li>
+<li>FfSscmMultiExp()
+: <a class="el" href="group___finite_field_primitives.html#ga0d0c31a22bbfb665a16b2d25b0cd2634">finitefield.h</a>
+</li>
+<li>FfSub()
+: <a class="el" href="group___finite_field_primitives.html#ga59d20610f245ff4bc3a17b7bfe289991">finitefield.h</a>
+</li>
+<li>FpAdd()
+: <a class="el" href="fp_8h.html#a55152abe8b866eba5a0c83cfb1bbe5f6">fp.h</a>
+</li>
+<li>FpClear()
+: <a class="el" href="fp_8h.html#adf010ec5710d4013e33efd7e5ba8f9ad">fp.h</a>
+</li>
+<li>FpDeserialize()
+: <a class="el" href="serialize_8h.html#ac49c8bd07a7f09aadd08c58c362cf3af">serialize.h</a>
+</li>
+<li>FpEq()
+: <a class="el" href="fp_8h.html#a7bb685bd810368d8077f638ffcab2554">fp.h</a>
+</li>
+<li>FpExp()
+: <a class="el" href="fp_8h.html#ab06b1b1a59f1138aa6c4d746ab707f86">fp.h</a>
+</li>
+<li>FpFromHash()
+: <a class="el" href="fp_8h.html#a472b0a9229b0eff0ca445f158efa1175">fp.h</a>
+</li>
+<li>FpInField()
+: <a class="el" href="fp_8h.html#ac2eab44a7aa9679d107667ffc035ee0a">fp.h</a>
+</li>
+<li>FpInv()
+: <a class="el" href="fp_8h.html#a9e7500fe8ee73592b002ed675d1758b3">fp.h</a>
+</li>
+<li>FpMul()
+: <a class="el" href="fp_8h.html#a9392597a6fe50e5c102ce21b8a1ae6c2">fp.h</a>
+</li>
+<li>FpNeg()
+: <a class="el" href="fp_8h.html#a0524fd074857712ea61ea5717ff54fd3">fp.h</a>
+</li>
+<li>FpRand()
+: <a class="el" href="fp_8h.html#a6c06b175fd82b5db555508f2d26713f8">fp.h</a>
+</li>
+<li>FpRandNonzero()
+: <a class="el" href="fp_8h.html#a54743809639797b4d4445c221291048b">fp.h</a>
+</li>
+<li>FpSerialize()
+: <a class="el" href="serialize_8h.html#a57237335a24f8a9b2a151a2141ec5917">serialize.h</a>
+</li>
+<li>FpSet()
+: <a class="el" href="fp_8h.html#a23bf42c7024a318970a6b60c02d9a08d">fp.h</a>
+</li>
+<li>FpSub()
+: <a class="el" href="fp_8h.html#aa9cc9f5e33bba75420b83cb2d49ca280">fp.h</a>
+</li>
+<li>Fq12Add()
+: <a class="el" href="fq12_8h.html#aa4a17bfa56644ab615c60bd7ec900821">fq12.h</a>
+</li>
+<li>Fq12Clear()
+: <a class="el" href="fq12_8h.html#aaeb34cf6f4d176674fc300d7e7fc57f1">fq12.h</a>
+</li>
+<li>Fq12Conj()
+: <a class="el" href="fq12_8h.html#a33a3bb0f378ac008cde38b88a39ea79c">fq12.h</a>
+</li>
+<li>Fq12Cp()
+: <a class="el" href="fq12_8h.html#ad739d6a59a3f7ed0c0117c7486d06290">fq12.h</a>
+</li>
+<li>Fq12Deserialize()
+: <a class="el" href="serialize_8h.html#a2f5ba336b7da938e92dad848e00ad157">serialize.h</a>
+</li>
+<li>Fq12Eq()
+: <a class="el" href="fq12_8h.html#a08b50a1f5fe19c78a19f1f4a457b9a39">fq12.h</a>
+</li>
+<li>Fq12Exp()
+: <a class="el" href="fq12_8h.html#a3bf52e5b01103632fa429927e5a07b1d">fq12.h</a>
+</li>
+<li>Fq12ExpCyc()
+: <a class="el" href="fq12_8h.html#a65ad8c0f4aa0859593aab885066c5025">fq12.h</a>
+</li>
+<li>Fq12Inv()
+: <a class="el" href="fq12_8h.html#afd089e0cb6e4ec68a3a3062f26d4430d">fq12.h</a>
+</li>
+<li>Fq12Mul()
+: <a class="el" href="fq12_8h.html#aec7e0ce55e01ab48c0c6315cb9e5b47d">fq12.h</a>
+</li>
+<li>Fq12MulSpecial()
+: <a class="el" href="fq12_8h.html#ac1b44bbceb1c648b2b880871c8b52195">fq12.h</a>
+</li>
+<li>Fq12MultiExp()
+: <a class="el" href="fq12_8h.html#ae88eb95c37c9db2e37e14d8a9304fadd">fq12.h</a>
+</li>
+<li>Fq12Neg()
+: <a class="el" href="fq12_8h.html#af3fd9055d559c592eb5715bb261c072b">fq12.h</a>
+</li>
+<li>Fq12Serialize()
+: <a class="el" href="serialize_8h.html#ad0de690fc04ff307fa64575f9033c4d7">serialize.h</a>
+</li>
+<li>Fq12Set()
+: <a class="el" href="fq12_8h.html#acd16f86f83021d44d25389ad9f701597">fq12.h</a>
+</li>
+<li>Fq12SqCyc()
+: <a class="el" href="fq12_8h.html#a1ad8710126bb4906d6170dd8ab30e43a">fq12.h</a>
+</li>
+<li>Fq12Square()
+: <a class="el" href="fq12_8h.html#a12e88a0bbfcc24b1863754f5e027d28e">fq12.h</a>
+</li>
+<li>Fq12Sub()
+: <a class="el" href="fq12_8h.html#a80c3da69a0991423a728e9b74a2dfe15">fq12.h</a>
+</li>
+<li>Fq2Add()
+: <a class="el" href="fq2_8h.html#afcaaf75460f36b85386cd1959b904f57">fq2.h</a>
+</li>
+<li>Fq2Clear()
+: <a class="el" href="fq2_8h.html#a59d3d8212ffd5bf75f9b6fd85b896654">fq2.h</a>
+</li>
+<li>Fq2CondSet()
+: <a class="el" href="fq2_8h.html#ad94b155025e7a11b9c5b60032fde4491">fq2.h</a>
+</li>
+<li>Fq2Conj()
+: <a class="el" href="fq2_8h.html#adc0d02ddec564ca86b0ef53d7ff79864">fq2.h</a>
+</li>
+<li>Fq2Cp()
+: <a class="el" href="fq2_8h.html#a6c67364f78e6946a7ad3af2c86baf1a5">fq2.h</a>
+</li>
+<li>Fq2Eq()
+: <a class="el" href="fq2_8h.html#a3dc330cff53539b51183c43085275f97">fq2.h</a>
+</li>
+<li>Fq2Exp()
+: <a class="el" href="fq2_8h.html#acecbff7a5a8cec15e24c47663957c05a">fq2.h</a>
+</li>
+<li>Fq2Inv()
+: <a class="el" href="fq2_8h.html#a756666161516fe541b26a4082f69343d">fq2.h</a>
+</li>
+<li>Fq2IsZero()
+: <a class="el" href="fq2_8h.html#a610c9d7c2afa63b1d48da30c684d6e27">fq2.h</a>
+</li>
+<li>Fq2Mul()
+: <a class="el" href="fq2_8h.html#a876f870f84cd8ab697176dbb42591565">fq2.h</a>
+</li>
+<li>Fq2MulScalar()
+: <a class="el" href="fq2_8h.html#af45903d791794faabedb00f760885e8c">fq2.h</a>
+</li>
+<li>Fq2MulXi()
+: <a class="el" href="fq2_8h.html#afeeb4e14ddf9f39f860661c599923c58">fq2.h</a>
+</li>
+<li>Fq2Neg()
+: <a class="el" href="fq2_8h.html#a5d523d5d6d4159c71f58945af82a7936">fq2.h</a>
+</li>
+<li>Fq2Set()
+: <a class="el" href="fq2_8h.html#a9165c1d2deef46ceb9af238928b2ec5c">fq2.h</a>
+</li>
+<li>Fq2Square()
+: <a class="el" href="fq2_8h.html#a3c6583dd519a3dd7efb26db5e9a59036">fq2.h</a>
+</li>
+<li>Fq2Sub()
+: <a class="el" href="fq2_8h.html#ae27a9400b5d8fbd0b720a449c60ad146">fq2.h</a>
+</li>
+<li>Fq6Add()
+: <a class="el" href="fq6_8h.html#a0607ab44e53c7a16f8e1b2746d250a7c">fq6.h</a>
+</li>
+<li>Fq6Clear()
+: <a class="el" href="fq6_8h.html#a7c77a862223f577e11e595332c9fb272">fq6.h</a>
+</li>
+<li>Fq6CondSet()
+: <a class="el" href="fq6_8h.html#aa0c82e905ee190ad2187b89e464466d4">fq6.h</a>
+</li>
+<li>Fq6Cp()
+: <a class="el" href="fq6_8h.html#a36bd769bc95b887f75bb60c2f7a45e17">fq6.h</a>
+</li>
+<li>Fq6Eq()
+: <a class="el" href="fq6_8h.html#aaf54d03c0afdb6eeced6ddad1237c2e4">fq6.h</a>
+</li>
+<li>Fq6Inv()
+: <a class="el" href="fq6_8h.html#a5f4708ca109578527afd8cda99acd6ee">fq6.h</a>
+</li>
+<li>Fq6IsZero()
+: <a class="el" href="fq6_8h.html#a634aab5dc04177587a22324352ff91e5">fq6.h</a>
+</li>
+<li>Fq6Mul()
+: <a class="el" href="fq6_8h.html#ad1e1cac423a2c3c69a4f3629d33faaf1">fq6.h</a>
+</li>
+<li>Fq6MulScalar()
+: <a class="el" href="fq6_8h.html#a701d89b5c73ba67a2f765d49f5d5ae4e">fq6.h</a>
+</li>
+<li>Fq6MulV()
+: <a class="el" href="fq6_8h.html#ad30bd276a4e2e9df3613072c38ec13ae">fq6.h</a>
+</li>
+<li>Fq6Neg()
+: <a class="el" href="fq6_8h.html#a9a5ddbf8f16b48030209b172079d22a6">fq6.h</a>
+</li>
+<li>Fq6Set()
+: <a class="el" href="fq6_8h.html#a06b8c3988c3782fda22c9ffb47b5180b">fq6.h</a>
+</li>
+<li>Fq6Square()
+: <a class="el" href="fq6_8h.html#a58e5b68a86b776d82ade8307046e2375">fq6.h</a>
+</li>
+<li>Fq6Sub()
+: <a class="el" href="fq6_8h.html#a87d07ab842862a482410a838516ad0c7">fq6.h</a>
+</li>
+<li>FqAdd()
+: <a class="el" href="fq_8h.html#ab52f69c761454d976c3fc56a26549419">fq.h</a>
+</li>
+<li>FqClear()
+: <a class="el" href="fq_8h.html#ac85eb642d3b3973477749769e04d45af">fq.h</a>
+</li>
+<li>FqCondSet()
+: <a class="el" href="fq_8h.html#afbb0976ef343b14c66305db0a48647ca">fq.h</a>
+</li>
+<li>FqCp()
+: <a class="el" href="fq_8h.html#a17133e5b777baa8c745b7dfcf1c8ad8d">fq.h</a>
+</li>
+<li>FqDeserialize()
+: <a class="el" href="serialize_8h.html#a051985a737e59da22d04dfcc5112ec77">serialize.h</a>
+</li>
+<li>FqEq()
+: <a class="el" href="fq_8h.html#abd40d255e0094f7156092db44a3b90fa">fq.h</a>
+</li>
+<li>FqExp()
+: <a class="el" href="fq_8h.html#a276d3747aefdac5503982f2aa5eccbf8">fq.h</a>
+</li>
+<li>FqFromHash()
+: <a class="el" href="fq_8h.html#a7794f72bcc506f8d8a60dbfae1a70ed0">fq.h</a>
+</li>
+<li>FqInField()
+: <a class="el" href="fq_8h.html#aceb37a8f5538fe9ca682058ff0e36091">fq.h</a>
+</li>
+<li>FqInv()
+: <a class="el" href="fq_8h.html#a7b60a8996973d474d2fb7a31838c6d8c">fq.h</a>
+</li>
+<li>FqIsZero()
+: <a class="el" href="fq_8h.html#ac08ca8c781cd18cbadabbeeb85722e49">fq.h</a>
+</li>
+<li>FqMul()
+: <a class="el" href="fq_8h.html#ab0bf77a97fb3a12292886bef3abcf9bd">fq.h</a>
+</li>
+<li>FqNeg()
+: <a class="el" href="fq_8h.html#ae8379530cca959e7e36446b2979d8af4">fq.h</a>
+</li>
+<li>FqRand()
+: <a class="el" href="fq_8h.html#a5cc7d7d7640cd0bbcb635e95be3ed8a3">fq.h</a>
+</li>
+<li>FqSerialize()
+: <a class="el" href="serialize_8h.html#a1fe8ff2aa7f73b807a7f5f5cdd8eba94">serialize.h</a>
+</li>
+<li>FqSet()
+: <a class="el" href="fq_8h.html#ab28f9df688a669a64dc04fa33f4cbb64">fq.h</a>
+</li>
+<li>FqSqrt()
+: <a class="el" href="fq_8h.html#a0cbded46e28a1e6f641c5c0ae37fd744">fq.h</a>
+</li>
+<li>FqSquare()
+: <a class="el" href="fq_8h.html#ab62c8f43f78a0c4f830c9ed65048b8f9">fq.h</a>
+</li>
+<li>FqSub()
+: <a class="el" href="fq_8h.html#a5148f610202ae759aafb197cb52137f1">fq.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_i.html b/doc/html/globals_func_i.html
new file mode 100644
index 0000000..9f7ca82
--- /dev/null
+++ b/doc/html/globals_func_i.html
@@ -0,0 +1,79 @@
+<!-- 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: Globals</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">6.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('globals_func_i.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_i"></a>- i -</h3><ul>
+<li>InitFfElementFromBn()
+: <a class="el" href="group___finite_field_primitives.html#ga90b2c192708973b54b7a3e82b34536ed">finitefield.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_m.html b/doc/html/globals_func_m.html
new file mode 100644
index 0000000..15f25a1
--- /dev/null
+++ b/doc/html/globals_func_m.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: Globals</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">6.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('globals_func_m.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_m"></a>- m -</h3><ul>
+<li>memcmp()
+: <a class="el" href="tiny__stdlib_8h.html#a1e7d61eb280250fb55dce370ba1a1709">tiny_stdlib.h</a>
+</li>
+<li>memset()
+: <a class="el" href="tiny__stdlib_8h.html#a4cb469bec7b722064b97a406346acb61">tiny_stdlib.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_n.html b/doc/html/globals_func_n.html
new file mode 100644
index 0000000..eec9400
--- /dev/null
+++ b/doc/html/globals_func_n.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: Globals</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">6.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('globals_func_n.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_n"></a>- n -</h3><ul>
+<li>NewBigNum()
+: <a class="el" href="group___big_num_primitives.html#gad5f6f262bfd780fed3678bcee16f0aed">bignum.h</a>
+</li>
+<li>NewEcGroup()
+: <a class="el" href="group___ec_group_primitives.html#gaf4e23677dd378ef2e0cf55df79cbdb62">ecgroup.h</a>
+</li>
+<li>NewEcPoint()
+: <a class="el" href="group___ec_group_primitives.html#ga6417b0ce72ba96de00c329e322fec7fb">ecgroup.h</a>
+</li>
+<li>NewEpid11PairingState()
+: <a class="el" href="group___epid11_pairing_primitives.html#ga0ee658e26e9f933ba2ffbf2504dfae7e">tatepairing.h</a>
+</li>
+<li>NewFfElement()
+: <a class="el" href="group___finite_field_primitives.html#gacc54f315ede2dbeb8c5990c024a0de6c">finitefield.h</a>
+</li>
+<li>NewFiniteField()
+: <a class="el" href="group___finite_field_primitives.html#ga7d99fdc5e4573668a5744e49df7ab67c">finitefield.h</a>
+</li>
+<li>NewFiniteFieldViaBinomalExtension()
+: <a class="el" href="group___finite_field_primitives.html#ga83041e3be9984a4bd8f1021934bfa3a2">finitefield.h</a>
+</li>
+<li>NewFiniteFieldViaPolynomialExtension()
+: <a class="el" href="group___finite_field_primitives.html#gae69af62a03179718cac81b004549c598">finitefield.h</a>
+</li>
+<li>NewPairingState()
+: <a class="el" href="group___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc">pairing.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_p.html b/doc/html/globals_func_p.html
new file mode 100644
index 0000000..9c235e4
--- /dev/null
+++ b/doc/html/globals_func_p.html
@@ -0,0 +1,125 @@
+<!-- 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: Globals</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">6.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('globals_func_p.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_p"></a>- p -</h3><ul>
+<li>Pairing()
+: <a class="el" href="group___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d">pairing.h</a>
+</li>
+<li>PairingCompute()
+: <a class="el" href="member_2tiny_2math_2pairing_8h.html#a74dabfd47d20d4086a89e1910ca27fe0">pairing.h</a>
+</li>
+<li>PairingInit()
+: <a class="el" href="member_2tiny_2math_2pairing_8h.html#aba03ba485b970dd2d3f30b1f74f6ed6f">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>
+<li>PrintBigNumStr()
+: <a class="el" href="group___epid_print.html#ga5f249c594ed12e4a9b11b7bc101da85d">printutils.h</a>
+</li>
+<li>PrintEcPoint()
+: <a class="el" href="group___epid_print.html#ga0d6377d9c1651d0101ec6b61feaa78ca">printutils.h</a>
+</li>
+<li>PrintFfElement()
+: <a class="el" href="group___epid_print.html#gaa3b1cbbfc6f78562658953113e5798cf">printutils.h</a>
+</li>
+<li>PrintFpElemStr()
+: <a class="el" href="group___epid_print.html#gae553c3a156a0e4968b89635ab0757580">printutils.h</a>
+</li>
+<li>PrintFq12ElemStr()
+: <a class="el" href="group___epid_print.html#gaf185fe3df270cd8b4a2969bf3cfc5d5f">printutils.h</a>
+</li>
+<li>PrintFq2ElemStr()
+: <a class="el" href="group___epid_print.html#ga883a834ab1703365bb0bca4abd3104de">printutils.h</a>
+</li>
+<li>PrintFq6ElemStr()
+: <a class="el" href="group___epid_print.html#ga3f2961ef6b4c44a6205d422d8a293476">printutils.h</a>
+</li>
+<li>PrintFqElemStr()
+: <a class="el" href="group___epid_print.html#ga6c9fea48fa0477f4a98abb50f891a5e4">printutils.h</a>
+</li>
+<li>PrintG1ElemStr()
+: <a class="el" href="group___epid_print.html#ga87168a3ce5306f9839b8e8d6c9a5f84f">printutils.h</a>
+</li>
+<li>PrintG2ElemStr()
+: <a class="el" href="group___epid_print.html#gab76a4cf0385dc4a76bb56ee9f0e3e87a">printutils.h</a>
+</li>
+<li>PrintGtElemStr()
+: <a class="el" href="group___epid_print.html#ga138cd388247a58680d4701d59d6976d2">printutils.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_r.html b/doc/html/globals_func_r.html
new file mode 100644
index 0000000..4190126
--- /dev/null
+++ b/doc/html/globals_func_r.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: Globals</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">6.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('globals_func_r.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_r"></a>- r -</h3><ul>
+<li>ReadBigNum()
+: <a class="el" href="group___big_num_primitives.html#gabe8e39d5788423f41770a71a4c911fbe">bignum.h</a>
+</li>
+<li>ReadEcPoint()
+: <a class="el" href="group___ec_group_primitives.html#gad495a9f91b79984f7533c8ea4f92b3cb">ecgroup.h</a>
+</li>
+<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>
+</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/globals_func_s.html b/doc/html/globals_func_s.html
new file mode 100644
index 0000000..5f24936
--- /dev/null
+++ b/doc/html/globals_func_s.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: Globals</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">6.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('globals_func_s.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_s"></a>- s -</h3><ul>
+<li>Sha256MessageDigest()
+: <a class="el" href="group___hash_primitives.html#ga86d62aac9efd7445acee311b41846c6c">hash.h</a>
+</li>
+<li>SwapNativeAndPortableLayout()
+: <a class="el" href="serialize_8h.html#a6789f8e258de2efc616c2f3109b7992b">serialize.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_t.html b/doc/html/globals_func_t.html
new file mode 100644
index 0000000..c6c9cce
--- /dev/null
+++ b/doc/html/globals_func_t.html
@@ -0,0 +1,169 @@
+<!-- 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: Globals</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">6.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('globals_func_t.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_t"></a>- t -</h3><ul>
+<li>tc_sha256_final()
+: <a class="el" href="sha256_8h.html#a8013bed3e0b388ec654f991b45c00bbf">sha256.h</a>
+</li>
+<li>tc_sha256_init()
+: <a class="el" href="sha256_8h.html#a05aad282287c226a9ab8a2eb65d10d1b">sha256.h</a>
+</li>
+<li>tc_sha256_update()
+: <a class="el" href="sha256_8h.html#ab42ecba529c48040c34e70cee8d98096">sha256.h</a>
+</li>
+<li>tinysha512_final()
+: <a class="el" href="sha512_8h.html#ace9440a26ec431a1596f40284cc8d5ee">sha512.h</a>
+</li>
+<li>tinysha512_init()
+: <a class="el" href="sha512_8h.html#a3cf87b13e209264d7aba7d708560dfde">sha512.h</a>
+</li>
+<li>tinysha512_update()
+: <a class="el" href="sha512_8h.html#a47108f5097342900a4a07f52b6204082">sha512.h</a>
+</li>
+<li>tinysha_digest_size()
+: <a class="el" href="hashwrap_8h.html#a6e07fd5b18355546d72dd09eae343c6a">hashwrap.h</a>
+</li>
+<li>tinysha_final()
+: <a class="el" href="hashwrap_8h.html#a22b9a3e01537f4f5d89e608c8b7956f6">hashwrap.h</a>
+</li>
+<li>tinysha_init()
+: <a class="el" href="hashwrap_8h.html#ab168fa663e74cc973af7e79d384df8b0">hashwrap.h</a>
+</li>
+<li>tinysha_update()
+: <a class="el" href="hashwrap_8h.html#a9844075a9ccf12e56f6a07d86b49c98d">hashwrap.h</a>
+</li>
+<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>Tpm2CreateContext()
+: <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">context.h</a>
+, <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">context.c</a>
+</li>
+<li>Tpm2CreatePrimary()
+: <a class="el" href="createprimary_8c.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.c</a>
+, <a class="el" href="createprimary_8h.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.h</a>
+</li>
+<li>Tpm2DeleteContext()
+: <a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">context.h</a>
+, <a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">context.c</a>
+</li>
+<li>Tpm2FlushKey()
+: <a class="el" href="context_8c.html#a7f547c0068dc63f0a6b76ad15b1b9675">context.c</a>
+</li>
+<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>Tpm2LoadExternal()
+: <a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">load_external.h</a>
+, <a class="el" href="group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">load_external.c</a>
+</li>
+<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>Tpm2NvRead()
+: <a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">nv.h</a>
+, <a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">nv.c</a>
+</li>
+<li>Tpm2NvUndefineSpace()
+: <a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">nv.h</a>
+, <a class="el" href="group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">nv.c</a>
+</li>
+<li>Tpm2NvWrite()
+: <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">nv.h</a>
+, <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">nv.c</a>
+</li>
+<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>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>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>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_8c.html#a51507a6be8d7dfa167c9e6fb70e5ee57">conversion.c</a>
+, <a class="el" href="conversion_8h.html#a51507a6be8d7dfa167c9e6fb70e5ee57">conversion.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_u.html b/doc/html/globals_func_u.html
new file mode 100644
index 0000000..da3c0f9
--- /dev/null
+++ b/doc/html/globals_func_u.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: Globals</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">6.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('globals_func_u.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_u"></a>- u -</h3><ul>
+<li>Uint32Deserialize()
+: <a class="el" href="serialize_8h.html#a2aaa1779f9085d62b27e072271329dd7">serialize.h</a>
+</li>
+<li>Uint32Serialize()
+: <a class="el" href="serialize_8h.html#ac74344e39b6d285c6a0258c4554712b0">serialize.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_v.html b/doc/html/globals_func_v.html
new file mode 100644
index 0000000..c38dd57
--- /dev/null
+++ b/doc/html/globals_func_v.html
@@ -0,0 +1,136 @@
+<!-- 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: Globals</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">6.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('globals_func_v.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_v"></a>- v -</h3><ul>
+<li>VliAdd()
+: <a class="el" href="vli_8h.html#a566cfdc23f1c35230891d53139850032">vli.h</a>
+</li>
+<li>VliClear()
+: <a class="el" href="vli_8h.html#ad1e2e5fe5fc466eff75dbe70fba3169f">vli.h</a>
+</li>
+<li>VliCmp()
+: <a class="el" href="vli_8h.html#a1f6ded73c6bb3dc340efd2a8978f8d7a">vli.h</a>
+</li>
+<li>VliCondSet()
+: <a class="el" href="vli_8h.html#a426db811cf4ee822bd4b6863f2e51d8c">vli.h</a>
+</li>
+<li>VliDeserialize()
+: <a class="el" href="serialize_8h.html#a7950febe703ea62457664eadc1e4eed9">serialize.h</a>
+</li>
+<li>VliIsZero()
+: <a class="el" href="vli_8h.html#a8f6a41541103b1bde8428ea7f4b816fa">vli.h</a>
+</li>
+<li>VliModAdd()
+: <a class="el" href="vli_8h.html#a6373f1d28198a0f34f220bfcc2ecf040">vli.h</a>
+</li>
+<li>VliModBarrett()
+: <a class="el" href="vli_8h.html#a5280e583a19e61ad815b02906c082033">vli.h</a>
+</li>
+<li>VliModExp()
+: <a class="el" href="vli_8h.html#aa1f2257e949c0c4f26b24aec95e01452">vli.h</a>
+</li>
+<li>VliModInv()
+: <a class="el" href="vli_8h.html#a3d4ee194f13293e61bddf243e4241b4c">vli.h</a>
+</li>
+<li>VliModMul()
+: <a class="el" href="vli_8h.html#a112a5d4118e101ec539e9669ebd4fdf9">vli.h</a>
+</li>
+<li>VliModSquare()
+: <a class="el" href="vli_8h.html#accf6070832e479e01c1268b0414645b9">vli.h</a>
+</li>
+<li>VliModSub()
+: <a class="el" href="vli_8h.html#aa53a875972ac2f10852fcaca92de2b40">vli.h</a>
+</li>
+<li>VliMul()
+: <a class="el" href="vli_8h.html#ab6d63a825df6f224fe37c76b6bb67bcf">vli.h</a>
+</li>
+<li>VliRand()
+: <a class="el" href="vli_8h.html#a10fc791278e51543fc685d5a4903fcd1">vli.h</a>
+</li>
+<li>VliRShift()
+: <a class="el" href="vli_8h.html#a4c7e60c47b82e5b2cf823d51b3a9fdcc">vli.h</a>
+</li>
+<li>VliSerialize()
+: <a class="el" href="serialize_8h.html#af2841bf57731c82f8164900bf3f52320">serialize.h</a>
+</li>
+<li>VliSet()
+: <a class="el" href="vli_8h.html#a9a1df0e7770aa1421e41b87965e71425">vli.h</a>
+</li>
+<li>VliSub()
+: <a class="el" href="vli_8h.html#ac47d57834c67877c10ecdc230cdaf503">vli.h</a>
+</li>
+<li>VliTestBit()
+: <a class="el" href="vli_8h.html#a80d1a80f5a21437354ee185923621d66">vli.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_func_w.html b/doc/html/globals_func_w.html
new file mode 100644
index 0000000..3acb969
--- /dev/null
+++ b/doc/html/globals_func_w.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: Globals</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">6.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('globals_func_w.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+&#160;
+
+<h3><a class="anchor" id="index_w"></a>- w -</h3><ul>
+<li>WriteBigNum()
+: <a class="el" href="group___big_num_primitives.html#ga904c16cc020e7196f22ac9abdc31b41f">bignum.h</a>
+</li>
+<li>WriteEcPoint()
+: <a class="el" href="group___ec_group_primitives.html#ga7a8bdb9782d065bc32fd102e0ae73ccb">ecgroup.h</a>
+</li>
+<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 -->
+<!-- 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/globals_g.html b/doc/html/globals_g.html
index 975621a..93000dc 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_h.html b/doc/html/globals_h.html
index 2eea091..531a8e2 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -63,6 +63,9 @@ $(document).ready(function(){initNavTree('globals_h.html','');});
<li>HashAlg
: <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">types.h</a>
</li>
+<li>htobe32
+: <a class="el" href="endian_8h.html#ab004b68a63ea32dcd67fbe597263120b">endian.h</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/globals_i.html b/doc/html/globals_i.html
index ea9c427..27defd9 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_k.html b/doc/html/globals_k.html
index f2d0274..872c493 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_m.html b/doc/html/globals_m.html
index 124ce6f..2ae2259 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -60,9 +60,21 @@ $(document).ready(function(){initNavTree('globals_m.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_m"></a>- m -</h3><ul>
+<li>MATH_FAIL
+: <a class="el" href="mathdefs_8h.html#a1a994bd1e283835646241e53b6728cee">mathdefs.h</a>
+</li>
+<li>MATH_SUCCESS
+: <a class="el" href="mathdefs_8h.html#a352e5652c4f35088eba5f769a5d7993f">mathdefs.h</a>
+</li>
<li>MemberCtx
: <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">api.h</a>
</li>
+<li>memcmp()
+: <a class="el" href="tiny__stdlib_8h.html#a1e7d61eb280250fb55dce370ba1a1709">tiny_stdlib.h</a>
+</li>
+<li>memset()
+: <a class="el" href="tiny__stdlib_8h.html#a4cb469bec7b722064b97a406346acb61">tiny_stdlib.h</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/globals_n.html b/doc/html/globals_n.html
index e4a55e0..fa2db91 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -87,6 +87,9 @@ $(document).ready(function(){initNavTree('globals_n.html','');});
<li>NewPairingState()
: <a class="el" href="group___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc">pairing.h</a>
</li>
+<li>NUM_ECC_DIGITS
+: <a class="el" href="mathtypes_8h.html#a94d0ffa1ccb9d2f09d1ada23a5807021">mathtypes.h</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/globals_o.html b/doc/html/globals_o.html
index 08301f5..e204841 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_p.html b/doc/html/globals_p.html
index b3942ca..dc1545e 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -63,12 +63,15 @@ $(document).ready(function(){initNavTree('globals_p.html','');});
<li>Pairing()
: <a class="el" href="group___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d">pairing.h</a>
</li>
-<li>PairingState
-: <a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">pairing.h</a>
+<li>PairingCompute()
+: <a class="el" href="member_2tiny_2math_2pairing_8h.html#a74dabfd47d20d4086a89e1910ca27fe0">pairing.h</a>
+</li>
+<li>PairingInit()
+: <a class="el" href="member_2tiny_2math_2pairing_8h.html#aba03ba485b970dd2d3f30b1f74f6ed6f">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>
+: <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>
diff --git a/doc/html/globals_r.html b/doc/html/globals_r.html
index e208810..871c5dd 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_s.html b/doc/html/globals_s.html
index 4935fc1..cbc53f5 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -63,9 +63,30 @@ $(document).ready(function(){initNavTree('globals_s.html','');});
<li>Seed
: <a class="el" href="group___epid_types.html#ga888541b8148df69c634a92c64ed51317">types.h</a>
</li>
+<li>SHA256_BLOCK_SIZE
+: <a class="el" href="sha256_8h.html#a9c1fe69ad43d4ca74b84303a0ed64f2f">sha256.h</a>
+</li>
+<li>SHA256_DIGEST_SIZE
+: <a class="el" href="sha256_8h.html#a81efbc0fc101b06a914f7ff9e2fbc0e9">sha256.h</a>
+</li>
+<li>SHA256_STATE_BLOCKS
+: <a class="el" href="sha256_8h.html#a0558ee82699b60132c23e0a049ab7a56">sha256.h</a>
+</li>
<li>Sha256MessageDigest()
: <a class="el" href="group___hash_primitives.html#ga86d62aac9efd7445acee311b41846c6c">hash.h</a>
</li>
+<li>SHA512_BLOCK_SIZE
+: <a class="el" href="sha512_8h.html#ac7071364cb94c9fcce009ba16a4bdca1">sha512.h</a>
+</li>
+<li>SHA512_DIGEST_SIZE
+: <a class="el" href="sha512_8h.html#a67f489f3eee39c447a6db3ba34ef75f2">sha512.h</a>
+</li>
+<li>SHA512_DIGEST_WORDS
+: <a class="el" href="sha512_8h.html#ab16e074d262ae09949e0bf222f95f5be">sha512.h</a>
+</li>
+<li>SwapNativeAndPortableLayout()
+: <a class="el" href="serialize_8h.html#a6789f8e258de2efc616c2f3109b7992b">serialize.h</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/globals_t.html b/doc/html/globals_t.html
index 5c6e9b1..26be8bc 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -60,21 +60,51 @@ $(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>tc_sha256_final()
+: <a class="el" href="sha256_8h.html#a8013bed3e0b388ec654f991b45c00bbf">sha256.h</a>
+</li>
+<li>tc_sha256_init()
+: <a class="el" href="sha256_8h.html#a05aad282287c226a9ab8a2eb65d10d1b">sha256.h</a>
+</li>
+<li>tc_sha256_update()
+: <a class="el" href="sha256_8h.html#ab42ecba529c48040c34e70cee8d98096">sha256.h</a>
+</li>
+<li>tinysha512_final()
+: <a class="el" href="sha512_8h.html#ace9440a26ec431a1596f40284cc8d5ee">sha512.h</a>
+</li>
+<li>tinysha512_init()
+: <a class="el" href="sha512_8h.html#a3cf87b13e209264d7aba7d708560dfde">sha512.h</a>
+</li>
+<li>tinysha512_update()
+: <a class="el" href="sha512_8h.html#a47108f5097342900a4a07f52b6204082">sha512.h</a>
+</li>
+<li>tinysha_digest_size()
+: <a class="el" href="hashwrap_8h.html#a6e07fd5b18355546d72dd09eae343c6a">hashwrap.h</a>
+</li>
+<li>tinysha_final()
+: <a class="el" href="hashwrap_8h.html#a22b9a3e01537f4f5d89e608c8b7956f6">hashwrap.h</a>
+</li>
+<li>tinysha_init()
+: <a class="el" href="hashwrap_8h.html#ab168fa663e74cc973af7e79d384df8b0">hashwrap.h</a>
+</li>
+<li>tinysha_update()
+: <a class="el" href="hashwrap_8h.html#a9844075a9ccf12e56f6a07d86b49c98d">hashwrap.h</a>
+</li>
<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>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>
+: <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">context.h</a>
+, <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">context.c</a>
</li>
<li>Tpm2CreatePrimary()
-: <a class="el" href="createprimary_8h.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.h</a>
-, <a class="el" href="createprimary_8c.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.c</a>
+: <a class="el" href="createprimary_8c.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.c</a>
+, <a class="el" href="createprimary_8h.html#a01df38cbb1c7c7986dadefcc1295bb9e">createprimary.h</a>
</li>
<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>
+: <a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">context.h</a>
+, <a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">context.c</a>
</li>
<li>Tpm2FlushKey()
: <a class="el" href="context_8c.html#a7f547c0068dc63f0a6b76ad15b1b9675">context.c</a>
@@ -92,16 +122,16 @@ $(document).ready(function(){initNavTree('globals_t.html','');});
, <a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">nv.h</a>
</li>
<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>
+: <a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">nv.h</a>
+, <a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">nv.c</a>
</li>
<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>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>
+: <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">nv.h</a>
+, <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">nv.c</a>
</li>
<li>Tpm2ReleaseCounter()
: <a class="el" href="group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">sign.c</a>
@@ -112,12 +142,12 @@ $(document).ready(function(){initNavTree('globals_t.html','');});
, <a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">context.c</a>
</li>
<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>
+: <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>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>
+: <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_8h.html#a51507a6be8d7dfa167c9e6fb70e5ee57">conversion.h</a>
diff --git a/doc/html/globals_type.html b/doc/html/globals_type.html
index 4acfc92..c105253 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -109,9 +109,6 @@ $(document).ready(function(){initNavTree('globals_type.html','');});
<li>OctStr
: <a class="el" href="group___epid_types.html#ga3315fb24f4c5783b6d6eb107933390b0">types.h</a>
</li>
-<li>PairingState
-: <a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">pairing.h</a>
-</li>
<li>ReKeySeed
: <a class="el" href="group___epid_types.html#ga54bd22670f2e348593db7ab631131d10">types.h</a>
</li>
diff --git a/doc/html/globals_u.html b/doc/html/globals_u.html
new file mode 100644
index 0000000..e48db03
--- /dev/null
+++ b/doc/html/globals_u.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: Globals</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">6.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('globals_u.html','');});
+</script>
+<div id="doc-content">
+<div class="contents">
+<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_u"></a>- u -</h3><ul>
+<li>Uint32Deserialize()
+: <a class="el" href="serialize_8h.html#a2aaa1779f9085d62b27e072271329dd7">serialize.h</a>
+</li>
+<li>Uint32Serialize()
+: <a class="el" href="serialize_8h.html#ac74344e39b6d285c6a0258c4554712b0">serialize.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="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/globals_v.html b/doc/html/globals_v.html
index 03b7653..c0de66c 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -63,6 +63,66 @@ $(document).ready(function(){initNavTree('globals_v.html','');});
<li>VerifierCtx
: <a class="el" href="group___epid_verifier_module.html#gaf172a5f8f7f069d38c5838b723a1a85c">api.h</a>
</li>
+<li>VliAdd()
+: <a class="el" href="vli_8h.html#a566cfdc23f1c35230891d53139850032">vli.h</a>
+</li>
+<li>VliClear()
+: <a class="el" href="vli_8h.html#ad1e2e5fe5fc466eff75dbe70fba3169f">vli.h</a>
+</li>
+<li>VliCmp()
+: <a class="el" href="vli_8h.html#a1f6ded73c6bb3dc340efd2a8978f8d7a">vli.h</a>
+</li>
+<li>VliCondSet()
+: <a class="el" href="vli_8h.html#a426db811cf4ee822bd4b6863f2e51d8c">vli.h</a>
+</li>
+<li>VliDeserialize()
+: <a class="el" href="serialize_8h.html#a7950febe703ea62457664eadc1e4eed9">serialize.h</a>
+</li>
+<li>VliIsZero()
+: <a class="el" href="vli_8h.html#a8f6a41541103b1bde8428ea7f4b816fa">vli.h</a>
+</li>
+<li>VliModAdd()
+: <a class="el" href="vli_8h.html#a6373f1d28198a0f34f220bfcc2ecf040">vli.h</a>
+</li>
+<li>VliModBarrett()
+: <a class="el" href="vli_8h.html#a5280e583a19e61ad815b02906c082033">vli.h</a>
+</li>
+<li>VliModExp()
+: <a class="el" href="vli_8h.html#aa1f2257e949c0c4f26b24aec95e01452">vli.h</a>
+</li>
+<li>VliModInv()
+: <a class="el" href="vli_8h.html#a3d4ee194f13293e61bddf243e4241b4c">vli.h</a>
+</li>
+<li>VliModMul()
+: <a class="el" href="vli_8h.html#a112a5d4118e101ec539e9669ebd4fdf9">vli.h</a>
+</li>
+<li>VliModSquare()
+: <a class="el" href="vli_8h.html#accf6070832e479e01c1268b0414645b9">vli.h</a>
+</li>
+<li>VliModSub()
+: <a class="el" href="vli_8h.html#aa53a875972ac2f10852fcaca92de2b40">vli.h</a>
+</li>
+<li>VliMul()
+: <a class="el" href="vli_8h.html#ab6d63a825df6f224fe37c76b6bb67bcf">vli.h</a>
+</li>
+<li>VliRand()
+: <a class="el" href="vli_8h.html#a10fc791278e51543fc685d5a4903fcd1">vli.h</a>
+</li>
+<li>VliRShift()
+: <a class="el" href="vli_8h.html#a4c7e60c47b82e5b2cf823d51b3a9fdcc">vli.h</a>
+</li>
+<li>VliSerialize()
+: <a class="el" href="serialize_8h.html#af2841bf57731c82f8164900bf3f52320">serialize.h</a>
+</li>
+<li>VliSet()
+: <a class="el" href="vli_8h.html#a9a1df0e7770aa1421e41b87965e71425">vli.h</a>
+</li>
+<li>VliSub()
+: <a class="el" href="vli_8h.html#ac47d57834c67877c10ecdc230cdaf503">vli.h</a>
+</li>
+<li>VliTestBit()
+: <a class="el" href="vli_8h.html#a80d1a80f5a21437354ee185923621d66">vli.h</a>
+</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
diff --git a/doc/html/globals_vars.html b/doc/html/globals_vars.html
index 83631f1..35cb165 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/globals_w.html b/doc/html/globals_w.html
index d5d4ca4..e2f0eeb 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/glossary_8dox.html b/doc/html/glossary_8dox.html
index 92138cf..f10896d 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">5.0.0</span>
+&#160;<span id="projectnumber">6.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 cd1d238..b6025a2 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___ec_group_primitives.html b/doc/html/group___ec_group_primitives.html
index be0febe..4bf9d15 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___ecdsa_primitives.html b/doc/html/group___ecdsa_primitives.html
index 7c5b725..01296e5 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid11_file_parser_module.html b/doc/html/group___epid11_file_parser_module.html
index 8606656..ecdaed9 100644
--- a/doc/html/group___epid11_file_parser_module.html
+++ b/doc/html/group___epid11_file_parser_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid11_pairing_primitives.html b/doc/html/group___epid11_pairing_primitives.html
index b90eee8..7b64818 100644
--- a/doc/html/group___epid11_pairing_primitives.html
+++ b/doc/html/group___epid11_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid11_types.html b/doc/html/group___epid11_types.html
index a020d8b..bd6e3e4 100644
--- a/doc/html/group___epid11_types.html
+++ b/doc/html/group___epid11_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid11_verifier_module.html b/doc/html/group___epid11_verifier_module.html
index d1d8006..9e14370 100644
--- a/doc/html/group___epid11_verifier_module.html
+++ b/doc/html/group___epid11_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid_common.html b/doc/html/group___epid_common.html
index ce239c0..d88c36f 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid_math.html b/doc/html/group___epid_math.html
index 510aff0..2baf0db 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid_member_module.html b/doc/html/group___epid_member_module.html
index 7730741..472dd53 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -84,8 +84,14 @@ Data Structures</h2></td></tr>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></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="memdesc:gae7a7b01bc0a84c44c9d14e6c311c1ba7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates and initializes 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:ga2b3c0cc1d8d4e50190ca94656fa36e24"><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#ga2b3c0cc1d8d4e50190ca94656fa36e24">EpidMemberGetSize</a> (<a class="el" href="struct_member_params.html">MemberParams</a> const *params, size_t *context_size)</td></tr>
+<tr class="memdesc:ga2b3c0cc1d8d4e50190ca94656fa36e24"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the size in bytes required for a member context. <a href="#ga2b3c0cc1d8d4e50190ca94656fa36e24">More...</a><br /></td></tr>
+<tr class="separator:ga2b3c0cc1d8d4e50190ca94656fa36e24"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga35273b8e75d51e312f0d2fd3aa094efb"><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#ga35273b8e75d51e312f0d2fd3aa094efb">EpidMemberInit</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:ga35273b8e75d51e312f0d2fd3aa094efb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes a new member context. <a href="#ga35273b8e75d51e312f0d2fd3aa094efb">More...</a><br /></td></tr>
+<tr class="separator:ga35273b8e75d51e312f0d2fd3aa094efb"><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>
@@ -101,6 +107,9 @@ Functions</h2></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:ga98b4d990a885339b83cd0513fedcc76d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d">EpidMemberDeinit</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx)</td></tr>
+<tr class="memdesc:ga98b4d990a885339b83cd0513fedcc76d"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-initializes an existing member context buffer. <a href="#ga98b4d990a885339b83cd0513fedcc76d">More...</a><br /></td></tr>
+<tr class="separator:ga98b4d990a885339b83cd0513fedcc76d"><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>
@@ -116,9 +125,12 @@ Functions</h2></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="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:ga8c6f097ba89542664375bd5e0f205220"><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#ga8c6f097ba89542664375bd5e0f205220">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:ga8c6f097ba89542664375bd5e0f205220"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a basename with a member. <a href="#ga8c6f097ba89542664375bd5e0f205220">More...</a><br /></td></tr>
+<tr class="separator:ga8c6f097ba89542664375bd5e0f205220"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga4f3a464f14581ef3e5a50719cb4709c3"><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#ga4f3a464f14581ef3e5a50719cb4709c3">EpidClearRegisteredBasenames</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx)</td></tr>
+<tr class="memdesc:ga4f3a464f14581ef3e5a50719cb4709c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears registered basenames. <a href="#ga4f3a464f14581ef3e5a50719cb4709c3">More...</a><br /></td></tr>
+<tr class="separator:ga4f3a464f14581ef3e5a50719cb4709c3"><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="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>
@@ -168,7 +180,34 @@ 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#gae7a7b01bc0a84c44c9d14e6c311c1ba7" 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#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga4f3a464f14581ef3e5a50719cb4709c3"></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> EpidClearRegisteredBasenames </td>
+ <td>(</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>
+ </table>
+</div><div class="memdoc">
+
+<p>Clears registered basenames. </p>
+<p>Allows clearing registered basenames without recreating member.</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 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 see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga8c6f097ba89542664375bd5e0f205220" title="Registers a basename with a member. ">EpidRegisterBasename</a> </dd></dl>
</div>
</div>
@@ -291,7 +330,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#gae7a7b01bc0a84c44c9d14e6c311c1ba7" 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#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a> </dd></dl>
</div>
</div>
@@ -347,7 +386,7 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
-<p>Creates a new member context. </p>
+<p>Allocates and initializes a new member context. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">params</td><td>Implementation specific configuration parameters. </td></tr>
@@ -355,10 +394,40 @@ Functions</h2></td></tr>
</table>
</dd>
</dl>
+<dl class="section warning"><dt>Warning</dt><dd>buffers allocated using this function should not be initialized with <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a>.</dd></dl>
+<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>This API has been superseded by <a class="el" href="group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24" title="Computes the size in bytes required for a member context. ">EpidMemberGetSize</a> and <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</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="ga98b4d990a885339b83cd0513fedcc76d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void EpidMemberDeinit </td>
+ <td>(</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>
+ </table>
+</div><div class="memdoc">
+
+<p>De-initializes an existing member context buffer. </p>
+<p>Must be called to safely release a member context initialized using <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a>.</p>
+<p>De-initializes the 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 member context. Can be NULL.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section warning"><dt>Warning</dt><dd>This function should not be used on buffers allocated with <a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Allocates and initializes a new member context. ">EpidMemberCreate</a>. Those buffers should be released using <a class="el" href="group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6" title="Deletes an existing member context. ">EpidMemberDelete</a></dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a> </dd></dl>
+
+</div>
+</div>
<a class="anchor" id="ga3824589c683c5e0e59d483462fce65d6"></a>
<div class="memitem">
<div class="memproto">
@@ -374,7 +443,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#gae7a7b01bc0a84c44c9d14e6c311c1ba7" 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="Allocates and initializes 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">
@@ -382,12 +451,88 @@ 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#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Creates a new member context. ">EpidMemberCreate</a></dd></dl>
+<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>This API has been superseded by <a class="el" href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d" title="De-initializes an existing member context buffer. ">EpidMemberDeinit</a>.</dd></dl>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7" title="Allocates and initializes 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="ga2b3c0cc1d8d4e50190ca94656fa36e24"></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> EpidMemberGetSize </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">size_t *&#160;</td>
+ <td class="paramname"><em>context_size</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Computes the size in bytes required for a member context. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <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">context_size</td><td>Number of bytes required for a <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817" title="Internal context of member. ">MemberCtx</a> 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>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a> </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ga35273b8e75d51e312f0d2fd3aa094efb"></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> EpidMemberInit </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"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</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>Initializes a new member context. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">params</td><td>Implementation specific configuration parameters. </td></tr>
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>An existing buffer that will be used as a <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817" title="Internal context of member. ">MemberCtx</a>.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section warning"><dt>Warning</dt><dd>ctx must be a buffer of at least the size reported by <a class="el" href="group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24" title="Computes the size in bytes required for a member context. ">EpidMemberGetSize</a> for the same parameters.</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#ga2b3c0cc1d8d4e50190ca94656fa36e24" title="Computes the size in bytes required for a member context. ">EpidMemberGetSize</a> </dd></dl>
+
+</div>
+</div>
<a class="anchor" id="ga9998eb454838ff5d232ff22ecbab31bf"></a>
<div class="memitem">
<div class="memproto">
@@ -422,7 +567,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#gae7a7b01bc0a84c44c9d14e6c311c1ba7" 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#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</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>
@@ -475,7 +620,7 @@ 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#gae7a7b01bc0a84c44c9d14e6c311c1ba7" 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#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</a></dd></dl>
<p><b>Example</b> </p>
<p><a class="el" href="UserManual_GeneratingAnIntelEpidSignature.html">Generating an Intel&reg; EPID Signature</a> </p>
@@ -656,12 +801,12 @@ It is the responsibility of the caller to free the memory pointed to by sig_rl a
</div>
</div>
-<a class="anchor" id="gad92d3c3266ae1833ffb1dba9ad76035d"></a>
+<a class="anchor" id="ga8c6f097ba89542664375bd5e0f205220"></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> EpidRegisterBasename </td>
<td>(</td>
<td class="paramtype"><a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *&#160;</td>
<td class="paramname"><em>ctx</em>, </td>
@@ -779,7 +924,7 @@ 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 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>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</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>
diff --git a/doc/html/group___epid_member_module.js b/doc/html/group___epid_member_module.js
index f904ae6..5896810 100644
--- a/doc/html/group___epid_member_module.js
+++ b/doc/html/group___epid_member_module.js
@@ -7,18 +7,22 @@ var group___epid_member_module =
[ "rnd_param", "struct_member_params.html#a7510f05e63328fa13cf2a3a3bd6acd95", null ]
] ],
[ "EpidAddPreSigs", "group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78", null ],
+ [ "EpidClearRegisteredBasenames", "group___epid_member_module.html#ga4f3a464f14581ef3e5a50719cb4709c3", 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#gae7a7b01bc0a84c44c9d14e6c311c1ba7", null ],
+ [ "EpidMemberDeinit", "group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d", null ],
[ "EpidMemberDelete", "group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6", null ],
+ [ "EpidMemberGetSize", "group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24", null ],
+ [ "EpidMemberInit", "group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb", null ],
[ "EpidMemberSetHashAlg", "group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf", null ],
[ "EpidMemberSetSigRl", "group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4", 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 ],
+ [ "EpidRegisterBasename", "group___epid_member_module.html#ga8c6f097ba89542664375bd5e0f205220", 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 636cb9f..1ec7cfc 100644
--- a/doc/html/group___epid_module.html
+++ b/doc/html/group___epid_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid_print.html b/doc/html/group___epid_print.html
index bc3039c..1a46d41 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid_types.html b/doc/html/group___epid_types.html
index c925672..d246477 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___epid_verifier_module.html b/doc/html/group___epid_verifier_module.html
index 44ae137..5c91aac 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___error_codes.html b/doc/html/group___error_codes.html
index c93f72d..1936361 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___file_parser.html b/doc/html/group___file_parser.html
index 4cf1003..4457f7a 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___finite_field_primitives.html b/doc/html/group___finite_field_primitives.html
index aba3702..b16bc79 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___hash_primitives.html b/doc/html/group___hash_primitives.html
index 6b38f26..df7289f 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/group___pairing_primitives.html b/doc/html/group___pairing_primitives.html
index 7e5e364..d6dae7b 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -59,7 +59,6 @@ $(document).ready(function(){initNavTree('group___pairing_primitives.html','');}
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> &#124;
-<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&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>
@@ -75,22 +74,15 @@ Modules</h2></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>
-Typedefs</h2></td></tr>
-<tr class="memitem:ga3f1fa61d25487f96dfb0ffef4ad35607"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3f1fa61d25487f96dfb0ffef4ad35607"></a>
-typedef struct <a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a></td></tr>
-<tr class="memdesc:ga3f1fa61d25487f96dfb0ffef4ad35607"><td class="mdescLeft">&#160;</td><td class="mdescRight">A pairing. <br /></td></tr>
-<tr class="separator:ga3f1fa61d25487f96dfb0ffef4ad35607"><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:ga29f79a645871830754d396b9b4a2a0cc"><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___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc">NewPairingState</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *ga, <a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *gb, <a class="el" href="group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e">FiniteField</a> *ff, <a class="el" href="struct_big_num_str.html">BigNumStr</a> const *t, <a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> neg, <a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> **ps)</td></tr>
+<tr class="memitem:ga29f79a645871830754d396b9b4a2a0cc"><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___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc">NewPairingState</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *ga, <a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *gb, <a class="el" href="group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e">FiniteField</a> *ff, <a class="el" href="struct_big_num_str.html">BigNumStr</a> const *t, <a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> neg, <a class="el" href="struct_pairing_state.html">PairingState</a> **ps)</td></tr>
<tr class="memdesc:ga29f79a645871830754d396b9b4a2a0cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new pairing state. <a href="#ga29f79a645871830754d396b9b4a2a0cc">More...</a><br /></td></tr>
<tr class="separator:ga29f79a645871830754d396b9b4a2a0cc"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gad54aebdc331d39b73000fdca9e04f94d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d">DeletePairingState</a> (<a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> **ps)</td></tr>
-<tr class="memdesc:gad54aebdc331d39b73000fdca9e04f94d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees a previously allocated by PairingState. <a href="#gad54aebdc331d39b73000fdca9e04f94d">More...</a><br /></td></tr>
+<tr class="memitem:gad54aebdc331d39b73000fdca9e04f94d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d">DeletePairingState</a> (<a class="el" href="struct_pairing_state.html">PairingState</a> **ps)</td></tr>
+<tr class="memdesc:gad54aebdc331d39b73000fdca9e04f94d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees a previously allocated by <a class="el" href="struct_pairing_state.html" title="A scratch buffer for stateful pairing calls. ">PairingState</a>. <a href="#gad54aebdc331d39b73000fdca9e04f94d">More...</a><br /></td></tr>
<tr class="separator:gad54aebdc331d39b73000fdca9e04f94d"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga58a9d3cb6129274a04c72a35a52f768d"><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___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d">Pairing</a> (<a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> *ps, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *a, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *b, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *d)</td></tr>
+<tr class="memitem:ga58a9d3cb6129274a04c72a35a52f768d"><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___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d">Pairing</a> (<a class="el" href="struct_pairing_state.html">PairingState</a> *ps, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *a, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *b, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *d)</td></tr>
<tr class="memdesc:ga58a9d3cb6129274a04c72a35a52f768d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes an Optimal Ate Pairing for two parameters. <a href="#ga58a9d3cb6129274a04c72a35a52f768d">More...</a><br /></td></tr>
<tr class="separator:ga58a9d3cb6129274a04c72a35a52f768d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
@@ -105,14 +97,14 @@ Functions</h2></td></tr>
<tr>
<td class="memname">void DeletePairingState </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> **&#160;</td>
+ <td class="paramtype"><a class="el" href="struct_pairing_state.html">PairingState</a> **&#160;</td>
<td class="paramname"><em>ps</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
-<p>Frees a previously allocated by PairingState. </p>
+<p>Frees a previously allocated by <a class="el" href="struct_pairing_state.html" title="A scratch buffer for stateful pairing calls. ">PairingState</a>. </p>
<p>Frees memory pointed to by pairing state. Nulls the pointer.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
@@ -161,7 +153,7 @@ Functions</h2></td></tr>
<tr>
<td class="paramkey"></td>
<td></td>
- <td class="paramtype"><a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> **&#160;</td>
+ <td class="paramtype"><a class="el" href="struct_pairing_state.html">PairingState</a> **&#160;</td>
<td class="paramname"><em>ps</em>&#160;</td>
</tr>
<tr>
@@ -187,7 +179,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 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 PairingState.</dd></dl>
+<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 <a class="el" href="struct_pairing_state.html" title="A scratch buffer for stateful pairing calls. ">PairingState</a>.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d" title="Frees a previously allocated by PairingState. ">DeletePairingState</a> </dd></dl>
</div>
@@ -199,7 +191,7 @@ Functions</h2></td></tr>
<tr>
<td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Pairing </td>
<td>(</td>
- <td class="paramtype"><a class="el" href="group___pairing_primitives.html#ga3f1fa61d25487f96dfb0ffef4ad35607">PairingState</a> *&#160;</td>
+ <td class="paramtype"><a class="el" href="struct_pairing_state.html">PairingState</a> *&#160;</td>
<td class="paramname"><em>ps</em>, </td>
</tr>
<tr>
diff --git a/doc/html/group___pairing_primitives.js b/doc/html/group___pairing_primitives.js
index dc48d2d..fad5c07 100644
--- a/doc/html/group___pairing_primitives.js
+++ b/doc/html/group___pairing_primitives.js
@@ -1,7 +1,6 @@
var group___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 ],
[ "Pairing", "group___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d", null ]
diff --git a/doc/html/group___tpm2_module.html b/doc/html/group___tpm2_module.html
index 931b7cf..41c1780 100644
--- a/doc/html/group___tpm2_module.html
+++ b/doc/html/group___tpm2_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/hash_8h.html b/doc/html/hash_8h.html
index 0b86f58..343d7fa 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/hashwrap_8h.html b/doc/html/hashwrap_8h.html
new file mode 100644
index 0000000..be75841
--- /dev/null
+++ b/doc/html/hashwrap_8h.html
@@ -0,0 +1,254 @@
+<!-- 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/tiny/math/hashwrap.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">6.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('hashwrap_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#nested-classes">Data Structures</a> &#124;
+<a href="#define-members">Macros</a> &#124;
+<a href="#func-members">Functions</a> </div>
+ <div class="headertitle">
+<div class="title">hashwrap.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Decleration of hash wrap function.
+<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="mathtypes_8h.html">epid/member/tiny/math/mathtypes.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="sha512_8h.html">epid/member/tiny/math/sha512.h</a>&quot;</code><br />
+<code>#include &quot;<a class="el" href="sha256_8h.html">epid/member/tiny/math/sha256.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">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionsha__digest.html">sha_digest</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sha Digest Element. <a href="unionsha__digest.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="structtiny__sha.html">tiny_sha</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tiny Sha wrapper Element. <a href="structtiny__sha.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:ab168fa663e74cc973af7e79d384df8b0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hashwrap_8h.html#ab168fa663e74cc973af7e79d384df8b0">tinysha_init</a> (<a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> sha_type, <a class="el" href="structtiny__sha.html">tiny_sha</a> *s)</td></tr>
+<tr class="memdesc:ab168fa663e74cc973af7e79d384df8b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the hash state. <a href="#ab168fa663e74cc973af7e79d384df8b0">More...</a><br /></td></tr>
+<tr class="separator:ab168fa663e74cc973af7e79d384df8b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9844075a9ccf12e56f6a07d86b49c98d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hashwrap_8h.html#a9844075a9ccf12e56f6a07d86b49c98d">tinysha_update</a> (<a class="el" href="structtiny__sha.html">tiny_sha</a> *s, void const *data, size_t data_length)</td></tr>
+<tr class="memdesc:a9844075a9ccf12e56f6a07d86b49c98d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes data into state using a chosen hash algorithm. <a href="#a9844075a9ccf12e56f6a07d86b49c98d">More...</a><br /></td></tr>
+<tr class="separator:a9844075a9ccf12e56f6a07d86b49c98d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a22b9a3e01537f4f5d89e608c8b7956f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hashwrap_8h.html#a22b9a3e01537f4f5d89e608c8b7956f6">tinysha_final</a> (unsigned char *digest, <a class="el" href="structtiny__sha.html">tiny_sha</a> *s)</td></tr>
+<tr class="memdesc:a22b9a3e01537f4f5d89e608c8b7956f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the hash algorithm in the digest buffer. <a href="#a22b9a3e01537f4f5d89e608c8b7956f6">More...</a><br /></td></tr>
+<tr class="separator:a22b9a3e01537f4f5d89e608c8b7956f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a6e07fd5b18355546d72dd09eae343c6a"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hashwrap_8h.html#a6e07fd5b18355546d72dd09eae343c6a">tinysha_digest_size</a> (<a class="el" href="structtiny__sha.html">tiny_sha</a> *s)</td></tr>
+<tr class="memdesc:a6e07fd5b18355546d72dd09eae343c6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns size of digest depending on hash algorithm. <a href="#a6e07fd5b18355546d72dd09eae343c6a">More...</a><br /></td></tr>
+<tr class="separator:a6e07fd5b18355546d72dd09eae343c6a"><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>Decleration of hash wrap function. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a6e07fd5b18355546d72dd09eae343c6a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">size_t tinysha_digest_size </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="structtiny__sha.html">tiny_sha</a> *&#160;</td>
+ <td class="paramname"><em>s</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Returns size of digest depending on hash algorithm. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">s</td><td>The hash state. Must be non-null or behavior is undefined.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>Size of digest </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a22b9a3e01537f4f5d89e608c8b7956f6"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tinysha_final </td>
+ <td>(</td>
+ <td class="paramtype">unsigned char *&#160;</td>
+ <td class="paramname"><em>digest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="structtiny__sha.html">tiny_sha</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>Computes the hash algorithm in the digest buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">digest</td><td>The computed digest. Must be non-null or behavior is undefined.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">s</td><td>The hash state. Must be non-null or behavior is undefined. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ab168fa663e74cc973af7e79d384df8b0"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tinysha_init </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td>
+ <td class="paramname"><em>sha_type</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="structtiny__sha.html">tiny_sha</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>Initializes the hash state. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">sha_type</td><td>Type of hash algorithm</td></tr>
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">s</td><td>The hash state to initialize. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a9844075a9ccf12e56f6a07d86b49c98d"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tinysha_update </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="structtiny__sha.html">tiny_sha</a> *&#160;</td>
+ <td class="paramname"><em>s</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void const *&#160;</td>
+ <td class="paramname"><em>data</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>data_length</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Hashes data into state using a chosen hash algorithm. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">s</td><td>The hash state. Must be non-null or behavior is undefined.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The data to hash into s.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">data_length</td><td>The size of data in bytes. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="hashwrap_8h.html">hashwrap.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/how__validated_8dox.html b/doc/html/how__validated_8dox.html
index d7d055f..6e03b52 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/implementation__notes_8dox.html b/doc/html/implementation__notes_8dox.html
index 55f065f..d0c79d5 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/implementing_member.png b/doc/html/implementing_member.png
new file mode 100644
index 0000000..ceb8bbb
--- /dev/null
+++ b/doc/html/implementing_member.png
Binary files differ
diff --git a/doc/html/index.html b/doc/html/index.html
index ec75efd..a1e4a44 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/issuer__material_8dox.html b/doc/html/issuer__material_8dox.html
index c3b55c3..8e05edd 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/legal__information_8dox.html b/doc/html/legal__information_8dox.html
index 6e99ee9..5ad8930 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/load__external_8c.html b/doc/html/load__external_8c.html
index 2c93b88..f176414 100644
--- a/doc/html/load__external_8c.html
+++ b/doc/html/load__external_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/load__external_8h.html b/doc/html/load__external_8h.html
index c52acb7..e5e93a0 100644
--- a/doc/html/load__external_8h.html
+++ b/doc/html/load__external_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/mainpage_8dox.html b/doc/html/mainpage_8dox.html
index 4572fd4..7f15b60 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/mathdefs_8h.html b/doc/html/mathdefs_8h.html
new file mode 100644
index 0000000..d298cd1
--- /dev/null
+++ b/doc/html/mathdefs_8h.html
@@ -0,0 +1,96 @@
+<!-- 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/tiny/math/mathdefs.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">6.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('mathdefs_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#define-members">Macros</a> </div>
+ <div class="headertitle">
+<div class="title">mathdefs.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Common public definitions for math headers.
+<a href="#details">More...</a></p>
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:a1a994bd1e283835646241e53b6728cee"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1a994bd1e283835646241e53b6728cee"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathdefs_8h.html#a1a994bd1e283835646241e53b6728cee">MATH_FAIL</a>&#160;&#160;&#160;0</td></tr>
+<tr class="memdesc:a1a994bd1e283835646241e53b6728cee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code representing failure of math function. <br /></td></tr>
+<tr class="separator:a1a994bd1e283835646241e53b6728cee"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a352e5652c4f35088eba5f769a5d7993f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a352e5652c4f35088eba5f769a5d7993f"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathdefs_8h.html#a352e5652c4f35088eba5f769a5d7993f">MATH_SUCCESS</a>&#160;&#160;&#160;1</td></tr>
+<tr class="memdesc:a352e5652c4f35088eba5f769a5d7993f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return code representing success of math function. <br /></td></tr>
+<tr class="separator:a352e5652c4f35088eba5f769a5d7993f"><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>Common public definitions for math headers. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="mathdefs_8h.html">mathdefs.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/mathtypes_8h.html b/doc/html/mathtypes_8h.html
new file mode 100644
index 0000000..0657112
--- /dev/null
+++ b/doc/html/mathtypes_8h.html
@@ -0,0 +1,133 @@
+<!-- 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/tiny/math/mathtypes.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">6.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('mathtypes_8h.html','');});
+</script>
+<div id="doc-content">
+<div class="header">
+ <div class="summary">
+<a href="#nested-classes">Data Structures</a> &#124;
+<a href="#define-members">Macros</a> </div>
+ <div class="headertitle">
+<div class="title">mathtypes.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of math types in tiny Intel(R) EPID.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;stdint.h&gt;</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_very_large_int.html">VeryLargeInt</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Large integer. <a href="struct_very_large_int.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_very_large_int_product.html">VeryLargeIntProduct</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Used for multiplication. <a href="struct_very_large_int_product.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_fp_elem.html">FpElem</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element of Fp. <a href="struct_fp_elem.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_fq_elem.html">FqElem</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element of Fq. <a href="struct_fq_elem.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_fq2_elem.html">Fq2Elem</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element of Fq2. <a href="struct_fq2_elem.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_ecc_point_fq.html">EccPointFq</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Point in EFq. <a href="struct_ecc_point_fq.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_ecc_point_fq2.html">EccPointFq2</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Point in EFq2. <a href="struct_ecc_point_fq2.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_fq6_elem.html">Fq6Elem</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element of Fq6. <a href="struct_fq6_elem.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_fq12_elem.html">Fq12Elem</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element of Fq12. <a href="struct_fq12_elem.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_ecc_point_jacobi_fq.html">EccPointJacobiFq</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element of EFq in Jacobi format. <a href="struct_ecc_point_jacobi_fq.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_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Element of EFq2 in Jacobi format. <a href="struct_ecc_point_jacobi_fq2.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_pairing_state.html">PairingState</a></td></tr>
+<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A scratch buffer for stateful pairing calls. <a href="struct_pairing_state.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="define-members"></a>
+Macros</h2></td></tr>
+<tr class="memitem:a94d0ffa1ccb9d2f09d1ada23a5807021"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a94d0ffa1ccb9d2f09d1ada23a5807021"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mathtypes_8h.html#a94d0ffa1ccb9d2f09d1ada23a5807021">NUM_ECC_DIGITS</a>&#160;&#160;&#160;8</td></tr>
+<tr class="memdesc:a94d0ffa1ccb9d2f09d1ada23a5807021"><td class="mdescLeft">&#160;</td><td class="mdescRight">number of 32bit words in a very large integer <br /></td></tr>
+<tr class="separator:a94d0ffa1ccb9d2f09d1ada23a5807021"><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>Definition of math types in tiny Intel(R) EPID. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="mathtypes_8h.html">mathtypes.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/member_2api_8h.html b/doc/html/member_2api_8h.html
index eafeb00..36d7715 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -69,6 +69,7 @@ $(document).ready(function(){initNavTree('member_2api_8h.html','');});
<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="epiddefs_8h.html">epid/common/epiddefs.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">
@@ -82,8 +83,14 @@ typedef struct <a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b0
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></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="memdesc:gae7a7b01bc0a84c44c9d14e6c311c1ba7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocates and initializes 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:ga2b3c0cc1d8d4e50190ca94656fa36e24"><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#ga2b3c0cc1d8d4e50190ca94656fa36e24">EpidMemberGetSize</a> (<a class="el" href="struct_member_params.html">MemberParams</a> const *params, size_t *context_size)</td></tr>
+<tr class="memdesc:ga2b3c0cc1d8d4e50190ca94656fa36e24"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the size in bytes required for a member context. <a href="group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24">More...</a><br /></td></tr>
+<tr class="separator:ga2b3c0cc1d8d4e50190ca94656fa36e24"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga35273b8e75d51e312f0d2fd3aa094efb"><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#ga35273b8e75d51e312f0d2fd3aa094efb">EpidMemberInit</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:ga35273b8e75d51e312f0d2fd3aa094efb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes a new member context. <a href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb">More...</a><br /></td></tr>
+<tr class="separator:ga35273b8e75d51e312f0d2fd3aa094efb"><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>
@@ -99,6 +106,9 @@ Functions</h2></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:ga98b4d990a885339b83cd0513fedcc76d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d">EpidMemberDeinit</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx)</td></tr>
+<tr class="memdesc:ga98b4d990a885339b83cd0513fedcc76d"><td class="mdescLeft">&#160;</td><td class="mdescRight">De-initializes an existing member context buffer. <a href="group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d">More...</a><br /></td></tr>
+<tr class="separator:ga98b4d990a885339b83cd0513fedcc76d"><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>
@@ -114,9 +124,12 @@ Functions</h2></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="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:ga8c6f097ba89542664375bd5e0f205220"><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#ga8c6f097ba89542664375bd5e0f205220">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:ga8c6f097ba89542664375bd5e0f205220"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a basename with a member. <a href="group___epid_member_module.html#ga8c6f097ba89542664375bd5e0f205220">More...</a><br /></td></tr>
+<tr class="separator:ga8c6f097ba89542664375bd5e0f205220"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ga4f3a464f14581ef3e5a50719cb4709c3"><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#ga4f3a464f14581ef3e5a50719cb4709c3">EpidClearRegisteredBasenames</a> (<a class="el" href="member_2api_8h.html#adfb10d5dfdadb0694792c7b06718e817">MemberCtx</a> *ctx)</td></tr>
+<tr class="memdesc:ga4f3a464f14581ef3e5a50719cb4709c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears registered basenames. <a href="group___epid_member_module.html#ga4f3a464f14581ef3e5a50719cb4709c3">More...</a><br /></td></tr>
+<tr class="separator:ga4f3a464f14581ef3e5a50719cb4709c3"><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="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>
diff --git a/doc/html/member_2tiny_2math_2pairing_8h.html b/doc/html/member_2tiny_2math_2pairing_8h.html
new file mode 100644
index 0000000..3aca1e3
--- /dev/null
+++ b/doc/html/member_2tiny_2math_2pairing_8h.html
@@ -0,0 +1,169 @@
+<!-- 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/tiny/math/pairing.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">6.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('member_2tiny_2math_2pairing_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">pairing.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of pairing math.
+<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:aba03ba485b970dd2d3f30b1f74f6ed6f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="member_2tiny_2math_2pairing_8h.html#aba03ba485b970dd2d3f30b1f74f6ed6f">PairingInit</a> (<a class="el" href="struct_pairing_state.html">PairingState</a> *state)</td></tr>
+<tr class="memdesc:aba03ba485b970dd2d3f30b1f74f6ed6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes pairing environment. <a href="#aba03ba485b970dd2d3f30b1f74f6ed6f">More...</a><br /></td></tr>
+<tr class="separator:aba03ba485b970dd2d3f30b1f74f6ed6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a74dabfd47d20d4086a89e1910ca27fe0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="member_2tiny_2math_2pairing_8h.html#a74dabfd47d20d4086a89e1910ca27fe0">PairingCompute</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *d, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *P, <a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> const *Q, <a class="el" href="struct_pairing_state.html">PairingState</a> const *state)</td></tr>
+<tr class="memdesc:a74dabfd47d20d4086a89e1910ca27fe0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes a pairing according to the Optimal Ate pairing computation. <a href="#a74dabfd47d20d4086a89e1910ca27fe0">More...</a><br /></td></tr>
+<tr class="separator:a74dabfd47d20d4086a89e1910ca27fe0"><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>Definition of pairing math. </p>
+<p>Tiny portable implementations of standard library functions.</p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a74dabfd47d20d4086a89e1910ca27fe0"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void PairingCompute </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>d</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>P</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> const *&#160;</td>
+ <td class="paramname"><em>Q</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_pairing_state.html">PairingState</a> const *&#160;</td>
+ <td class="paramname"><em>state</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Computes a pairing according to the Optimal Ate pairing computation. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">d</td><td>target, an element in GT. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">P</td><td>an element in G1. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">Q</td><td>an element in G2. </td></tr>
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">state</td><td>pairing state information. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aba03ba485b970dd2d3f30b1f74f6ed6f"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void PairingInit </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_pairing_state.html">PairingState</a> *&#160;</td>
+ <td class="paramname"><em>state</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Initializes pairing environment. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">state</td><td>pairing state information. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="member_2tiny_2math_2pairing_8h.html">pairing.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/modules.html b/doc/html/modules.html
index 98654ab..8a3374b 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/navtreedata.js b/doc/html/navtreedata.js
index 51e30e3..bf119d8 100644
--- a/doc/html/navtreedata.js
+++ b/doc/html/navtreedata.js
@@ -22,12 +22,14 @@ var NAVTREE =
] ]
] ],
[ "What's Included in the SDK", "SdkOverview.html", [
- [ "SDK Components", "SdkOverview.html#SdkOverview_Components", null ],
- [ "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 ],
+ [ "SDK Components", "SdkOverview.html#SdkOverview_Components", [
+ [ "SDK Core", "SdkOverview.html#SdkOverview_Core", null ],
+ [ "Samples", "SdkOverview.html#SdkOverview_Samples", null ],
+ [ "Tools", "SdkOverview.html#SdkOverview_Tools", null ],
+ [ "Other Components", "SdkOverview.html#SdkOverview_BuildingAndValidation", null ]
+ ] ],
[ "Intel® EPID 1.1 Compatibility", "SdkOverview.html#SdkOverview_Compatibility", null ],
+ [ "Member Implementations", "SdkOverview.html#SdkOverview_TPM", null ],
[ "Folder Layout", "SdkOverview.html#SdkOverview_Files", [
[ "Source Layout", "SdkOverview.html#SdkOverview_Files_SourceLayout", null ],
[ "Install Layout", "SdkOverview.html#SdkOverview_Files_InstallLayout", null ]
@@ -36,9 +38,11 @@ var NAVTREE =
[ "Building from Source", "BuildingSdk.html", [
[ "Prerequisites", "BuildingSdk.html#BuildingSdk_Prerequisites", null ],
[ "Building SDK with SCons", "BuildingSdk.html#BuildingSdk_Building_SCons", null ],
- [ "Alternate Makefile/Autoconf Based Build Approach", "BuildingSdk.html#BuildingSdk_Building_Makefile", null ],
+ [ "Alternate Makefile Based Build Approach", "BuildingSdk.html#BuildingSdk_Building_Makefile", null ],
[ "Improving Performance with Commercial IPP", "BuildingSdk.html#BuildingSdk_CommercialIpp", null ],
- [ "Optimizing Code Size over Performance", "BuildingSdk.html#BuildingSdk_SizeOptimizedBuild", null ],
+ [ "Optimizing for Code Size", "BuildingSdk.html#BuildingSdk_Tiny", [
+ [ "Limitations", "BuildingSdk.html#implementation_TinyLimitations", null ]
+ ] ],
[ "Example Programs", "BuildingSdk.html#BuildingSdk_Examples", null ],
[ "Building with Other Build Systems", "BuildingSdk.html#BuildingSdk_PortingBuildSystem", null ]
] ],
@@ -111,6 +115,7 @@ var NAVTREE =
[ "Name Based Signatures", "Basenames.html#name_based", null ]
] ],
[ "Implementation Notes", "ImplementationNotes.html", [
+ [ "Member Implementations", "ImplementationNotes.html#implementationNotes_Members", null ],
[ "Random Number Generation", "ImplementationNotes.html#ImplementationNotes_Prng", null ],
[ "Protecting Secrets", "ImplementationNotes.html#ImplementationNotes_ProtectingSecrets", null ],
[ "Replacing Math Primitives", "ImplementationNotes.html#ImplementationNotes_MathPrimitives", null ],
@@ -128,7 +133,7 @@ var NAVTREE =
[ "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 ]
+ [ "Intel® EPID Signing and Verification with a TPM", "TpmConsiderations.html#TpmConsiderations_Signing", null ]
] ]
] ],
[ "Glossary", "Glossary.html", [
@@ -160,6 +165,7 @@ var NAVTREE =
[ "Tested Libraries and Compilers", "HowValidated.html#validated_supported_compilers", null ]
] ],
[ "Walkthroughs of Examples Showing API Usage", "Examples.html", "Examples" ],
+ [ "Deprecated List", "deprecated.html", null ],
[ "API Reference", "modules.html", "modules" ]
] ]
];
@@ -167,8 +173,8 @@ var NAVTREE =
var NAVTREEINDEX =
[
"Basenames.html",
-"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890aefb89989305b5c34120b0f18ee8e2c5d",
-"struct_fq3_elem_str.html#af1be0a4d5c9c674d75bec34f95e3c731"
+"group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2",
+"struct_fp_elem_str.html"
];
var SYNCONMSG = 'click to disable panel synchronisation';
diff --git a/doc/html/navtreeindex0.js b/doc/html/navtreeindex0.js
index 3f8ec0c..e68112b 100644
--- a/doc/html/navtreeindex0.js
+++ b/doc/html/navtreeindex0.js
@@ -14,7 +14,8 @@ var NAVTREEINDEX0 =
"BuildingSdk.html#BuildingSdk_Examples":[6,5],
"BuildingSdk.html#BuildingSdk_PortingBuildSystem":[6,6],
"BuildingSdk.html#BuildingSdk_Prerequisites":[6,0],
-"BuildingSdk.html#BuildingSdk_SizeOptimizedBuild":[6,4],
+"BuildingSdk.html#BuildingSdk_Tiny":[6,4],
+"BuildingSdk.html#implementation_TinyLimitations":[6,4,0],
"ChangeLog.html":[3],
"EpidOverview.html":[4],
"EpidOverview.html#EpidOverview_Entity_interaction":[4,1],
@@ -50,11 +51,12 @@ var NAVTREEINDEX0 =
"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],
+"ImplementationNotes.html#ImplementationNotes_FlexibleArrays":[13,5],
+"ImplementationNotes.html#ImplementationNotes_MathPrimitives":[13,3],
+"ImplementationNotes.html#ImplementationNotes_Prng":[13,1],
+"ImplementationNotes.html#ImplementationNotes_ProtectingSecrets":[13,2],
+"ImplementationNotes.html#ImplementationNotes_SerializedTypes":[13,4],
+"ImplementationNotes.html#implementationNotes_Members":[13,0],
"IssuerMaterial.html":[9],
"IssuerMaterial.html#CompressedSamples":[9,2],
"IssuerMaterial.html#IssuerMaterial_CmpGroupRls":[9,3],
@@ -80,15 +82,16 @@ var NAVTREEINDEX0 =
"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_BuildingAndValidation":[5,0,3],
+"SdkOverview.html#SdkOverview_Compatibility":[5,1],
"SdkOverview.html#SdkOverview_Components":[5,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],
+"SdkOverview.html#SdkOverview_Core":[5,0,0],
+"SdkOverview.html#SdkOverview_Files":[5,3],
+"SdkOverview.html#SdkOverview_Files_InstallLayout":[5,3,1],
+"SdkOverview.html#SdkOverview_Files_SourceLayout":[5,3,0],
+"SdkOverview.html#SdkOverview_Samples":[5,0,1],
+"SdkOverview.html#SdkOverview_TPM":[5,2],
+"SdkOverview.html#SdkOverview_Tools":[5,0,2],
"SignVerifyTutorial.html":[7],
"SignVerifyTutorial.html#SignVerifyTutorial_GroupRevocation":[7,3,0],
"SignVerifyTutorial.html#SignVerifyTutorial_KeyRevocation":[7,3,1],
@@ -131,123 +134,120 @@ var NAVTREEINDEX0 =
"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]
+"deprecated.html":[19],
+"group___big_num_primitives.html":[20,0,0,0,0],
+"group___big_num_primitives.html#ga03c89b8b8dd87de2c0f4b5822145d317":[20,0,0,0,0,6],
+"group___big_num_primitives.html#ga166134085464b0df2c8efcfccf8ec573":[20,0,0,0,0,2],
+"group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718":[20,0,0,0,0,0],
+"group___big_num_primitives.html#ga2d17600068b1d94000635c6644258a03":[20,0,0,0,0,9],
+"group___big_num_primitives.html#ga7dd6038987210d10bf843602fef0c929":[20,0,0,0,0,5],
+"group___big_num_primitives.html#ga904c16cc020e7196f22ac9abdc31b41f":[20,0,0,0,0,12],
+"group___big_num_primitives.html#gabe8e39d5788423f41770a71a4c911fbe":[20,0,0,0,0,11],
+"group___big_num_primitives.html#gacbec9669ab0fe768e2be74dcaca397ea":[20,0,0,0,0,8],
+"group___big_num_primitives.html#gacde6564a814617a96985b379be0dfabb":[20,0,0,0,0,4],
+"group___big_num_primitives.html#gad5f6f262bfd780fed3678bcee16f0aed":[20,0,0,0,0,10],
+"group___big_num_primitives.html#gae70fd9b3026f0ab3c7e9601d0a3186b8":[20,0,0,0,0,1],
+"group___big_num_primitives.html#gaf0366e47226563b17fcbc8e3ed766084":[20,0,0,0,0,3],
+"group___big_num_primitives.html#gafd64b66fc85dab0005f4a1bb67bdf7b4":[20,0,0,0,0,7],
+"group___ec_group_primitives.html":[20,0,0,0,2],
+"group___ec_group_primitives.html#ga01bf8d6fa60a2e445490966b3a06c270":[20,0,0,0,2,4],
+"group___ec_group_primitives.html#ga0b6d7a3398251e9352fb29ef4abef466":[20,0,0,0,2,8],
+"group___ec_group_primitives.html#ga25c9013cc76907d73765eb7a96aa8c96":[20,0,0,0,2,12],
+"group___ec_group_primitives.html#ga3f96c43d14d24de0f7a5e214aef64196":[20,0,0,0,2,5],
+"group___ec_group_primitives.html#ga40e3431d3dbe8cf7a65ada7b7811cba4":[20,0,0,0,2,16],
+"group___ec_group_primitives.html#ga48ec5ae951c9f49d8d7d983234eea921":[20,0,0,0,2,7],
+"group___ec_group_primitives.html#ga6417b0ce72ba96de00c329e322fec7fb":[20,0,0,0,2,19],
+"group___ec_group_primitives.html#ga76d24378455eb96a3257fe8045c0993a":[20,0,0,0,2,14],
+"group___ec_group_primitives.html#ga7a8bdb9782d065bc32fd102e0ae73ccb":[20,0,0,0,2,21],
+"group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa":[20,0,0,0,2,1],
+"group___ec_group_primitives.html#ga8a6114a48214a327d4ec04fd25e5940e":[20,0,0,0,2,11],
+"group___ec_group_primitives.html#ga8cb086d792bffb79b3ca07e6ca4ce0e7":[20,0,0,0,2,3],
+"group___ec_group_primitives.html#ga9cf15b34bc4ff12e58b169dd989d8210":[20,0,0,0,2,10],
+"group___ec_group_primitives.html#gaad96a1498b85d28f71514b8f7b154d82":[20,0,0,0,2,17],
+"group___ec_group_primitives.html#gab7af276256c27610eda85ff432b846ea":[20,0,0,0,2,2],
+"group___ec_group_primitives.html#gac3067cc899e65e647390bb3bd1cabe4c":[20,0,0,0,2,6],
+"group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159":[20,0,0,0,2,0],
+"group___ec_group_primitives.html#gad3b3c63c48fa24e8dea07837b05bc061":[20,0,0,0,2,9],
+"group___ec_group_primitives.html#gad495a9f91b79984f7533c8ea4f92b3cb":[20,0,0,0,2,20],
+"group___ec_group_primitives.html#gae96c38e004ccd2211290ad6e66415ec4":[20,0,0,0,2,13],
+"group___ec_group_primitives.html#gaf3b6a548aa6f0d4f028a14feca251f57":[20,0,0,0,2,15],
+"group___ec_group_primitives.html#gaf4e23677dd378ef2e0cf55df79cbdb62":[20,0,0,0,2,18],
+"group___ecdsa_primitives.html":[20,0,0,0,1],
+"group___ecdsa_primitives.html#ga07e4ebd3423e1f6f9ae35f0608dde7c0":[20,0,0,0,1,1],
+"group___ecdsa_primitives.html#gaef0e8a31e830fe9285b43a0969e6611a":[20,0,0,0,1,0],
+"group___epid11_file_parser_module.html":[20,0,0,2,0],
+"group___epid11_file_parser_module.html#ga1f92d1cb6bd7d9815711fde515b40a4c":[20,0,0,2,0,0],
+"group___epid11_file_parser_module.html#gac3f6daaa5333627d4efe5438c1fe8868":[20,0,0,2,0,3],
+"group___epid11_file_parser_module.html#gae28a844eb68828480b2a76fcb7d252a3":[20,0,0,2,0,1],
+"group___epid11_file_parser_module.html#gae682077d315c39ed298ef198fd738546":[20,0,0,2,0,2],
+"group___epid11_pairing_primitives.html":[20,0,0,0,5,0],
+"group___epid11_pairing_primitives.html#ga0ee658e26e9f933ba2ffbf2504dfae7e":[20,0,0,0,5,0,3],
+"group___epid11_pairing_primitives.html#ga74236e8ebbfc30a7daa7fa1cf1df148b":[20,0,0,0,5,0,0],
+"group___epid11_pairing_primitives.html#gaa3457d6f85889bc714910252fd21c758":[20,0,0,0,5,0,1],
+"group___epid11_pairing_primitives.html#gaa4076dfe25e8e61ac6753333a322c059":[20,0,0,0,5,0,2],
+"group___epid11_types.html":[20,0,0,4,0],
+"group___epid11_types.html#ga7293cec8f937d6f5da42084403f978f1":[20,0,0,4,0,17],
+"group___epid11_types.html#gadff9c05d5b7751024152b40dda545545":[20,0,0,4,0,15],
+"group___epid11_types.html#gaf1f4f1d6f001895abe548cfb33611c23":[20,0,0,4,0,16],
+"group___epid11_verifier_module.html":[20,0,2,0],
+"group___epid11_verifier_module.html#ga0b79c79d09e3551158e1c38c7c335929":[20,0,2,0,3],
+"group___epid11_verifier_module.html#ga0cb6d30df527ee0d8f0a1b68d2b7c0c0":[20,0,2,0,7],
+"group___epid11_verifier_module.html#ga241520cb925e5be89893a2037451cf1c":[20,0,2,0,11],
+"group___epid11_verifier_module.html#ga3a2e320d7de6156b2ce9d73e9cdce813":[20,0,2,0,4],
+"group___epid11_verifier_module.html#ga63cae8d5abcf4d7e3af4157de18998f1":[20,0,2,0,6],
+"group___epid11_verifier_module.html#ga7b5d19277da043c2b79721975d7bd070":[20,0,2,0,13],
+"group___epid11_verifier_module.html#ga809c777908b2f9d029062d9424cb5f65":[20,0,2,0,8],
+"group___epid11_verifier_module.html#gab0b6560b226a37321f5ca5d4fb55eba7":[20,0,2,0,2],
+"group___epid11_verifier_module.html#gabe6a864a06322205ae7536ffea34c702":[20,0,2,0,1],
+"group___epid11_verifier_module.html#gac5a8f8d7624063ea428d81dbdbf61fa8":[20,0,2,0,5],
+"group___epid11_verifier_module.html#gafe5ad6bde38ad0c3e0a9960975fd5216":[20,0,2,0,12],
+"group___epid11_verifier_module.html#gaff5a014b0334be7e8583f0f99cb5e9b8":[20,0,2,0,10],
+"group___epid11_verifier_module.html#gaffbe6ac2bc7236ad65126a17ebdceb14":[20,0,2,0,9],
+"group___epid_common.html":[20,0,0],
+"group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c":[20,0,0,5],
+"group___epid_math.html":[20,0,0,0],
+"group___epid_member_module.html":[20,0,1],
+"group___epid_member_module.html#ga07094399c1e040b95ae3e58a74e7c302":[20,0,1,18],
+"group___epid_member_module.html#ga2b3c0cc1d8d4e50190ca94656fa36e24":[20,0,1,11],
+"group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb":[20,0,1,12],
+"group___epid_member_module.html#ga3824589c683c5e0e59d483462fce65d6":[20,0,1,10],
+"group___epid_member_module.html#ga4f3a464f14581ef3e5a50719cb4709c3":[20,0,1,3],
+"group___epid_member_module.html#ga74d1409a816cb52633564b793072da5f":[20,0,1,20],
+"group___epid_member_module.html#ga76cddb8e20afc43de2c30d5e4addb2ea":[20,0,1,16],
+"group___epid_member_module.html#ga76e535722467af7c16809b5b521e0000":[20,0,1,7],
+"group___epid_member_module.html#ga788ebc9d1ba6153c637b762484ca1140":[20,0,1,17],
+"group___epid_member_module.html#ga8c6f097ba89542664375bd5e0f205220":[20,0,1,19],
+"group___epid_member_module.html#ga98b4d990a885339b83cd0513fedcc76d":[20,0,1,9],
+"group___epid_member_module.html#ga9998eb454838ff5d232ff22ecbab31bf":[20,0,1,13],
+"group___epid_member_module.html#gaa2c85b1f0ea17a11ac5d297b21aa30f6":[20,0,1,15],
+"group___epid_member_module.html#gaaae6f21f58c22fce58076f10d68159f4":[20,0,1,14],
+"group___epid_member_module.html#gac10008d8c9ba7bc5e5be899ed03c61c3":[20,0,1,4],
+"group___epid_member_module.html#gacb0547ec085a9ed324d323416bce4a78":[20,0,1,2],
+"group___epid_member_module.html#gad78ca056dfea2565bbacd5734d9dc075":[20,0,1,6],
+"group___epid_member_module.html#gae7a7b01bc0a84c44c9d14e6c311c1ba7":[20,0,1,8],
+"group___epid_member_module.html#gaf8cd05388f017486f14da2ee48d067ef":[20,0,1,5],
+"group___epid_module.html":[20,0],
+"group___epid_print.html":[20,0,0,3],
+"group___epid_print.html#ga0d6377d9c1651d0101ec6b61feaa78ca":[20,0,0,3,3],
+"group___epid_print.html#ga138cd388247a58680d4701d59d6976d2":[20,0,0,3,12],
+"group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83":[20,0,0,3,0],
+"group___epid_print.html#ga3f2961ef6b4c44a6205d422d8a293476":[20,0,0,3,8],
+"group___epid_print.html#ga45a933b44fc1dfe926e3af89c198070a":[20,0,0,3,1],
+"group___epid_print.html#ga5f249c594ed12e4a9b11b7bc101da85d":[20,0,0,3,2],
+"group___epid_print.html#ga6c9fea48fa0477f4a98abb50f891a5e4":[20,0,0,3,9],
+"group___epid_print.html#ga87168a3ce5306f9839b8e8d6c9a5f84f":[20,0,0,3,10],
+"group___epid_print.html#ga883a834ab1703365bb0bca4abd3104de":[20,0,0,3,7],
+"group___epid_print.html#gaa3b1cbbfc6f78562658953113e5798cf":[20,0,0,3,4],
+"group___epid_print.html#gab76a4cf0385dc4a76bb56ee9f0e3e87a":[20,0,0,3,11],
+"group___epid_print.html#gae553c3a156a0e4968b89635ab0757580":[20,0,0,3,5],
+"group___epid_print.html#gaf185fe3df270cd8b4a2969bf3cfc5d5f":[20,0,0,3,6],
+"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83ade23610605d0ba7dd48db5060e28995a":[20,0,0,3,0,2],
+"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83ae2d5345c14f57fc992a613003c3c443d":[20,0,0,3,0,1],
+"group___epid_print.html#gga3e215d157eb205ad596bb84bce694a83aeb475b793d8d357087d7fcc74702ffae":[20,0,0,3,0,0],
+"group___epid_types.html":[20,0,0,4],
+"group___epid_types.html#ga3315fb24f4c5783b6d6eb107933390b0":[20,0,0,4,39],
+"group___epid_types.html#ga54bd22670f2e348593db7ab631131d10":[20,0,0,4,40],
+"group___epid_types.html#ga55eb2193045bde31af3f551565126042":[20,0,0,4,38],
+"group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890":[20,0,0,4,42],
+"group___epid_types.html#ga888541b8148df69c634a92c64ed51317":[20,0,0,4,41]
};
diff --git a/doc/html/navtreeindex1.js b/doc/html/navtreeindex1.js
index b1bcdee..41c1473 100644
--- a/doc/html/navtreeindex1.js
+++ b/doc/html/navtreeindex1.js
@@ -1,253 +1,253 @@
var NAVTREEINDEX1 =
{
-"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],
+"group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2":[20,0,0,4,36],
+"group___epid_types.html#gada666b48d0cbc301985405fde896f1de":[20,0,0,4,37],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a0f4dde6e82b84f5769873f6704fcd290":[20,0,0,4,42,2],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a4fa16d3867498f5e2f8ae5c94b0fab85":[20,0,0,4,42,5],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a68b2137c7946583a99f0dac2286523eb":[20,0,0,4,42,0],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a90d21c8885ab138f7cf91f253dd6ef86":[20,0,0,4,42,6],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890a9746b5049a62bca2f7b844925e6136ba":[20,0,0,4,42,4],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890ade8e74cf7910b3a71fe902a40abf7eee":[20,0,0,4,42,7],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890aefb89989305b5c34120b0f18ee8e2c5d":[20,0,0,4,42,1],
+"group___epid_types.html#gga5e450438f6f9a5eacd0cf5ce354ec890afb78d98f37fecc53dd1637d94c5c0055":[20,0,0,4,42,3],
+"group___epid_verifier_module.html":[20,0,2],
+"group___epid_verifier_module.html#ga0909703a0a4dfe080374d0d99077465a":[20,0,2,15],
+"group___epid_verifier_module.html#ga1c3810ef361da678a1f77823bd9c37a6":[20,0,2,10],
+"group___epid_verifier_module.html#ga1d116daaee5466a1485d26ebc4e3ab70":[20,0,2,8],
+"group___epid_verifier_module.html#ga1d41d6ef4dabbc30ec28452edd6baffb":[20,0,2,11],
+"group___epid_verifier_module.html#ga2a75c7d5775e852a7b6e24178dd4054f":[20,0,2,6],
+"group___epid_verifier_module.html#ga4c7c9820409ee06f30bb8dc75fdd5dcf":[20,0,2,14],
+"group___epid_verifier_module.html#ga6707e691f4b3916f9c684d5bbd463d12":[20,0,2,9],
+"group___epid_verifier_module.html#ga8eaeb9f4a34e9e37ccdf342919f38c69":[20,0,2,4],
+"group___epid_verifier_module.html#ga92df4d00ea4ee59d7bfd35b23da03392":[20,0,2,16],
+"group___epid_verifier_module.html#ga97b58b2382f24756b66a357f1e825c92":[20,0,2,12],
+"group___epid_verifier_module.html#gac3b1f1a2bdba8eeeebbf1e0c8c00862e":[20,0,2,18],
+"group___epid_verifier_module.html#gac6e2fab59e3af8a33a74a5b201642700":[20,0,2,7],
+"group___epid_verifier_module.html#gac857bff47e7d80363eac15285471fe81":[20,0,2,19],
+"group___epid_verifier_module.html#gae3f9c37628e18b880d8bbee3e7f55064":[20,0,2,17],
+"group___epid_verifier_module.html#gae44bd8acbc1e7205aeedff0c7e2632a8":[20,0,2,3],
+"group___epid_verifier_module.html#gaeb05e6faea6f09c0665b13adc6e7ddea":[20,0,2,5],
+"group___epid_verifier_module.html#gaf172a5f8f7f069d38c5838b723a1a85c":[20,0,2,2],
+"group___epid_verifier_module.html#gafab08180a43b58ce2e1d56c4b070bb0e":[20,0,2,13],
+"group___error_codes.html":[20,0,0,1],
+"group___error_codes.html#ga59e8680ce52509302fd58a987e45004d":[20,0,0,1,1],
+"group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360":[20,0,0,1,0],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a11a4d2f1c37064eb663de08dc57bcda8":[20,0,0,1,0,11],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a1739ecb620f4bede2e1b84e52a96cee6":[20,0,0,1,0,12],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a1dc7b7e6ff97c7ed9ff4191d76ebd6e1":[20,0,0,1,0,4],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a3706f895a660260033b5b91890516c0f":[20,0,0,1,0,17],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a43c658cbf0d156850d71ce3f8efd461c":[20,0,0,1,0,5],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a486e052baa99c6c25ae5d5cc710de298":[20,0,0,1,0,6],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a5252da1ff519a098446723e9edd30cc7":[20,0,0,1,0,8],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a61234ad9610406da6bf7977afd72a357":[20,0,0,1,0,16],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a700953ded1af35781948e8ada6dedf43":[20,0,0,1,0,20],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a83a867b4f71ee13edbfca2f1b72abbec":[20,0,0,1,0,14],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a893cd0d417b139bb376d09c93695c3f3":[20,0,0,1,0,13],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a8a6861e14322ca9193498ffc955537f9":[20,0,0,1,0,0],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a94ae9c9b9337afd2fefd3b4f9c3160df":[20,0,0,1,0,18],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aa08f0d2e394b37694117a6a32bc71e6e":[20,0,0,1,0,7],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab2768a1a5c4374cb1ac6175c09c73129":[20,0,0,1,0,19],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab45ad60085d03c03ea30b40a0519897e":[20,0,0,1,0,1],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab7dfec784192a827a91a4b8a6054d01c":[20,0,0,1,0,10],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad134d6cc95a9dcb1b1a9f9c358047cbf":[20,0,0,1,0,9],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ad4d4ff24a7ef2cd7a50b8082265e9ff4":[20,0,0,1,0,15],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aedd43fb4043bef3b515fc23f1d9a5fe5":[20,0,0,1,0,3],
+"group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aeedd19b8a1cbdecf963f90b4860e02b8":[20,0,0,1,0,2],
+"group___file_parser.html":[20,0,0,2],
+"group___file_parser.html#ga1562efc7c1891875d6b2b9180d65de9d":[20,0,0,2,4],
+"group___file_parser.html#ga237ef5a43076aa6fc6eb18829a93da3f":[20,0,0,2,9],
+"group___file_parser.html#ga3770c39a0546c79447c9d4159d794c33":[20,0,0,2,10],
+"group___file_parser.html#ga43fdbc1bf2edd3695d21cb457365afbb":[20,0,0,2,6],
+"group___file_parser.html#ga8e38d1102eb1dd9b5af2e2f79236da55":[20,0,0,2,5],
+"group___file_parser.html#ga9a33be7edc6b4c7a867fb07bd2bddecb":[20,0,0,2,3],
+"group___file_parser.html#gaae808987ce82188dff42baa4e43cab82":[20,0,0,2,11],
+"group___file_parser.html#gad767f72dc55307b872a8b5600da3fd6f":[20,0,0,2,7],
+"group___file_parser.html#gadc033fb23e3cbda56aa7e3d412060b7e":[20,0,0,2,8],
+"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da5f270e2e8c2412bc07de293023f425cc":[20,0,0,2,4,0],
+"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da6af0ee9d9689f1d4325bdd0beb8a89e2":[20,0,0,2,4,1],
+"group___file_parser.html#gga1562efc7c1891875d6b2b9180d65de9da8bbd27765997dd10f1c0378dbecef01d":[20,0,0,2,4,2],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba1f8d8c4b253403a35c51e05d34a7ca1e":[20,0,0,2,3,1],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba692b4141bff8225bee6000750b0da322":[20,0,0,2,3,2],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba8aead4b6aab87a1efb2d7e8c77a9b710":[20,0,0,2,3,3],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecba8e5247daee3999540e6cb24d4c2b3770":[20,0,0,2,3,4],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbab772fa1e3f221af125ffb34b86b3f24c":[20,0,0,2,3,7],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac24554caafe2db01e2daed413188cd92":[20,0,0,2,3,0],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac52e5fe24a12424316f655b9b7c62600":[20,0,0,2,3,6],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac6d742ea3dd3b17f6d763970ac84b811":[20,0,0,2,3,8],
+"group___file_parser.html#gga9a33be7edc6b4c7a867fb07bd2bddecbac708ba9e56eaeac0f1256457cbd45911":[20,0,0,2,3,5],
+"group___finite_field_primitives.html":[20,0,0,0,3],
+"group___finite_field_primitives.html#ga0d0c31a22bbfb665a16b2d25b0cd2634":[20,0,0,0,3,16],
+"group___finite_field_primitives.html#ga1a6e6d3c2319bb24eae8670b021e223b":[20,0,0,0,3,4],
+"group___finite_field_primitives.html#ga1bad3c6945d1d709fceb07a1dd03000e":[20,0,0,0,3,2],
+"group___finite_field_primitives.html#ga1ef46fc83f9c11263a2aa1ec906c9144":[20,0,0,0,3,13],
+"group___finite_field_primitives.html#ga20d9140e5670d679ef8183d9b5115f53":[20,0,0,0,3,10],
+"group___finite_field_primitives.html#ga26069d035d0f6ade33af2b5d5c14949a":[20,0,0,0,3,8],
+"group___finite_field_primitives.html#ga39892fe2ab431e166dbbcf57756660f6":[20,0,0,0,3,15],
+"group___finite_field_primitives.html#ga4613a75bd001a974b3e3e494c3a112a5":[20,0,0,0,3,11],
+"group___finite_field_primitives.html#ga59d20610f245ff4bc3a17b7bfe289991":[20,0,0,0,3,17],
+"group___finite_field_primitives.html#ga6622db072782fd9e53b4d59dd3dbd8e8":[20,0,0,0,3,6],
+"group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa":[20,0,0,0,3,0],
+"group___finite_field_primitives.html#ga7d99fdc5e4573668a5744e49df7ab67c":[20,0,0,0,3,20],
+"group___finite_field_primitives.html#ga83041e3be9984a4bd8f1021934bfa3a2":[20,0,0,0,3,21],
+"group___finite_field_primitives.html#ga84d21decc1c957bcf6e98e1492eb2ac3":[20,0,0,0,3,12],
+"group___finite_field_primitives.html#ga8a143a5a815a62f4947be2de1653c50f":[20,0,0,0,3,23],
+"group___finite_field_primitives.html#ga90b2c192708973b54b7a3e82b34536ed":[20,0,0,0,3,18],
+"group___finite_field_primitives.html#gaa3c1f7515dd823ddad8764091ebc665f":[20,0,0,0,3,24],
+"group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e":[20,0,0,0,3,1],
+"group___finite_field_primitives.html#gabd511d79d9cbd1899e59258f149102c5":[20,0,0,0,3,7],
+"group___finite_field_primitives.html#gacbdd2871ecf93dadaac9d2c5b16e1e5f":[20,0,0,0,3,3],
+"group___finite_field_primitives.html#gacc54f315ede2dbeb8c5990c024a0de6c":[20,0,0,0,3,19],
+"group___finite_field_primitives.html#gae69af62a03179718cac81b004549c598":[20,0,0,0,3,22],
+"group___finite_field_primitives.html#gae7a8c7503b6fc7a41bcaab4d45ca37b2":[20,0,0,0,3,14],
+"group___finite_field_primitives.html#gaed2acb8583e9c9f6b49fdb660c672625":[20,0,0,0,3,9],
+"group___finite_field_primitives.html#gaf0ddbc1bad048d67771cba119eb44a6c":[20,0,0,0,3,5],
+"group___hash_primitives.html":[20,0,0,0,4],
+"group___hash_primitives.html#ga86d62aac9efd7445acee311b41846c6c":[20,0,0,0,4,1],
+"group___pairing_primitives.html":[20,0,0,0,5],
+"group___pairing_primitives.html#ga29f79a645871830754d396b9b4a2a0cc":[20,0,0,0,5,2],
+"group___pairing_primitives.html#ga58a9d3cb6129274a04c72a35a52f768d":[20,0,0,0,5,3],
+"group___pairing_primitives.html#gad54aebdc331d39b73000fdca9e04f94d":[20,0,0,0,5,1],
+"group___tpm2_module.html":[20,0,1,0],
+"group___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7":[20,0,1,0,12],
+"group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e":[20,0,1,0,1],
+"group___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69":[20,0,1,0,11],
+"group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd":[20,0,1,0,6],
+"group___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22":[20,0,1,0,7],
+"group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4":[20,0,1,0,2],
+"group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9":[20,0,1,0,0],
+"group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81":[20,0,1,0,10],
+"group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc":[20,0,1,0,8],
+"group___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9":[20,0,1,0,4],
+"group___tpm2_module.html#gac3735163276efa0da4b793ba935513bb":[20,0,1,0,9],
+"group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326":[20,0,1,0,5],
+"group___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6":[20,0,1,0,3],
"index.html":[],
+"index.html":[1],
"index.html#mainpage_roadmap":[1,0],
-"modules.html":[19],
+"modules.html":[20],
"pages.html":[],
-"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]
+"struct_basic_signature.html":[20,0,0,4,21],
+"struct_basic_signature.html#a0078cc83ecf6c7e31f96b7d44aa60e21":[20,0,0,4,21,2],
+"struct_basic_signature.html#a0e8ea6a2cd3af10e9b59d96d7d06bc69":[20,0,0,4,21,6],
+"struct_basic_signature.html#a4daa94db5068db3f10960f3dd178d603":[20,0,0,4,21,1],
+"struct_basic_signature.html#a69115a4776d15b48411dd6c3a76d0f3d":[20,0,0,4,21,3],
+"struct_basic_signature.html#a730f74d85cfb4fa4089d43c87b97a624":[20,0,0,4,21,7],
+"struct_basic_signature.html#a79d8dec8c5da176e497abf22e4c43adb":[20,0,0,4,21,5],
+"struct_basic_signature.html#a91daebc5b577688afeed2a7ee7913245":[20,0,0,4,21,4],
+"struct_basic_signature.html#ae90cb6af66b010ae39913f033c1e65ac":[20,0,0,4,21,0],
+"struct_big_num_str.html":[20,0,0,4,8],
+"struct_big_num_str.html#a442dcf33889b4f85c5b1228d2c8e6838":[20,0,0,4,8,0],
+"struct_compressed_priv_key.html":[20,0,0,4,18],
+"struct_compressed_priv_key.html#a0b0535f0567eb0e48f799d27991d0f66":[20,0,0,4,18,0],
+"struct_compressed_priv_key.html#a54b9af7699f517bbaef3d52d03e3fed8":[20,0,0,4,18,2],
+"struct_compressed_priv_key.html#ac6689899f1d9a6a8c5e4915563679840":[20,0,0,4,18,1],
+"struct_ecdsa_private_key.html":[20,0,0,4,35],
+"struct_ecdsa_private_key.html#a97efee9b4079f95d94a104f9a6d8c96d":[20,0,0,4,35,0],
+"struct_ecdsa_public_key.html":[20,0,0,4,34],
+"struct_ecdsa_public_key.html#a37c51614faf022eec491b4de8f3a13e1":[20,0,0,4,34,0],
+"struct_ecdsa_public_key.html#a4503c4613386cbc78add1dc245c99284":[20,0,0,4,34,1],
+"struct_ecdsa_signature.html":[20,0,0,4,33],
+"struct_ecdsa_signature.html#a2efd6bf37b12f35135bf325fa491b029":[20,0,0,4,33,1],
+"struct_ecdsa_signature.html#a64b623605a55a267a36df18f29142d0d":[20,0,0,4,33,0],
+"struct_epid11_basic_signature.html":[20,0,0,4,0,8],
+"struct_epid11_basic_signature.html#a1a73fc922f69e2499643dd4c53d0d42d":[20,0,0,4,0,8,5],
+"struct_epid11_basic_signature.html#a267cf4e17d10584736b0c38f3668d822":[20,0,0,4,0,8,12],
+"struct_epid11_basic_signature.html#a2718346665210b7e26521bf4a15cb3bd":[20,0,0,4,0,8,9],
+"struct_epid11_basic_signature.html#a27fd7ae99d1ada652e21e7508a467c0b":[20,0,0,4,0,8,0],
+"struct_epid11_basic_signature.html#a29a700f3bec251600e18b2292081df4b":[20,0,0,4,0,8,6],
+"struct_epid11_basic_signature.html#a5882fcbfd272774e12e50a2d77f0b139":[20,0,0,4,0,8,2],
+"struct_epid11_basic_signature.html#a58b058a9c5119a240177acfade328b3b":[20,0,0,4,0,8,11],
+"struct_epid11_basic_signature.html#a911441845fc9b82d514133371b5ba87c":[20,0,0,4,0,8,10],
+"struct_epid11_basic_signature.html#a9cc6efcd3d7270022779bd16776168ed":[20,0,0,4,0,8,1],
+"struct_epid11_basic_signature.html#ae17b45194997a6fa13c6014a51ec711c":[20,0,0,4,0,8,8],
+"struct_epid11_basic_signature.html#aeb221cf52bc2b1a9bf6e0a9779bfd20f":[20,0,0,4,0,8,4],
+"struct_epid11_basic_signature.html#af18200712d2cf3ed3ccaee328e8a4e0f":[20,0,0,4,0,8,3],
+"struct_epid11_basic_signature.html#afe28bad6328f81e6f7af011cc96ac2e5":[20,0,0,4,0,8,7],
+"struct_epid11_g2_elem_str.html":[20,0,0,4,0,4],
+"struct_epid11_g2_elem_str.html#a9e8984e479bcbe8bd36c65e80c340032":[20,0,0,4,0,4,1],
+"struct_epid11_g2_elem_str.html#af28558484298f4f56377ededf57a4a04":[20,0,0,4,0,4,0],
+"struct_epid11_group_pub_key.html":[20,0,0,4,0,7],
+"struct_epid11_group_pub_key.html#a056c7138246e2bdcd47eaad501b756bb":[20,0,0,4,0,7,3],
+"struct_epid11_group_pub_key.html#a36f688472e2655052d485eac67d8c362":[20,0,0,4,0,7,1],
+"struct_epid11_group_pub_key.html#a964344b3c595bdd585bb9b5d9d0ea762":[20,0,0,4,0,7,0],
+"struct_epid11_group_pub_key.html#aa724e9d2f0cb6019c05547d76a13b72a":[20,0,0,4,0,7,2],
+"struct_epid11_group_rl.html":[20,0,0,4,0,14],
+"struct_epid11_group_rl.html#a35cb954f598d4006b0f047cde77010a5":[20,0,0,4,0,14,1],
+"struct_epid11_group_rl.html#a63afa9863e8dcb63ff884e6e4093c481":[20,0,0,4,0,14,2],
+"struct_epid11_group_rl.html#a97f165c59bc447e3ca3c2148a096710f":[20,0,0,4,0,14,0],
+"struct_epid11_gt_elem_str.html":[20,0,0,4,0,5],
+"struct_epid11_gt_elem_str.html#aed8dd86f1696c2f3537154fc904bf2b0":[20,0,0,4,0,5,0],
+"struct_epid11_nr_proof.html":[20,0,0,4,0,9],
+"struct_epid11_nr_proof.html#a1ad7fe6b32c09f2504ee49731c0ad145":[20,0,0,4,0,9,1],
+"struct_epid11_nr_proof.html#a2e5ee8dc25d296538dce935397a93d68":[20,0,0,4,0,9,0],
+"struct_epid11_nr_proof.html#a5ad9ba3bfac4eac37fd4a4e33ea65ddc":[20,0,0,4,0,9,3],
+"struct_epid11_nr_proof.html#aa8406e938b2f87bded9e374e93a8ee5d":[20,0,0,4,0,9,2],
+"struct_epid11_params.html":[20,0,0,4,0,6],
+"struct_epid11_params.html#a01381f84b2d747b6273e21c71c58a1b0":[20,0,0,4,0,6,0],
+"struct_epid11_params.html#a02bd6fa2ab256e3a07533e947ab0101e":[20,0,0,4,0,6,10],
+"struct_epid11_params.html#a0fe238db4ebc0225899dc2dac97d11c0":[20,0,0,4,0,6,9],
+"struct_epid11_params.html#a1c6bbc4e066449d9c329f88cb653ef7c":[20,0,0,4,0,6,6],
+"struct_epid11_params.html#a27b45ed7771a3024d1d059b4b4ff6eae":[20,0,0,4,0,6,2],
+"struct_epid11_params.html#a2aa4d8a2ebe0dfeb6d930fd7b39f9d1a":[20,0,0,4,0,6,11],
+"struct_epid11_params.html#a49462f35596d07a456a731d0690fdd83":[20,0,0,4,0,6,14],
+"struct_epid11_params.html#a77a8350b97a7afb584a46eb5b32f03bf":[20,0,0,4,0,6,12],
+"struct_epid11_params.html#a7eb9a1371d7187ae81bccfa8d5595033":[20,0,0,4,0,6,7],
+"struct_epid11_params.html#a835e70da717cd5b0c94e242a6418a287":[20,0,0,4,0,6,5],
+"struct_epid11_params.html#aacc39ebe0cc625321039ffb6be0b0e87":[20,0,0,4,0,6,4],
+"struct_epid11_params.html#aad03fd1cc3955bb8879535fa7298123f":[20,0,0,4,0,6,13],
+"struct_epid11_params.html#ade3f88ce73d7de656ec67d9fdb0719d7":[20,0,0,4,0,6,3],
+"struct_epid11_params.html#ae2d1dc635d9d7cba496c3d64fb6f9d5b":[20,0,0,4,0,6,8],
+"struct_epid11_params.html#ae8770bb921aac9214ff8c45c41dbb228":[20,0,0,4,0,6,1],
+"struct_epid11_params.html#af22cfcd6c7ec0e7e7369b79554b963bd":[20,0,0,4,0,6,15],
+"struct_epid11_priv_rl.html":[20,0,0,4,0,11],
+"struct_epid11_priv_rl.html#a2b3899f5a35bf64f860d6d91bccb03c8":[20,0,0,4,0,11,3],
+"struct_epid11_priv_rl.html#aa8945d81e30674b52a6d0900b64feb3c":[20,0,0,4,0,11,1],
+"struct_epid11_priv_rl.html#abbb75fee81aecb2dde7e2daab895ad3b":[20,0,0,4,0,11,0],
+"struct_epid11_priv_rl.html#ad95f880f40e2f40c723f5bdbd22ecfa2":[20,0,0,4,0,11,2],
+"struct_epid11_sig_rl.html":[20,0,0,4,0,13],
+"struct_epid11_sig_rl.html#a6473f8a98f76c9f82183041ea5ae17e3":[20,0,0,4,0,13,0],
+"struct_epid11_sig_rl.html#a8c654d43df132db7874f4c84c177dc12":[20,0,0,4,0,13,2],
+"struct_epid11_sig_rl.html#aa38674729293f4879ff94328dd3c59b1":[20,0,0,4,0,13,3],
+"struct_epid11_sig_rl.html#ad45b0e3e1be59649150dd34c104000ac":[20,0,0,4,0,13,1],
+"struct_epid11_sig_rl_entry.html":[20,0,0,4,0,12],
+"struct_epid11_sig_rl_entry.html#a5de66e1352eafe95774a0d76bac8f01a":[20,0,0,4,0,12,1],
+"struct_epid11_sig_rl_entry.html#abe47cfbd00684941f93a211417bedf0c":[20,0,0,4,0,12,0],
+"struct_epid11_signature.html":[20,0,0,4,0,10],
+"struct_epid11_signature.html#a43cb3ed13c862ff05a9292623ad57c5e":[20,0,0,4,0,10,1],
+"struct_epid11_signature.html#a48526e73f02ad3f1544c4c71c481f153":[20,0,0,4,0,10,3],
+"struct_epid11_signature.html#abf24a8df563ba3f535486d8dad7384f4":[20,0,0,4,0,10,2],
+"struct_epid11_signature.html#ad25c277223a5210063163ea554d08ad4":[20,0,0,4,0,10,0],
+"struct_epid11_verifier_precomp.html":[20,0,2,0,0],
+"struct_epid11_verifier_precomp.html#a03138e937f4488bdbc52ed473dc313da":[20,0,2,0,0,3],
+"struct_epid11_verifier_precomp.html#a0a980adb039089263ec59a995600ee91":[20,0,2,0,0,0],
+"struct_epid11_verifier_precomp.html#a14ebadf105aff085edb9a817a2d1db89":[20,0,2,0,0,2],
+"struct_epid11_verifier_precomp.html#ad0ff2a13c2c87460296900dde72a2f30":[20,0,2,0,0,1],
+"struct_epid2_params.html":[20,0,0,4,14],
+"struct_epid2_params.html#a023603228fed2854ddae2e228938940f":[20,0,0,4,14,6],
+"struct_epid2_params.html#a200a0cba1c9e4ad512bece23f2461a5f":[20,0,0,4,14,7],
+"struct_epid2_params.html#a2f868edb49be49f645101ef5ebbbc551":[20,0,0,4,14,0],
+"struct_epid2_params.html#a4c5195b4fa9393a07a121336202531ad":[20,0,0,4,14,2],
+"struct_epid2_params.html#a609b0aac17fca34fe39bee29676a9618":[20,0,0,4,14,3],
+"struct_epid2_params.html#ac0e0dad45b10927860cd5fa4f8101f08":[20,0,0,4,14,5],
+"struct_epid2_params.html#ac2d7507c6f58c3451beacacb91b52695":[20,0,0,4,14,1],
+"struct_epid2_params.html#ae1d8f5d6036a82064e91bc137b278e74":[20,0,0,4,14,8],
+"struct_epid2_params.html#af23f07fb0e1745c0ad14aceeaa946928":[20,0,0,4,14,4],
+"struct_epid_ca_certificate.html":[20,0,0,2,2],
+"struct_epid_ca_certificate.html#a280e0b0238cf45834c21849ab8a7e124":[20,0,0,2,2,1],
+"struct_epid_ca_certificate.html#a2811c1914ffae913820f13da914c8f01":[20,0,0,2,2,0],
+"struct_epid_ca_certificate.html#a2f8f09ae02919c379c38386668b47418":[20,0,0,2,2,6],
+"struct_epid_ca_certificate.html#a3a44e8050ca2f5085652b2b4e15b779c":[20,0,0,2,2,3],
+"struct_epid_ca_certificate.html#a4f77996f90ed7da1d0503c4236b2c9d1":[20,0,0,2,2,7],
+"struct_epid_ca_certificate.html#a9d2fc21f46cf9fc96e2ea557b70e5356":[20,0,0,2,2,4],
+"struct_epid_ca_certificate.html#ab9d4c318b1fc8d38d3ce53b29f2dfee2":[20,0,0,2,2,5],
+"struct_epid_ca_certificate.html#abd69cce8d5e3940787ee0d17f72184ab":[20,0,0,2,2,8],
+"struct_epid_ca_certificate.html#ac03cf7257c52ad14e3dd3201b930dd50":[20,0,0,2,2,2],
+"struct_epid_file_header.html":[20,0,0,2,1],
+"struct_epid_file_header.html#a35d43c51c1739940381e4898ca87b824":[20,0,0,2,1,0],
+"struct_epid_file_header.html#af5d48c739cc6c00c6e1ce35abf4f1473":[20,0,0,2,1,1],
+"struct_epid_signature.html":[20,0,0,4,23],
+"struct_epid_signature.html#a4155f3f4f1223fc4ae50c94f5305def1":[20,0,0,4,23,1],
+"struct_epid_signature.html#a62a6b0ffcd5f68dd3d2786a58fe43017":[20,0,0,4,23,0],
+"struct_epid_signature.html#a89d2e38223944310b6eeeadf6061a2dd":[20,0,0,4,23,2],
+"struct_epid_signature.html#ab0fe5f98bff737fcfbfe0b4d658e83f2":[20,0,0,4,23,3]
};
diff --git a/doc/html/navtreeindex2.js b/doc/html/navtreeindex2.js
index 9550284..fed10d0 100644
--- a/doc/html/navtreeindex2.js
+++ b/doc/html/navtreeindex2.js
@@ -1,103 +1,110 @@
var NAVTREEINDEX2 =
{
-"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],
+"struct_fp_elem_str.html":[20,0,0,4,9],
+"struct_fp_elem_str.html#a5ddb96a5567750f2834335851c906c45":[20,0,0,4,9,0],
+"struct_fq12_elem_str.html":[20,0,0,4,32],
+"struct_fq12_elem_str.html#a0520947335aaf52de90af1dec5bdd112":[20,0,0,4,32,0],
+"struct_fq2_elem_str.html":[20,0,0,4,30],
+"struct_fq2_elem_str.html#ab1d253eb24ba30eaf516ac429daab915":[20,0,0,4,30,0],
+"struct_fq3_elem_str.html":[20,0,0,4,0,3],
+"struct_fq3_elem_str.html#af1be0a4d5c9c674d75bec34f95e3c731":[20,0,0,4,0,3,0],
+"struct_fq6_elem_str.html":[20,0,0,4,31],
+"struct_fq6_elem_str.html#a89d656e5c815b4a2382d11ef6932a7d2":[20,0,0,4,31,0],
+"struct_fq_elem_str.html":[20,0,0,4,10],
+"struct_fq_elem_str.html#aac1a876b51a8d2c6d1510e4df2fd3f14":[20,0,0,4,10,0],
+"struct_g1_elem_str.html":[20,0,0,4,11],
+"struct_g1_elem_str.html#a3b0e658d6e5697763ad9c633c11d4ec4":[20,0,0,4,11,0],
+"struct_g1_elem_str.html#a8f2455ca314e885ea180dadf84bf27c3":[20,0,0,4,11,1],
+"struct_g2_elem_str.html":[20,0,0,4,12],
+"struct_g2_elem_str.html#a145ec5b20a6f4f00b080e11c8680afc3":[20,0,0,4,12,0],
+"struct_g2_elem_str.html#a43141b2458aecceed8ee2748270f7908":[20,0,0,4,12,1],
+"struct_group_pub_key.html":[20,0,0,4,15],
+"struct_group_pub_key.html#a2a4320ec99fd1a15df412fbf2a8d49f1":[20,0,0,4,15,2],
+"struct_group_pub_key.html#a86be439104fb60b324784baf24a943f9":[20,0,0,4,15,3],
+"struct_group_pub_key.html#a8c22c758ea186f95e3bf4b2ef8451da5":[20,0,0,4,15,1],
+"struct_group_pub_key.html#ae8e77ab4d5eb3c8e566c24a64cce56ee":[20,0,0,4,15,0],
+"struct_group_rl.html":[20,0,0,4,27],
+"struct_group_rl.html#a51022e172ab8b945efc69f1e63170107":[20,0,0,4,27,0],
+"struct_group_rl.html#a69c41d99cdfc5b6ece7442f466f7ec3f":[20,0,0,4,27,2],
+"struct_group_rl.html#a9067f01c63cdefbc8e23c3cf67a10172":[20,0,0,4,27,1],
+"struct_gt_elem_str.html":[20,0,0,4,13],
+"struct_gt_elem_str.html#aeaeb0e9e1c6efd378a475eb9a6c42132":[20,0,0,4,13,0],
+"struct_i_priv_key.html":[20,0,0,4,16],
+"struct_i_priv_key.html#a6d484175317aef09fb959c3ca55fc70a":[20,0,0,4,16,0],
+"struct_i_priv_key.html#ad400a4237b6d50855538fd40580eb1bb":[20,0,0,4,16,1],
+"struct_join_request.html":[20,0,0,4,20],
+"struct_join_request.html#a005651506fd4511e8a3537f6c3634532":[20,0,0,4,20,1],
+"struct_join_request.html#a55e30a274e83b808db6fbab5ae6c6cb8":[20,0,0,4,20,0],
+"struct_join_request.html#a73bf8989df5f90eb3d06e7a42ad74d1d":[20,0,0,4,20,2],
+"struct_member_params.html":[20,0,1,1],
+"struct_member_params.html#a7510f05e63328fa13cf2a3a3bd6acd95":[20,0,1,1,2],
+"struct_member_params.html#ad6782a38fd79477bccf2313c676ea4fc":[20,0,1,1,0],
+"struct_member_params.html#ad844c7a2be20bac70b118e7c08530c0b":[20,0,1,1,1],
+"struct_member_precomp.html":[20,0,0,4,29],
+"struct_member_precomp.html#a4e7412969bed3964f813b093b948e7b4":[20,0,0,4,29,1],
+"struct_member_precomp.html#a55e5c4b25c8f0f426969a8d745260fe5":[20,0,0,4,29,0],
+"struct_member_precomp.html#a573551f6494e372f44fd3bdf5b02aeda":[20,0,0,4,29,3],
+"struct_member_precomp.html#a879d5a7b0c30088b23f6e5c5fc62f834":[20,0,0,4,29,2],
+"struct_membership_credential.html":[20,0,0,4,19],
+"struct_membership_credential.html#a2c5c0d22999d6917fea5ad6618883bcf":[20,0,0,4,19,2],
+"struct_membership_credential.html#a6d38ac3a9c5417833b8adb9b22bc9dc8":[20,0,0,4,19,0],
+"struct_membership_credential.html#afbff64ec55888c7e2a658eabb5e16671":[20,0,0,4,19,1],
+"struct_nr_proof.html":[20,0,0,4,22],
+"struct_nr_proof.html#a0de1aa69acf3d93da34cf4a613b359a1":[20,0,0,4,22,0],
+"struct_nr_proof.html#a717ec36a6c91acd01d9b642bb20fc178":[20,0,0,4,22,1],
+"struct_nr_proof.html#ace535065bbf96502b893ac677dc8dcd3":[20,0,0,4,22,3],
+"struct_nr_proof.html#ae2e9f22089793a4d44a0f7f5cdb78a0c":[20,0,0,4,22,2],
+"struct_oct_str128.html":[20,0,0,4,5],
+"struct_oct_str128.html#a7482aa9b0b580fdd50bd65419d52d4b9":[20,0,0,4,5,0],
+"struct_oct_str16.html":[20,0,0,4,2],
+"struct_oct_str16.html#a86ed6671693a3f60ec4ff7de2c1206c3":[20,0,0,4,2,0],
+"struct_oct_str256.html":[20,0,0,4,6],
+"struct_oct_str256.html#a359781bb84f5717a16094583a00ef14e":[20,0,0,4,6,0],
+"struct_oct_str32.html":[20,0,0,4,3],
+"struct_oct_str32.html#a5588a7e70f3d73f6ce58b567a9f5c5c8":[20,0,0,4,3,0],
+"struct_oct_str512.html":[20,0,0,4,7],
+"struct_oct_str512.html#abd4d1b97fe49321571da86de1aeac653":[20,0,0,4,7,0],
+"struct_oct_str600.html":[20,0,0,4,0,1],
+"struct_oct_str600.html#a06d53af92a06e1decc6062fd16c43a59":[20,0,0,4,0,1,0],
+"struct_oct_str64.html":[20,0,0,4,4],
+"struct_oct_str64.html#a0e107d78192a5ae0b48ed9e5c4eab0fc":[20,0,0,4,4,0],
+"struct_oct_str768.html":[20,0,0,4,0,2],
+"struct_oct_str768.html#ae45eea89259bd22e60a8d960063921cc":[20,0,0,4,0,2,0],
+"struct_oct_str8.html":[20,0,0,4,1],
+"struct_oct_str8.html#a5e6c56fda48c88b419e621b464b03bef":[20,0,0,4,1,0],
+"struct_oct_str80.html":[20,0,0,4,0,0],
+"struct_oct_str80.html#af80e2b81554109d9a41c5e771aceb8c9":[20,0,0,4,0,0,0],
+"struct_priv_key.html":[20,0,0,4,17],
+"struct_priv_key.html#a266c7e369b8b868ef5755e9cd3c0c849":[20,0,0,4,17,0],
+"struct_priv_key.html#aa805f9e124f05bdb733c85cb93614cbd":[20,0,0,4,17,3],
+"struct_priv_key.html#ab416dcb4366427c24b44c2a02e4ae7c8":[20,0,0,4,17,2],
+"struct_priv_key.html#ad7ee0392a583edd2e287cf8c1f9066ba":[20,0,0,4,17,1],
+"struct_priv_rl.html":[20,0,0,4,24],
+"struct_priv_rl.html#a4c6b51cec760f7e81ca8635422ac6a50":[20,0,0,4,24,3],
+"struct_priv_rl.html#a60d73f9ef5fc81f117b3abadf8c18466":[20,0,0,4,24,0],
+"struct_priv_rl.html#a6da9639ec4061689d1c30a58e0befd14":[20,0,0,4,24,2],
+"struct_priv_rl.html#af7317529b8e55476bd06b66ed8131d64":[20,0,0,4,24,1],
+"struct_sha256_digest.html":[20,0,0,0,4,0],
+"struct_sha256_digest.html#a4b6462ddd3f89e4c40220ceb6b1c7f28":[20,0,0,0,4,0,0],
+"struct_sig_rl.html":[20,0,0,4,26],
+"struct_sig_rl.html#a12757d30fcccd310716433948e0b603e":[20,0,0,4,26,1],
+"struct_sig_rl.html#a9dfb6b508db9051f4dc480a51d702af2":[20,0,0,4,26,2],
+"struct_sig_rl.html#ac23a919993d99d24a5150302f1778102":[20,0,0,4,26,0],
+"struct_sig_rl.html#ac9d4c343c539dba799e1f42eb38b351f":[20,0,0,4,26,3],
+"struct_sig_rl_entry.html":[20,0,0,4,25],
+"struct_sig_rl_entry.html#a0dfeb058614e81878bfbf86ae3edac3c":[20,0,0,4,25,1],
+"struct_sig_rl_entry.html#ac6a47ff0d1b8ea1512e0ff14983ac5ce":[20,0,0,4,25,0],
+"struct_verifier_precomp.html":[20,0,2,1],
+"struct_verifier_precomp.html#a8caf79578e3c0baf91921460391103ca":[20,0,2,1,2],
+"struct_verifier_precomp.html#ab061d6cc07d1467eeb5bf25f3ea7e306":[20,0,2,1,3],
+"struct_verifier_precomp.html#ad1106376f12772942af0331eb74de6e5":[20,0,2,1,0],
+"struct_verifier_precomp.html#af8fd90f3a5a2be932a97dcd86099d5b2":[20,0,2,1,1],
+"struct_verifier_precomp.html#afc3e29a325c95c62bb192d5f8cdd5c1c":[20,0,2,1,4],
+"struct_verifier_rl.html":[20,0,0,4,28],
+"struct_verifier_rl.html#a1e3f84b873bccc0c882aa6432c42d2f7":[20,0,0,4,28,3],
+"struct_verifier_rl.html#a5d9a9265fffa96fd5f9260543eb08c68":[20,0,0,4,28,0],
+"struct_verifier_rl.html#ab85c4666d16145ff16443e84468d2d7d":[20,0,0,4,28,1],
+"struct_verifier_rl.html#ac7d3dceab4772096bbbeb3fa735d18a9":[20,0,0,4,28,2],
+"struct_verifier_rl.html#afa44ab69ffff5a3508366aeb2131fdaa":[20,0,0,4,28,4],
"user":[0]
};
diff --git a/doc/html/nv_8c.html b/doc/html/nv_8c.html
index 6a4da8c..14b83d6 100644
--- a/doc/html/nv_8c.html
+++ b/doc/html/nv_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/nv_8h.html b/doc/html/nv_8h.html
index 87a3155..b5c739c 100644
--- a/doc/html/nv_8h.html
+++ b/doc/html/nv_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/organization_8dox.html b/doc/html/organization_8dox.html
index 1fa462b..a325a4d 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/pageorder_8dox.html b/doc/html/pageorder_8dox.html
index 48d82d8..4ed411e 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/pages.html b/doc/html/pages.html
index 3b02945..5fe31c8 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -82,6 +82,7 @@ $(document).ready(function(){initNavTree('pages.html','');});
<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>
+<tr id="row_17_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><a class="el" href="deprecated.html" target="_self">Deprecated List</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
diff --git a/doc/html/printtss_8c.html b/doc/html/printtss_8c.html
index 505bbdd..1a5b8a5 100644
--- a/doc/html/printtss_8c.html
+++ b/doc/html/printtss_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/printtss_8h.html b/doc/html/printtss_8h.html
index 0f5cb84..c47f6f1 100644
--- a/doc/html/printtss_8h.html
+++ b/doc/html/printtss_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/printutils_8h.html b/doc/html/printutils_8h.html
index 1f231cf..e29cad9 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/provisioning_8dox.html b/doc/html/provisioning_8dox.html
index b53da80..f6b2ab4 100644
--- a/doc/html/provisioning_8dox.html
+++ b/doc/html/provisioning_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/revocation_8dox.html b/doc/html/revocation_8dox.html
index 55339f6..f4e221c 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/sdk__overview_8dox.html b/doc/html/sdk__overview_8dox.html
index a3091e9..192e78a 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/serialize_8h.html b/doc/html/serialize_8h.html
new file mode 100644
index 0000000..b76e971
--- /dev/null
+++ b/doc/html/serialize_8h.html
@@ -0,0 +1,694 @@
+<!-- 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/tiny/math/serialize.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">6.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('serialize_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">serialize.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of de/serialize functionality.
+<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 />
+</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:a6789f8e258de2efc616c2f3109b7992b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a6789f8e258de2efc616c2f3109b7992b">SwapNativeAndPortableLayout</a> (void *dest, size_t dest_size, void const *src, size_t src_size)</td></tr>
+<tr class="memdesc:a6789f8e258de2efc616c2f3109b7992b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialize or deserailize a sequence of math objects. <a href="#a6789f8e258de2efc616c2f3109b7992b">More...</a><br /></td></tr>
+<tr class="separator:a6789f8e258de2efc616c2f3109b7992b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac74344e39b6d285c6a0258c4554712b0"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#ac74344e39b6d285c6a0258c4554712b0">Uint32Serialize</a> (<a class="el" href="struct_oct_str32.html">OctStr32</a> *dest, uint32_t src)</td></tr>
+<tr class="memdesc:ac74344e39b6d285c6a0258c4554712b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a uint32_t to a portable buffer. <a href="#ac74344e39b6d285c6a0258c4554712b0">More...</a><br /></td></tr>
+<tr class="separator:ac74344e39b6d285c6a0258c4554712b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a2aaa1779f9085d62b27e072271329dd7"><td class="memItemLeft" align="right" valign="top">void const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a2aaa1779f9085d62b27e072271329dd7">Uint32Deserialize</a> (uint32_t *dest, <a class="el" href="struct_oct_str32.html">OctStr32</a> const *src)</td></tr>
+<tr class="memdesc:a2aaa1779f9085d62b27e072271329dd7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a uint32_t from a portable buffer. <a href="#a2aaa1779f9085d62b27e072271329dd7">More...</a><br /></td></tr>
+<tr class="separator:a2aaa1779f9085d62b27e072271329dd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:af2841bf57731c82f8164900bf3f52320"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#af2841bf57731c82f8164900bf3f52320">VliSerialize</a> (<a class="el" href="struct_big_num_str.html">BigNumStr</a> *dest, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *src)</td></tr>
+<tr class="memdesc:af2841bf57731c82f8164900bf3f52320"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a large integer to a portable buffer. <a href="#af2841bf57731c82f8164900bf3f52320">More...</a><br /></td></tr>
+<tr class="separator:af2841bf57731c82f8164900bf3f52320"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a7950febe703ea62457664eadc1e4eed9"><td class="memItemLeft" align="right" valign="top">void const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a7950febe703ea62457664eadc1e4eed9">VliDeserialize</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *dest, <a class="el" href="struct_big_num_str.html">BigNumStr</a> const *src)</td></tr>
+<tr class="memdesc:a7950febe703ea62457664eadc1e4eed9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a large integer from a portable buffer. <a href="#a7950febe703ea62457664eadc1e4eed9">More...</a><br /></td></tr>
+<tr class="separator:a7950febe703ea62457664eadc1e4eed9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a1fe8ff2aa7f73b807a7f5f5cdd8eba94"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a1fe8ff2aa7f73b807a7f5f5cdd8eba94">FqSerialize</a> (<a class="el" href="struct_fq_elem_str.html">FqElemStr</a> *dest, <a class="el" href="struct_fq_elem.html">FqElem</a> const *src)</td></tr>
+<tr class="memdesc:a1fe8ff2aa7f73b807a7f5f5cdd8eba94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write an element of Fq to a portable buffer. <a href="#a1fe8ff2aa7f73b807a7f5f5cdd8eba94">More...</a><br /></td></tr>
+<tr class="separator:a1fe8ff2aa7f73b807a7f5f5cdd8eba94"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a051985a737e59da22d04dfcc5112ec77"><td class="memItemLeft" align="right" valign="top">void const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a051985a737e59da22d04dfcc5112ec77">FqDeserialize</a> (<a class="el" href="struct_fq_elem.html">FqElem</a> *dest, <a class="el" href="struct_fq_elem_str.html">FqElemStr</a> const *src)</td></tr>
+<tr class="memdesc:a051985a737e59da22d04dfcc5112ec77"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read an element of Fq from a portable buffer. <a href="#a051985a737e59da22d04dfcc5112ec77">More...</a><br /></td></tr>
+<tr class="separator:a051985a737e59da22d04dfcc5112ec77"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad0de690fc04ff307fa64575f9033c4d7"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#ad0de690fc04ff307fa64575f9033c4d7">Fq12Serialize</a> (<a class="el" href="struct_fq12_elem_str.html">Fq12ElemStr</a> *dest, <a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *src)</td></tr>
+<tr class="memdesc:ad0de690fc04ff307fa64575f9033c4d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write an element of Fq12 to a portable buffer. <a href="#ad0de690fc04ff307fa64575f9033c4d7">More...</a><br /></td></tr>
+<tr class="separator:ad0de690fc04ff307fa64575f9033c4d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a2f5ba336b7da938e92dad848e00ad157"><td class="memItemLeft" align="right" valign="top">void const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a2f5ba336b7da938e92dad848e00ad157">Fq12Deserialize</a> (<a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *dest, <a class="el" href="struct_fq12_elem_str.html">Fq12ElemStr</a> const *src)</td></tr>
+<tr class="memdesc:a2f5ba336b7da938e92dad848e00ad157"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read an element of Fq12 from a portable buffer. <a href="#a2f5ba336b7da938e92dad848e00ad157">More...</a><br /></td></tr>
+<tr class="separator:a2f5ba336b7da938e92dad848e00ad157"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a57237335a24f8a9b2a151a2141ec5917"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a57237335a24f8a9b2a151a2141ec5917">FpSerialize</a> (<a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *dest, <a class="el" href="struct_fp_elem.html">FpElem</a> const *src)</td></tr>
+<tr class="memdesc:a57237335a24f8a9b2a151a2141ec5917"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write an element of Fp to a portable buffer. <a href="#a57237335a24f8a9b2a151a2141ec5917">More...</a><br /></td></tr>
+<tr class="separator:a57237335a24f8a9b2a151a2141ec5917"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac49c8bd07a7f09aadd08c58c362cf3af"><td class="memItemLeft" align="right" valign="top">void const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#ac49c8bd07a7f09aadd08c58c362cf3af">FpDeserialize</a> (<a class="el" href="struct_fp_elem.html">FpElem</a> *dest, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *src)</td></tr>
+<tr class="memdesc:ac49c8bd07a7f09aadd08c58c362cf3af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read an element of Fp from a portable buffer. <a href="#ac49c8bd07a7f09aadd08c58c362cf3af">More...</a><br /></td></tr>
+<tr class="separator:ac49c8bd07a7f09aadd08c58c362cf3af"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a81b7bcb69d6ea28ebb3e3520c7d0eeb5"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a81b7bcb69d6ea28ebb3e3520c7d0eeb5">EFqSerialize</a> (<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *dest, <a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *src)</td></tr>
+<tr class="memdesc:a81b7bcb69d6ea28ebb3e3520c7d0eeb5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a point on EFq to a portable buffer. <a href="#a81b7bcb69d6ea28ebb3e3520c7d0eeb5">More...</a><br /></td></tr>
+<tr class="separator:a81b7bcb69d6ea28ebb3e3520c7d0eeb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:af7f9b8ffdf1bb18bc156a4f80fc32419"><td class="memItemLeft" align="right" valign="top">void const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#af7f9b8ffdf1bb18bc156a4f80fc32419">EFqDeserialize</a> (<a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *dest, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *src)</td></tr>
+<tr class="memdesc:af7f9b8ffdf1bb18bc156a4f80fc32419"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point on EFq from a portable buffer. <a href="#af7f9b8ffdf1bb18bc156a4f80fc32419">More...</a><br /></td></tr>
+<tr class="separator:af7f9b8ffdf1bb18bc156a4f80fc32419"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aa53e1c30fa109e586fa90a3a4cf3d0ac"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#aa53e1c30fa109e586fa90a3a4cf3d0ac">EFq2Serialize</a> (<a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> *dest, <a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> const *src)</td></tr>
+<tr class="memdesc:aa53e1c30fa109e586fa90a3a4cf3d0ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a point on EFq2 to a portable buffer. <a href="#aa53e1c30fa109e586fa90a3a4cf3d0ac">More...</a><br /></td></tr>
+<tr class="separator:aa53e1c30fa109e586fa90a3a4cf3d0ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a393c9cf42edef41aa28449a0d321a57e"><td class="memItemLeft" align="right" valign="top">void const *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="serialize_8h.html#a393c9cf42edef41aa28449a0d321a57e">EFq2Deserialize</a> (<a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> *dest, <a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *src)</td></tr>
+<tr class="memdesc:a393c9cf42edef41aa28449a0d321a57e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a point on EFq2 from a portable buffer. <a href="#a393c9cf42edef41aa28449a0d321a57e">More...</a><br /></td></tr>
+<tr class="separator:a393c9cf42edef41aa28449a0d321a57e"><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>Definition of de/serialize functionality. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a393c9cf42edef41aa28449a0d321a57e"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void const* EFq2Deserialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> *&#160;</td>
+ <td class="paramname"><em>dest</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>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read a point on EFq2 from a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data read from to src </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="aa53e1c30fa109e586fa90a3a4cf3d0ac"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void* EFq2Serialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq2.html">EccPointFq2</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Write a point on EFq2 to a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data written to dest </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="af7f9b8ffdf1bb18bc156a4f80fc32419"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void const* EFqDeserialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> *&#160;</td>
+ <td class="paramname"><em>dest</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>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read a point on EFq from a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data read from to src </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a81b7bcb69d6ea28ebb3e3520c7d0eeb5"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void* EFqSerialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_ecc_point_fq.html">EccPointFq</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Write a point on EFq to a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data written to dest </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ac49c8bd07a7f09aadd08c58c362cf3af"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void const* FpDeserialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> *&#160;</td>
+ <td class="paramname"><em>dest</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>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read an element of Fp from a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data read from to src </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a57237335a24f8a9b2a151a2141ec5917"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void* FpSerialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fp_elem.html">FpElem</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Write an element of Fp to a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data written to dest </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a2f5ba336b7da938e92dad848e00ad157"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void const* Fq12Deserialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem_str.html">Fq12ElemStr</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read an element of Fq12 from a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data read from to src </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ad0de690fc04ff307fa64575f9033c4d7"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void* Fq12Serialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem_str.html">Fq12ElemStr</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq12_elem.html">Fq12Elem</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Write an element of Fq12 to a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data written to dest </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a051985a737e59da22d04dfcc5112ec77"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void const* FqDeserialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> *&#160;</td>
+ <td class="paramname"><em>dest</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>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read an element of Fq from a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data read from to src </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a1fe8ff2aa7f73b807a7f5f5cdd8eba94"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void* FqSerialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem_str.html">FqElemStr</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_fq_elem.html">FqElem</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Write an element of Fq to a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data written to dest </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a6789f8e258de2efc616c2f3109b7992b"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void SwapNativeAndPortableLayout </td>
+ <td>(</td>
+ <td class="paramtype">void *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>dest_size</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void const *&#160;</td>
+ <td class="paramname"><em>src</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>src_size</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Serialize or deserailize a sequence of math objects. </p>
+<p>Converts layouts between native and portable or between portable and native of the following types: <a class="el" href="struct_very_large_int.html" title="Large integer. ">VeryLargeInt</a> and <a class="el" href="struct_big_num_str.html" title="Serialized BigNum. ">BigNumStr</a>, <a class="el" href="struct_fq_elem.html" title="Element of Fq. ">FqElem</a> and <a class="el" href="struct_fq_elem_str.html" title="a number in [0, q-1] ">FqElemStr</a>, <a class="el" href="struct_fp_elem.html" title="Element of Fp. ">FpElem</a> and <a class="el" href="struct_fp_elem_str.html" title="a number in [0, p-1] ">FpElemStr</a>, <a class="el" href="struct_ecc_point_fq.html" title="Point in EFq. ">EccPointFq</a> and <a class="el" href="struct_g1_elem_str.html" title="Serialized G1 element. ">G1ElemStr</a>, <a class="el" href="struct_fq12_elem.html" title="Element of Fq12. ">Fq12Elem</a> and <a class="el" href="struct_fq12_elem_str.html" title="Serialized Fq2^3^2 element. ">Fq12ElemStr</a>.</p>
+<p>If input contain multiple values of supported types all will be converted.</p>
+<dl class="section note"><dt>Note</dt><dd>The following types are not supported: <a class="el" href="struct_very_large_int_product.html" title="Used for multiplication. ">VeryLargeIntProduct</a>.</dd>
+<dd>
+This function have the assumptions that the input structures are packed such that consequent 32 byte fields would have no gap in between.</dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">dest_size</td><td>size of dest buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src_size</td><td>size of src buffer </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a2aaa1779f9085d62b27e072271329dd7"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void const* Uint32Deserialize </td>
+ <td>(</td>
+ <td class="paramtype">uint32_t *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_oct_str32.html">OctStr32</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read a uint32_t from a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data read from to src </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ac74344e39b6d285c6a0258c4554712b0"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void* Uint32Serialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_oct_str32.html">OctStr32</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Write a uint32_t to a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data written to dest </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a7950febe703ea62457664eadc1e4eed9"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void const* VliDeserialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_big_num_str.html">BigNumStr</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read a large integer from a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data read from to src </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="af2841bf57731c82f8164900bf3f52320"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void* VliSerialize </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_big_num_str.html">BigNumStr</a> *&#160;</td>
+ <td class="paramname"><em>dest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>src</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Write a large integer to a portable buffer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">dest</td><td>target buffer </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">src</td><td>source data </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>pointer to next byte after final data written to dest </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="serialize_8h.html">serialize.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/sha256_8h.html b/doc/html/sha256_8h.html
new file mode 100644
index 0000000..746e981
--- /dev/null
+++ b/doc/html/sha256_8h.html
@@ -0,0 +1,227 @@
+<!-- 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/tiny/math/sha256.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">6.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('sha256_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">sha256.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Interface to a SHA-256 implementation.
+<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 />
+</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:a9c1fe69ad43d4ca74b84303a0ed64f2f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9c1fe69ad43d4ca74b84303a0ed64f2f"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha256_8h.html#a9c1fe69ad43d4ca74b84303a0ed64f2f">SHA256_BLOCK_SIZE</a>&#160;&#160;&#160;(64)</td></tr>
+<tr class="memdesc:a9c1fe69ad43d4ca74b84303a0ed64f2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Block size. <br /></td></tr>
+<tr class="separator:a9c1fe69ad43d4ca74b84303a0ed64f2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a81efbc0fc101b06a914f7ff9e2fbc0e9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a81efbc0fc101b06a914f7ff9e2fbc0e9"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha256_8h.html#a81efbc0fc101b06a914f7ff9e2fbc0e9">SHA256_DIGEST_SIZE</a>&#160;&#160;&#160;(32)</td></tr>
+<tr class="memdesc:a81efbc0fc101b06a914f7ff9e2fbc0e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Digest size. <br /></td></tr>
+<tr class="separator:a81efbc0fc101b06a914f7ff9e2fbc0e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a0558ee82699b60132c23e0a049ab7a56"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0558ee82699b60132c23e0a049ab7a56"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha256_8h.html#a0558ee82699b60132c23e0a049ab7a56">SHA256_STATE_BLOCKS</a>&#160;&#160;&#160;(<a class="el" href="sha256_8h.html#a81efbc0fc101b06a914f7ff9e2fbc0e9">SHA256_DIGEST_SIZE</a> / 4)</td></tr>
+<tr class="memdesc:a0558ee82699b60132c23e0a049ab7a56"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of blocks in state. <br /></td></tr>
+<tr class="separator:a0558ee82699b60132c23e0a049ab7a56"><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:a05aad282287c226a9ab8a2eb65d10d1b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha256_8h.html#a05aad282287c226a9ab8a2eb65d10d1b">tc_sha256_init</a> (sha256_state *s)</td></tr>
+<tr class="memdesc:a05aad282287c226a9ab8a2eb65d10d1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">The SHA state. <a href="#a05aad282287c226a9ab8a2eb65d10d1b">More...</a><br /></td></tr>
+<tr class="separator:a05aad282287c226a9ab8a2eb65d10d1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab42ecba529c48040c34e70cee8d98096"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha256_8h.html#ab42ecba529c48040c34e70cee8d98096">tc_sha256_update</a> (sha256_state *s, const uint8_t *data, size_t datalen)</td></tr>
+<tr class="memdesc:ab42ecba529c48040c34e70cee8d98096"><td class="mdescLeft">&#160;</td><td class="mdescRight">SHA256 update procedure Hashes data_length bytes addressed by data into state s. <a href="#ab42ecba529c48040c34e70cee8d98096">More...</a><br /></td></tr>
+<tr class="separator:ab42ecba529c48040c34e70cee8d98096"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a8013bed3e0b388ec654f991b45c00bbf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha256_8h.html#a8013bed3e0b388ec654f991b45c00bbf">tc_sha256_final</a> (uint8_t *digest, sha256_state *s)</td></tr>
+<tr class="memdesc:a8013bed3e0b388ec654f991b45c00bbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">SHA256 final procedure Inserts the completed hash computation into digest. <a href="#a8013bed3e0b388ec654f991b45c00bbf">More...</a><br /></td></tr>
+<tr class="separator:a8013bed3e0b388ec654f991b45c00bbf"><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>Interface to a SHA-256 implementation. </p>
+<p>Overview: SHA-256 is a NIST approved cryptographic hashing algorithm specified in FIPS 180. A hash algorithm maps data of arbitrary size to data of fixed length.</p>
+<p>Security: SHA-256 provides 128 bits of security against collision attacks and 256 bits of security against pre-image attacks. SHA-256 does NOT behave like a random oracle, but it can be used as one if the string being hashed is prefix-free encoded before hashing.</p>
+<p>Usage: 1) call tc_sha256_init to initialize a struct tc_sha256_state_struct before hashing a new string.</p>
+<p>2) call tc_sha256_update to hash the next string segment; tc_sha256_update can be called as many times as needed to hash all of the segments of a string; the order is important.</p>
+<p>3) call tc_sha256_final to out put the digest from a hashing operation. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a8013bed3e0b388ec654f991b45c00bbf"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tc_sha256_final </td>
+ <td>(</td>
+ <td class="paramtype">uint8_t *&#160;</td>
+ <td class="paramname"><em>digest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">sha256_state *&#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>SHA256 final procedure Inserts the completed hash computation into digest. </p>
+<dl class="section return"><dt>Returns</dt><dd>returns 1 returns 0 if: s == NULL, s-&gt;iv == NULL, digest == NULL </dd></dl>
+<dl class="section note"><dt>Note</dt><dd>Assumes: s has been initialized by tc_sha256_init digest points to at least SHA256_DIGEST_SIZE bytes </dd></dl>
+<dl class="section warning"><dt>Warning</dt><dd>The state buffer 'leftover' is left in memory after processing If your application intends to have sensitive data in this buffer, remind to erase it after the data has been processed </dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramname">digest</td><td>unsigned eight bit integer </td></tr>
+ <tr><td class="paramname">s</td><td>Sha256 state struct </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a05aad282287c226a9ab8a2eb65d10d1b"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tc_sha256_init </td>
+ <td>(</td>
+ <td class="paramtype">sha256_state *&#160;</td>
+ <td class="paramname"><em>s</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>The SHA state. </p>
+<p>SHA256 initialization procedure Initializes s </p><dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramname">s</td><td>Sha256 state struct </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ab42ecba529c48040c34e70cee8d98096"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tc_sha256_update </td>
+ <td>(</td>
+ <td class="paramtype">sha256_state *&#160;</td>
+ <td class="paramname"><em>s</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const uint8_t *&#160;</td>
+ <td class="paramname"><em>data</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>datalen</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>SHA256 update procedure Hashes data_length bytes addressed by data into state s. </p>
+<dl class="section note"><dt>Note</dt><dd>Assumes s has been initialized by tc_sha256_init </dd></dl>
+<dl class="section warning"><dt>Warning</dt><dd>The state buffer 'leftover' is left in memory after processing If your application intends to have sensitive data in this buffer, remind to erase it after the data has been processed </dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramname">s</td><td>Sha256 state struct </td></tr>
+ <tr><td class="paramname">data</td><td>message to hash </td></tr>
+ <tr><td class="paramname">datalen</td><td>length of message to hash </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="sha256_8h.html">sha256.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/sha512_8h.html b/doc/html/sha512_8h.html
new file mode 100644
index 0000000..3a7b2c4
--- /dev/null
+++ b/doc/html/sha512_8h.html
@@ -0,0 +1,221 @@
+<!-- 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/tiny/math/sha512.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">6.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('sha512_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">sha512.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Interface to a SHA-512 implementation.
+<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 />
+</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:ac7071364cb94c9fcce009ba16a4bdca1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac7071364cb94c9fcce009ba16a4bdca1"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha512_8h.html#ac7071364cb94c9fcce009ba16a4bdca1">SHA512_BLOCK_SIZE</a>&#160;&#160;&#160;(128)</td></tr>
+<tr class="memdesc:ac7071364cb94c9fcce009ba16a4bdca1"><td class="mdescLeft">&#160;</td><td class="mdescRight">block size <br /></td></tr>
+<tr class="separator:ac7071364cb94c9fcce009ba16a4bdca1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a67f489f3eee39c447a6db3ba34ef75f2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a67f489f3eee39c447a6db3ba34ef75f2"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha512_8h.html#a67f489f3eee39c447a6db3ba34ef75f2">SHA512_DIGEST_SIZE</a>&#160;&#160;&#160;(64)</td></tr>
+<tr class="memdesc:a67f489f3eee39c447a6db3ba34ef75f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">digest size <br /></td></tr>
+<tr class="separator:a67f489f3eee39c447a6db3ba34ef75f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab16e074d262ae09949e0bf222f95f5be"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab16e074d262ae09949e0bf222f95f5be"></a>
+#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha512_8h.html#ab16e074d262ae09949e0bf222f95f5be">SHA512_DIGEST_WORDS</a>&#160;&#160;&#160;(8)</td></tr>
+<tr class="memdesc:ab16e074d262ae09949e0bf222f95f5be"><td class="mdescLeft">&#160;</td><td class="mdescRight">number of words in SHA state <br /></td></tr>
+<tr class="separator:ab16e074d262ae09949e0bf222f95f5be"><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:a3cf87b13e209264d7aba7d708560dfde"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha512_8h.html#a3cf87b13e209264d7aba7d708560dfde">tinysha512_init</a> (sha512_state *s)</td></tr>
+<tr class="memdesc:a3cf87b13e209264d7aba7d708560dfde"><td class="mdescLeft">&#160;</td><td class="mdescRight">The SHA state. <a href="#a3cf87b13e209264d7aba7d708560dfde">More...</a><br /></td></tr>
+<tr class="separator:a3cf87b13e209264d7aba7d708560dfde"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a47108f5097342900a4a07f52b6204082"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha512_8h.html#a47108f5097342900a4a07f52b6204082">tinysha512_update</a> (sha512_state *s, void const *data, size_t data_length)</td></tr>
+<tr class="memdesc:a47108f5097342900a4a07f52b6204082"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hashes data into state using SHA-512. <a href="#a47108f5097342900a4a07f52b6204082">More...</a><br /></td></tr>
+<tr class="separator:a47108f5097342900a4a07f52b6204082"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ace9440a26ec431a1596f40284cc8d5ee"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sha512_8h.html#ace9440a26ec431a1596f40284cc8d5ee">tinysha512_final</a> (unsigned char *digest, sha512_state *s)</td></tr>
+<tr class="memdesc:ace9440a26ec431a1596f40284cc8d5ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the SHA-512 hash in the digest buffer. <a href="#ace9440a26ec431a1596f40284cc8d5ee">More...</a><br /></td></tr>
+<tr class="separator:ace9440a26ec431a1596f40284cc8d5ee"><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>Interface to a SHA-512 implementation. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="ace9440a26ec431a1596f40284cc8d5ee"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tinysha512_final </td>
+ <td>(</td>
+ <td class="paramtype">unsigned char *&#160;</td>
+ <td class="paramname"><em>digest</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">sha512_state *&#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>Computes the SHA-512 hash in the digest buffer. </p>
+<dl class="section note"><dt>Note</dt><dd>Assumes SHA512_DIGEST_SIZE bytes are available to accept the digest.</dd></dl>
+<dl class="section warning"><dt>Warning</dt><dd>The state buffer 'leftover' is left in memory after processing. If your application intends to have sensitive data in this buffer, remember to erase it after the data has been processed</dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">digest</td><td>The computed digest. Must be non-null or behavior is undefined.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">s</td><td>The hash state. Must be non-null or behavior is undefined. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a3cf87b13e209264d7aba7d708560dfde"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tinysha512_init </td>
+ <td>(</td>
+ <td class="paramtype">sha512_state *&#160;</td>
+ <td class="paramname"><em>s</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>The SHA state. </p>
+<p>Initializes the hash state</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">s</td><td>The hash state to initialize. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a47108f5097342900a4a07f52b6204082"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void tinysha512_update </td>
+ <td>(</td>
+ <td class="paramtype">sha512_state *&#160;</td>
+ <td class="paramname"><em>s</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">void const *&#160;</td>
+ <td class="paramname"><em>data</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>data_length</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Hashes data into state using SHA-512. </p>
+<dl class="section warning"><dt>Warning</dt><dd>The state buffer 'leftover' is left in memory after processing. If your application intends to have sensitive data in this buffer, remember to erase it after the data has been processed</dd></dl>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in,out]</td><td class="paramname">s</td><td>The hash state. Must be non-null or behavior is undefined.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The data to hash into s.</td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">data_length</td><td>The size of data in bytes. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="sha512_8h.html">sha512.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/sign_8c.html b/doc/html/sign_8c.html
index a0cd97d..123b8e1 100644
--- a/doc/html/sign_8c.html
+++ b/doc/html/sign_8c.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/sign_8h.html b/doc/html/sign_8h.html
index a49bd2b..67b9654 100644
--- a/doc/html/sign_8h.html
+++ b/doc/html/sign_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/sign__verify__tutorial_8dox.html b/doc/html/sign__verify__tutorial_8dox.html
index 39ff405..4cc251b 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/signmsg__walkthrough_8dox.html b/doc/html/signmsg__walkthrough_8dox.html
index ec0d952..4a217e3 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/software__member_8h.html b/doc/html/software__member_8h.html
index 5b63a91..b935ded 100644
--- a/doc/html/software__member_8h.html
+++ b/doc/html/software__member_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/state_8h.html b/doc/html/state_8h.html
index 1ff63e2..145fb92 100644
--- a/doc/html/state_8h.html
+++ b/doc/html/state_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/stdtypes_8h.html b/doc/html/stdtypes_8h.html
index e35919b..edb207f 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_basic_signature.html b/doc/html/struct_basic_signature.html
index b98d667..33dae41 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_big_num_str.html b/doc/html/struct_big_num_str.html
index 83c52cc..bb97fde 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_compressed_priv_key.html b/doc/html/struct_compressed_priv_key.html
index 2ca35e2..4f3111e 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_ecc_point_fq.html b/doc/html/struct_ecc_point_fq.html
new file mode 100644
index 0000000..dc35cc4
--- /dev/null
+++ b/doc/html/struct_ecc_point_fq.html
@@ -0,0 +1,101 @@
+<!-- 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: EccPointFq 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">6.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_ecc_point_fq.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">EccPointFq Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Point in EFq.
+ <a href="struct_ecc_point_fq.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a50491ef33f641fa3e81d58bdc906b258"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a50491ef33f641fa3e81d58bdc906b258"></a>
+<a class="el" href="struct_fq_elem.html">FqElem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_fq.html#a50491ef33f641fa3e81d58bdc906b258">x</a></td></tr>
+<tr class="memdesc:a50491ef33f641fa3e81d58bdc906b258"><td class="mdescLeft">&#160;</td><td class="mdescRight">x coordinate <br /></td></tr>
+<tr class="separator:a50491ef33f641fa3e81d58bdc906b258"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:abd3c36cb29db82a73ba89e9e15739b5a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd3c36cb29db82a73ba89e9e15739b5a"></a>
+<a class="el" href="struct_fq_elem.html">FqElem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_fq.html#abd3c36cb29db82a73ba89e9e15739b5a">y</a></td></tr>
+<tr class="memdesc:abd3c36cb29db82a73ba89e9e15739b5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">y coordinate <br /></td></tr>
+<tr class="separator:abd3c36cb29db82a73ba89e9e15739b5a"><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>Point in EFq. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_ecc_point_fq.html">EccPointFq</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_ecc_point_fq2.html b/doc/html/struct_ecc_point_fq2.html
new file mode 100644
index 0000000..6bbae14
--- /dev/null
+++ b/doc/html/struct_ecc_point_fq2.html
@@ -0,0 +1,101 @@
+<!-- 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: EccPointFq2 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">6.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_ecc_point_fq2.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">EccPointFq2 Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Point in EFq2.
+ <a href="struct_ecc_point_fq2.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:ac1c2f9e66988d12c61bd1ffd4975eb7d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac1c2f9e66988d12c61bd1ffd4975eb7d"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_fq2.html#ac1c2f9e66988d12c61bd1ffd4975eb7d">x</a></td></tr>
+<tr class="memdesc:ac1c2f9e66988d12c61bd1ffd4975eb7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">x coordinate <br /></td></tr>
+<tr class="separator:ac1c2f9e66988d12c61bd1ffd4975eb7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a137a9467dc77df97319c88880d13ea48"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a137a9467dc77df97319c88880d13ea48"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_fq2.html#a137a9467dc77df97319c88880d13ea48">y</a></td></tr>
+<tr class="memdesc:a137a9467dc77df97319c88880d13ea48"><td class="mdescLeft">&#160;</td><td class="mdescRight">y coordinate <br /></td></tr>
+<tr class="separator:a137a9467dc77df97319c88880d13ea48"><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>Point in EFq2. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_ecc_point_fq2.html">EccPointFq2</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_ecc_point_jacobi_fq.html b/doc/html/struct_ecc_point_jacobi_fq.html
new file mode 100644
index 0000000..f15d7cb
--- /dev/null
+++ b/doc/html/struct_ecc_point_jacobi_fq.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: EccPointJacobiFq 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">6.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_ecc_point_jacobi_fq.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">EccPointJacobiFq Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Element of EFq in Jacobi format.
+ <a href="struct_ecc_point_jacobi_fq.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a281019c17dd470ab6b5a763efc23fa1b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a281019c17dd470ab6b5a763efc23fa1b"></a>
+<a class="el" href="struct_fq_elem.html">FqElem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_jacobi_fq.html#a281019c17dd470ab6b5a763efc23fa1b">X</a></td></tr>
+<tr class="memdesc:a281019c17dd470ab6b5a763efc23fa1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">x coordinate <br /></td></tr>
+<tr class="separator:a281019c17dd470ab6b5a763efc23fa1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad86b6242f7c242107f7af9a37fad2a74"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad86b6242f7c242107f7af9a37fad2a74"></a>
+<a class="el" href="struct_fq_elem.html">FqElem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_jacobi_fq.html#ad86b6242f7c242107f7af9a37fad2a74">Y</a></td></tr>
+<tr class="memdesc:ad86b6242f7c242107f7af9a37fad2a74"><td class="mdescLeft">&#160;</td><td class="mdescRight">y coordinate <br /></td></tr>
+<tr class="separator:ad86b6242f7c242107f7af9a37fad2a74"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:afe6154e547f9c3908a8ce801a14afeca"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afe6154e547f9c3908a8ce801a14afeca"></a>
+<a class="el" href="struct_fq_elem.html">FqElem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_jacobi_fq.html#afe6154e547f9c3908a8ce801a14afeca">Z</a></td></tr>
+<tr class="memdesc:afe6154e547f9c3908a8ce801a14afeca"><td class="mdescLeft">&#160;</td><td class="mdescRight">z coordinate <br /></td></tr>
+<tr class="separator:afe6154e547f9c3908a8ce801a14afeca"><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>Element of EFq in Jacobi format. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_ecc_point_jacobi_fq.html">EccPointJacobiFq</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_ecc_point_jacobi_fq2.html b/doc/html/struct_ecc_point_jacobi_fq2.html
new file mode 100644
index 0000000..a838126
--- /dev/null
+++ b/doc/html/struct_ecc_point_jacobi_fq2.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: EccPointJacobiFq2 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">6.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_ecc_point_jacobi_fq2.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">EccPointJacobiFq2 Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Element of EFq2 in Jacobi format.
+ <a href="struct_ecc_point_jacobi_fq2.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:aa540cd77c703ba538b245897009076a7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa540cd77c703ba538b245897009076a7"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_jacobi_fq2.html#aa540cd77c703ba538b245897009076a7">X</a></td></tr>
+<tr class="memdesc:aa540cd77c703ba538b245897009076a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">x coordinate <br /></td></tr>
+<tr class="separator:aa540cd77c703ba538b245897009076a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:adc2fa4757b5091e7927daae3452ee739"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adc2fa4757b5091e7927daae3452ee739"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_jacobi_fq2.html#adc2fa4757b5091e7927daae3452ee739">Y</a></td></tr>
+<tr class="memdesc:adc2fa4757b5091e7927daae3452ee739"><td class="mdescLeft">&#160;</td><td class="mdescRight">y coordinate <br /></td></tr>
+<tr class="separator:adc2fa4757b5091e7927daae3452ee739"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aea8a3a5b2bd2fce104e75cfe21615619"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aea8a3a5b2bd2fce104e75cfe21615619"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_ecc_point_jacobi_fq2.html#aea8a3a5b2bd2fce104e75cfe21615619">Z</a></td></tr>
+<tr class="memdesc:aea8a3a5b2bd2fce104e75cfe21615619"><td class="mdescLeft">&#160;</td><td class="mdescRight">z coordinate <br /></td></tr>
+<tr class="separator:aea8a3a5b2bd2fce104e75cfe21615619"><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>Element of EFq2 in Jacobi format. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_ecc_point_jacobi_fq2.html">EccPointJacobiFq2</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_ecdsa_private_key.html b/doc/html/struct_ecdsa_private_key.html
index 2a5e904..ad6adf3 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_ecdsa_public_key.html b/doc/html/struct_ecdsa_public_key.html
index 20f1284..ebcfb5f 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_ecdsa_signature.html b/doc/html/struct_ecdsa_signature.html
index 9a3ed16..dc793be 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_basic_signature.html b/doc/html/struct_epid11_basic_signature.html
index 2f034e8..2f90d18 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_g2_elem_str.html b/doc/html/struct_epid11_g2_elem_str.html
index f5adb6f..404daf3 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_group_pub_key.html b/doc/html/struct_epid11_group_pub_key.html
index 287ed10..ce7cf84 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_group_rl.html b/doc/html/struct_epid11_group_rl.html
index 87ed580..d54ad3a 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_gt_elem_str.html b/doc/html/struct_epid11_gt_elem_str.html
index 70b40f6..487ee04 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_nr_proof.html b/doc/html/struct_epid11_nr_proof.html
index b4c9433..db6b77f 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_params.html b/doc/html/struct_epid11_params.html
index 2e5f821..e8e52a1 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_priv_rl.html b/doc/html/struct_epid11_priv_rl.html
index c7d6f36..21106a2 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_sig_rl.html b/doc/html/struct_epid11_sig_rl.html
index 1af66b6..cf8fac7 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_sig_rl_entry.html b/doc/html/struct_epid11_sig_rl_entry.html
index 58e4e1e..7565160 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_signature.html b/doc/html/struct_epid11_signature.html
index eac6851..ba69f16 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid11_verifier_precomp.html b/doc/html/struct_epid11_verifier_precomp.html
index 63479f9..93633c0 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid2_params.html b/doc/html/struct_epid2_params.html
index d3adaf8..08b47fc 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid_ca_certificate.html b/doc/html/struct_epid_ca_certificate.html
index c5f0336..12a32bd 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid_file_header.html b/doc/html/struct_epid_file_header.html
index 0527c9e..2e73deb 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_epid_signature.html b/doc/html/struct_epid_signature.html
index 6e3e8a9..09690e6 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_fp_elem.html b/doc/html/struct_fp_elem.html
new file mode 100644
index 0000000..ff8fbef
--- /dev/null
+++ b/doc/html/struct_fp_elem.html
@@ -0,0 +1,97 @@
+<!-- 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: FpElem 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">6.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_fp_elem.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">FpElem Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Element of Fp.
+ <a href="struct_fp_elem.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a755a581a230c169e36985fb0301f2a28"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a755a581a230c169e36985fb0301f2a28"></a>
+<a class="el" href="struct_very_large_int.html">VeryLargeInt</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fp_elem.html#a755a581a230c169e36985fb0301f2a28">limbs</a></td></tr>
+<tr class="memdesc:a755a581a230c169e36985fb0301f2a28"><td class="mdescLeft">&#160;</td><td class="mdescRight">An integer in [0, p-1]. <br /></td></tr>
+<tr class="separator:a755a581a230c169e36985fb0301f2a28"><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>Element of Fp. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_fp_elem.html">FpElem</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_fp_elem_str.html b/doc/html/struct_fp_elem_str.html
index b1f6635..c7bc4e6 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_fq12_elem.html b/doc/html/struct_fq12_elem.html
new file mode 100644
index 0000000..66b3323
--- /dev/null
+++ b/doc/html/struct_fq12_elem.html
@@ -0,0 +1,101 @@
+<!-- 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: Fq12Elem 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">6.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_fq12_elem.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">Fq12Elem Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Element of Fq12.
+ <a href="struct_fq12_elem.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a2f33b78b0e6f4c720f481aac8f82d938"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2f33b78b0e6f4c720f481aac8f82d938"></a>
+<a class="el" href="struct_fq6_elem.html">Fq6Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq12_elem.html#a2f33b78b0e6f4c720f481aac8f82d938">z0</a></td></tr>
+<tr class="memdesc:a2f33b78b0e6f4c720f481aac8f82d938"><td class="mdescLeft">&#160;</td><td class="mdescRight">A coefficent in Fq6. <br /></td></tr>
+<tr class="separator:a2f33b78b0e6f4c720f481aac8f82d938"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a53a5954433b4c4df1fda6dcb08f54c7b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a53a5954433b4c4df1fda6dcb08f54c7b"></a>
+<a class="el" href="struct_fq6_elem.html">Fq6Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq12_elem.html#a53a5954433b4c4df1fda6dcb08f54c7b">z1</a></td></tr>
+<tr class="memdesc:a53a5954433b4c4df1fda6dcb08f54c7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">A coefficent in Fq6. <br /></td></tr>
+<tr class="separator:a53a5954433b4c4df1fda6dcb08f54c7b"><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>Element of Fq12. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_fq12_elem.html">Fq12Elem</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_fq12_elem_str.html b/doc/html/struct_fq12_elem_str.html
index f6d92ee..a2c1e92 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_fq2_elem.html b/doc/html/struct_fq2_elem.html
new file mode 100644
index 0000000..632c825
--- /dev/null
+++ b/doc/html/struct_fq2_elem.html
@@ -0,0 +1,101 @@
+<!-- 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: Fq2Elem 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">6.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_fq2_elem.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">Fq2Elem Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Element of Fq2.
+ <a href="struct_fq2_elem.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a3e0e0c995074a18ca1e234fd99f90b3d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3e0e0c995074a18ca1e234fd99f90b3d"></a>
+<a class="el" href="struct_fq_elem.html">FqElem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq2_elem.html#a3e0e0c995074a18ca1e234fd99f90b3d">x0</a></td></tr>
+<tr class="memdesc:a3e0e0c995074a18ca1e234fd99f90b3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">A coefficent in Fq. <br /></td></tr>
+<tr class="separator:a3e0e0c995074a18ca1e234fd99f90b3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a4f48b8d7f1d6bac1579c1fad81ef4a02"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4f48b8d7f1d6bac1579c1fad81ef4a02"></a>
+<a class="el" href="struct_fq_elem.html">FqElem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq2_elem.html#a4f48b8d7f1d6bac1579c1fad81ef4a02">x1</a></td></tr>
+<tr class="memdesc:a4f48b8d7f1d6bac1579c1fad81ef4a02"><td class="mdescLeft">&#160;</td><td class="mdescRight">A coefficent in Fq. <br /></td></tr>
+<tr class="separator:a4f48b8d7f1d6bac1579c1fad81ef4a02"><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>Element of Fq2. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_fq2_elem.html">Fq2Elem</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_fq2_elem_str.html b/doc/html/struct_fq2_elem_str.html
index 466305b..2e0c338 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_fq3_elem_str.html b/doc/html/struct_fq3_elem_str.html
index c4b743e..6eb18c5 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_fq6_elem.html b/doc/html/struct_fq6_elem.html
new file mode 100644
index 0000000..15156e4
--- /dev/null
+++ b/doc/html/struct_fq6_elem.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: Fq6Elem 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">6.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_fq6_elem.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">Fq6Elem Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Element of Fq6.
+ <a href="struct_fq6_elem.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a84522e736d8b9fb706c90aeef5e0fda2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a84522e736d8b9fb706c90aeef5e0fda2"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq6_elem.html#a84522e736d8b9fb706c90aeef5e0fda2">y0</a></td></tr>
+<tr class="memdesc:a84522e736d8b9fb706c90aeef5e0fda2"><td class="mdescLeft">&#160;</td><td class="mdescRight">A coefficent in Fq2. <br /></td></tr>
+<tr class="separator:a84522e736d8b9fb706c90aeef5e0fda2"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac35469120214ab7d75767a8adeb9c0f6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac35469120214ab7d75767a8adeb9c0f6"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq6_elem.html#ac35469120214ab7d75767a8adeb9c0f6">y1</a></td></tr>
+<tr class="memdesc:ac35469120214ab7d75767a8adeb9c0f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">A coefficent in Fq2. <br /></td></tr>
+<tr class="separator:ac35469120214ab7d75767a8adeb9c0f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a1753ef18695535ada56e337e8f6f7280"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1753ef18695535ada56e337e8f6f7280"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq6_elem.html#a1753ef18695535ada56e337e8f6f7280">y2</a></td></tr>
+<tr class="memdesc:a1753ef18695535ada56e337e8f6f7280"><td class="mdescLeft">&#160;</td><td class="mdescRight">A coefficent in Fq2. <br /></td></tr>
+<tr class="separator:a1753ef18695535ada56e337e8f6f7280"><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>Element of Fq6. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_fq6_elem.html">Fq6Elem</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_fq6_elem_str.html b/doc/html/struct_fq6_elem_str.html
index a4f2fd7..bcf9540 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_fq_elem.html b/doc/html/struct_fq_elem.html
new file mode 100644
index 0000000..90f6eea
--- /dev/null
+++ b/doc/html/struct_fq_elem.html
@@ -0,0 +1,97 @@
+<!-- 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: FqElem 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">6.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_fq_elem.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">FqElem Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Element of Fq.
+ <a href="struct_fq_elem.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:ad7d9feb0b777d58abfa9a31d6ddc466f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad7d9feb0b777d58abfa9a31d6ddc466f"></a>
+<a class="el" href="struct_very_large_int.html">VeryLargeInt</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq_elem.html#ad7d9feb0b777d58abfa9a31d6ddc466f">limbs</a></td></tr>
+<tr class="memdesc:ad7d9feb0b777d58abfa9a31d6ddc466f"><td class="mdescLeft">&#160;</td><td class="mdescRight">An integer in [0, q-1]. <br /></td></tr>
+<tr class="separator:ad7d9feb0b777d58abfa9a31d6ddc466f"><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>Element of Fq. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_fq_elem.html">FqElem</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_fq_elem_str.html b/doc/html/struct_fq_elem_str.html
index b410738..50a8104 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_g1_elem_str.html b/doc/html/struct_g1_elem_str.html
index f770e4a..246b826 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_g2_elem_str.html b/doc/html/struct_g2_elem_str.html
index b5c729a..2d2b622 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_group_pub_key.html b/doc/html/struct_group_pub_key.html
index 8858942..91f6c8e 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_group_rl.html b/doc/html/struct_group_rl.html
index c3a8e77..2138bbe 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_gt_elem_str.html b/doc/html/struct_gt_elem_str.html
index b5238b3..a094642 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_i_priv_key.html b/doc/html/struct_i_priv_key.html
index ba97e46..0f62872 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_join_request.html b/doc/html/struct_join_request.html
index 305db76..4fcbd1e 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_member_params.html b/doc/html/struct_member_params.html
index b74f3ae..f580fdf 100644
--- a/doc/html/struct_member_params.html
+++ b/doc/html/struct_member_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
@@ -87,7 +87,7 @@ void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="st
<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>
+<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#ga2b3c0cc1d8d4e50190ca94656fa36e24" title="Computes the size in bytes required for a member context. ">EpidMemberGetSize</a> and <a class="el" href="group___epid_member_module.html#ga35273b8e75d51e312f0d2fd3aa094efb" title="Initializes a new member context. ">EpidMemberInit</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>
diff --git a/doc/html/struct_member_precomp.html b/doc/html/struct_member_precomp.html
index 8d03cff..a8a8667 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_membership_credential.html b/doc/html/struct_membership_credential.html
index 6f28da1..cdac584 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_nr_proof.html b/doc/html/struct_nr_proof.html
index 6195801..302ec54 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str128.html b/doc/html/struct_oct_str128.html
index 90694ae..49e2614 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str16.html b/doc/html/struct_oct_str16.html
index d81e6d1..d5fb00d 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str256.html b/doc/html/struct_oct_str256.html
index 5996ad2..293557b 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str32.html b/doc/html/struct_oct_str32.html
index ab79790..3c09e10 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str512.html b/doc/html/struct_oct_str512.html
index c6c2584..b832ab3 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str600.html b/doc/html/struct_oct_str600.html
index d0cc47d..2e14740 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str64.html b/doc/html/struct_oct_str64.html
index b727f72..3c928cd 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str768.html b/doc/html/struct_oct_str768.html
index d9a2ffd..46cb649 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str8.html b/doc/html/struct_oct_str8.html
index 522412f..9ef40c3 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_oct_str80.html b/doc/html/struct_oct_str80.html
index 8e5bd51..1f5e7aa 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_pairing_state.html b/doc/html/struct_pairing_state.html
new file mode 100644
index 0000000..d140212
--- /dev/null
+++ b/doc/html/struct_pairing_state.html
@@ -0,0 +1,98 @@
+<!-- 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: PairingState 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">6.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_pairing_state.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">PairingState Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>A scratch buffer for stateful pairing calls.
+ <a href="struct_pairing_state.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a0e19d5e16a81645aca678e04b88758da"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0e19d5e16a81645aca678e04b88758da"></a>
+<a class="el" href="struct_fq2_elem.html">Fq2Elem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_pairing_state.html#a0e19d5e16a81645aca678e04b88758da">g</a> [3][5]</td></tr>
+<tr class="memdesc:a0e19d5e16a81645aca678e04b88758da"><td class="mdescLeft">&#160;</td><td class="mdescRight">pairing scratch data <br /></td></tr>
+<tr class="separator:a0e19d5e16a81645aca678e04b88758da"><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>A scratch buffer for stateful pairing calls. </p>
+<p>A pairing. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_pairing_state.html">PairingState</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_priv_key.html b/doc/html/struct_priv_key.html
index a3d923f..06f1c81 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_priv_rl.html b/doc/html/struct_priv_rl.html
index 5ea47e4..ea67de2 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_sha256_digest.html b/doc/html/struct_sha256_digest.html
index 6d43ddd..e8af00d 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_sig_rl.html b/doc/html/struct_sig_rl.html
index 4aa31f6..f9bbb8a 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_sig_rl_entry.html b/doc/html/struct_sig_rl_entry.html
index 8860624..7b0167c 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_tpm2_ctx.html b/doc/html/struct_tpm2_ctx.html
index abce046..2a6b769 100644
--- a/doc/html/struct_tpm2_ctx.html
+++ b/doc/html/struct_tpm2_ctx.html
@@ -32,7 +32,7 @@
id="projectlink"
class="index.html"
href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_verifier_precomp.html b/doc/html/struct_verifier_precomp.html
index 302db67..6f8ed2f 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_verifier_rl.html b/doc/html/struct_verifier_rl.html
index 9d3eb7d..45ff38f 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/struct_very_large_int.html b/doc/html/struct_very_large_int.html
new file mode 100644
index 0000000..ab32e31
--- /dev/null
+++ b/doc/html/struct_very_large_int.html
@@ -0,0 +1,98 @@
+<!-- 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: VeryLargeInt 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">6.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_very_large_int.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">VeryLargeInt Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Large integer.
+ <a href="struct_very_large_int.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a42fb1bb370910b7fadf474b421b29eb8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a42fb1bb370910b7fadf474b421b29eb8"></a>
+uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_very_large_int.html#a42fb1bb370910b7fadf474b421b29eb8">word</a> [<a class="el" href="mathtypes_8h.html#a94d0ffa1ccb9d2f09d1ada23a5807021">NUM_ECC_DIGITS</a>]</td></tr>
+<tr class="memdesc:a42fb1bb370910b7fadf474b421b29eb8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Large integer data. <br /></td></tr>
+<tr class="separator:a42fb1bb370910b7fadf474b421b29eb8"><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>Large integer. </p>
+<p>VeryLargeInt* is always expected to point to a buffer with NUM_ECC_DIGITS uint32_t sized words. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_very_large_int.html">VeryLargeInt</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/struct_very_large_int_product.html b/doc/html/struct_very_large_int_product.html
new file mode 100644
index 0000000..afc6fdf
--- /dev/null
+++ b/doc/html/struct_very_large_int_product.html
@@ -0,0 +1,97 @@
+<!-- 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: VeryLargeIntProduct 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">6.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_very_large_int_product.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">VeryLargeIntProduct Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Used for multiplication.
+ <a href="struct_very_large_int_product.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/mathtypes.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:a02a4e20db872ec6264e614ac0f1438be"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a02a4e20db872ec6264e614ac0f1438be"></a>
+uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_very_large_int_product.html#a02a4e20db872ec6264e614ac0f1438be">word</a> [2 *<a class="el" href="mathtypes_8h.html#a94d0ffa1ccb9d2f09d1ada23a5807021">NUM_ECC_DIGITS</a>]</td></tr>
+<tr class="memdesc:a02a4e20db872ec6264e614ac0f1438be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Large integer data. <br /></td></tr>
+<tr class="separator:a02a4e20db872ec6264e614ac0f1438be"><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>Used for multiplication. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="mathtypes_8h.html">mathtypes.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_very_large_int_product.html">VeryLargeIntProduct</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/structtiny__sha.html b/doc/html/structtiny__sha.html
new file mode 100644
index 0000000..9530d33
--- /dev/null
+++ b/doc/html/structtiny__sha.html
@@ -0,0 +1,110 @@
+<!-- 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: tiny_sha 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">6.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('structtiny__sha.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">tiny_sha Struct Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Tiny Sha wrapper Element.
+ <a href="structtiny__sha.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/hashwrap.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:a414a745937e610b84c0f6942470b531c"><td class="memItemLeft" ><a class="anchor" id="a414a745937e610b84c0f6942470b531c"></a>
+union {</td></tr>
+<tr class="memitem:ae57f00079dbef220b860d581e1bd633b"><td class="memItemLeft" >
+&#160;&#160;&#160;sha512_state&#160;&#160;&#160;<a class="el" href="structtiny__sha.html#a10addc820d663785aa5dd90c572bf953">sha512s</a></td></tr>
+<tr class="memdesc:ae57f00079dbef220b860d581e1bd633b"><td class="mdescLeft">&#160;</td><td class="mdescRight">The state of sha512 if supported. <br /></td></tr>
+<tr class="separator:ae57f00079dbef220b860d581e1bd633b"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ae7b4d7fa6c79d15428808b13066c5076"><td class="memItemLeft" >
+&#160;&#160;&#160;sha256_state&#160;&#160;&#160;<a class="el" href="structtiny__sha.html#a40fd76fa2a0395295d4747ce2cb80888">sha256s</a></td></tr>
+<tr class="memdesc:ae7b4d7fa6c79d15428808b13066c5076"><td class="mdescLeft">&#160;</td><td class="mdescRight">The state of sha256 if supported. <br /></td></tr>
+<tr class="separator:ae7b4d7fa6c79d15428808b13066c5076"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a414a745937e610b84c0f6942470b531c"><td class="memItemLeft" valign="top">}&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtiny__sha.html#a414a745937e610b84c0f6942470b531c">sha_state_t</a></td></tr>
+<tr class="memdesc:a414a745937e610b84c0f6942470b531c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Store state of hash algorithm. <br /></td></tr>
+<tr class="separator:a414a745937e610b84c0f6942470b531c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:acc38b88204bd86b40f1f1de557b247c4"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="acc38b88204bd86b40f1f1de557b247c4"></a>
+<a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtiny__sha.html#acc38b88204bd86b40f1f1de557b247c4">hash_alg</a></td></tr>
+<tr class="memdesc:acc38b88204bd86b40f1f1de557b247c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The hash algorithem which selected. <br /></td></tr>
+<tr class="separator:acc38b88204bd86b40f1f1de557b247c4"><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>Tiny Sha wrapper Element. </p>
+</div><hr/>The documentation for this struct was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="hashwrap_8h.html">hashwrap.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="structtiny__sha.html">tiny_sha</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/tatepairing_8h.html b/doc/html/tatepairing_8h.html
index 359015e..9c9c046 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/tiny__stdlib_8h.html b/doc/html/tiny__stdlib_8h.html
new file mode 100644
index 0000000..c4ca4fd
--- /dev/null
+++ b/doc/html/tiny__stdlib_8h.html
@@ -0,0 +1,193 @@
+<!-- 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/tiny/stdlib/tiny_stdlib.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">6.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('tiny__stdlib_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">tiny_stdlib.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Tiny portable implementations of standard library functions.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;stddef.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:a4cb469bec7b722064b97a406346acb61"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tiny__stdlib_8h.html#a4cb469bec7b722064b97a406346acb61">memset</a> (void *ptr, int value, size_t num)</td></tr>
+<tr class="memdesc:a4cb469bec7b722064b97a406346acb61"><td class="mdescLeft">&#160;</td><td class="mdescRight">Fill block of memory. <a href="#a4cb469bec7b722064b97a406346acb61">More...</a><br /></td></tr>
+<tr class="separator:a4cb469bec7b722064b97a406346acb61"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a1e7d61eb280250fb55dce370ba1a1709"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="tiny__stdlib_8h.html#a1e7d61eb280250fb55dce370ba1a1709">memcmp</a> (const void *ptr1, const void *ptr2, size_t num)</td></tr>
+<tr class="memdesc:a1e7d61eb280250fb55dce370ba1a1709"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two blocks of memory. <a href="#a1e7d61eb280250fb55dce370ba1a1709">More...</a><br /></td></tr>
+<tr class="separator:a1e7d61eb280250fb55dce370ba1a1709"><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>Tiny portable implementations of standard library functions. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a1e7d61eb280250fb55dce370ba1a1709"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int memcmp </td>
+ <td>(</td>
+ <td class="paramtype">const void *&#160;</td>
+ <td class="paramname"><em>ptr1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const void *&#160;</td>
+ <td class="paramname"><em>ptr2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>num</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Compare two blocks of memory. </p>
+<p>Compares the first num bytes of the block of memory pointed by ptr1 to the first num bytes pointed by ptr2, returning zero if they all match or a value different from zero representing which is greater if they do not.</p>
+<p>Notice that, unlike strcmp, the function does not stop comparing after finding a null character.</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramname">ptr1</td><td>Pointer to block of memory. </td></tr>
+ <tr><td class="paramname">ptr2</td><td>Pointer to block of memory. </td></tr>
+ <tr><td class="paramname">num</td><td>Number of bytes to compare. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>an integral value indicating the relationship between the content of the memory blocks: </dd></dl>
+<dl class="retval"><dt>Return values</dt><dd>
+ <table class="retval">
+ <tr><td class="paramname">&lt;0</td><td>the first byte that does not match in both memory blocks has a lower value in ptr1 than in ptr2 (if evaluated as unsigned char values) </td></tr>
+ <tr><td class="paramname">0</td><td>the contents of both memory blocks are equal </td></tr>
+ <tr><td class="paramname">&gt;0</td><td>the first byte that does not match in both memory blocks has a greater value in ptr1 than in ptr2 (if evaluated as unsigned char values) </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a4cb469bec7b722064b97a406346acb61"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void* memset </td>
+ <td>(</td>
+ <td class="paramtype">void *&#160;</td>
+ <td class="paramname"><em>ptr</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int&#160;</td>
+ <td class="paramname"><em>value</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">size_t&#160;</td>
+ <td class="paramname"><em>num</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Fill block of memory. </p>
+<p>Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char)</p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramname">ptr</td><td>Pointer to the block of memory to fill. </td></tr>
+ <tr><td class="paramname">value</td><td>Value to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value. </td></tr>
+ <tr><td class="paramname">num</td><td>Number of bytes to be set to the value. size_t is an unsigned integral type. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>ptr is returned. </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_a6a596e2b2b50fb0973c7fe0b17a09e5.html">stdlib</a></li><li class="navelem"><a class="el" href="tiny__stdlib_8h.html">tiny_stdlib.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/tpm__considerations_8dox.html b/doc/html/tpm__considerations_8dox.html
index e9745d7..2fe2b08 100644
--- a/doc/html/tpm__considerations_8dox.html
+++ b/doc/html/tpm__considerations_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/tpm__member_8h.html b/doc/html/tpm__member_8h.html
index 33cb3da..5a51bf5 100644
--- a/doc/html/tpm__member_8h.html
+++ b/doc/html/tpm__member_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/types_8h.html b/doc/html/types_8h.html
index 2aba609..8011cdd 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/uml_sequence.png b/doc/html/uml_sequence.png
index 69e5e4f..66a44ce 100644
--- a/doc/html/uml_sequence.png
+++ b/doc/html/uml_sequence.png
Binary files differ
diff --git a/doc/html/unionsha__digest.html b/doc/html/unionsha__digest.html
new file mode 100644
index 0000000..9907cc0
--- /dev/null
+++ b/doc/html/unionsha__digest.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: sha_digest Union 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">6.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('unionsha__digest.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">sha_digest Union Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Sha Digest Element.
+ <a href="unionsha__digest.html#details">More...</a></p>
+
+<p><code>#include &lt;epid/member/tiny/math/hashwrap.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:a2c5fa88c4f65cc62d1839bd9a166b843"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2c5fa88c4f65cc62d1839bd9a166b843"></a>
+uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionsha__digest.html#a2c5fa88c4f65cc62d1839bd9a166b843">sha512_digest</a> [<a class="el" href="sha512_8h.html#a67f489f3eee39c447a6db3ba34ef75f2">SHA512_DIGEST_SIZE</a>]</td></tr>
+<tr class="memdesc:a2c5fa88c4f65cc62d1839bd9a166b843"><td class="mdescLeft">&#160;</td><td class="mdescRight">Support digest for sha512. <br /></td></tr>
+<tr class="separator:a2c5fa88c4f65cc62d1839bd9a166b843"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a2d79411c2115953d2c5fa50c176dda8d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2d79411c2115953d2c5fa50c176dda8d"></a>
+uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionsha__digest.html#a2d79411c2115953d2c5fa50c176dda8d">sha256_digest</a> [<a class="el" href="sha256_8h.html#a81efbc0fc101b06a914f7ff9e2fbc0e9">SHA256_DIGEST_SIZE</a>]</td></tr>
+<tr class="memdesc:a2d79411c2115953d2c5fa50c176dda8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Support digest for sha256. <br /></td></tr>
+<tr class="separator:a2d79411c2115953d2c5fa50c176dda8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a182db3a17879fc1fb95c018044533060"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a182db3a17879fc1fb95c018044533060"></a>
+uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="unionsha__digest.html#a182db3a17879fc1fb95c018044533060">digest</a> [1]</td></tr>
+<tr class="memdesc:a182db3a17879fc1fb95c018044533060"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to digest. <br /></td></tr>
+<tr class="separator:a182db3a17879fc1fb95c018044533060"><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>Sha Digest Element. </p>
+</div><hr/>The documentation for this union was generated from the following file:<ul>
+<li>epid/member/tiny/math/<a class="el" href="hashwrap_8h.html">hashwrap.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="unionsha__digest.html">sha_digest</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/doc/html/using__ikgf_8dox.html b/doc/html/using__ikgf_8dox.html
index 86bdbae..248a2f3 100644
--- a/doc/html/using__ikgf_8dox.html
+++ b/doc/html/using__ikgf_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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/verifier_21_81_2api_8h.html b/doc/html/verifier_21_81_2api_8h.html
index 504ce96..0a60ced 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/verifier_2api_8h.html b/doc/html/verifier_2api_8h.html
index cb90b98..b852059 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/verifysig__walkthrough_8dox.html b/doc/html/verifysig__walkthrough_8dox.html
index f1ccd9c..0293f3b 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">5.0.0</span>
+&#160;<span id="projectnumber">6.0.0</span>
</div>
</td>
</tr>
diff --git a/doc/html/vli_8h.html b/doc/html/vli_8h.html
new file mode 100644
index 0000000..9100414
--- /dev/null
+++ b/doc/html/vli_8h.html
@@ -0,0 +1,886 @@
+<!-- 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/tiny/math/vli.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">6.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('vli_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">vli.h File Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+
+<p>Definition of Large Integer math.
+<a href="#details">More...</a></p>
+<div class="textblock"><code>#include &lt;stdint.h&gt;</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>
+<tr class="memitem:a566cfdc23f1c35230891d53139850032"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a566cfdc23f1c35230891d53139850032">VliAdd</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *left, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *right)</td></tr>
+<tr class="memdesc:a566cfdc23f1c35230891d53139850032"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two large integers. <a href="#a566cfdc23f1c35230891d53139850032">More...</a><br /></td></tr>
+<tr class="separator:a566cfdc23f1c35230891d53139850032"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ab6d63a825df6f224fe37c76b6bb67bcf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#ab6d63a825df6f224fe37c76b6bb67bcf">VliMul</a> (<a class="el" href="struct_very_large_int_product.html">VeryLargeIntProduct</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *left, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *right)</td></tr>
+<tr class="memdesc:ab6d63a825df6f224fe37c76b6bb67bcf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two large integers. <a href="#ab6d63a825df6f224fe37c76b6bb67bcf">More...</a><br /></td></tr>
+<tr class="separator:ab6d63a825df6f224fe37c76b6bb67bcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a4c7e60c47b82e5b2cf823d51b3a9fdcc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a4c7e60c47b82e5b2cf823d51b3a9fdcc">VliRShift</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *in, uint32_t shift)</td></tr>
+<tr class="memdesc:a4c7e60c47b82e5b2cf823d51b3a9fdcc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Right shift a large integers. <a href="#a4c7e60c47b82e5b2cf823d51b3a9fdcc">More...</a><br /></td></tr>
+<tr class="separator:a4c7e60c47b82e5b2cf823d51b3a9fdcc"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ac47d57834c67877c10ecdc230cdaf503"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#ac47d57834c67877c10ecdc230cdaf503">VliSub</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *left, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *right)</td></tr>
+<tr class="memdesc:ac47d57834c67877c10ecdc230cdaf503"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtract two large integers. <a href="#ac47d57834c67877c10ecdc230cdaf503">More...</a><br /></td></tr>
+<tr class="separator:ac47d57834c67877c10ecdc230cdaf503"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a9a1df0e7770aa1421e41b87965e71425"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a9a1df0e7770aa1421e41b87965e71425">VliSet</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *in)</td></tr>
+<tr class="memdesc:a9a1df0e7770aa1421e41b87965e71425"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set a large integer's value. <a href="#a9a1df0e7770aa1421e41b87965e71425">More...</a><br /></td></tr>
+<tr class="separator:a9a1df0e7770aa1421e41b87965e71425"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:ad1e2e5fe5fc466eff75dbe70fba3169f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#ad1e2e5fe5fc466eff75dbe70fba3169f">VliClear</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result)</td></tr>
+<tr class="memdesc:ad1e2e5fe5fc466eff75dbe70fba3169f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear a large integer's value. <a href="#ad1e2e5fe5fc466eff75dbe70fba3169f">More...</a><br /></td></tr>
+<tr class="separator:ad1e2e5fe5fc466eff75dbe70fba3169f"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a8f6a41541103b1bde8428ea7f4b816fa"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a8f6a41541103b1bde8428ea7f4b816fa">VliIsZero</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *in)</td></tr>
+<tr class="memdesc:a8f6a41541103b1bde8428ea7f4b816fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if a large integer is zero. <a href="#a8f6a41541103b1bde8428ea7f4b816fa">More...</a><br /></td></tr>
+<tr class="separator:a8f6a41541103b1bde8428ea7f4b816fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a426db811cf4ee822bd4b6863f2e51d8c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a426db811cf4ee822bd4b6863f2e51d8c">VliCondSet</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *true_val, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *false_val, int truth_val)</td></tr>
+<tr class="memdesc:a426db811cf4ee822bd4b6863f2e51d8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Conditionally Set a large inter's value to one of two values. <a href="#a426db811cf4ee822bd4b6863f2e51d8c">More...</a><br /></td></tr>
+<tr class="separator:a426db811cf4ee822bd4b6863f2e51d8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a80d1a80f5a21437354ee185923621d66"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a80d1a80f5a21437354ee185923621d66">VliTestBit</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *in, uint32_t bit)</td></tr>
+<tr class="memdesc:a80d1a80f5a21437354ee185923621d66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test the value of a bit in a large integer. <a href="#a80d1a80f5a21437354ee185923621d66">More...</a><br /></td></tr>
+<tr class="separator:a80d1a80f5a21437354ee185923621d66"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a10fc791278e51543fc685d5a4903fcd1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a10fc791278e51543fc685d5a4903fcd1">VliRand</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param)</td></tr>
+<tr class="memdesc:a10fc791278e51543fc685d5a4903fcd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate a random large integer. <a href="#a10fc791278e51543fc685d5a4903fcd1">More...</a><br /></td></tr>
+<tr class="separator:a10fc791278e51543fc685d5a4903fcd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a1f6ded73c6bb3dc340efd2a8978f8d7a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a1f6ded73c6bb3dc340efd2a8978f8d7a">VliCmp</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *left, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *right)</td></tr>
+<tr class="memdesc:a1f6ded73c6bb3dc340efd2a8978f8d7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">compare two large integers. <a href="#a1f6ded73c6bb3dc340efd2a8978f8d7a">More...</a><br /></td></tr>
+<tr class="separator:a1f6ded73c6bb3dc340efd2a8978f8d7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a6373f1d28198a0f34f220bfcc2ecf040"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a6373f1d28198a0f34f220bfcc2ecf040">VliModAdd</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *left, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *right, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *mod)</td></tr>
+<tr class="memdesc:a6373f1d28198a0f34f220bfcc2ecf040"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add two large integers modulo a value. <a href="#a6373f1d28198a0f34f220bfcc2ecf040">More...</a><br /></td></tr>
+<tr class="separator:a6373f1d28198a0f34f220bfcc2ecf040"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aa53a875972ac2f10852fcaca92de2b40"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#aa53a875972ac2f10852fcaca92de2b40">VliModSub</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *left, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *right, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *mod)</td></tr>
+<tr class="memdesc:aa53a875972ac2f10852fcaca92de2b40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Subtract two large integers modulo a value. <a href="#aa53a875972ac2f10852fcaca92de2b40">More...</a><br /></td></tr>
+<tr class="separator:aa53a875972ac2f10852fcaca92de2b40"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a112a5d4118e101ec539e9669ebd4fdf9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a112a5d4118e101ec539e9669ebd4fdf9">VliModMul</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *left, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *right, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *mod)</td></tr>
+<tr class="memdesc:a112a5d4118e101ec539e9669ebd4fdf9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Multiply two large integers modulo a value. <a href="#a112a5d4118e101ec539e9669ebd4fdf9">More...</a><br /></td></tr>
+<tr class="separator:a112a5d4118e101ec539e9669ebd4fdf9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:aa1f2257e949c0c4f26b24aec95e01452"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#aa1f2257e949c0c4f26b24aec95e01452">VliModExp</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *base, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *exp, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *mod)</td></tr>
+<tr class="memdesc:aa1f2257e949c0c4f26b24aec95e01452"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exponentiate a large integer modulo a value. <a href="#aa1f2257e949c0c4f26b24aec95e01452">More...</a><br /></td></tr>
+<tr class="separator:aa1f2257e949c0c4f26b24aec95e01452"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a3d4ee194f13293e61bddf243e4241b4c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a3d4ee194f13293e61bddf243e4241b4c">VliModInv</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *input, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *mod)</td></tr>
+<tr class="memdesc:a3d4ee194f13293e61bddf243e4241b4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invert a large integer modulo a value. <a href="#a3d4ee194f13293e61bddf243e4241b4c">More...</a><br /></td></tr>
+<tr class="separator:a3d4ee194f13293e61bddf243e4241b4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:accf6070832e479e01c1268b0414645b9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#accf6070832e479e01c1268b0414645b9">VliModSquare</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *input, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *mod)</td></tr>
+<tr class="memdesc:accf6070832e479e01c1268b0414645b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Square a large integer modulo a value. <a href="#accf6070832e479e01c1268b0414645b9">More...</a><br /></td></tr>
+<tr class="separator:accf6070832e479e01c1268b0414645b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
+<tr class="memitem:a5280e583a19e61ad815b02906c082033"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="vli_8h.html#a5280e583a19e61ad815b02906c082033">VliModBarrett</a> (<a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *result, <a class="el" href="struct_very_large_int_product.html">VeryLargeIntProduct</a> const *input, <a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *mod)</td></tr>
+<tr class="memdesc:a5280e583a19e61ad815b02906c082033"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reduce a value to a modulo. <a href="#a5280e583a19e61ad815b02906c082033">More...</a><br /></td></tr>
+<tr class="separator:a5280e583a19e61ad815b02906c082033"><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>Definition of Large Integer math. </p>
+</div><h2 class="groupheader">Function Documentation</h2>
+<a class="anchor" id="a566cfdc23f1c35230891d53139850032"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">uint32_t VliAdd </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two large integers. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>the carry portion of the addition. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="ad1e2e5fe5fc466eff75dbe70fba3169f"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliClear </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Clear a large integer's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>value to clear. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a1f6ded73c6bb3dc340efd2a8978f8d7a"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int VliCmp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>compare two large integers. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>the left hand value. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>the right hand value.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>the sign of left - right </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a426db811cf4ee822bd4b6863f2e51d8c"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliCondSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>true_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>false_val</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int&#160;</td>
+ <td class="paramname"><em>truth_val</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Conditionally Set a large inter's value to one of two values. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">true_val</td><td>value to set if condition is true. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">false_val</td><td>value to set if condition is false. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">truth_val</td><td>value of condition. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a8f6a41541103b1bde8428ea7f4b816fa"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int VliIsZero </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>in</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test if a large integer is zero. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the value to test. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if indeed the value is zero. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a6373f1d28198a0f34f220bfcc2ecf040"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliModAdd </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>mod</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Add two large integers modulo a value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be added. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">mod</td><td>The modulo. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a5280e583a19e61ad815b02906c082033"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliModBarrett </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int_product.html">VeryLargeIntProduct</a> const *&#160;</td>
+ <td class="paramname"><em>input</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>mod</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Reduce a value to a modulo. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">input</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">mod</td><td>The modulo.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section warning"><dt>Warning</dt><dd>This function makes significant assumptions about the range of values input </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="aa1f2257e949c0c4f26b24aec95e01452"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliModExp </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>base</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>exp</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>mod</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Exponentiate a large integer modulo a value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">base</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">exp</td><td>the exponent. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">mod</td><td>The modulo. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a3d4ee194f13293e61bddf243e4241b4c"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliModInv </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>input</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>mod</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Invert a large integer modulo a value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">input</td><td>the value to invert. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">mod</td><td>The modulo. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a112a5d4118e101ec539e9669ebd4fdf9"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliModMul </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>mod</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two large integers modulo a value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">mod</td><td>The modulo. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="accf6070832e479e01c1268b0414645b9"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliModSquare </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>input</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>mod</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Square a large integer modulo a value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">input</td><td>the base. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">mod</td><td>The modulo. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="aa53a875972ac2f10852fcaca92de2b40"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliModSub </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>mod</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Subtract two large integers modulo a value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The operand to be subtracted from. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The operand to subtract. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">mod</td><td>The modulo. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ab6d63a825df6f224fe37c76b6bb67bcf"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliMul </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int_product.html">VeryLargeIntProduct</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Multiply two large integers. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>of multiplying left and right. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The first operand to be multiplied. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The second operand to be multiplied. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a10fc791278e51543fc685d5a4903fcd1"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int VliRand </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</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>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Generate a random large integer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>the random value. </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>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>A value different from zero (i.e., true) if on success. Zero (i.e., false) otherwise. </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a4c7e60c47b82e5b2cf823d51b3a9fdcc"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliRShift </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>shift</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Right shift a large integers. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>The value to be shifted. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">shift</td><td>The number of bits to shift. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="a9a1df0e7770aa1421e41b87965e71425"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void VliSet </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Set a large integer's value. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>value to set. </td></tr>
+ </table>
+ </dd>
+</dl>
+
+</div>
+</div>
+<a class="anchor" id="ac47d57834c67877c10ecdc230cdaf503"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">uint32_t VliSub </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> *&#160;</td>
+ <td class="paramname"><em>result</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>left</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>right</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Subtract two large integers. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>target. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">left</td><td>The operand to be subtracted from. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">right</td><td>The operand to subtract. </td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>1 on success, 0 on failure </dd></dl>
+
+</div>
+</div>
+<a class="anchor" id="a80d1a80f5a21437354ee185923621d66"></a>
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">uint32_t VliTestBit </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="struct_very_large_int.html">VeryLargeInt</a> const *&#160;</td>
+ <td class="paramname"><em>in</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">uint32_t&#160;</td>
+ <td class="paramname"><em>bit</em>&#160;</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Test the value of a bit in a large integer. </p>
+<dl class="params"><dt>Parameters</dt><dd>
+ <table class="params">
+ <tr><td class="paramdir">[in]</td><td class="paramname">in</td><td>the value to test. </td></tr>
+ <tr><td class="paramdir">[in]</td><td class="paramname">bit</td><td>the bit index.</td></tr>
+ </table>
+ </dd>
+</dl>
+<dl class="section return"><dt>Returns</dt><dd>value of the bit (1 or 0). </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_ea12d375fc1eb79df248c0adf953af4f.html">tiny</a></li><li class="navelem"><a class="el" href="dir_5f2fc2cf41db41de2b55e03ffa7a1d16.html">math</a></li><li class="navelem"><a class="el" href="vli_8h.html">vli.h</a></li>
+ <li class="footer">
+ &copy; 2016-2017 Intel Corporation
+ </li>
+ </ul>
+</div>
+</body>
+</html>
diff --git a/epid/common-testhelper/Makefile b/epid/common-testhelper/Makefile
index b5a0b63..1b9559b 100644
--- a/epid/common-testhelper/Makefile
+++ b/epid/common-testhelper/Makefile
@@ -23,6 +23,10 @@ LDFLAGS += -L$(GTEST_INCLUDE_DIR)/gtest -L$(LIB_COMMON_TESTHELPER_DIR) \
-L$(LIB_COMMON_DIR) -L$(LIB_IPPCP_DIR) \
-lgtest -lcommon-testhelper -lcommon -lippcp
+ifneq ($(TSS_PATH),)
+ CXXFLAGS += -DTPM_TSS
+endif
+
#target part
$(COMMON_TESTHELPER_LIB): $(COMMON_TESTHELPER_OBJ)
$(AR) rc $(COMMON_TESTHELPER_LIB) $(COMMON_TESTHELPER_OBJ)
diff --git a/epid/common-testhelper/epid_gtest-testhelper.cc b/epid/common-testhelper/epid_gtest-testhelper.cc
index 33c2a9b..d19e822 100644
--- a/epid/common-testhelper/epid_gtest-testhelper.cc
+++ b/epid/common-testhelper/epid_gtest-testhelper.cc
@@ -50,7 +50,8 @@ static const struct EpidStatusTextEntry kEnumToText[] = {
EPID_STATUS_TEXT_ENTRY_VALUE(kEpidRandMaxIterErr),
EPID_STATUS_TEXT_ENTRY_VALUE(kEpidDuplicateErr),
EPID_STATUS_TEXT_ENTRY_VALUE(kEpidInconsistentBasenameSetErr),
- EPID_STATUS_TEXT_ENTRY_VALUE(kEpidMathQuadraticNonResidueError)};
+ EPID_STATUS_TEXT_ENTRY_VALUE(kEpidMathQuadraticNonResidueError),
+ EPID_STATUS_TEXT_ENTRY_VALUE(kEpidOutOfSequenceError)};
const char* EpidStatusToName(EpidStatus e) {
size_t i = 0;
diff --git a/epid/common-testhelper/member_wrapper-testhelper.cc b/epid/common-testhelper/member_wrapper-testhelper.cc
new file mode 100644
index 0000000..7dfcefe
--- /dev/null
+++ b/epid/common-testhelper/member_wrapper-testhelper.cc
@@ -0,0 +1,290 @@
+/*############################################################################
+ # 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 C++ wrapper implementation.
+ */
+
+#include "epid/common-testhelper/member_wrapper-testhelper.h"
+
+#include <stdint.h>
+#include <cstdio>
+#include <cstring>
+#include <new>
+#include <sstream>
+#include <stdexcept>
+#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; \
+ }
+
+MemberCtxObj::MemberCtxObj(GroupPubKey const& pub_key, PrivKey const& priv_key,
+ BitSupplier rnd_func, void* rnd_param)
+ : ctx_(nullptr) {
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, &priv_key.f, &params);
+ ctx_ = CreateMember(&params);
+ sts = EpidProvisionKey(ctx_, &pub_key, &priv_key, nullptr);
+ if (kEpidNoErr != sts) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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);
+ ctx_ = CreateMember(&params);
+ sts = EpidProvisionCredential(ctx_, &pub_key, &cred, nullptr);
+ if (kEpidNoErr != sts) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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);
+ ctx_ = CreateMember(&params);
+ sts = EpidMemberSetHashAlg(ctx_, hash_alg);
+ if (kEpidNoErr != sts) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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) {
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, nullptr, &params);
+ ctx_ = CreateMember(&params);
+}
+
+MemberCtxObj::MemberCtxObj(MemberParams const* params) : ctx_(nullptr) {
+ ctx_ = CreateMember(params);
+}
+
+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);
+ ctx_ = CreateMember(&params);
+ sts = EpidProvisionKey(ctx_, &pub_key, &priv_key, &precomp);
+ if (kEpidNoErr != sts) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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);
+ ctx_ = CreateMember(&params);
+ sts = EpidMemberSetHashAlg(ctx_, hash_alg);
+ if (kEpidNoErr != sts) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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) {
+ EpidStatus sts = kEpidErr;
+ MemberParams params = {0};
+ SetMemberParams(rnd_func, rnd_param, nullptr, &params);
+ ctx_ = CreateMember(&params);
+ sts = EpidProvisionCredential(ctx_, &pub_key, &cred, &precomp);
+ if (kEpidNoErr != sts) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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);
+ ctx_ = CreateMember(&params);
+ sts = EpidMemberSetHashAlg(ctx_, hash_alg);
+ if (kEpidNoErr != sts) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ 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) {
+ DeleteMember(&ctx_);
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberStartup()");
+ }
+}
+
+MemberCtxObj::~MemberCtxObj() { DeleteMember(&ctx_); }
+
+MemberCtx* MemberCtxObj::ctx() const { return ctx_; }
+
+MemberCtxObj::operator MemberCtx*() const { return ctx_; }
+
+MemberCtxObj::operator const MemberCtx*() const { return ctx_; }
+
+MemberCtx* MemberCtxObj::CreateMember(MemberParams const* params) const {
+ size_t context_size = 0;
+ EpidStatus sts = kEpidErr;
+ MemberCtx* member_ctx = NULL;
+
+ sts = EpidMemberGetSize(params, &context_size);
+ if (kEpidNoErr != sts) {
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberGetSize()");
+ }
+
+ // allocate and zero initialize, no throw on failure
+ member_ctx = (MemberCtx*)new (std::nothrow) uint8_t[context_size]();
+ if (!member_ctx) {
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ std::ostringstream err;
+ err << "Failed to allocate " << context_size
+ << "bytes after EpidMemberGetSize()";
+ throw std::logic_error(err.str());
+ }
+
+ sts = EpidMemberInit(params, member_ctx);
+ if (kEpidNoErr != sts) {
+ delete[](uint8_t*) member_ctx;
+ printf("%s(%d): %s\n", __FILE__, __LINE__, "test defect:");
+ throw std::logic_error(std::string("Failed to call: ") +
+ "EpidMemberInit()");
+ }
+ return member_ctx;
+}
+
+void MemberCtxObj::DeleteMember(MemberCtx** ctx) const {
+ if (ctx) {
+ EpidMemberDeinit(*ctx);
+ delete[](uint8_t*)(*ctx);
+ *ctx = NULL;
+ }
+}
diff --git a/epid/common-testhelper/member_wrapper-testhelper.h b/epid/common-testhelper/member_wrapper-testhelper.h
new file mode 100644
index 0000000..d25f196
--- /dev/null
+++ b/epid/common-testhelper/member_wrapper-testhelper.h
@@ -0,0 +1,84 @@
+/*############################################################################
+ # 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 C++ wrapper interface.
+ */
+#ifndef EPID_COMMON_TESTHELPER_MEMBER_WRAPPER_TESTHELPER_H_
+#define EPID_COMMON_TESTHELPER_MEMBER_WRAPPER_TESTHELPER_H_
+
+extern "C" {
+#include "epid/member/api.h"
+}
+
+/// 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;
+ MemberCtxObj& operator=(const MemberCtxObj&) = delete;
+
+ /// Destroy the MemberCtx
+ ~MemberCtxObj();
+ /// get a pointer to the stored MemberCtx
+ MemberCtx* ctx() const;
+ /// cast operator to get the pointer to the stored MemberCtx
+ operator MemberCtx*() const;
+ /// const cast operator to get the pointer to the stored MemberCtx
+ operator const MemberCtx*() const;
+
+ private:
+ /// Creates and initializes new member given parameters.
+ MemberCtx* CreateMember(MemberParams const* params) const;
+ /// Deletes the member created by CreateMember().
+ void DeleteMember(MemberCtx** ctx) const;
+ /// The stored MemberCtx
+ MemberCtx* ctx_;
+};
+
+#endif // EPID_COMMON_TESTHELPER_MEMBER_WRAPPER_TESTHELPER_H_
diff --git a/epid/common/epiddefs.h b/epid/common/epiddefs.h
new file mode 100644
index 0000000..1ff7673
--- /dev/null
+++ b/epid/common/epiddefs.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.
+ ############################################################################*/
+/// Common SDK macro definitions
+/*! \file */
+#ifndef EPID_COMMON_EPIDDEFS_H_
+#define EPID_COMMON_EPIDDEFS_H_
+
+#if defined(SHARED)
+#if defined(_WIN32)
+#ifdef EXPORT_EPID_APIS
+#define EPID_API __declspec(dllexport)
+#else
+#define EPID_API __declspec(dllimport)
+#endif
+#else // defined(_WIN32)
+#if __GNUC__ >= 4
+#define EPID_API __attribute__((visibility("default")))
+#else
+#define EPID_API
+#endif
+#endif // defined(_WIN32)
+#else // defined(SHARED)
+#define EPID_API
+#endif // defined(SHARED)
+
+#endif // EPID_COMMON_EPIDDEFS_H_
diff --git a/epid/common/math/unittests/ecgroup-test.cc b/epid/common/math/unittests/ecgroup-test.cc
index 9e2f012..426b32a 100644
--- a/epid/common/math/unittests/ecgroup-test.cc
+++ b/epid/common/math/unittests/ecgroup-test.cc
@@ -1831,6 +1831,81 @@ TEST_F(EcGroupTest, HashReturnsValidISha512256) {
this->efq_r, &i));
EXPECT_EQ((uint32_t)0, i);
}
+TEST_F(EcGroupTest, HashWorksForArbitraryMsg) {
+ uint32_t i = 0;
+ std::vector<uint8_t> msg_aad = {'a', 'a', 'd'};
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, msg_aad.data(), msg_aad.size(),
+ kSha512, this->efq_r, &i));
+ G1ElemStr exp_aad = {
+ 0x5e, 0x73, 0xbe, 0x39, 0x6b, 0xd8, 0x50, 0x2f, 0xb1, 0x93, 0xbf,
+ 0x9a, 0x3f, 0x42, 0x9d, 0x2a, 0xeb, 0xb7, 0x89, 0xb6, 0xcf, 0x52,
+ 0x78, 0x61, 0x19, 0x24, 0xae, 0x56, 0xb3, 0x15, 0xd6, 0x7e, 0x0d,
+ 0xb4, 0x3c, 0x33, 0xf3, 0x0a, 0xf1, 0x80, 0x21, 0x23, 0xd5, 0x6c,
+ 0x4a, 0xb6, 0x68, 0xcf, 0xa9, 0xcd, 0x44, 0x91, 0xc9, 0x6b, 0x50,
+ 0x96, 0x0f, 0x13, 0x47, 0x2d, 0x0b, 0xd5, 0x19, 0x68};
+ G1ElemStr res_aad;
+ THROW_ON_EPIDERR(
+ WriteEcPoint(this->efq, this->efq_r, &res_aad, sizeof(res_aad)));
+ EXPECT_EQ(exp_aad, res_aad);
+ i = 0;
+ std::vector<uint8_t> msg_1_MB(1024 * 1024); // exactly 1 MB;
+ uint8_t c = 0;
+ for (size_t j = 0; j < msg_1_MB.size(); ++j) {
+ msg_1_MB[j] = c++;
+ }
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, msg_1_MB.data(), msg_1_MB.size(),
+ kSha512, this->efq_r, &i));
+ G1ElemStr exp_1_MB = {
+ 0xd8, 0xf7, 0xcd, 0x26, 0xa1, 0x86, 0x2e, 0x25, 0xa5, 0x17, 0x84,
+ 0x98, 0x80, 0x5b, 0xb6, 0x10, 0x1c, 0x0d, 0xe1, 0xf4, 0xaa, 0x50,
+ 0xfa, 0xdd, 0x67, 0x2f, 0xfd, 0x96, 0x95, 0x57, 0x1d, 0x0f, 0x92,
+ 0xcd, 0xd1, 0x99, 0x27, 0x29, 0xbe, 0x7c, 0x66, 0x27, 0x8e, 0x5b,
+ 0xc7, 0x0f, 0x9f, 0xad, 0xd7, 0x29, 0x54, 0x0f, 0xea, 0xa8, 0x01,
+ 0x42, 0xf9, 0x47, 0x1d, 0xec, 0x5c, 0x0c, 0x2e, 0xdb};
+ G1ElemStr res_1_MB;
+ THROW_ON_EPIDERR(
+ WriteEcPoint(this->efq, this->efq_r, &res_1_MB, sizeof(res_1_MB)));
+ EXPECT_EQ(exp_1_MB, res_1_MB);
+ i = 0;
+ std::vector<uint8_t> msg_1_MB_Minus_2(1024 * 1024 - 2); // exactly 1 MB;
+ c = 0;
+ for (size_t j = 0; j < msg_1_MB_Minus_2.size(); ++j) {
+ msg_1_MB_Minus_2[j] = c++;
+ }
+ EXPECT_EQ(kEpidNoErr,
+ EcHash(this->efq, msg_1_MB_Minus_2.data(), msg_1_MB_Minus_2.size(),
+ kSha512, this->efq_r, &i));
+ G1ElemStr exp_1_MB_Minus_2 = {
+ 0x96, 0x31, 0xc8, 0xf7, 0x63, 0x82, 0x4b, 0x69, 0xae, 0xcd, 0x7a,
+ 0x54, 0xed, 0x66, 0x45, 0x22, 0xa1, 0xd3, 0x5a, 0x07, 0x56, 0xf4,
+ 0xfb, 0x47, 0xc7, 0xdf, 0x07, 0xf7, 0x21, 0xfb, 0x77, 0x2b, 0x65,
+ 0xe1, 0xa2, 0x2e, 0x3b, 0x1a, 0xc8, 0x62, 0x0b, 0xb8, 0xac, 0x32,
+ 0x21, 0xce, 0xa1, 0x74, 0x50, 0x55, 0xc2, 0x03, 0x91, 0x35, 0x63,
+ 0x25, 0x45, 0xb3, 0xc6, 0x3c, 0xe0, 0xe8, 0x74, 0xb4};
+ G1ElemStr res_1_MB_Minus_2;
+ THROW_ON_EPIDERR(WriteEcPoint(this->efq, this->efq_r, &res_1_MB_Minus_2,
+ sizeof(res_1_MB_Minus_2)));
+ EXPECT_EQ(exp_1_MB_Minus_2, res_1_MB_Minus_2);
+ i = 0;
+ std::vector<uint8_t> msg_102(102); // exactly 1 MB;
+ c = 0;
+ for (size_t j = 0; j < msg_102.size(); ++j) {
+ msg_102[j] = c++;
+ }
+ EXPECT_EQ(kEpidNoErr, EcHash(this->efq, msg_102.data(), msg_102.size(),
+ kSha512, this->efq_r, &i));
+ G1ElemStr exp_102 = {
+ 0x21, 0xf6, 0xb5, 0x2c, 0xbc, 0xb7, 0x90, 0x2b, 0x36, 0xe1, 0x43,
+ 0xb6, 0xca, 0x66, 0x7e, 0x0a, 0x87, 0x66, 0x32, 0xe0, 0x70, 0x74,
+ 0x2b, 0x20, 0x92, 0x8f, 0x8b, 0x3d, 0xd7, 0xe1, 0x95, 0xc7, 0xa9,
+ 0x1b, 0x46, 0x94, 0xab, 0xfc, 0x59, 0x0e, 0x63, 0x9d, 0x42, 0x15,
+ 0x85, 0xcb, 0x91, 0x12, 0xca, 0x19, 0x54, 0xa3, 0xe9, 0x77, 0xd0,
+ 0x1b, 0x2a, 0x97, 0x1e, 0xd0, 0x59, 0x33, 0xe1, 0x1d};
+ G1ElemStr res_102;
+ THROW_ON_EPIDERR(
+ WriteEcPoint(this->efq, this->efq_r, &res_102, sizeof(res_102)));
+ EXPECT_EQ(exp_102, res_102);
+}
///////////////////////////////////////////////////////////////////////
// 1.1 EcHash
TEST_F(EcGroupTest, Epid11HashFailsGivenMismatchedArguments) {
diff --git a/epid/common/tinycommon.parts b/epid/common/tinycommon.parts
new file mode 100644
index 0000000..3e9f00b
--- /dev/null
+++ b/epid/common/tinycommon.parts
@@ -0,0 +1,46 @@
+# pylint:disable=I0011,W0401,W0614,C0103,E0602
+############################################################################
+# 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.
+############################################################################
+"""Build confioguration for include-only common
+
+Needed to avoid linking to avoid listing ipp in dependencies when only
+depending on headers. Eventually should unify this into single header.
+
+"""
+Import('*')
+env.PartName('tinycommon')
+
+include_files = Pattern(src_dir='.',
+ includes=['*.h'],
+ recursive=False).files()
+
+install_files = Pattern(src_dir='.',
+ includes=[
+ '*.h',
+ '*.c',
+ '*-test.cc',
+ '*-testhelper.cc',
+ '*.parts'
+ 'Makefile'],
+ recursive=True)
+
+if 'install_package' in env['MODE']:
+ env.InstallTopLevel(install_files,
+ sub_dir='epid/common')
+else:
+ env.SdkInclude(include_files, sub_dir='epid/common')
+ if 'install_lib' in env['MODE']:
+ env.InstallInclude(include_files, sub_dir='epid/common')
diff --git a/epid/member/Makefile b/epid/member/Makefile
index d165032..29e0cf3 100644
--- a/epid/member/Makefile
+++ b/epid/member/Makefile
@@ -12,21 +12,48 @@ HEADERS_INSTALL_DIR := $(epidinstalldir)/include/epid/member/
API_HEADERS_INSTALL = $(wildcard ./*.h)
MEMBER_INCLUDE_DIR = ../../
+TINY_MEMBER_INCLUDE_DIR = ./tiny/
MEMBER_SRC = $(wildcard ./src/*.c)
-MEMBER_SRC += $(wildcard ./tpm2/src/*.c)
-MEMBER_OBJ = $(MEMBER_SRC:.c=.o)
+TINY_MEMBER_SRC = $(wildcard ./tiny/src/*.c)
+TINY_MEMBER_MATH_SRC = $(wildcard ./tiny/math/src/*.c)
+TINY_STDLIB_MEMBER_SRC = $(wildcard ./tiny/stdlib/src/*.c)
+MEMBER_TPM2_TSS_UTEST_SRC = $(wildcard ./tpm2/unittests/*.cc)
+ifneq ($(TSS_PATH),)
+ MEMBER_TPM2_SRC = $(wildcard ./tpm2/ibm_tss/*.c)
+ MEMBER_TPM2_UTEST_SRC = $(filter-out $(wildcard ./tpm2/unittests/*-simulator-test.cc), \
+ $(MEMBER_TPM2_TSS_UTEST_SRC))
+ MEMBER_INCLUDE_DIR += -I$(TSS_PATH)
+ CFLAGS += -DTPM_TSS
+ CXXFLAGS += -DTPM_TSS
+else
+ MEMBER_TPM2_SRC = $(wildcard ./tpm2/src/*.c)
+ MEMBER_TPM2_UTEST_SRC = $(filter-out $(wildcard ./tpm2/unittests/*-tss-test.cc), \
+ $(MEMBER_TPM2_TSS_UTEST_SRC))
+endif
+MEMBER_SRC += $(MEMBER_TPM2_SRC)
MEMBER_LIB = ./libmember.a
+MATH_LIB = ./libmath.a
+STDLIB_LIB = ./libtiny_stdlib.a
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)
+TINY_MEMBER_UTEST_SRC = $(wildcard ./tiny/unittests/*.cc)
+TINY_MEMBER_MATH_UTEST_SRC = $(wildcard ./tiny/math/unittests/*.cc)
+ifneq ($(TINY),)
+ MEMBER_OBJ = $(TINY_MEMBER_SRC:.c=.o)
+ MATH_OBJ = $(TINY_MEMBER_MATH_SRC:.c=.o)
+ STDLIB_OBJ = $(TINY_STDLIB_MEMBER_SRC:.c=.o)
+ MEMBER_UTEST_OBJ = $(TINY_MEMBER_UTEST_SRC:.cc=.o)
+ TINY_MEMBER_MATH_UTEST_OBJ = $(TINY_MEMBER_MATH_UTEST_SRC:.cc=.o)
+ MEMBER_INCLUDE_DIR += -I$(TINY_MEMBER_INCLUDE_DIR)
+else
+ MEMBER_OBJ = $(MEMBER_SRC:.c=.o)
+ MEMBER_UTEST_OBJ = $(MEMBER_UTEST_SRC:.cc=.o)
+ MEMBER_TPM2_UTEST_OBJ = $(MEMBER_TPM2_UTEST_SRC:.cc=.o)
+endif
+
LIB_MEMBER_DIR = .
LIB_VERIFIER_DIR = ../verifier
LIB_COMMON_TESTHELPER_DIR = ../common-testhelper
@@ -39,6 +66,26 @@ LDFLAGS += -L$(GTEST_INCLUDE_DIR)/gtest -L$(LIB_COMMON_TESTHELPER_DIR) \
-L$(LIB_IPPCP_DIR) -lgtest -lcommon-testhelper \
-lmember -lverifier -lcommon -lippcp
+ifneq ($(TSS_PATH),)
+ LDFLAGS += -L$(TSS_PATH) -ltss -lcrypto
+endif
+
+ifneq ($(TINY),)
+ CPPDEFINES := -DNDEBUG
+ LDFLAGS += -lmath -ltiny_stdlib
+ CFLAGS := -Os -fno-builtin -fno-stack-protector -fomit-frame-pointer -fno-asynchronous-unwind-tables \
+ -fdata-sections -ffunction-sections -fvisibility=hidden -Werror -Wall -Wextra
+ ifneq ($(OS),Windows_NT)
+ CFLAGS += -fPIC
+ endif
+ ifeq ($(findstring gcc,$(CC)),gcc)
+ CFLAGS += -Wno-missing-braces
+ endif
+ ifeq ($(ARCH), x86)
+ CFLAGS += -m32
+ endif
+endif
+
$(MEMBER_OBJ): %.o: %.c
$(CC) $(CFLAGS) -I$(IPP_INCLUDE_DIR) -I$(IPP_SRC_INCLUDE_DIR) \
-I$(MEMBER_INCLUDE_DIR) -c $^ -o $@
@@ -54,42 +101,86 @@ $(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)
+ifneq ($(TINY),)
+ $(MATH_OBJ): %.o: %.c
+ $(CC) $(CFLAGS) -I$(MEMBER_INCLUDE_DIR) -c $^ -o $@
-$(MEMBER_TPM2_UTEST_OBJ): %.o: %.cc
- $(CXX) -o $@ $(CXXFLAGS) $(GTEST_DEFINES) -I$(MEMBER_INCLUDE_DIR) \
- -I$(GTEST_INCLUDE_DIR) -c $^
+ $(STDLIB_OBJ): %.o: %.c
+ $(CC) $(CFLAGS) -I$(MEMBER_INCLUDE_DIR) -c $^ -o $@
-build: all
+ $(MATH_LIB): $(MATH_OBJ)
+ $(AR) rc $(MATH_LIB) $(MATH_OBJ)
+ $(RANLIB) $(MATH_LIB)
+
+ $(STDLIB_LIB): $(STDLIB_OBJ)
+ $(AR) rc $(STDLIB_LIB) $(STDLIB_OBJ)
+ $(RANLIB) $(STDLIB_LIB)
+
+ TINY_MEMBER_MATH_UTEST_EXE = ./member.math-utest$(EXE_EXTENSION)
+ $(TINY_MEMBER_MATH_UTEST_EXE): $(TINY_MEMBER_MATH_UTEST_OBJ)
+ $(CXX) -o $@ $^ $(LDFLAGS)
-all: $(MEMBER_LIB)
+ $(TINY_MEMBER_MATH_UTEST_OBJ): %.o: %.cc
+ $(CXX) -o $@ $(CXXFLAGS) $(GTEST_DEFINES) -I$(MEMBER_INCLUDE_DIR) \
+ -I$(GTEST_INCLUDE_DIR) -c $^
+else
+ MEMBER_TPM2_UTEST_EXE = ./member.tpm2-utest$(EXE_EXTENSION)
+ $(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 $^
+endif
+
+build: all
+LIBS = $(MEMBER_LIB)
+ifneq ($(TINY),)
+ LIBS += $(STDLIB_LIB) $(MATH_LIB)
+endif
+all: $(LIBS)
install:
mkdir -p '$(LIB_INSTALL_DIR)'
mkdir -p '$(HEADERS_INSTALL_DIR)'
cp $(MEMBER_LIB) '$(LIB_INSTALL_DIR)'
+ifneq ($(TINY),)
+ cp $(MATH_LIB) '$(LIB_INSTALL_DIR)'
+ cp $(STDLIB_LIB) '$(LIB_INSTALL_DIR)'
+endif
cp $(API_HEADERS_INSTALL) '$(HEADERS_INSTALL_DIR)'
#install tests if they exist
ifneq (,$(wildcard $(MEMBER_UTEST_EXE)))
mkdir -p '$(TEST_INSTALL_DIR)'
cp $(MEMBER_UTEST_EXE) '$(TEST_INSTALL_DIR)'
+endif
+ifneq ($(TINY),)
+ mkdir -p '$(TEST_INSTALL_DIR)'
+ cp $(TINY_MEMBER_MATH_UTEST_EXE) '$(TEST_INSTALL_DIR)'
+else
+ mkdir -p '$(TEST_INSTALL_DIR)'
cp $(MEMBER_TPM2_UTEST_EXE) '$(TEST_INSTALL_DIR)'
endif
-utest: $(MEMBER_UTEST_EXE) $(MEMBER_TPM2_UTEST_EXE)
+utest: $(MEMBER_UTEST_EXE) $(MEMBER_TPM2_UTEST_EXE) $(TINY_MEMBER_MATH_UTEST_EXE)
run_utest:
$(MEMBER_UTEST_EXE) $(GTEST_FLAGS)
$(MEMBER_TPM2_UTEST_EXE) $(GTEST_FLAGS)
+ $(TINY_MEMBER_MATH_UTEST_EXE) $(GTEST_FLAGS)
check: utest run_utest
clean:
rm -f $(MEMBER_OBJ) \
$(MEMBER_LIB) \
+ $(MATH_OBJ) \
+ $(MATH_LIB) \
+ $(STDLIB_OBJ) \
+ $(STDLIB_LIB) \
$(MEMBER_UTEST_OBJ) \
$(MEMBER_UTEST_EXE) \
$(MEMBER_TPM2_UTEST_OBJ) \
$(MEMBER_TPM2_UTEST_EXE) \
+ $(TINY_MEMBER_MATH_UTEST_OBJ) \
+ $(TINY_MEMBER_MATH_UTEST_EXE) \
*.xml
diff --git a/epid/member/api.h b/epid/member/api.h
index 0124da5..b6c8dd0 100644
--- a/epid/member/api.h
+++ b/epid/member/api.h
@@ -18,8 +18,13 @@
#ifndef EPID_MEMBER_API_H_
#define EPID_MEMBER_API_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stddef.h>
#include "epid/common/bitsupplier.h"
+#include "epid/common/epiddefs.h"
#include "epid/common/errors.h"
#include "epid/common/types.h"
@@ -42,16 +47,51 @@ typedef struct MemberParams MemberParams;
@{
*/
-/// Creates a new member context.
+/// Allocates and initializes a new member context.
/*!
\param[in] params
Implementation specific configuration parameters.
\param[out] ctx
Newly constructed member context.
+ \warning buffers allocated using this function should not be
+ initialized with ::EpidMemberInit.
+
+ \deprecated This API has been superseded by ::EpidMemberGetSize
+ and ::EpidMemberInit.
+
+ \returns ::EpidStatus
+ */
+EpidStatus EPID_API EpidMemberCreate(MemberParams const* params,
+ MemberCtx** ctx);
+
+/// Computes the size in bytes required for a member context
+/*!
+ \param[in] params
+ Implementation specific configuration parameters.
+ \param[out] context_size
+ Number of bytes required for a ::MemberCtx buffer
+
+ \returns ::EpidStatus
+ \see EpidMemberInit
+ */
+EpidStatus EPID_API EpidMemberGetSize(MemberParams const* params,
+ size_t* context_size);
+
+/// Initializes a new member context.
+/*!
+ \param[in] params
+ Implementation specific configuration parameters.
+ \param[in,out] ctx
+ An existing buffer that will be used as a ::MemberCtx.
+
+ \warning ctx must be a buffer of at least the size reported by
+ ::EpidMemberGetSize for the same parameters.
+
\returns ::EpidStatus
+ \see EpidMemberGetSize
*/
-EpidStatus EpidMemberCreate(MemberParams const* params, MemberCtx** ctx);
+EpidStatus EPID_API EpidMemberInit(MemberParams const* params, MemberCtx* ctx);
/// Creates a request to join a group.
/*!
@@ -69,9 +109,10 @@ The join request.
\returns ::EpidStatus
*/
-EpidStatus EpidCreateJoinRequest(MemberCtx* ctx, GroupPubKey const* pub_key,
- IssuerNonce const* ni,
- JoinRequest* join_request);
+EpidStatus EPID_API EpidCreateJoinRequest(MemberCtx* ctx,
+ GroupPubKey const* pub_key,
+ IssuerNonce const* ni,
+ JoinRequest* join_request);
/// Provisions a member context from a membership credential
/*!
@@ -86,9 +127,9 @@ Precomputed state (implementation specific optional)
\returns ::EpidStatus
*/
-EpidStatus EpidProvisionCredential(MemberCtx* ctx, GroupPubKey const* pub_key,
- MembershipCredential const* credential,
- MemberPrecomp const* precomp_str);
+EpidStatus EPID_API EpidProvisionCredential(
+ MemberCtx* ctx, GroupPubKey const* pub_key,
+ MembershipCredential const* credential, MemberPrecomp const* precomp_str);
/// Provisions a member context from a compressed private key
/*!
@@ -103,9 +144,10 @@ Precomputed state (implementation specific optional)
\returns ::EpidStatus
*/
-EpidStatus EpidProvisionCompressed(MemberCtx* ctx, GroupPubKey const* pub_key,
- CompressedPrivKey const* compressed_privkey,
- MemberPrecomp const* precomp_str);
+EpidStatus EPID_API
+EpidProvisionCompressed(MemberCtx* ctx, GroupPubKey const* pub_key,
+ CompressedPrivKey const* compressed_privkey,
+ MemberPrecomp const* precomp_str);
/// Provisions a member context from a private key
/*!
@@ -120,9 +162,9 @@ Precomputed state (implementation specific optional)
\returns ::EpidStatus
*/
-EpidStatus EpidProvisionKey(MemberCtx* ctx, GroupPubKey const* pub_key,
- PrivKey const* priv_key,
- MemberPrecomp const* precomp_str);
+EpidStatus EPID_API EpidProvisionKey(MemberCtx* ctx, GroupPubKey const* pub_key,
+ PrivKey const* priv_key,
+ MemberPrecomp const* precomp_str);
/// Change member from setup state to normal operation
/*!
@@ -131,7 +173,24 @@ The member context.
\returns ::EpidStatus
*/
-EpidStatus EpidMemberStartup(MemberCtx* ctx);
+EpidStatus EPID_API EpidMemberStartup(MemberCtx* ctx);
+
+/// De-initializes an existing member context buffer.
+/*!
+ Must be called to safely release a member context initialized using
+ ::EpidMemberInit.
+
+ De-initializes the context.
+
+ \param[in,out] ctx
+ The member context. Can be NULL.
+
+ \warning This function should not be used on buffers allocated with
+ ::EpidMemberCreate. Those buffers should be released using ::EpidMemberDelete
+
+ \see EpidMemberInit
+ */
+void EPID_API EpidMemberDeinit(MemberCtx* ctx);
/// Deletes an existing member context.
/*!
@@ -144,13 +203,15 @@ EpidStatus EpidMemberStartup(MemberCtx* ctx);
\param[in,out] ctx
The member context. Can be NULL.
+ \deprecated This API has been superseded by ::EpidMemberDeinit.
+
\see EpidMemberCreate
\b Example
\ref UserManual_GeneratingAnIntelEpidSignature
*/
-void EpidMemberDelete(MemberCtx** ctx);
+void EPID_API EpidMemberDelete(MemberCtx** ctx);
/// Sets the hash algorithm to be used by a member.
/*!
@@ -165,14 +226,14 @@ void EpidMemberDelete(MemberCtx** ctx);
If the result is not ::kEpidNoErr, the hash algorithm used by the member is
undefined.
- \see EpidMemberCreate
+ \see EpidMemberInit
\see ::HashAlg
\b Example
\ref UserManual_GeneratingAnIntelEpidSignature
*/
-EpidStatus EpidMemberSetHashAlg(MemberCtx* ctx, HashAlg hash_alg);
+EpidStatus EPID_API EpidMemberSetHashAlg(MemberCtx* ctx, HashAlg hash_alg);
/// Sets the signature based revocation list to be used by a member.
/*!
@@ -204,14 +265,14 @@ EpidStatus EpidMemberSetHashAlg(MemberCtx* ctx, HashAlg hash_alg);
If the result is not ::kEpidNoErr the signature based revocation list pointed
to by the member is not changed.
- \see EpidMemberCreate
+ \see EpidMemberInit
\b Example
\ref UserManual_GeneratingAnIntelEpidSignature
*/
-EpidStatus EpidMemberSetSigRl(MemberCtx* ctx, SigRl const* sig_rl,
- size_t sig_rl_size);
+EpidStatus EPID_API EpidMemberSetSigRl(MemberCtx* ctx, SigRl const* sig_rl,
+ size_t sig_rl_size);
/// Computes the size in bytes required for an Intel(R) EPID signature.
/*!
@@ -229,7 +290,7 @@ EpidStatus EpidMemberSetSigRl(MemberCtx* ctx, SigRl const* sig_rl,
\ref UserManual_GeneratingAnIntelEpidSignature
*/
-size_t EpidGetSigSize(SigRl const* sig_rl);
+size_t EPID_API EpidGetSigSize(SigRl const* sig_rl);
/// Writes an Intel(R) EPID signature.
/*!
@@ -258,7 +319,7 @@ size_t EpidGetSigSize(SigRl const* sig_rl);
\note
If the result is not ::kEpidNoErr the content of sig is undefined.
- \see EpidMemberCreate
+ \see EpidMemberInit
\see EpidMemberSetHashAlg
\see EpidMemberSetSigRl
\see EpidGetSigSize
@@ -267,9 +328,10 @@ size_t EpidGetSigSize(SigRl const* sig_rl);
\ref UserManual_GeneratingAnIntelEpidSignature
*/
-EpidStatus EpidSign(MemberCtx const* ctx, void const* msg, size_t msg_len,
- void const* basename, size_t basename_len,
- EpidSignature* sig, size_t sig_len);
+EpidStatus EPID_API EpidSign(MemberCtx const* ctx, void const* msg,
+ size_t msg_len, void const* basename,
+ size_t basename_len, EpidSignature* sig,
+ size_t sig_len);
/// Registers a basename with a member.
/*!
@@ -305,8 +367,22 @@ EpidStatus EpidSign(MemberCtx const* ctx, void const* msg, size_t msg_len,
\ref UserManual_GeneratingAnIntelEpidSignature
*/
-EpidStatus EpidRegisterBaseName(MemberCtx* ctx, void const* basename,
- size_t basename_len);
+EpidStatus EPID_API EpidRegisterBasename(MemberCtx* ctx, void const* basename,
+ size_t basename_len);
+
+/// Clears registered basenames.
+/*!
+
+ Allows clearing registered basenames without recreating member.
+
+ \param[in,out] ctx
+ The member context.
+
+ \returns ::EpidStatus
+
+ \see ::EpidRegisterBasename
+ */
+EpidStatus EPID_API EpidClearRegisteredBasenames(MemberCtx* ctx);
/// Extends the member's pool of pre-computed signatures.
/*!
@@ -319,9 +395,9 @@ EpidStatus EpidRegisterBaseName(MemberCtx* ctx, void const* basename,
\returns ::EpidStatus
- \see ::EpidMemberCreate
+ \see ::EpidMemberInit
*/
-EpidStatus EpidAddPreSigs(MemberCtx* ctx, size_t number_presigs);
+EpidStatus EPID_API EpidAddPreSigs(MemberCtx* ctx, size_t number_presigs);
/// Gets the number of pre-computed signatures in the member's pool.
/*!
@@ -331,9 +407,9 @@ EpidStatus EpidAddPreSigs(MemberCtx* ctx, size_t number_presigs);
\returns
Number of remaining pre-computed signatures. Returns 0 if ctx is NULL.
- \see ::EpidMemberCreate
+ \see ::EpidMemberInit
*/
-size_t EpidGetNumPreSigs(MemberCtx const* ctx);
+size_t EPID_API EpidGetNumPreSigs(MemberCtx const* ctx);
/// Decompresses compressed member private key.
/*!
@@ -354,10 +430,14 @@ size_t EpidGetNumPreSigs(MemberCtx const* ctx);
\ref UserManual_GeneratingAnIntelEpidSignature
*/
-EpidStatus EpidDecompressPrivKey(GroupPubKey const* pub_key,
- CompressedPrivKey const* compressed_privkey,
- PrivKey* priv_key);
+EpidStatus EPID_API EpidDecompressPrivKey(
+ GroupPubKey const* pub_key, CompressedPrivKey const* compressed_privkey,
+ PrivKey* priv_key);
/*! @} */
+#ifdef __cplusplus
+}
+#endif
+
#endif // EPID_MEMBER_API_H_
diff --git a/epid/member/software_member.h b/epid/member/software_member.h
index c9aeff1..4e86175 100644
--- a/epid/member/software_member.h
+++ b/epid/member/software_member.h
@@ -32,7 +32,7 @@
/*!
You need to use a cryptographically secure random
number generator to create a member context using
- ::EpidMemberCreate. The ::BitSupplier is provided
+ ::EpidMemberGetSize and ::EpidMemberInit. The ::BitSupplier is provided
as a function prototype for your own implementation
of the random number generator.
*/
diff --git a/epid/member/src/context.c b/epid/member/src/context.c
index 3509bce..73d181c 100644
--- a/epid/member/src/context.c
+++ b/epid/member/src/context.c
@@ -43,94 +43,145 @@
break; \
}
-EpidStatus EpidMemberCreate(MemberParams const* params, MemberCtx** ctx) {
+EpidStatus EpidMemberGetSize(MemberParams const* params, size_t* context_size) {
+ if (!params || !context_size) {
+ return kEpidBadArgErr;
+ }
+ *context_size = sizeof(MemberCtx);
+ return kEpidNoErr;
+}
+
+EpidStatus EpidMemberInit(MemberParams const* params, MemberCtx* ctx) {
EpidStatus sts = kEpidErr;
- MemberCtx* member_ctx = NULL;
if (!params || !ctx) {
return kEpidBadArgErr;
}
- // Allocate memory for MemberCtx
- member_ctx = SAFE_ALLOC(sizeof(MemberCtx));
- if (!member_ctx) {
- return kEpidMemAllocErr;
- }
-
+ memset(ctx, 0, sizeof(*ctx));
do {
const FpElemStr* f = NULL;
// set the default hash algorithm to sha512
- member_ctx->hash_alg = kSha512;
+ ctx->hash_alg = kSha512;
#ifdef TPM_TSS // if build for TSS, make Sha256 default
- member_ctx->hash_alg = kSha256;
+ 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;
+ ctx->sig_rl = NULL;
+ ctx->precomp_ready = false;
+ ctx->is_initially_provisioned = false;
+ ctx->is_provisioned = false;
+ ctx->primary_key_set = false;
- sts = CreateBasenames(&member_ctx->allowed_basenames);
+ sts = CreateBasenames(&ctx->allowed_basenames);
BREAK_ON_EPID_ERROR(sts);
// Internal representation of Epid2Params
- sts = CreateEpid2Params(&member_ctx->epid2_params);
+ sts = CreateEpid2Params(&ctx->epid2_params);
BREAK_ON_EPID_ERROR(sts);
// create TPM2 context
- sts = Tpm2CreateContext(params, member_ctx->epid2_params,
- &member_ctx->rnd_func, &member_ctx->rnd_param, &f,
- &member_ctx->tpm2_ctx);
+ sts = Tpm2CreateContext(params, ctx->epid2_params, &ctx->rnd_func,
+ &ctx->rnd_param, &f, &ctx->tpm2_ctx);
BREAK_ON_EPID_ERROR(sts);
- if (!CreateStack(sizeof(PreComputedSignature), &member_ctx->presigs)) {
+ if (!CreateStack(sizeof(PreComputedSignature), &ctx->presigs)) {
sts = kEpidMemAllocErr;
BREAK_ON_EPID_ERROR(sts);
}
- member_ctx->f = f;
- member_ctx->join_ctr = 0;
- member_ctx->rf_ctr = 0;
- member_ctx->rnu_ctr = 0;
+ ctx->f = f;
+ ctx->join_ctr = 0;
+ ctx->rf_ctr = 0;
+ ctx->rnu_ctr = 0;
- sts = NewEcPoint(member_ctx->epid2_params->G1, (EcPoint**)&member_ctx->A);
+ sts = NewEcPoint(ctx->epid2_params->G1, (EcPoint**)&ctx->A);
BREAK_ON_EPID_ERROR(sts);
- sts =
- NewFfElement(member_ctx->epid2_params->Fp, (FfElement**)&member_ctx->x);
+ sts = NewFfElement(ctx->epid2_params->Fp, (FfElement**)&ctx->x);
BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(member_ctx->epid2_params->G1, (EcPoint**)&member_ctx->h1);
+ sts = NewEcPoint(ctx->epid2_params->G1, (EcPoint**)&ctx->h1);
BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(member_ctx->epid2_params->G1, (EcPoint**)&member_ctx->h2);
+ sts = NewEcPoint(ctx->epid2_params->G1, (EcPoint**)&ctx->h2);
BREAK_ON_EPID_ERROR(sts);
- sts = NewEcPoint(member_ctx->epid2_params->G2, (EcPoint**)&member_ctx->w);
+ sts = NewEcPoint(ctx->epid2_params->G2, (EcPoint**)&ctx->w);
BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(member_ctx->epid2_params->GT,
- (FfElement**)&member_ctx->e12);
+ sts = NewFfElement(ctx->epid2_params->GT, (FfElement**)&ctx->e12);
BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(member_ctx->epid2_params->GT,
- (FfElement**)&member_ctx->e22);
+ sts = NewFfElement(ctx->epid2_params->GT, (FfElement**)&ctx->e22);
BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(member_ctx->epid2_params->GT,
- (FfElement**)&member_ctx->e2w);
+ sts = NewFfElement(ctx->epid2_params->GT, (FfElement**)&ctx->e2w);
BREAK_ON_EPID_ERROR(sts);
- sts = NewFfElement(member_ctx->epid2_params->GT,
- (FfElement**)&member_ctx->ea2);
+ sts = NewFfElement(ctx->epid2_params->GT, (FfElement**)&ctx->ea2);
BREAK_ON_EPID_ERROR(sts);
- sts = Tpm2SetHashAlg(member_ctx->tpm2_ctx, member_ctx->hash_alg);
+ sts = Tpm2SetHashAlg(ctx->tpm2_ctx, ctx->hash_alg);
BREAK_ON_EPID_ERROR(sts);
- member_ctx->primary_key_set = true;
- *ctx = member_ctx;
+ ctx->primary_key_set = true;
sts = kEpidNoErr;
} while (0);
if (kEpidNoErr != sts) {
- EpidMemberDelete(&member_ctx);
+ EpidMemberDeinit(ctx);
}
return (sts);
}
+void EpidMemberDeinit(MemberCtx* ctx) {
+ size_t i = 0;
+ size_t presig_size = 0;
+ PreComputedSignature* buf = NULL;
+ if (!ctx) {
+ return;
+ }
+ presig_size = StackGetSize(ctx->presigs);
+ 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);
+}
+
+EpidStatus EpidMemberCreate(MemberParams const* params, MemberCtx** ctx) {
+ size_t context_size = 0;
+ EpidStatus sts = kEpidErr;
+ MemberCtx* member_ctx = NULL;
+ if (!params || !ctx) {
+ return kEpidBadArgErr;
+ }
+ do {
+ sts = EpidMemberGetSize(params, &context_size);
+ BREAK_ON_EPID_ERROR(sts);
+ member_ctx = SAFE_ALLOC(context_size);
+ if (!member_ctx) {
+ BREAK_ON_EPID_ERROR(kEpidMemAllocErr);
+ }
+ sts = EpidMemberInit(params, member_ctx);
+ BREAK_ON_EPID_ERROR(sts);
+ } while (0);
+ if (kEpidNoErr != sts) {
+ SAFE_FREE(member_ctx);
+ member_ctx = NULL;
+ }
+ *ctx = member_ctx;
+ return sts;
+}
+
EpidStatus EpidMemberInitialProvision(MemberCtx* ctx) {
EpidStatus sts = kEpidErr;
@@ -160,32 +211,12 @@ EpidStatus EpidMemberInitialProvision(MemberCtx* ctx) {
}
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);
+ if (!ctx) {
+ return;
}
+ EpidMemberDeinit(*ctx);
+ SAFE_FREE(*ctx);
+ *ctx = NULL;
}
EpidStatus EpidMemberSetHashAlg(MemberCtx* ctx, HashAlg hash_alg) {
@@ -207,6 +238,9 @@ EpidStatus EpidMemberSetSigRl(MemberCtx* ctx, SigRl const* sig_rl,
if (!ctx || !sig_rl) {
return kEpidBadArgErr;
}
+ if (!ctx->is_provisioned) {
+ return kEpidOutOfSequenceError;
+ }
if (!IsSigRlValid(&ctx->pub_key.gid, sig_rl, sig_rl_size)) {
return kEpidBadArgErr;
}
@@ -225,7 +259,7 @@ EpidStatus EpidMemberSetSigRl(MemberCtx* ctx, SigRl const* sig_rl,
return kEpidNoErr;
}
-EpidStatus EpidRegisterBaseName(MemberCtx* ctx, void const* basename,
+EpidStatus EpidRegisterBasename(MemberCtx* ctx, void const* basename,
size_t basename_len) {
EpidStatus sts = kEpidErr;
if (basename_len == 0) {
@@ -243,3 +277,13 @@ EpidStatus EpidRegisterBaseName(MemberCtx* ctx, void const* basename,
return sts;
}
+
+EpidStatus EpidClearRegisteredBasenames(MemberCtx* ctx) {
+ EpidStatus sts = kEpidErr;
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+ DeleteBasenames(&ctx->allowed_basenames);
+ sts = CreateBasenames(&ctx->allowed_basenames);
+ return sts;
+}
diff --git a/epid/member/src/nrprove.h b/epid/member/src/nrprove.h
index debc593..3a1a70e 100644
--- a/epid/member/src/nrprove.h
+++ b/epid/member/src/nrprove.h
@@ -60,7 +60,7 @@ typedef struct NrProof NrProof;
\note
If the result is not ::kEpidNoErr, the content of proof is undefined.
- \see EpidMemberCreate
+ \see EpidMemberInit
\see EpidSignBasic
*/
EpidStatus EpidNrProve(MemberCtx const* ctx, void const* msg, size_t msg_len,
diff --git a/epid/member/src/sign.c b/epid/member/src/sign.c
index 3ce964b..2c49aa5 100644
--- a/epid/member/src/sign.c
+++ b/epid/member/src/sign.c
@@ -49,6 +49,9 @@ EpidStatus EpidSign(MemberCtx const* ctx, void const* msg, size_t msg_len,
// if basename is non-empty it must have both length and content
return kEpidBadArgErr;
}
+ if (!ctx->is_provisioned) {
+ return kEpidOutOfSequenceError;
+ }
if (EpidGetSigSize(ctx->sig_rl) > sig_len) {
return kEpidBadArgErr;
}
diff --git a/epid/member/src/signbasic.h b/epid/member/src/signbasic.h
index 53359e0..2d26a29 100644
--- a/epid/member/src/signbasic.h
+++ b/epid/member/src/signbasic.h
@@ -60,7 +60,7 @@ typedef struct BigNumStr BigNumStr;
\note
If the result is not ::kEpidNoErr the content of sig, is undefined.
- \see EpidMemberCreate
+ \see EpidMemberInit
\see EpidNrProve
*/
EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
diff --git a/epid/member/tiny/math/efq.h b/epid/member/tiny/math/efq.h
new file mode 100644
index 0000000..f9805e1
--- /dev/null
+++ b/epid/member/tiny/math/efq.h
@@ -0,0 +1,254 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of EFq math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_EFQ_H_
+#define EPID_MEMBER_TINY_MATH_EFQ_H_
+#include <stddef.h>
+#include "epid/common/bitsupplier.h"
+#include "epid/common/types.h"
+
+/// \cond
+typedef struct EccPointFq EccPointFq;
+typedef struct EccPointJacobiFq EccPointJacobiFq;
+typedef struct FpElem FpElem;
+typedef struct FqElem FqElem;
+/// \endcond
+
+/// Multiply two points in EFq.
+/*!
+This function is mitigated against software side-channel
+attacks.
+
+\param[out] result of multiplying left and right.
+\param[in] base The first operand to be multiplied.
+\param[in] exp The second operand to be multiplied.
+*/
+void EFqMulSSCM(EccPointJacobiFq* result, EccPointJacobiFq const* base,
+ FpElem const* exp);
+
+/// Exponentiate a point in EFq by an element of Fp.
+/*!
+\param[out] result target.
+\param[in] base the base.
+\param[in] exp the exponent.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+
+\returns 1 on success, 0 on failure
+*/
+int EFqAffineExp(EccPointFq* result, EccPointFq const* base, FpElem const* exp);
+
+/// Sum the results of exponentiating two points in EFq by elements of Fp.
+/*!
+\param[out] result target.
+\param[in] base0 the first base.
+\param[in] exp0 the first exponent.
+\param[in] base1 the second base.
+\param[in] exp1 the second exponent.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int EFqAffineMultiExp(EccPointFq* result, EccPointFq const* base0,
+ FpElem const* exp0, EccPointFq const* base1,
+ FpElem const* exp1);
+
+/// Sum the results of exponentiating two points in EFq by elements of Fp.
+/*!
+\param[out] result target.
+\param[in] base0 the first base.
+\param[in] exp0 the first exponent.
+\param[in] base1 the second base.
+\param[in] exp1 the second exponent.
+\returns 1 on success, 0 on failure
+*/
+void EFqMultiExp(EccPointJacobiFq* result, EccPointJacobiFq const* base0,
+ FpElem const* exp0, EccPointJacobiFq const* base1,
+ FpElem const* exp1);
+
+/// Add two points in EFq.
+/*!
+\param[out] result of adding left and right.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int EFqAffineAdd(EccPointFq* result, EccPointFq const* left,
+ EccPointFq const* right);
+
+/// Double a point in EFq.
+/*!
+\param[out] result target.
+\param[in] in the value to double.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int EFqAffineDbl(EccPointFq* result, EccPointFq const* in);
+
+/// Double a point in EFq.
+/*!
+\param[out] result target.
+\param[in] in the value to double.
+*/
+void EFqDbl(EccPointJacobiFq* result, EccPointJacobiFq const* in);
+
+/// Add two points in EFq.
+/*!
+\param[out] result of adding left and right.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+*/
+void EFqAdd(EccPointJacobiFq* result, EccPointJacobiFq const* left,
+ EccPointJacobiFq const* right);
+
+/// Generate a random point in EFq.
+/*!
+\param[in] result the random value.
+\param[in] rnd_func Random number generator.
+\param[in] rnd_param Pass through context data for rnd_func.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int EFqRand(EccPointFq* result, BitSupplier rnd_func, void* rnd_param);
+
+/// Set a point's value.
+/*!
+\param[out] result target.
+\param[in] x value to set.
+\param[in] y value to set.
+*/
+void EFqSet(EccPointJacobiFq* result, FqElem const* x, FqElem const* y);
+
+/// Test if a point is infinity.
+/*!
+\param[in] in the point to test.
+\returns A value different from zero (i.e., true) indeed
+ the value is infinity. Zero (i.e., false) otherwise.
+*/
+int EFqIsInf(EccPointJacobiFq const* in);
+
+/// Convert a point from Affine to Jacobi representation.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+*/
+void EFqFromAffine(EccPointJacobiFq* result, EccPointFq const* in);
+
+/// Convert a point from Jacobi to Affine representation.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int EFqToAffine(EccPointFq* result, EccPointJacobiFq const* in);
+
+/// Negate a point on EFq.
+/*!
+\param[out] result the negative of the element.
+\param[in] in the element to negate.
+*/
+void EFqNeg(EccPointJacobiFq* result, EccPointJacobiFq const* in);
+
+/// Test if two points on EFq are equal
+/*!
+\param[in] left The first operand to be tested.
+\param[in] right The second operand to be tested.
+\returns A value different from zero (i.e., true) if indeed
+ the values are equal. Zero (i.e., false) otherwise.
+*/
+int EFqEq(EccPointJacobiFq const* left, EccPointJacobiFq const* right);
+
+/// Hashes an arbitrary message to a point on EFq.
+/*!
+\param[out] result target.
+\param[in] msg buffer to reinterpret.
+\param[in] len length of msg in bytes.
+\param[in] hashalg hash algorithm to use.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int EFqHash(EccPointFq* result, unsigned char const* msg, size_t len,
+ HashAlg hashalg);
+
+/// Copy a point's value
+/*!
+\param[out] result copy target.
+\param[in] in copy source.
+*/
+void EFqCp(EccPointFq* result, EccPointFq const* in);
+
+/// Test if two points on EFq are equal
+/*!
+\param[in] left The first operand to be tested.
+\param[in] right The second operand to be tested.
+\returns A value different from zero (i.e., true) if indeed
+ the values are equal. Zero (i.e., false) otherwise.
+*/
+int EFqEqAffine(EccPointFq const* left, EccPointFq const* right);
+
+/// Conditionally Set a point's value to one of two values.
+/*!
+\param[out] result target.
+\param[in] true_val value to set if condition is true.
+\param[in] false_val value to set if condition is false.
+\param[in] truth_val value of condition.
+*/
+void EFqCondSet(EccPointJacobiFq* result, EccPointJacobiFq const* true_val,
+ EccPointJacobiFq const* false_val, int truth_val);
+
+/// Copy a point's value
+/*!
+\param[out] result copy target.
+\param[in] in copy source.
+*/
+void EFqJCp(EccPointJacobiFq* result, EccPointJacobiFq const* in);
+
+/// Set an element's value to infinity.
+/*!
+\param[out] result element to set.
+*/
+void EFqInf(EccPointJacobiFq* result);
+
+/// Test if a point is on EFq.
+/*!
+\param[in] in the point to test.
+\returns A value different from zero (i.e., true) indeed
+ the point is on the curve. Zero (i.e., false) otherwise.
+*/
+int EFqOnCurve(EccPointFq const* in);
+
+/// Test if a point is on EFq.
+/*!
+\param[in] in the point to test.
+\returns A value different from zero (i.e., true) indeed
+ the point is on the curve. Zero (i.e., false) otherwise.
+*/
+int EFqJOnCurve(EccPointJacobiFq const* in);
+
+/// Generate a random point in EFq.
+/*!
+\param[in] result the random value.
+\param[in] rnd_func Random number generator.
+\param[in] rnd_param Pass through context data for rnd_func.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int EFqJRand(EccPointJacobiFq* result, BitSupplier rnd_func, void* rnd_param);
+
+#endif // EPID_MEMBER_TINY_MATH_EFQ_H_
diff --git a/epid/member/tiny/math/efq2.h b/epid/member/tiny/math/efq2.h
new file mode 100644
index 0000000..ca9dcb6
--- /dev/null
+++ b/epid/member/tiny/math/efq2.h
@@ -0,0 +1,103 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of EFq2 math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_EFQ2_H_
+#define EPID_MEMBER_TINY_MATH_EFQ2_H_
+
+/// \cond
+typedef struct EccPointFq2 EccPointFq2;
+typedef struct EccPointJacobiFq2 EccPointJacobiFq2;
+typedef struct FpElem FpElem;
+/// \endcond
+
+/// Test if a point is infinity.
+/*!
+\param[in] in the point to test.
+\returns A value different from zero (i.e., true) indeed
+ the value is infinity. Zero (i.e., false) otherwise.
+*/
+int EFq2IsInf(EccPointJacobiFq2 const* in);
+
+/// Convert a point from Affine to Jacobi representation.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+*/
+void EFq2FromAffine(EccPointJacobiFq2* result, EccPointFq2 const* in);
+
+/// Convert a point from Jacobi to Affine representation.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+\returns 1 on success, 0 on failure
+*/
+int EFq2ToAffine(EccPointFq2* result, EccPointJacobiFq2 const* in);
+
+/// Double a point in EFq2.
+/*!
+\param[out] result target.
+\param[in] in the value to double.
+*/
+void EFq2Dbl(EccPointJacobiFq2* result, EccPointJacobiFq2 const* in);
+
+/// Add two points in EFq2.
+/*!
+\param[out] result of adding left and right.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+*/
+void EFq2Add(EccPointJacobiFq2* result, EccPointJacobiFq2 const* left,
+ EccPointJacobiFq2 const* right);
+
+/// Negate a point on EFq2.
+/*!
+\param[out] result the negative of the element.
+\param[in] in the element to negate.
+*/
+void EFq2Neg(EccPointJacobiFq2* result, EccPointJacobiFq2 const* in);
+
+/// Multiply two points in EFq.
+/*!
+This function is mitigated against software side-channel
+attacks.
+
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void EFq2MulSSCM(EccPointJacobiFq2* result, EccPointJacobiFq2 const* left,
+ FpElem const* right);
+
+/// Test if two points on EFq2 are equal
+/*!
+\param[in] left The first operand to be tested.
+\param[in] right The second operand to be tested.
+\returns A value different from zero (i.e., true) if indeed
+ the values are equal. Zero (i.e., false) otherwise.
+*/
+int EFq2Eq(EccPointJacobiFq2 const* left, EccPointJacobiFq2 const* right);
+
+/// Test if a point is in EFq2.
+/*!
+\param[in] in the point to test.
+\returns A value different from zero (i.e., true) indeed
+ the point is on the curve. Zero (i.e., false) otherwise.
+*/
+int EFq2OnCurve(EccPointFq2 const* in);
+
+#endif // EPID_MEMBER_TINY_MATH_EFQ2_H_
diff --git a/epid/member/tiny/math/fp.h b/epid/member/tiny/math/fp.h
new file mode 100644
index 0000000..00820f5
--- /dev/null
+++ b/epid/member/tiny/math/fp.h
@@ -0,0 +1,135 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of Fp math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_FP_H_
+#define EPID_MEMBER_TINY_MATH_FP_H_
+
+#include <stddef.h>
+#include <stdint.h>
+#include "epid/common/bitsupplier.h"
+
+/// \cond
+typedef struct FpElem FpElem;
+typedef struct VeryLargeInt VeryLargeInt;
+/// \endcond
+
+/// Test if an element is in Fp
+/*!
+\param[in] in the element to test
+\returns A value different from zero (i.e., true) indeed
+ the value is in the field. Zero (i.e., false) otherwise.
+*/
+int FpInField(FpElem const* in);
+
+/// Add two elements of Fp
+/*!
+\param[out] result of adding left and right.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+*/
+void FpAdd(FpElem* result, FpElem const* left, FpElem const* right);
+
+/// Multiply two elements of Fp.
+/*!
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void FpMul(FpElem* result, FpElem const* left, FpElem const* right);
+
+/// Subtract two elements of Fp.
+/*!
+\param[out] result of subtracting left from right.
+\param[in] left The operand to be subtracted from.
+\param[in] right The operand to subtract.
+*/
+void FpSub(FpElem* result, FpElem const* left, FpElem const* right);
+
+/// Exponentiate an element of Fp by a large integer.
+/*!
+\param[out] result target.
+\param[in] base the base.
+\param[in] exp the exponent.
+*/
+void FpExp(FpElem* result, FpElem const* base, VeryLargeInt const* exp);
+
+/// Negate an element of Fp.
+/*!
+\param[out] result target.
+\param[in] in the value to negate.
+*/
+void FpNeg(FpElem* result, FpElem const* in);
+
+/// Test if two elements in Fp are equal
+/*!
+\param[in] left The first operand to be tested.
+\param[in] right The second operand to be tested.
+\returns A value different from zero (i.e., true) if indeed
+ the values are equal. Zero (i.e., false) otherwise.
+*/
+int FpEq(FpElem const* left, FpElem const* right);
+
+/// Invert an element of Fp.
+/*!
+\param[out] result target.
+\param[in] in the value to invert.
+*/
+void FpInv(FpElem* result, FpElem const* in);
+
+/// Generate a random element of Fp.
+/*!
+\param[in] result the random value.
+\param[in] rnd_func Random number generator.
+\param[in] rnd_param Pass through context data for rnd_func.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int FpRand(FpElem* result, BitSupplier rnd_func, void* rnd_param);
+
+/// Generate a non-zero random element of Fp.
+/*!
+\param[in] result the random value.
+\param[in] rnd_func Random number generator.
+\param[in] rnd_param Pass through context data for rnd_func.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int FpRandNonzero(FpElem* result, BitSupplier rnd_func, void* rnd_param);
+
+/// Clear an element of Fp.
+/*!
+\param[out] result value to clear.
+*/
+void FpClear(FpElem* result);
+
+/// Set a element of Fp's value.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+*/
+void FpSet(FpElem* result, uint32_t in);
+
+/// Reinterpret a buffer as an element of Fp
+/*!
+\param[out] result target.
+\param[in] hash buffer to reinterpret.
+\param[in] len length of hash in bytes.
+*/
+void FpFromHash(FpElem* result, unsigned char const* hash, size_t len);
+
+#endif // EPID_MEMBER_TINY_MATH_FP_H_
diff --git a/epid/member/tiny/math/fq.h b/epid/member/tiny/math/fq.h
new file mode 100644
index 0000000..a813c41
--- /dev/null
+++ b/epid/member/tiny/math/fq.h
@@ -0,0 +1,168 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of Fq math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_FQ_H_
+#define EPID_MEMBER_TINY_MATH_FQ_H_
+
+#include <stddef.h>
+#include <stdint.h>
+#include "epid/common/bitsupplier.h"
+
+/// \cond
+typedef struct FqElem FqElem;
+typedef struct VeryLargeInt VeryLargeInt;
+/// \endcond
+
+/// Test if an element is in Fq.
+/*!
+\param[in] in the element to test.
+\returns A value different from zero (i.e., true) indeed
+ the value is in the field. Zero (i.e., false) otherwise.
+*/
+int FqInField(FqElem const* in);
+
+/// Add two elements of Fq.
+/*!
+\param[out] result of adding left and right.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+*/
+void FqAdd(FqElem* result, FqElem const* left, FqElem const* right);
+
+/// Subtract two elements of Fq.
+/*!
+\param[out] result of subtracting left from right.
+\param[in] left The operand to be subtracted from.
+\param[in] right The operand to subtract.
+*/
+void FqSub(FqElem* result, FqElem const* left, FqElem const* right);
+
+/// Multiply two elements of Fq.
+/*!
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void FqMul(FqElem* result, FqElem const* left, FqElem const* right);
+
+/// Exponentiate an element of Fq by a large integer.
+/*!
+\param[out] result target.
+\param[in] base the base.
+\param[in] exp the exponent.
+*/
+void FqExp(FqElem* result, FqElem const* base, VeryLargeInt const* exp);
+
+/// Copy an element's value
+/*!
+\param[out] result copy target.
+\param[in] in copy source.
+*/
+void FqCp(FqElem* result, FqElem const* in);
+
+/// Test if an element is zero.
+/*!
+\param[in] value the element to test.
+\returns A value different from zero (i.e., true) if indeed
+ the value is zero. Zero (i.e., false) otherwise.
+*/
+int FqIsZero(FqElem const* value);
+
+/// Invert an element of Fq.
+/*!
+\param[out] result the inverse of the element.
+\param[in] in the element to invert.
+*/
+void FqInv(FqElem* result, FqElem const* in);
+
+/// Negate an element of Fq.
+/*!
+This function was formerly called as FqConst.
+
+\param[out] result the negative of the element.
+\param[in] in the element to negate.
+*/
+void FqNeg(FqElem* result, FqElem const* in);
+
+/// Square an element of Fq.
+/*!
+\param[out] result the square of the element.
+\param[in] in the element to square.
+*/
+void FqSquare(FqElem* result, FqElem const* in);
+
+/// Clear an element's value.
+/*!
+\param[out] result element to clear.
+*/
+void FqClear(FqElem* result);
+
+/// Set an element's value.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+*/
+void FqSet(FqElem* result, uint32_t in);
+
+/// Test if two elements in Fq are equal
+/*!
+\param[in] left The first operand to be tested.
+\param[in] right The second operand to be tested.
+\returns A value different from zero (i.e., true) if indeed
+ the values are equal. Zero (i.e., false) otherwise.
+*/
+int FqEq(FqElem const* left, FqElem const* right);
+
+/// Conditionally Set an element's value to one of two values.
+/*!
+\param[out] result target.
+\param[in] true_val value to set if condition is true.
+\param[in] false_val value to set if condition is false.
+\param[in] truth_val value of condition.
+*/
+void FqCondSet(FqElem* result, FqElem const* true_val, FqElem const* false_val,
+ int truth_val);
+
+/// Compute the Square root of an element of Fq.
+/*!
+\param[out] result the square root of the element.
+\param[in] in the element to find the square root of.
+\returns A value different from zero (i.e., true) if the square root
+ exists. Zero (i.e., false) otherwise.
+*/
+int FqSqrt(FqElem* result, FqElem const* in);
+
+/// Generate a random element of Fq.
+/*!
+\param[in] result the random value.
+\param[in] rnd_func Random number generator.
+\param[in] rnd_param Pass through context data for rnd_func.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int FqRand(FqElem* result, BitSupplier rnd_func, void* rnd_param);
+
+/// Reinterpret a buffer as an element of Fq
+/*!
+\param[out] result target.
+\param[in] hash buffer to reinterpret.
+\param[in] len length of hash in bytes.
+*/
+void FqFromHash(FqElem* result, unsigned char const* hash, size_t len);
+
+#endif // EPID_MEMBER_TINY_MATH_FQ_H_
diff --git a/epid/member/tiny/math/fq12.h b/epid/member/tiny/math/fq12.h
new file mode 100644
index 0000000..861596e
--- /dev/null
+++ b/epid/member/tiny/math/fq12.h
@@ -0,0 +1,165 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of Fq12 math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_FQ12_H_
+#define EPID_MEMBER_TINY_MATH_FQ12_H_
+
+#include <stdint.h>
+
+/// \cond
+typedef struct Fq12Elem Fq12Elem;
+typedef struct VeryLargeInt VeryLargeInt;
+/// \endcond
+
+/// Add two elements of Fq12.
+/*!
+\param[out] result of adding left and right.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+*/
+void Fq12Add(Fq12Elem* result, Fq12Elem const* left, Fq12Elem const* right);
+
+/// Subtract two elements of Fq12.
+/*!
+\param[out] result of subtracting left from right.
+\param[in] left The operand to be subtracted from.
+\param[in] right The operand to subtract.
+*/
+void Fq12Sub(Fq12Elem* result, Fq12Elem const* left, Fq12Elem const* right);
+
+/// Square an element of Fq12.
+/*!
+\param[out] result the square of the element.
+\param[in] in the element to square.
+*/
+void Fq12Square(Fq12Elem* result, Fq12Elem const* in);
+
+/// Multiply two elements of Fq12.
+/*!
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void Fq12Mul(Fq12Elem* result, Fq12Elem const* left, Fq12Elem const* right);
+
+/// Invert an element of Fq12.
+/*!
+\param[out] result the inverse of the element.
+\param[in] in the element to invert.
+*/
+void Fq12Inv(Fq12Elem* result, Fq12Elem const* in);
+
+/// Negate an element of Fq12.
+/*!
+\param[out] result the negative of the element.
+\param[in] in the element to negate.
+*/
+void Fq12Neg(Fq12Elem* result, Fq12Elem const* in);
+
+/// Set an element's value.
+/*!
+\param[out] result target.
+\param[in] val value to set.
+*/
+void Fq12Set(Fq12Elem* result, uint32_t val);
+
+/// Exponentiate an element of Fq12 by a large integer.
+/*!
+\param[out] result target.
+\param[in] base the base.
+\param[in] exp the exponent.
+*/
+void Fq12Exp(Fq12Elem* result, Fq12Elem const* base, VeryLargeInt const* exp);
+
+/// Multiply of exponentiation of elements of Fq12 by a large integers.
+/*!
+\param[out] result target.
+\param[in] base0 the base.
+\param[in] exp0 the exponent.
+\param[in] base1 the base.
+\param[in] exp1 the exponent.
+\param[in] base2 the base.
+\param[in] exp2 the exponent.
+\param[in] base3 the base.
+\param[in] exp3 the exponent.
+*/
+void Fq12MultiExp(Fq12Elem* result, Fq12Elem const* base0,
+ VeryLargeInt const* exp0, Fq12Elem const* base1,
+ VeryLargeInt const* exp1, Fq12Elem const* base2,
+ VeryLargeInt const* exp2, Fq12Elem const* base3,
+ VeryLargeInt const* exp3);
+
+/// Test if two elements in Fq12 are equal
+/*!
+\param[in] left The first operand to be tested.
+\param[in] right The second operand to be tested.
+\returns A value different from zero (i.e., true) if indeed
+ the values are equal. Zero (i.e., false) otherwise.
+*/
+int Fq12Eq(Fq12Elem const* left, Fq12Elem const* right);
+
+/// Calculate the conjugate of an element of Fq2.
+/*!
+\param[out] result the conjugate of the element.
+\param[in] in the element.
+*/
+void Fq12Conj(Fq12Elem* result, Fq12Elem const* in);
+
+/// Calculate the cyclotomic exponentiation of an element of Fq12
+/// by another element of Fq12.
+/*!
+\param[in,out] result the base of the exponentiation. This will
+ receive the result.
+\param[in] in the exponent.
+\param[in] t pairing parameter t
+*/
+void Fq12ExpCyc(Fq12Elem* result, Fq12Elem const* in, VeryLargeInt const* t);
+
+/// Calculate the cyclotomic square of an element of fq12.
+/*!
+\param[in,out] result result of the cyclotomic square.
+\param[in] in the base.
+*/
+void Fq12SqCyc(Fq12Elem* result, Fq12Elem const* in);
+
+/// Multiply two elements of Fq12.
+/*!
+Requires that b[2] = b[4] = b[5] = 0.
+where right = ((b[0], b[2], b[4]), (b[1], b[3], b[5]))
+
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void Fq12MulSpecial(Fq12Elem* result, Fq12Elem const* left,
+ Fq12Elem const* right);
+
+/// Copy an element's value
+/*!
+\param[out] result copy target.
+\param[in] in copy source.
+*/
+void Fq12Cp(Fq12Elem* result, Fq12Elem const* in);
+
+/// Clear an element's value.
+/*!
+\param[out] result element to clear.
+*/
+void Fq12Clear(Fq12Elem* result);
+
+#endif // EPID_MEMBER_TINY_MATH_FQ12_H_
diff --git a/epid/member/tiny/math/fq2.h b/epid/member/tiny/math/fq2.h
new file mode 100644
index 0000000..02efb71
--- /dev/null
+++ b/epid/member/tiny/math/fq2.h
@@ -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.
+############################################################################*/
+/// Definition of Fq2 math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_FQ2_H_
+#define EPID_MEMBER_TINY_MATH_FQ2_H_
+
+#include <stdint.h>
+
+/// \cond
+typedef struct Fq2Elem Fq2Elem;
+typedef struct FqElem FqElem;
+typedef struct VeryLargeInt VeryLargeInt;
+/// \endcond
+
+/// Copy an element's value
+/*!
+\param[out] result copy target.
+\param[in] in copy source.
+*/
+void Fq2Cp(Fq2Elem* result, Fq2Elem const* in);
+
+/// Set an element's value.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+*/
+void Fq2Set(Fq2Elem* result, uint32_t in);
+
+/// Clear an element's value.
+/*!
+\param[out] result element to clear.
+*/
+void Fq2Clear(Fq2Elem* result);
+
+/// Add two elements of Fq2.
+/*!
+\param[out] result of adding left and right.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+*/
+void Fq2Add(Fq2Elem* result, Fq2Elem const* left, Fq2Elem const* right);
+
+/// Exponentiate an element of Fq2 by a large integer.
+/*!
+\param[out] result target.
+\param[in] base the base.
+\param[in] exp the exponent.
+*/
+void Fq2Exp(Fq2Elem* result, Fq2Elem const* base, VeryLargeInt const* exp);
+
+/// Subtract two elements of Fq2.
+/*!
+\param[out] result of subtracting left from right.
+\param[in] left The operand to be subtracted from.
+\param[in] right The operand to subtract.
+*/
+void Fq2Sub(Fq2Elem* result, Fq2Elem const* left, Fq2Elem const* right);
+
+/// Multiply two elements of Fq2.
+/*!
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void Fq2Mul(Fq2Elem* result, Fq2Elem const* left, Fq2Elem const* right);
+
+/// Invert an element of Fq2.
+/*!
+\param[out] result the inverse of the element.
+\param[in] in the element to invert.
+*/
+void Fq2Inv(Fq2Elem* result, Fq2Elem const* in);
+
+/// Negate an element of Fq2.
+/*!
+\param[out] result the negative of the element.
+\param[in] in the element to negate.
+*/
+void Fq2Neg(Fq2Elem* result, Fq2Elem const* in);
+
+/// Calculate the conjugate of an element of Fq2.
+/*!
+\param[out] result the conjugate of the element.
+\param[in] in the element.
+*/
+void Fq2Conj(Fq2Elem* result, Fq2Elem const* in);
+
+/// Square an element of Fq2.
+/*!
+\param[out] result the square of the element.
+\param[in] in the element to square.
+*/
+void Fq2Square(Fq2Elem* result, Fq2Elem const* in);
+
+/// Multiply an element of Fq2 by and element of Fq.
+/*!
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void Fq2MulScalar(Fq2Elem* result, Fq2Elem const* left, FqElem const* right);
+
+/// Conditionally Set an element's value to one of two values.
+/*!
+\param[out] result target.
+\param[in] true_val value to set if condition is true.
+\param[in] false_val value to set if condition is false.
+\param[in] truth_val value of condition.
+*/
+void Fq2CondSet(Fq2Elem* result, Fq2Elem const* true_val,
+ Fq2Elem const* false_val, int truth_val);
+
+/// Test if two elements in Fq2 are equal
+/*!
+\param[in] left The first operand to be tested.
+\param[in] right The second operand to be tested.
+\returns A value different from zero (i.e., true) if indeed
+ the values are equal. Zero (i.e., false) otherwise.
+*/
+int Fq2Eq(Fq2Elem const* left, Fq2Elem const* right);
+
+/// Multiply an element of Fq2 by xi.
+/*!
+This function was formerly called as Fq2Const.
+
+\param[out] result of multiplying in by xi.
+\param[in] in The first operand to be multiplied.
+
+*/
+void Fq2MulXi(Fq2Elem* result, Fq2Elem const* in);
+
+/// Test if an element is zero.
+/*!
+\param[in] value the element to test.
+\returns A value different from zero (i.e., true) if indeed
+ the value is zero. Zero (i.e., false) otherwise.
+*/
+int Fq2IsZero(Fq2Elem const* value);
+
+#endif // EPID_MEMBER_TINY_MATH_FQ2_H_
diff --git a/epid/member/tiny/math/fq6.h b/epid/member/tiny/math/fq6.h
new file mode 100644
index 0000000..72901dd
--- /dev/null
+++ b/epid/member/tiny/math/fq6.h
@@ -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.
+############################################################################*/
+/// Definition of Fq6 math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_FQ6_H_
+#define EPID_MEMBER_TINY_MATH_FQ6_H_
+#include <stdint.h>
+
+/// \cond
+typedef struct Fq2Elem Fq2Elem;
+typedef struct Fq6Elem Fq6Elem;
+/// \endcond
+
+/// Add two elements of Fq6.
+/*!
+\param[out] result of adding left and right.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+*/
+void Fq6Add(Fq6Elem* result, Fq6Elem const* left, Fq6Elem const* right);
+
+/// Subtract two elements of Fq6.
+/*!
+\param[out] result of subtracting left from right.
+\param[in] left The operand to be subtracted from.
+\param[in] right The operand to subtract.
+*/
+void Fq6Sub(Fq6Elem* result, Fq6Elem const* left, Fq6Elem const* right);
+
+/// Multiply two elements of Fq6.
+/*!
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void Fq6Mul(Fq6Elem* result, Fq6Elem const* left, Fq6Elem const* right);
+
+/// Invert an element of Fq6.
+/*!
+\param[out] result the inverse of the element.
+\param[in] in the element to invert.
+*/
+void Fq6Inv(Fq6Elem* result, Fq6Elem const* in);
+
+/// Negate an element of Fq6.
+/*!
+\param[out] result the negative of the element.
+\param[in] in the element to negate.
+*/
+void Fq6Neg(Fq6Elem* result, Fq6Elem const* in);
+
+/// Clear an element's value.
+/*!
+\param[out] result element to clear.
+*/
+void Fq6Clear(Fq6Elem* result);
+
+/// Multiply an element of Fq6 by and element of Fq2.
+/*!
+\param[out] result of multiplying left and right.
+\param[in] in The first operand to be multiplied.
+\param[in] scalar The second operand to be multiplied.
+*/
+void Fq6MulScalar(Fq6Elem* result, Fq6Elem const* in, Fq2Elem const* scalar);
+
+/// Multiply an element of Fq6 by V.
+/*!
+This function was formerly called as Fq2Const.
+
+\param[out] result of multiplying in and V.
+\param[in] in The first operand to be multiplied.
+*/
+void Fq6MulV(Fq6Elem* result, Fq6Elem const* in);
+
+/// Test if two elements in Fq6 are equal
+/*!
+\param[in] left The first operand to be tested.
+\param[in] right The second operand to be tested.
+\returns A value different from zero (i.e., true) if indeed
+ the values are equal. Zero (i.e., false) otherwise.
+*/
+int Fq6Eq(Fq6Elem const* left, Fq6Elem const* right);
+
+/// Test if an element is zero.
+/*!
+\param[in] in the element to test.
+\returns A value different from zero (i.e., true) if indeed
+ the value is zero. Zero (i.e., false) otherwise.
+*/
+int Fq6IsZero(Fq6Elem const* in);
+
+/// Square an element of Fq6.
+/*!
+\param[out] result the square of the element.
+\param[in] in the element to square.
+*/
+void Fq6Square(Fq6Elem* result, Fq6Elem const* in);
+
+/// Copy an element's value
+/*!
+\param[out] result copy target.
+\param[in] in copy source.
+*/
+void Fq6Cp(Fq6Elem* result, Fq6Elem const* in);
+
+/// Conditionally Set an element's value to one of two values.
+/*!
+\param[out] result target.
+\param[in] true_val value to set if condition is true.
+\param[in] false_val value to set if condition is false.
+\param[in] truth_val value of condition.
+*/
+void Fq6CondSet(Fq6Elem* result, Fq6Elem const* true_val,
+ Fq6Elem const* false_val, int truth_val);
+
+/// Set an element's value.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+*/
+void Fq6Set(Fq6Elem* result, uint32_t in);
+
+#endif // EPID_MEMBER_TINY_MATH_FQ6_H_
diff --git a/epid/member/tiny/math/hashwrap.h b/epid/member/tiny/math/hashwrap.h
new file mode 100644
index 0000000..bbba01a
--- /dev/null
+++ b/epid/member/tiny/math/hashwrap.h
@@ -0,0 +1,109 @@
+/*############################################################################
+# 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_TINY_MATH_HASHWRAP_H_
+#define EPID_MEMBER_TINY_MATH_HASHWRAP_H_
+/// Decleration of hash wrap function
+/*! \file */
+#include <stddef.h>
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/mathtypes.h"
+
+#define SHA512_SUPPORT
+#define SHA256_SUPPORT
+
+#ifdef SHA512_SUPPORT
+#include "epid/member/tiny/math/sha512.h"
+#endif
+
+#ifdef SHA256_SUPPORT
+#include "epid/member/tiny/math/sha256.h"
+#endif
+
+/// Sha Digest Element
+typedef union sha_digest {
+#ifdef SHA512_SUPPORT
+ uint8_t sha512_digest[SHA512_DIGEST_SIZE]; ///< Support digest for sha512
+#endif
+#ifdef SHA256_SUPPORT
+ uint8_t sha256_digest[SHA256_DIGEST_SIZE]; ///< Support digest for sha256
+#endif
+ uint8_t digest[1]; ///< Pointer to digest
+} sha_digest;
+
+/// Tiny Sha wrapper Element
+typedef struct tiny_sha {
+ union {
+#ifdef SHA512_SUPPORT
+ sha512_state sha512s; ///< The state of sha512 if supported
+#endif
+#ifdef SHA256_SUPPORT
+ sha256_state sha256s; ///< The state of sha256 if supported
+#endif
+ } sha_state_t; ///< Store state of hash algorithm
+ HashAlg hash_alg; ///< The hash algorithem which selected
+} tiny_sha;
+
+/// Initializes the hash state
+/*!
+
+\param[in] sha_type
+Type of hash algorithm
+
+\param[in,out] s
+The hash state to initialize.
+*/
+void tinysha_init(HashAlg sha_type, tiny_sha* s);
+
+/// Hashes data into state using a chosen hash algorithm
+/*!
+
+\param[in,out] s
+The hash state. Must be non-null or behavior is undefined.
+
+\param[in] data
+The data to hash into s.
+
+\param[in] data_length
+The size of data in bytes.
+
+
+*/
+void tinysha_update(tiny_sha* s, void const* data, size_t data_length);
+
+/// Computes the hash algorithm in the digest buffer
+/*!
+
+\param[out] digest
+The computed digest. Must be non-null or behavior is undefined.
+
+\param[in] s
+The hash state. Must be non-null or behavior is undefined.
+*/
+void tinysha_final(unsigned char* digest, tiny_sha* s);
+
+/// Returns size of digest depending on hash algorithm
+/*!
+
+\param[in] s
+The hash state. Must be non-null or behavior is undefined.
+
+\returns
+Size of digest
+
+*/
+size_t tinysha_digest_size(tiny_sha* s);
+
+#endif // EPID_MEMBER_TINY_MATH_HASHWRAP_H_
diff --git a/epid/member/tiny/math/math.parts b/epid/member/tiny/math/math.parts
new file mode 100644
index 0000000..ff17e73
--- /dev/null
+++ b/epid/member/tiny/math/math.parts
@@ -0,0 +1,51 @@
+# pylint:disable=I0011,W0401,W0614,C0103,E0602
+############################################################################
+# 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.
+############################################################################
+"""Build configuration for tiny math library.
+"""
+Import('*')
+env.PartName('math')
+
+env.DependsOn([
+ Component('member.tiny_stdlib'),
+ Component('tinycommon', requires=REQ.HEADERS)
+])
+
+include_files = Pattern(src_dir='.',
+ includes=['*.h'],
+ recursive=False).files()
+
+src_files = Pattern(src_dir='src',
+ includes=['*.c'],
+ recursive=False).files()
+
+env.Append(CPPPATH='#')
+
+outputs = env.Library('${PART_SHORT_NAME}', src_files)
+
+sdk_outs = env.Sdk(outputs)
+env.SdkInclude(include_files, sub_dir='${PART_SHORT_NAME}')
+
+if 'install_lib' in env['MODE'] and 'shared' not in env['MODE']:
+ env.InstallLib(outputs)
+
+is_utest_build = False
+for i in BUILD_TARGETS:
+ if "utest::" in str(i):
+ is_utest_build = True
+if is_utest_build:
+ env.Part(parts_file='unittests/utest.parts',
+ CONFIG=DefaultEnvironment().subst('$CONFIG'))
diff --git a/epid/member/tiny/math/mathdefs.h b/epid/member/tiny/math/mathdefs.h
new file mode 100644
index 0000000..0331cf9
--- /dev/null
+++ b/epid/member/tiny/math/mathdefs.h
@@ -0,0 +1,27 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Common public definitions for math headers
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_MATHDEFS_H_
+#define EPID_MEMBER_TINY_MATH_MATHDEFS_H_
+
+/// Return code representing failure of math function
+#define MATH_FAIL 0
+/// Return code representing success of math function
+#define MATH_SUCCESS 1
+
+#endif // EPID_MEMBER_TINY_MATH_MATHDEFS_H_
diff --git a/epid/member/tiny/math/mathtypes.h b/epid/member/tiny/math/mathtypes.h
new file mode 100644
index 0000000..5ea1a49
--- /dev/null
+++ b/epid/member/tiny/math/mathtypes.h
@@ -0,0 +1,101 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of math types in tiny Intel(R) EPID.
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_MATHTYPES_H_
+#define EPID_MEMBER_TINY_MATH_MATHTYPES_H_
+
+/// number of 32bit words in a very large integer
+#define NUM_ECC_DIGITS 8
+
+#include <stdint.h>
+
+/// Large integer.
+/*!
+VeryLargeInt* is always expected to point to a buffer
+with NUM_ECC_DIGITS uint32_t sized words.
+*/
+typedef struct VeryLargeInt {
+ uint32_t word[NUM_ECC_DIGITS]; ///< Large integer data
+} VeryLargeInt;
+
+/// Used for multiplication
+typedef struct VeryLargeIntProduct {
+ uint32_t word[2 * NUM_ECC_DIGITS]; ///< Large integer data
+} VeryLargeIntProduct;
+
+/// Element of Fp.
+typedef struct FpElem {
+ VeryLargeInt limbs; ///< An integer in [0, p-1]
+} FpElem;
+
+/// Element of Fq.
+typedef struct FqElem {
+ VeryLargeInt limbs; ///< An integer in [0, q-1]
+} FqElem;
+
+/// Element of Fq2.
+typedef struct Fq2Elem {
+ FqElem x0; ///< A coefficent in Fq
+ FqElem x1; ///< A coefficent in Fq
+} Fq2Elem;
+
+/// Point in EFq.
+typedef struct EccPointFq {
+ FqElem x; ///< x coordinate
+ FqElem y; ///< y coordinate
+} EccPointFq;
+
+/// Point in EFq2.
+typedef struct EccPointFq2 {
+ Fq2Elem x; ///< x coordinate
+ Fq2Elem y; ///< y coordinate
+} EccPointFq2;
+
+/// Element of Fq6.
+typedef struct Fq6Elem {
+ Fq2Elem y0; ///< A coefficent in Fq2
+ Fq2Elem y1; ///< A coefficent in Fq2
+ Fq2Elem y2; ///< A coefficent in Fq2
+} Fq6Elem;
+
+/// Element of Fq12.
+typedef struct Fq12Elem {
+ Fq6Elem z0; ///< A coefficent in Fq6
+ Fq6Elem z1; ///< A coefficent in Fq6
+} Fq12Elem;
+
+/// Element of EFq in Jacobi format.
+typedef struct EccPointJacobiFq {
+ FqElem X; ///< x coordinate
+ FqElem Y; ///< y coordinate
+ FqElem Z; ///< z coordinate
+} EccPointJacobiFq;
+
+/// Element of EFq2 in Jacobi format.
+typedef struct EccPointJacobiFq2 {
+ Fq2Elem X; ///< x coordinate
+ Fq2Elem Y; ///< y coordinate
+ Fq2Elem Z; ///< z coordinate
+} EccPointJacobiFq2;
+
+/// A scratch buffer for stateful pairing calls.
+typedef struct PairingState {
+ Fq2Elem g[3][5]; ///< pairing scratch data
+} PairingState;
+
+#endif // EPID_MEMBER_TINY_MATH_MATHTYPES_H_
diff --git a/epid/member/tiny/math/pairing.h b/epid/member/tiny/math/pairing.h
new file mode 100644
index 0000000..a8a6de6
--- /dev/null
+++ b/epid/member/tiny/math/pairing.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.
+ ############################################################################*/
+/// Definition of pairing math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_PAIRING_H_
+#define EPID_MEMBER_TINY_MATH_PAIRING_H_
+/*!
+ * \file
+ * \brief Tiny portable implementations of standard library functions
+ */
+/// \cond
+typedef struct Fq12Elem Fq12Elem;
+typedef struct EccPointFq EccPointFq;
+typedef struct EccPointFq2 EccPointFq2;
+typedef struct PairingState PairingState;
+/// \endcond
+
+/// Initializes pairing environment.
+/*!
+\param[out] state pairing state information.
+*/
+void PairingInit(PairingState* state);
+
+/// Computes a pairing according to the Optimal Ate pairing computation
+/*!
+\param[out] d target, an element in GT.
+\param[in] P an element in G1.
+\param[in] Q an element in G2.
+\param[in,out] state pairing state information.
+*/
+void PairingCompute(Fq12Elem* d, EccPointFq const* P, EccPointFq2 const* Q,
+ PairingState const* state);
+
+#endif // EPID_MEMBER_TINY_MATH_PAIRING_H_
diff --git a/epid/member/tiny/math/serialize.h b/epid/member/tiny/math/serialize.h
new file mode 100644
index 0000000..6008f3c
--- /dev/null
+++ b/epid/member/tiny/math/serialize.h
@@ -0,0 +1,183 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of de/serialize functionality.
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_SERIALIZE_H_
+#define EPID_MEMBER_TINY_MATH_SERIALIZE_H_
+#include <stddef.h>
+#include <stdint.h>
+
+/// \cond
+typedef struct OctStr32 OctStr32;
+
+typedef struct VeryLargeInt VeryLargeInt;
+typedef struct BigNumStr BigNumStr;
+
+typedef struct FqElem FqElem;
+typedef struct FqElemStr FqElemStr;
+
+typedef struct FpElem FpElem;
+typedef struct FpElemStr FpElemStr;
+
+typedef struct EccPointFq EccPointFq;
+typedef struct G1ElemStr G1ElemStr;
+
+typedef struct EccPointFq2 EccPointFq2;
+typedef struct G2ElemStr G2ElemStr;
+
+typedef struct Fq12Elem Fq12Elem;
+typedef struct Fq12ElemStr Fq12ElemStr;
+/// \endcond
+
+#if !defined(UNOPTIMIZED_SERIALIZATION)
+
+/// Serialize or deserailize a sequence of math objects
+/*!
+Converts layouts between native and portable or between portable and
+native of the following types: VeryLargeInt and BigNumStr,
+FqElem and FqElemStr, FpElem and FpElemStr, EccPointFq and G1ElemStr,
+Fq12Elem and Fq12ElemStr.
+
+If input contain multiple values of supported types all will be converted.
+
+\note The following types are not supported: VeryLargeIntProduct.
+
+\note This function have the assumptions that the input structures are packed
+such that consequent 32 byte fields would have no gap in between.
+
+\param[out] dest target buffer
+\param [in] dest_size size of dest buffer
+\param [in] src source data
+\param [in] src_size size of src buffer
+*/
+void SwapNativeAndPortableLayout(void* dest, size_t dest_size, void const* src,
+ size_t src_size);
+#endif // !defined(UNOPTIMIZED_SERIALIZATION)
+
+/// Write a uint32_t to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data written to dest
+*/
+void* Uint32Serialize(OctStr32* dest, uint32_t src);
+
+/// Read a uint32_t from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data read from to src
+*/
+void const* Uint32Deserialize(uint32_t* dest, OctStr32 const* src);
+
+/// Write a large integer to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data written to dest
+*/
+void* VliSerialize(BigNumStr* dest, VeryLargeInt const* src);
+
+/// Read a large integer from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data read from to src
+*/
+void const* VliDeserialize(VeryLargeInt* dest, BigNumStr const* src);
+
+/// Write an element of Fq to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data written to dest
+*/
+void* FqSerialize(FqElemStr* dest, FqElem const* src);
+
+/// Read an element of Fq from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data read from to src
+*/
+void const* FqDeserialize(FqElem* dest, FqElemStr const* src);
+
+/// Write an element of Fq12 to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data written to dest
+*/
+void* Fq12Serialize(Fq12ElemStr* dest, Fq12Elem const* src);
+
+/// Read an element of Fq12 from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data read from to src
+*/
+void const* Fq12Deserialize(Fq12Elem* dest, Fq12ElemStr const* src);
+
+/// Write an element of Fp to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data written to dest
+*/
+void* FpSerialize(FpElemStr* dest, FpElem const* src);
+
+/// Read an element of Fp from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data read from to src
+*/
+void const* FpDeserialize(FpElem* dest, FpElemStr const* src);
+
+/// Write a point on EFq to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data written to dest
+*/
+void* EFqSerialize(G1ElemStr* dest, EccPointFq const* src);
+
+/// Read a point on EFq from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data read from to src
+*/
+void const* EFqDeserialize(EccPointFq* dest, G1ElemStr const* src);
+
+/// Write a point on EFq2 to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data written to dest
+*/
+void* EFq2Serialize(G2ElemStr* dest, EccPointFq2 const* src);
+
+/// Read a point on EFq2 from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\returns pointer to next byte after final data read from to src
+*/
+void const* EFq2Deserialize(EccPointFq2* dest, G2ElemStr const* src);
+
+#endif // EPID_MEMBER_TINY_MATH_SERIALIZE_H_
diff --git a/epid/member/tiny/math/sha256.h b/epid/member/tiny/math/sha256.h
new file mode 100644
index 0000000..0c1e7cc
--- /dev/null
+++ b/epid/member/tiny/math/sha256.h
@@ -0,0 +1,133 @@
+/*############################################################################
+# 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 (C) 2017 by Intel Corporation, 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 Intel Corporation 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.
+ */
+
+/**
+ * @file
+ * @brief Interface to a SHA-256 implementation.
+ *
+ * Overview: SHA-256 is a NIST approved cryptographic hashing algorithm
+ * specified in FIPS 180. A hash algorithm maps data of arbitrary
+ * size to data of fixed length.
+ *
+ * Security: SHA-256 provides 128 bits of security against collision attacks
+ * and 256 bits of security against pre-image attacks. SHA-256 does
+ * NOT behave like a random oracle, but it can be used as one if
+ * the string being hashed is prefix-free encoded before hashing.
+ *
+ * Usage: 1) call tc_sha256_init to initialize a struct
+ * tc_sha256_state_struct before hashing a new string.
+ *
+ * 2) call tc_sha256_update to hash the next string segment;
+ * tc_sha256_update can be called as many times as needed to hash
+ * all of the segments of a string; the order is important.
+ *
+ * 3) call tc_sha256_final to out put the digest from a hashing
+ * operation.
+ */
+
+#ifndef EPID_MEMBER_TINY_MATH_SHA256_H_
+#define EPID_MEMBER_TINY_MATH_SHA256_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+/// Block size
+#define SHA256_BLOCK_SIZE (64)
+/// Digest size
+#define SHA256_DIGEST_SIZE (32)
+/// Number of blocks in state
+#define SHA256_STATE_BLOCKS (SHA256_DIGEST_SIZE / 4)
+
+/// The SHA state
+/// \cond
+typedef struct sha256_state {
+ unsigned int iv[SHA256_STATE_BLOCKS];
+ uint64_t bits_hashed;
+ uint8_t leftover[SHA256_BLOCK_SIZE];
+ size_t leftover_offset;
+} sha256_state;
+/// \endcond
+
+/**
+ * @brief SHA256 initialization procedure
+ * Initializes s
+ * @param s Sha256 state struct
+ */
+void tc_sha256_init(sha256_state* s);
+
+/**
+ * @brief SHA256 update procedure
+ * Hashes data_length bytes addressed by data into state s
+
+ * @note Assumes s has been initialized by tc_sha256_init
+ * @warning The state buffer 'leftover' is left in memory after processing
+ * If your application intends to have sensitive data in this
+ * buffer, remind to erase it after the data has been processed
+ * @param s Sha256 state struct
+ * @param data message to hash
+ * @param datalen length of message to hash
+ */
+void tc_sha256_update(sha256_state* s, const uint8_t* data, size_t datalen);
+
+/**
+ * @brief SHA256 final procedure
+ * Inserts the completed hash computation into digest
+ * @return returns 1
+ * returns 0 if:
+ * s == NULL,
+ * s->iv == NULL,
+ * digest == NULL
+ * @note Assumes: s has been initialized by tc_sha256_init
+ * digest points to at least SHA256_DIGEST_SIZE bytes
+ * @warning The state buffer 'leftover' is left in memory after processing
+ * If your application intends to have sensitive data in this
+ * buffer, remind to erase it after the data has been processed
+ * @param digest unsigned eight bit integer
+ * @param s Sha256 state struct
+ */
+void tc_sha256_final(uint8_t* digest, sha256_state* s);
+
+#endif // EPID_MEMBER_TINY_MATH_SHA256_H_
diff --git a/epid/member/tiny/math/sha512.h b/epid/member/tiny/math/sha512.h
new file mode 100644
index 0000000..8aa152b
--- /dev/null
+++ b/epid/member/tiny/math/sha512.h
@@ -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.
+############################################################################*/
+/// Interface to a SHA-512 implementation.
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_SHA512_H_
+#define EPID_MEMBER_TINY_MATH_SHA512_H_
+
+#include <stddef.h>
+#include <stdint.h>
+
+/// block size
+#define SHA512_BLOCK_SIZE (128)
+/// digest size
+#define SHA512_DIGEST_SIZE (64)
+/// number of words in SHA state
+#define SHA512_DIGEST_WORDS (8)
+
+/// The SHA state
+/// \cond
+typedef struct sha512_state {
+ uint64_t iv[SHA512_DIGEST_WORDS];
+ uint64_t bits_hashed_low;
+ uint64_t bits_hashed_high;
+ unsigned char leftover[SHA512_BLOCK_SIZE];
+ unsigned int leftover_offset;
+} sha512_state;
+/// \endcond
+
+/// Initializes the hash state
+/*!
+
+ \param[in,out] s
+ The hash state to initialize.
+ */
+void tinysha512_init(sha512_state* s);
+
+/// Hashes data into state using SHA-512
+/*!
+
+ \warning
+ The state buffer 'leftover' is left in memory after processing. If
+ your application intends to have sensitive data in this buffer,
+ remember to erase it after the data has been processed
+
+ \param[in,out] s
+ The hash state. Must be non-null or behavior is undefined.
+
+ \param[in] data
+ The data to hash into s.
+
+ \param[in] data_length
+ The size of data in bytes.
+ */
+void tinysha512_update(sha512_state* s, void const* data, size_t data_length);
+
+/// Computes the SHA-512 hash in the digest buffer
+/*!
+
+ \note Assumes SHA512_DIGEST_SIZE bytes are available to accept the
+ digest.
+
+ \warning
+ The state buffer 'leftover' is left in memory after processing. If
+ your application intends to have sensitive data in this buffer,
+ remember to erase it after the data has been processed
+
+ \param[out] digest
+ The computed digest. Must be non-null or behavior is undefined.
+
+ \param[in] s
+ The hash state. Must be non-null or behavior is undefined.
+ */
+void tinysha512_final(unsigned char* digest, sha512_state* s);
+
+#endif // EPID_MEMBER_TINY_MATH_SHA512_H_
diff --git a/epid/member/tiny/math/src/efq.c b/epid/member/tiny/math/src/efq.c
new file mode 100644
index 0000000..90867dc
--- /dev/null
+++ b/epid/member/tiny/math/src/efq.c
@@ -0,0 +1,412 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Implementation of EFq math
+/*! \file */
+
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/fq.h"
+#include "epid/member/tiny/math/hashwrap.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/math/vli.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static int EFqMakePoint(EccPointFq* output, FqElem* in) {
+ FqElem fq_sqrt = {0};
+ FqElem fq_tmp = {0};
+ FqSet(&fq_tmp, 3);
+ FqSquare(&fq_sqrt, in);
+ FqMul(&fq_sqrt, &fq_sqrt, in);
+ FqAdd(&fq_sqrt, &fq_sqrt, &fq_tmp);
+ if (!FqSqrt(&output->y, &fq_sqrt)) {
+ return 0;
+ }
+ FqCp(&output->x, in);
+
+ return 1;
+}
+
+void EFqMulSSCM(EccPointJacobiFq* result, EccPointJacobiFq const* base,
+ FpElem const* exp) {
+ EccPointJacobiFq efqj_1;
+ EccPointJacobiFq efqj_2;
+
+ uint32_t position;
+ EFqInf(&efqj_1);
+ EFqJCp(&efqj_2, base);
+ for (position = 32 * NUM_ECC_DIGITS; position > 0; --position) {
+ EFqDbl(&efqj_1, &efqj_1);
+ EFqAdd(&efqj_2, base, &efqj_1);
+ EFqCondSet(&efqj_1, &efqj_2, &efqj_1,
+ VliTestBit(&(exp->limbs), position - 1));
+ }
+ EFqJCp(result, &efqj_1);
+}
+
+int EFqAffineExp(EccPointFq* result, EccPointFq const* base,
+ FpElem const* exp) {
+ EccPointJacobiFq efqj;
+ EFqFromAffine(&efqj, base);
+ EFqMulSSCM(&efqj, &efqj, exp);
+ return EFqToAffine(result, &efqj);
+}
+
+int EFqAffineMultiExp(EccPointFq* result, EccPointFq const* base0,
+ FpElem const* exp0, EccPointFq const* base1,
+ FpElem const* exp1) {
+ EccPointJacobiFq efqj_base0;
+ EccPointJacobiFq efqj_base1;
+ EFqFromAffine(&efqj_base0, base0);
+ EFqFromAffine(&efqj_base1, base1);
+ EFqMultiExp(&efqj_base0, &efqj_base0, exp0, &efqj_base1, exp1);
+ return EFqToAffine(result, &efqj_base0);
+}
+
+void EFqMultiExp(EccPointJacobiFq* result, EccPointJacobiFq const* base0,
+ FpElem const* exp0, EccPointJacobiFq const* base1,
+ FpElem const* exp1) {
+ EccPointJacobiFq efqj_base0;
+ EccPointJacobiFq efqj_a;
+ EccPointJacobiFq efqj_b;
+ int i, j;
+
+ EFqAdd(&efqj_base0, base0, base1);
+ EFqInf(&efqj_a);
+ for (i = NUM_ECC_DIGITS - 1; i >= 0; i--) {
+ for (j = 31; j >= 0; j--) {
+ EFqAdd(&efqj_a, &efqj_a, &efqj_a);
+ EFqInf(&efqj_b);
+ EFqJCp(&efqj_b, base0);
+
+ EFqCondSet(&efqj_b, base1, &efqj_b,
+ (int)((exp1->limbs.word[i] >> j) & (0x1)));
+
+ EFqCondSet(&efqj_b, &efqj_base0, &efqj_b,
+ (int)((exp0->limbs.word[i] >> j) & (exp1->limbs.word[i] >> j) &
+ (0x1)));
+
+ EFqAdd(&efqj_b, &efqj_a, &efqj_b);
+
+ EFqCondSet(&efqj_a, &efqj_b, &efqj_a, (int)(((exp0->limbs.word[i] >> j) |
+ (exp1->limbs.word[i] >> j)) &
+ (0x1)));
+ }
+ }
+ EFqJCp(result, &efqj_a);
+}
+
+int EFqAffineAdd(EccPointFq* result, EccPointFq const* left,
+ EccPointFq const* right) {
+ EccPointJacobiFq efqj_a;
+ EccPointJacobiFq efqj_b;
+ if (EFqEqAffine(left, right)) return EFqAffineDbl(result, left);
+
+ EFqFromAffine(&efqj_a, left);
+ EFqFromAffine(&efqj_b, right);
+ EFqAdd(&efqj_a, &efqj_a, &efqj_b);
+
+ return EFqToAffine(result, &efqj_a);
+}
+
+int EFqAffineDbl(EccPointFq* result, EccPointFq const* in) {
+ EccPointJacobiFq efqj_a;
+ EFqFromAffine(&efqj_a, in);
+ EFqAdd(&efqj_a, &efqj_a, &efqj_a);
+
+ return EFqToAffine(result, &efqj_a);
+}
+
+void EFqDbl(EccPointJacobiFq* result, EccPointJacobiFq const* in) {
+ FqElem fq_a;
+ FqElem fq_b;
+
+ FqAdd(&(result->Z), &(in->Z), &(in->Z));
+ FqMul(&(result->Z), &(result->Z), &(in->Y));
+ FqSquare(&fq_a, &(in->X));
+ FqAdd(&fq_b, &fq_a, &fq_a);
+ FqAdd(&fq_b, &fq_b, &fq_a);
+ FqSquare(&fq_a, &(in->Y));
+ FqAdd(&fq_a, &fq_a, &fq_a);
+ FqSquare(&(result->Y), &fq_a);
+ FqAdd(&(result->Y), &(result->Y), &(result->Y));
+ FqAdd(&fq_a, &fq_a, &fq_a);
+ FqMul(&fq_a, &fq_a, &(in->X));
+ FqSquare(&(result->X), &fq_b);
+ FqSub(&(result->X), &(result->X), &fq_a);
+ FqSub(&(result->X), &(result->X), &fq_a);
+ FqSub(&fq_a, &fq_a, &(result->X));
+ FqMul(&fq_a, &fq_a, &fq_b);
+ FqSub(&(result->Y), &fq_a, &(result->Y));
+}
+
+void EFqAdd(EccPointJacobiFq* result, EccPointJacobiFq const* left,
+ EccPointJacobiFq const* right) {
+ FqElem fq0;
+ FqElem fq1;
+ FqElem fq2;
+ FqElem fq3;
+ FqElem fq4;
+ FqElem fq5;
+
+ if (FqIsZero(&(left->Z))) {
+ EFqJCp(result, right);
+ return;
+ }
+ if (FqIsZero(&(right->Z))) {
+ EFqJCp(result, left);
+ return;
+ }
+
+ FqSquare(&fq2, &(right->Z));
+ FqSquare(&fq3, &(left->Z));
+ // P.X * Q.Z^2
+ FqMul(&fq0, &(left->X), &fq2);
+ // Q.X * P.Z^2
+ FqMul(&fq1, &(right->X), &fq3);
+ // Q.X*P.Z^2 - P*X+Q*Z^2
+ FqSub(&fq5, &fq1, &fq0);
+ FqMul(&fq3, &(right->Y), &fq3);
+ // P.Y * Q.Z^3
+ FqMul(&fq3, &(left->Z), &fq3);
+ FqMul(&fq2, &(left->Y), &fq2);
+ // Q.Y * P.Z^3
+ FqMul(&fq2, &(right->Z), &fq2);
+ FqSub(&fq4, &fq3, &fq2);
+
+ if (FqIsZero(&fq5)) {
+ if (FqIsZero(&fq4)) {
+ EFqDbl(result, left);
+ return;
+ } else {
+ EFqInf(result);
+ return;
+ }
+ }
+ FqMul(&(result->Z), &(left->Z), &(right->Z));
+ FqMul(&(result->Z), &(result->Z), &fq5);
+ // Q.X*P.Z^2 + P*X+Q*Z^2
+ FqAdd(&fq1, &fq0, &fq1);
+ FqMul(&fq2, &fq2, &fq5);
+ FqSquare(&fq5, &fq5);
+ FqMul(&fq1, &fq1, &fq5);
+ FqSquare(&(result->X), &fq4);
+ FqSub(&(result->X), &(result->X), &fq1);
+ FqMul(&fq2, &fq2, &fq5);
+ FqMul(&fq0, &fq0, &fq5);
+ FqSub(&fq0, &fq0, &(result->X));
+ FqMul(&(result->Y), &fq4, &fq0);
+ FqSub(&(result->Y), &(result->Y), &fq2);
+}
+
+int EFqRand(EccPointFq* result, BitSupplier rnd_func, void* rnd_param) {
+ FqElem fq;
+ do {
+ if (!FqRand(&fq, rnd_func, rnd_param)) {
+ return 0;
+ }
+ } while (!EFqMakePoint(result, &fq));
+ return 1;
+}
+
+void EFqSet(EccPointJacobiFq* result, FqElem const* x, FqElem const* y) {
+ FqCp(&result->X, x);
+ FqCp(&result->Y, y);
+ FqSet(&result->Z, 1);
+}
+
+int EFqIsInf(EccPointJacobiFq const* in) {
+ return FqIsZero(&in->X) && FqIsZero(&in->Z) && (!FqIsZero(&in->Y));
+}
+
+void EFqFromAffine(EccPointJacobiFq* result, EccPointFq const* in) {
+ FqCp(&result->X, &in->x);
+ FqCp(&result->Y, &in->y);
+ FqSet(&result->Z, 1);
+}
+
+int EFqToAffine(EccPointFq* result, EccPointJacobiFq const* in) {
+ FqElem fq_inv;
+ if (EFqIsInf(in)) {
+ return 0;
+ }
+ FqInv(&fq_inv, &in->Z);
+ FqMul(&result->x, &in->X, &fq_inv);
+ FqMul(&result->x, &result->x, &fq_inv);
+ FqMul(&result->y, &in->Y, &fq_inv);
+ FqMul(&result->y, &result->y, &fq_inv);
+ FqMul(&result->y, &result->y, &fq_inv);
+
+ return 1;
+}
+
+void EFqNeg(EccPointJacobiFq* result, EccPointJacobiFq const* in) {
+ FqCp(&result->X, &in->X);
+ FqNeg(&result->Y, &in->Y);
+ FqCp(&result->Z, &in->Z);
+}
+
+int EFqEq(EccPointJacobiFq const* left, EccPointJacobiFq const* right) {
+ FqElem fq1;
+ FqElem fq2;
+ FqElem fq3;
+ FqElem fq4;
+ if (EFqIsInf(left) && EFqIsInf(right)) {
+ return 1;
+ }
+ if (EFqIsInf(left) || EFqIsInf(right)) {
+ return 0;
+ }
+ // Z1^2
+ FqSquare(&fq1, &left->Z);
+ // Z2^2
+ FqSquare(&fq2, &right->Z);
+ // (Z1^2)*X2
+ FqMul(&fq3, &fq1, &right->X);
+ // (Z2^2)*X1
+ FqMul(&fq4, &fq2, &left->X);
+ // Z1^3
+ FqMul(&fq1, &fq1, &left->Z);
+ // Z2^3
+ FqMul(&fq2, &fq2, &right->Z);
+ // (Z1^3)*Y2
+ FqMul(&fq1, &fq1, &right->Y);
+ // (Z2^3)*Y1
+ FqMul(&fq2, &fq2, &left->Y);
+ // (Z1^2)*X2 == (Z2^2)*X1 && (Z1^3)*Y2 == (Z2^3)*Y1
+ return FqEq(&fq1, &fq2) && FqEq(&fq3, &fq4);
+}
+
+int EFqHash(EccPointFq* result, unsigned char const* msg, size_t len,
+ HashAlg hashalg) {
+ tiny_sha hash_context;
+ FqElem three;
+ FqElem tmp;
+ uint32_t hash_salt = 0;
+ uint32_t buf = 0;
+ sha_digest hash_buf;
+ // 1/q in Fq
+ FqElem montgomery_r = {
+ 0x512ccfed, 0x2cd6d224, 0xed67f57d, 0xf3239a04,
+ 0x118e5b60, 0xb91a0da1, 0x00030f32, 0,
+ };
+ if ((kSha512 != hashalg) && (kSha256 != hashalg)) {
+ return 0;
+ }
+ FqSet(&three, 3);
+
+ for (hash_salt = 0; hash_salt < 0xFFFFFFFF; ++hash_salt) {
+ tinysha_init(hashalg, &hash_context);
+
+ Uint32Serialize((OctStr32*)&buf, hash_salt);
+ tinysha_update(&hash_context, &buf, sizeof(buf));
+ tinysha_update(&hash_context, msg, len);
+
+ tinysha_final(hash_buf.digest, &hash_context);
+
+ FqFromHash(&result->x, hash_buf.digest, tinysha_digest_size(&hash_context));
+ FqSquare(&tmp, &result->x);
+ FqMul(&tmp, &tmp, &result->x);
+ FqAdd(&tmp, &tmp, &three);
+ if (FqSqrt(&result->y, &tmp)) {
+ FqNeg(&tmp, &result->y);
+ // Verify and Non-tiny member use montgomery representation to determine
+ // if negation is needed: this is to be compatible with them
+ FqMul(&montgomery_r, &result->y, &montgomery_r);
+ FqCondSet(&result->y, &tmp, &result->y, montgomery_r.limbs.word[0] & 1);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void EFqCp(EccPointFq* result, EccPointFq const* in) {
+ FqCp(&result->x, &in->x);
+ FqCp(&result->y, &in->y);
+}
+
+int EFqEqAffine(EccPointFq const* left, EccPointFq const* right) {
+ return FqEq(&left->x, &right->x) && FqEq(&left->y, &right->y);
+}
+
+void EFqCondSet(EccPointJacobiFq* result, EccPointJacobiFq const* true_val,
+ EccPointJacobiFq const* false_val, int truth_val) {
+ FqCondSet(&result->X, &true_val->X, &false_val->X, truth_val);
+ FqCondSet(&result->Y, &true_val->Y, &false_val->Y, truth_val);
+ FqCondSet(&result->Z, &true_val->Z, &false_val->Z, truth_val);
+}
+
+void EFqJCp(EccPointJacobiFq* result, EccPointJacobiFq const* in) {
+ FqCp(&result->X, &in->X);
+ FqCp(&result->Y, &in->Y);
+ FqCp(&result->Z, &in->Z);
+}
+
+void EFqInf(EccPointJacobiFq* result) {
+ FqSet(&result->X, 0);
+ FqSet(&result->Y, 1);
+ FqSet(&result->Z, 0);
+}
+
+int EFqOnCurve(EccPointFq const* in) {
+ // test that Y^2 mod q == (X^3 + a*Z^4*X + b*Z^6) mod q
+ // This simplifies to: Y^2 mod q == (X^3 + 3) mod q
+ // since: Z = 1
+ // a = 0
+ // b = 3
+ FqElem t1;
+ FqElem t2;
+ FqSquare(&t1, &in->x);
+ FqMul(&t2, &in->x, &t1);
+ FqSquare(&t1, &in->y);
+ FqSub(&t1, &t1, &t2);
+ t1.limbs.word[0] -= 3; // check equal to curve b
+ // this operation will not always
+ // result in the same value as T1 - 3
+ // however it will always result in a correct
+ // value for the zero check below
+ return FqIsZero(&t1);
+}
+
+int EFqJOnCurve(EccPointJacobiFq const* in) {
+ FqElem fq1;
+ FqElem fq2;
+
+ FqSquare(&fq1, &in->Z);
+ FqSquare(&fq2, &fq1);
+ FqMul(&fq2, &fq2, &fq1); // T2 = Z^6
+ FqAdd(&fq1, &fq2, &fq2);
+ FqAdd(&fq1, &fq1, &fq2); // T1 = 3 * Z^6
+ FqSquare(&fq2, &in->X);
+ FqMul(&fq2, &fq2, &in->X); // T2 = X^3
+ FqAdd(&fq1, &fq1, &fq2); // T1 = X^3 + 3 Z^6
+ FqSquare(&fq2, &in->Y);
+ FqMul(&fq1, &fq1, &in->Z);
+ FqMul(&fq2, &fq2, &in->Z);
+ return FqEq(&fq1, &fq2); // check Y^2 = X^3 + 3 Z^6
+}
+
+int EFqJRand(EccPointJacobiFq* result, BitSupplier rnd_func, void* rnd_param) {
+ FqElem fq;
+ do {
+ if (!FqRand(&fq, rnd_func, rnd_param)) {
+ return 0;
+ }
+ } while (!EFqMakePoint((EccPointFq*)result, &fq));
+
+ FqSet(&result->Z, 1);
+
+ return 1;
+}
diff --git a/epid/member/tiny/math/src/efq2.c b/epid/member/tiny/math/src/efq2.c
new file mode 100644
index 0000000..80c66fe
--- /dev/null
+++ b/epid/member/tiny/math/src/efq2.c
@@ -0,0 +1,253 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Implementation of EFq2 math
+/*! \file */
+
+#include "epid/member/tiny/math/efq2.h"
+
+#include "epid/member/tiny/math/fq.h"
+#include "epid/member/tiny/math/fq2.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/vli.h"
+
+static void EFq2CondSet(EccPointJacobiFq2* result,
+ EccPointJacobiFq2 const* true_val,
+ EccPointJacobiFq2 const* false_val, int truth_val) {
+ Fq2CondSet(&result->X, &true_val->X, &false_val->X, truth_val);
+ Fq2CondSet(&result->Y, &true_val->Y, &false_val->Y, truth_val);
+ Fq2CondSet(&result->Z, &true_val->Z, &false_val->Z, truth_val);
+}
+
+static void EFq2Cp(EccPointJacobiFq2* result, EccPointJacobiFq2 const* in) {
+ Fq2Cp(&result->X, &in->X);
+ Fq2Cp(&result->Y, &in->Y);
+ Fq2Cp(&result->Z, &in->Z);
+}
+
+static void EFq2Inf(EccPointJacobiFq2* result) {
+ Fq2Set(&result->X, 0);
+ Fq2Set(&result->Y, 1);
+ Fq2Set(&result->Z, 0);
+}
+
+int EFq2IsInf(EccPointJacobiFq2 const* in) {
+ return Fq2IsZero(&in->X) && Fq2IsZero(&in->Z) && (!Fq2IsZero(&in->Y));
+}
+
+void EFq2FromAffine(EccPointJacobiFq2* result, EccPointFq2 const* in) {
+ Fq2Cp(&result->X, &in->x);
+ Fq2Cp(&result->Y, &in->y);
+ Fq2Set(&result->Z, 1);
+}
+
+int EFq2ToAffine(EccPointFq2* result, EccPointJacobiFq2 const* in) {
+ Fq2Elem inverted_z;
+ if (EFq2IsInf(in)) {
+ return 0;
+ }
+ Fq2Inv(&inverted_z, &in->Z);
+ Fq2Mul(&result->x, &in->X, &inverted_z);
+ Fq2Mul(&result->x, &result->x, &inverted_z);
+ Fq2Mul(&result->y, &in->Y, &inverted_z);
+ Fq2Mul(&result->y, &result->y, &inverted_z);
+ Fq2Mul(&result->y, &result->y, &inverted_z);
+ return 1;
+}
+
+void EFq2Dbl(EccPointJacobiFq2* result, EccPointJacobiFq2 const* in) {
+ Fq2Elem a;
+ Fq2Elem b;
+ // Z3 = 2Z1
+ Fq2Add(&(result->Z), &(in->Z), &(in->Z));
+ // Z3 = 2*Z1*Y1
+ Fq2Mul(&(result->Z), &(result->Z), &(in->Y));
+ // A = X1^2
+ Fq2Square(&a, &(in->X));
+ // B = 2(X1^2)
+ Fq2Add(&b, &a, &a);
+ // B = 3(X1^2)
+ Fq2Add(&b, &b, &a);
+ // A = Y1^2
+ Fq2Square(&a, &(in->Y));
+ // A = 2*(Y1^2)
+ Fq2Add(&a, &a, &a);
+ // Y3 = 4*(Y1^4)
+ Fq2Square(&(result->Y), &a);
+ // Y3 = 8*(Y1^4)
+ Fq2Add(&(result->Y), &(result->Y), &(result->Y));
+ // A = 4(Y1^2)
+ Fq2Add(&a, &a, &a);
+ // A = 4(Y1^2)*X1
+ Fq2Mul(&a, &a, &(in->X));
+ // X3 = B^2
+ Fq2Square(&(result->X), &b);
+ // X3 = (B^2) - A
+ Fq2Sub(&(result->X), &(result->X), &a);
+ // X3 = (B^2) - 2A
+ Fq2Sub(&(result->X), &(result->X), &a);
+ // A = A - X3
+ Fq2Sub(&a, &a, &(result->X));
+ // A = B*(A-X3)
+ Fq2Mul(&a, &a, &b);
+ // Y3 = B*(A-X3) - 8*(Y1^4)
+ Fq2Sub(&(result->Y), &a, &(result->Y));
+}
+
+void EFq2Add(EccPointJacobiFq2* result, EccPointJacobiFq2 const* left,
+ EccPointJacobiFq2 const* right) {
+ Fq2Elem A;
+ Fq2Elem B;
+ Fq2Elem C;
+ Fq2Elem D;
+ Fq2Elem W;
+ Fq2Elem V;
+
+ if (Fq2IsZero(&left->Z)) {
+ // If P = O, set R = Q and return
+ EFq2Cp(result, right);
+ return;
+ }
+ if (Fq2IsZero(&right->Z)) {
+ // If Q = O, set R = P and return.
+ EFq2Cp(result, left);
+ return;
+ }
+ // A = P.X * Q.Z^2
+ Fq2Square(&C, &right->Z);
+ Fq2Mul(&A, &left->X, &C);
+ // B = Q.X * P.Z^2
+ Fq2Square(&D, &left->Z);
+ Fq2Mul(&B, &right->X, &D);
+ // C = P.Y * Q.Z^3
+ Fq2Mul(&C, &right->Z, &C);
+ Fq2Mul(&C, &left->Y, &C);
+ // D = Q.Y * P.Z^3
+ Fq2Mul(&D, &left->Z, &D);
+ Fq2Mul(&D, &right->Y, &D);
+ // W = B - A
+ Fq2Sub(&W, &B, &A);
+ // V = D - C
+ Fq2Sub(&V, &D, &C);
+ if (Fq2IsZero(&W)) {
+ if (Fq2IsZero(&V)) {
+ EFq2Dbl(result, left);
+ return;
+ } else {
+ EFq2Inf(result);
+ return;
+ }
+ }
+ // R.Z = P.Z * Q.Z * W
+ Fq2Mul(&result->Z, &left->Z, &right->Z);
+ Fq2Mul(&result->Z, &result->Z, &W);
+ // R.X = V^2 - (A + B) * W^2
+ Fq2Square(&result->X, &V);
+ Fq2Add(&B, &A, &B);
+ // Before squaring W save (C * W) to use in compitation of R.Y
+ Fq2Mul(&C, &C, &W);
+ Fq2Square(&W, &W);
+ Fq2Mul(&B, &B, &W);
+ Fq2Sub(&result->X, &result->X, &B);
+ // R.Y = V * (A * W^2 - R.X) - C * W^3
+ Fq2Mul(&A, &A, &W);
+ Fq2Sub(&A, &A, &result->X);
+ Fq2Mul(&result->Y, &V, &A);
+ Fq2Mul(&C, &C, &W);
+ Fq2Sub(&result->Y, &result->Y, &C);
+}
+
+void EFq2Neg(EccPointJacobiFq2* result, EccPointJacobiFq2 const* in) {
+ Fq2Cp(&result->X, &in->X);
+ Fq2Neg(&result->Y, &in->Y);
+ Fq2Cp(&result->Z, &in->Z);
+}
+
+void EFq2MulSSCM(EccPointJacobiFq2* result, EccPointJacobiFq2 const* left,
+ FpElem const* right) {
+ int position;
+ EccPointJacobiFq2 nv;
+ EccPointJacobiFq2 mv;
+ EFq2Inf(&nv);
+ EFq2Cp(&mv, left);
+ for (position = 32 * NUM_ECC_DIGITS - 1; position >= 0; position--) {
+ EFq2Dbl(&nv, &nv);
+ EFq2Add(&mv, left, &nv);
+ EFq2CondSet(&nv, &mv, &nv,
+ (int)(VliTestBit(&right->limbs, (uint32_t)position)));
+ }
+ EFq2Cp(result, &nv);
+}
+
+int EFq2Eq(EccPointJacobiFq2 const* left, EccPointJacobiFq2 const* right) {
+ Fq2Elem t1;
+ Fq2Elem t2;
+ Fq2Elem t3;
+ Fq2Elem t4;
+
+ if (EFq2IsInf(left) && EFq2IsInf(right)) {
+ return 1;
+ }
+ // if either left or right equals to inf return 0
+ if (EFq2IsInf(left) || EFq2IsInf(right)) {
+ return 0;
+ }
+ Fq2Square(&t1, &(left->Z));
+ Fq2Square(&t2, &(right->Z));
+ Fq2Mul(&t3, &t1, &(right->X));
+ Fq2Mul(&t4, &t2, &(left->X));
+ Fq2Mul(&t1, &t1, &(left->Z));
+ Fq2Mul(&t2, &t2, &(right->Z));
+ Fq2Mul(&t1, &t1, &(right->Y));
+ Fq2Mul(&t2, &t2, &(left->Y));
+ return Fq2Eq(&t1, &t2) && Fq2Eq(&t3, &t4);
+}
+
+int EFq2OnCurve(EccPointFq2 const* in) {
+ // test that Y^2 mod q == (X^3 + a*Z^4*X + b'*Z^6) mod q
+ // This simplifies to: Y^2 mod q == (X^3 + b') mod q
+ // since: Z = 1
+ // a = 0
+ // b = 3
+ Fq2Elem t1;
+ Fq2Elem t2;
+ FqElem three;
+ // Fq2xi
+ Fq2Elem bp = {{{{0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000}}},
+ {{{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000}}}};
+ Fq2Elem const* x = &in->x;
+ Fq2Elem const* y = &in->y;
+
+ // b' = b * inv(x1)
+ FqSet(&three, 3);
+ Fq2Inv(&bp, &bp);
+ Fq2MulScalar(&bp, &bp, &three);
+
+ // set t2 = X^3
+ Fq2Square(&t1, x);
+ Fq2Mul(&t2, x, &t1);
+ // set t2 = X^3 + b'
+ Fq2Add(&t2, &t2, &bp);
+
+ // set t1 = Y^2
+ Fq2Square(&t1, y);
+
+ // set t1 = Y^2 - (X^3 + b')
+ Fq2Sub(&t1, &t1, &t2);
+ // return if t1 is zero
+ return Fq2IsZero(&t1);
+}
diff --git a/epid/member/tiny/math/src/fp.c b/epid/member/tiny/math/src/fp.c
new file mode 100644
index 0000000..a785122
--- /dev/null
+++ b/epid/member/tiny/math/src/fp.c
@@ -0,0 +1,120 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Implementation of Fp math
+/*! \file */
+
+#include "epid/member/tiny/math/fp.h"
+
+#include <limits.h> // for CHAR_BIT
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/math/vli.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+/// A security parameter. In this version of Intel(R) EPID SDK, slen = 128
+#define EPID_SLEN 128
+/// buffer size of random integer t in INT32
+#define RAND_NUM_WORDS \
+ ((sizeof(FpElem) + EPID_SLEN / CHAR_BIT) / sizeof(uint32_t))
+
+static VeryLargeInt const epid20_p = {{0xD10B500D, 0xF62D536C, 0x1299921A,
+ 0x0CDC65FB, 0xEE71A49E, 0x46E5F25E,
+ 0xFFFCF0CD, 0xFFFFFFFF}};
+static FpElem const one = {{{1, 0, 0, 0, 0, 0, 0, 0}}};
+static VeryLargeInt const p_minus_one = {{0xD10B500C, 0xF62D536C, 0x1299921A,
+ 0x0CDC65FB, 0xEE71A49E, 0x46E5F25E,
+ 0xFFFCF0CD, 0xFFFFFFFF}};
+
+int FpInField(FpElem const* in) { return (VliCmp(&in->limbs, &epid20_p) < 0); }
+
+void FpAdd(FpElem* result, FpElem const* left, FpElem const* right) {
+ VliModAdd(&result->limbs, &left->limbs, &right->limbs, &epid20_p);
+}
+
+void FpMul(FpElem* result, FpElem const* left, FpElem const* right) {
+ VliModMul(&result->limbs, &left->limbs, &right->limbs, &epid20_p);
+}
+
+void FpSub(FpElem* result, FpElem const* left, FpElem const* right) {
+ VliModSub(&result->limbs, &left->limbs, &right->limbs, &epid20_p);
+}
+
+void FpExp(FpElem* result, FpElem const* base, VeryLargeInt const* exp) {
+ VliModExp(&result->limbs, &base->limbs, exp, &epid20_p);
+}
+
+void FpNeg(FpElem* result, FpElem const* in) {
+ VliCondSet(&result->limbs, &epid20_p, &in->limbs, VliIsZero(&in->limbs));
+ VliSub(&result->limbs, &epid20_p, &result->limbs);
+}
+
+int FpEq(FpElem const* left, FpElem const* right) {
+ return (VliCmp(&left->limbs, &right->limbs) == 0);
+}
+
+void FpInv(FpElem* result, FpElem const* in) {
+ VliModInv(&result->limbs, &in->limbs, &epid20_p);
+}
+
+int FpRand(FpElem* result, BitSupplier rnd_func, void* rnd_param) {
+ VeryLargeIntProduct deserialized_t = {{0}};
+ uint32_t t[RAND_NUM_WORDS] = {0};
+ OctStr32 const* src = (OctStr32 const*)t;
+
+ int i;
+ if (rnd_func(t, sizeof(FpElem) * CHAR_BIT + EPID_SLEN, rnd_param)) {
+ return 0;
+ }
+ for (i = RAND_NUM_WORDS - 1; i >= 0; i--) {
+ src = Uint32Deserialize(deserialized_t.word + i, src);
+ }
+ VliModBarrett(&result->limbs, &deserialized_t, &epid20_p);
+ return 1;
+}
+
+int FpRandNonzero(FpElem* result, BitSupplier rnd_func, void* rnd_param) {
+ VeryLargeIntProduct deserialized_t = {{0}};
+ uint32_t t[RAND_NUM_WORDS] = {0};
+ OctStr32 const* src = (OctStr32 const*)t;
+ int i;
+ if (rnd_func(t, sizeof(FpElem) * CHAR_BIT + EPID_SLEN, rnd_param)) {
+ return 0;
+ }
+ for (i = RAND_NUM_WORDS - 1; i >= 0; i--) {
+ src = Uint32Deserialize(deserialized_t.word + i, src);
+ }
+ VliModBarrett(&result->limbs, &deserialized_t, &p_minus_one);
+ // (t mod(p-1)) + 1 gives number in [1,p-1]
+ FpAdd(result, result, &one);
+ return 1;
+}
+
+void FpClear(FpElem* result) { VliClear(&result->limbs); }
+
+void FpSet(FpElem* result, uint32_t in) {
+ FpClear(result);
+ *(uint32_t*)(result->limbs.word) = in;
+}
+
+void FpFromHash(FpElem* result, unsigned char const* hash, size_t len) {
+ size_t i;
+ VeryLargeIntProduct vli;
+ memset(&vli, 0, sizeof(vli));
+ for (i = 0; i < len; i++) {
+ ((uint8_t*)vli.word)[len - i - 1] = hash[i];
+ }
+ VliModBarrett(&result->limbs, &vli, &epid20_p);
+}
diff --git a/epid/member/tiny/math/src/fq.c b/epid/member/tiny/math/src/fq.c
new file mode 100644
index 0000000..33a7367
--- /dev/null
+++ b/epid/member/tiny/math/src/fq.c
@@ -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.
+############################################################################*/
+/// Implementation of Fq math
+/*! \file */
+
+#include "epid/member/tiny/math/fq.h"
+
+#include <limits.h> // for CHAR_BIT
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/math/vli.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+/// A security parameter. In this version of Intel(R) EPID SDK, slen = 128
+#define EPID_SLEN 128
+/// buffer size of random integer t in INT32
+#define RAND_NUM_WORDS \
+ ((sizeof(FpElem) + EPID_SLEN / CHAR_BIT) / sizeof(uint32_t))
+
+static VeryLargeInt const epid20_q = {{0xAED33013, 0xD3292DDB, 0x12980A82,
+ 0x0CDC65FB, 0xEE71A49F, 0x46E5F25E,
+ 0xFFFCF0CD, 0xFFFFFFFF}};
+
+int FqInField(FqElem const* in) { return (VliCmp(&in->limbs, &epid20_q) < 0); }
+
+void FqAdd(FqElem* result, FqElem const* left, FqElem const* right) {
+ VliModAdd(&result->limbs, &left->limbs, &right->limbs, &epid20_q);
+}
+
+void FqSub(FqElem* result, FqElem const* left, FqElem const* right) {
+ VliModSub(&result->limbs, &left->limbs, &right->limbs, &epid20_q);
+}
+
+void FqMul(FqElem* result, FqElem const* left, FqElem const* right) {
+ VliModMul(&result->limbs, &left->limbs, &right->limbs, &epid20_q);
+}
+
+void FqExp(FqElem* result, FqElem const* base, VeryLargeInt const* exp) {
+ VliModExp(&result->limbs, &base->limbs, exp, &epid20_q);
+}
+
+void FqCp(FqElem* result, FqElem const* in) {
+ VliSet(&result->limbs, &in->limbs);
+}
+
+int FqIsZero(FqElem const* value) { return VliIsZero(&value->limbs); }
+
+void FqInv(FqElem* result, FqElem const* in) {
+ VliModInv(&result->limbs, &in->limbs, &epid20_q);
+}
+
+void FqNeg(FqElem* result, FqElem const* in) {
+ VliCondSet(&result->limbs, &epid20_q, &in->limbs, VliIsZero(&in->limbs));
+ VliSub(&result->limbs, &epid20_q, &result->limbs);
+}
+
+void FqSquare(FqElem* result, FqElem const* in) {
+ VliModSquare(&result->limbs, &in->limbs, &epid20_q);
+}
+
+void FqClear(FqElem* result) { VliClear(&result->limbs); }
+
+void FqSet(FqElem* result, uint32_t in) {
+ FqClear(result);
+ *(uint32_t*)(result->limbs.word) = in;
+}
+
+int FqEq(FqElem const* left, FqElem const* right) {
+ return (VliCmp(&left->limbs, &right->limbs) == 0);
+}
+
+void FqCondSet(FqElem* result, FqElem const* true_val, FqElem const* false_val,
+ int truth_val) {
+ VliCondSet(&result->limbs, &true_val->limbs, &false_val->limbs, truth_val);
+}
+
+int FqSqrt(FqElem* result, FqElem const* in) {
+ VeryLargeInt tmp;
+ // Intel(R) EPID 2.0 parameter q meets q = 3 mod 4.
+ // Square root can be computed as in^((q+1)/4) mod q.
+ VliRShift(&tmp, &epid20_q, 2); // tmp = (q-3)/4
+ (tmp.word[0])++; // tmp = (q+1)/4
+ FqExp(result, in, &tmp); // result = in^((q+1)/4) mod q
+ // validate sqrt exists
+ VliModSquare(&tmp, &result->limbs, &epid20_q);
+ return 0 == VliCmp(&tmp, &in->limbs);
+}
+
+int FqRand(FqElem* result, BitSupplier rnd_func, void* rnd_param) {
+ VeryLargeIntProduct deserialized_t = {{0}};
+ uint32_t t[RAND_NUM_WORDS] = {0};
+ OctStr32 const* src = (OctStr32 const*)t;
+ int i;
+
+ if (rnd_func(t, sizeof(FpElem) * CHAR_BIT + EPID_SLEN, rnd_param)) {
+ return 0;
+ }
+ for (i = RAND_NUM_WORDS - 1; i >= 0; i--) {
+ src = Uint32Deserialize(deserialized_t.word + i, src);
+ }
+ VliModBarrett(&result->limbs, &deserialized_t, &epid20_q);
+ return 1;
+}
+
+void FqFromHash(FqElem* result, unsigned char const* hash, size_t len) {
+ size_t i;
+ VeryLargeIntProduct vli;
+ memset(&vli, 0, sizeof(vli));
+ for (i = 0; i < len; i++) {
+ ((uint8_t*)vli.word)[len - i - 1] = hash[i];
+ }
+ VliModBarrett(&result->limbs, &vli, &epid20_q);
+}
diff --git a/epid/member/tiny/math/src/fq12.c b/epid/member/tiny/math/src/fq12.c
new file mode 100644
index 0000000..dd7176b
--- /dev/null
+++ b/epid/member/tiny/math/src/fq12.c
@@ -0,0 +1,282 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Implementation of Fq12 math
+/*! \file */
+
+#include "epid/member/tiny/math/fq12.h"
+
+#include "epid/member/tiny/math/fq.h"
+#include "epid/member/tiny/math/fq2.h"
+#include "epid/member/tiny/math/fq6.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/vli.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static void Fq12MulScalar(Fq12Elem* result, Fq12Elem const* left,
+ Fq6Elem const* right) {
+ Fq6Mul(&result->z0, &left->z0, right);
+ Fq6Mul(&result->z1, &left->z1, right);
+}
+
+static void Fq4Square(Fq2Elem* out0, Fq2Elem* out1, Fq2Elem const* in0,
+ Fq2Elem const* in1) {
+ Fq2Elem tmp;
+ Fq2Elem* temp = &tmp;
+ Fq2Square(temp, in1);
+ Fq2Add(out1, in0, in1);
+ Fq2Square(out0, in0);
+ Fq2Square(out1, out1);
+ Fq2Sub(out1, out1, temp);
+ Fq2Sub(out1, out1, out0);
+ Fq2MulXi(temp, temp);
+ Fq2Add(out0, out0, temp);
+}
+
+static void Fq12CondSet(Fq12Elem* result, Fq12Elem const* true_val,
+ Fq12Elem const* false_val, int truth_val) {
+ Fq6CondSet(&result->z0, &true_val->z0, &false_val->z0, truth_val);
+ Fq6CondSet(&result->z1, &true_val->z1, &false_val->z1, truth_val);
+}
+
+void Fq12Add(Fq12Elem* result, Fq12Elem const* left, Fq12Elem const* right) {
+ Fq6Add(&result->z0, &left->z0, &right->z0);
+ Fq6Add(&result->z1, &left->z1, &right->z1);
+}
+
+void Fq12Sub(Fq12Elem* result, Fq12Elem const* left, Fq12Elem const* right) {
+ Fq6Sub(&result->z0, &left->z0, &right->z0);
+ Fq6Sub(&result->z1, &left->z1, &right->z1);
+}
+
+void Fq12Square(Fq12Elem* result, Fq12Elem const* in) {
+ Fq6Elem tmpa;
+ Fq6Elem* temp_a = &tmpa;
+ Fq6Square(temp_a, &in->z1);
+ Fq6Add(&result->z1, &in->z0, &in->z1);
+ Fq6Square(&result->z0, &in->z0);
+ Fq6Square(&result->z1, &result->z1);
+ Fq6Sub(&result->z1, &result->z1, (&result->z0));
+ Fq6Sub(&result->z1, &result->z1, temp_a);
+ Fq6MulV(temp_a, temp_a);
+ Fq6Add((&result->z0), (&result->z0), temp_a);
+}
+
+void Fq12Mul(Fq12Elem* result, Fq12Elem const* left, Fq12Elem const* right) {
+ Fq6Elem A;
+ Fq6Elem B;
+ Fq6Elem* t0 = &A;
+ Fq6Elem* t1 = &B;
+
+ Fq6Add(t0, &left->z0, &left->z1);
+ Fq6Add(t1, &right->z0, &right->z1);
+ Fq6Mul(t0, t0, t1);
+ Fq6Mul(&result->z0, &left->z0, &right->z0);
+ Fq6Sub(t0, t0, &result->z0);
+ Fq6Mul(t1, &left->z1, &right->z1);
+ Fq6Sub(&result->z1, t0, t1);
+ Fq6MulV(t1, t1);
+ Fq6Add(&result->z0, &result->z0, t1);
+}
+
+void Fq12Inv(Fq12Elem* result, Fq12Elem const* in) {
+ Fq12Elem tmp3;
+ Fq12Elem tmp4;
+ Fq12Elem* const temp3 = &tmp3;
+ Fq12Elem* const temp4 = &tmp4;
+ Fq12Conj(temp3, in);
+ Fq12Mul(temp4, temp3, in);
+ Fq6Inv(&temp4->z0, &temp4->z0);
+ Fq12MulScalar(result, temp3, &temp4->z0);
+}
+
+void Fq12Neg(Fq12Elem* result, Fq12Elem const* in) {
+ Fq6Neg(&result->z0, &in->z0);
+ Fq6Neg(&result->z1, &in->z1);
+}
+
+void Fq12Set(Fq12Elem* result, uint32_t val) {
+ Fq12Clear(result);
+ FqSet(&(*result).z0.y0.x0, val);
+}
+
+void Fq12Exp(Fq12Elem* result, Fq12Elem const* base, VeryLargeInt const* exp) {
+ int i;
+ Fq12Elem tmp, tmp2, *const temp = &tmp, *const temp2 = &tmp2;
+ Fq12Clear(temp);
+ temp->z0.y0.x0.limbs.word[0]++;
+ for (i = NUM_ECC_DIGITS * 32 - 1; i >= 0; i--) {
+ Fq12Square(temp, temp);
+ Fq12Mul(temp2, temp, base);
+
+ Fq12CondSet(temp, temp2, temp,
+ (int)((exp->word[i / 32] >> (i & 31)) & (0x1)));
+ }
+ Fq12Cp(result, temp);
+}
+
+void Fq12MultiExp(Fq12Elem* result, Fq12Elem const* base0,
+ VeryLargeInt const* exp0, Fq12Elem const* base1,
+ VeryLargeInt const* exp1, Fq12Elem const* base2,
+ VeryLargeInt const* exp2, Fq12Elem const* base3,
+ VeryLargeInt const* exp3) {
+ Fq12Elem tmp;
+ Fq12Exp(result, base0, exp0);
+ Fq12Exp(&tmp, base1, exp1);
+ Fq12Mul(result, result, &tmp);
+ Fq12Exp(&tmp, base2, exp2);
+ Fq12Mul(result, result, &tmp);
+ Fq12Exp(&tmp, base3, exp3);
+ Fq12Mul(result, result, &tmp);
+}
+
+int Fq12Eq(Fq12Elem const* left, Fq12Elem const* right) {
+ return Fq6Eq(&left->z0, &right->z0) && Fq6Eq(&left->z0, &right->z0);
+}
+
+void Fq12Conj(Fq12Elem* result, Fq12Elem const* in) {
+ Fq6Cp(&result->z0, &in->z0);
+ Fq6Neg(&result->z1, &in->z1);
+}
+
+void Fq12ExpCyc(Fq12Elem* result, Fq12Elem const* in, VeryLargeInt const* t) {
+ int i = 0;
+ Fq12Elem ac;
+ Fq12Elem* const acc = &ac;
+ Fq12Cp(acc, in);
+ Fq12Cp(result, in);
+
+ for (i = 61; i >= 0; i--) {
+ Fq12SqCyc(result, result);
+
+ if (VliTestBit(t, (uint32_t)i)) {
+ Fq12Mul(result, result, acc);
+ }
+ }
+}
+
+void Fq12SqCyc(Fq12Elem* result, Fq12Elem const* in) {
+ Fq2Elem const* a0 = &(in->z0).y0;
+ Fq2Elem const* a1 = &(in->z1).y0;
+ Fq2Elem const* a2 = &(in->z0).y1;
+ Fq2Elem const* a3 = &(in->z1).y1;
+ Fq2Elem const* a4 = &(in->z0).y2;
+ Fq2Elem const* a5 = &(in->z1).y2;
+ Fq2Elem* e0 = &(result->z0).y0;
+ Fq2Elem* e1 = &(result->z1).y0;
+ Fq2Elem* e2 = &(result->z0).y1;
+ Fq2Elem* e3 = &(result->z1).y1;
+ Fq2Elem* e4 = &(result->z0).y2;
+ Fq2Elem* e5 = &(result->z1).y2;
+ Fq2Elem tmp1;
+ Fq2Elem tmp2;
+ Fq2Elem tmp3;
+ Fq2Elem tmp4;
+ Fq2Elem* temp1 = &tmp1;
+ Fq2Elem* temp2 = &tmp2;
+ Fq2Elem* temp3 = &tmp3;
+ Fq2Elem* temp4 = &tmp4;
+
+ Fq4Square(temp1, temp2, a0, a3); // t00,t11 = sq(a0,a3)
+ Fq2Add(e0, a0, a0); // e0 = 3*t00 - 2*a0
+ Fq2Sub(e0, temp1, e0);
+ Fq2Add(e0, temp1, e0);
+ Fq2Add(e0, temp1, e0);
+ Fq2Add(e3, a3, a3); // e3 = 3*t11 - 2*a3
+ Fq2Add(e3, temp2, e3);
+ Fq2Add(e3, temp2, e3);
+ Fq2Add(e3, temp2, e3);
+
+ Fq4Square(temp1, temp2, a2, a5); // t02, t10 = sq(a2,a5)
+ Fq2MulXi(temp2, temp2);
+ Fq4Square(temp3, temp4, a1, a4); // t01, t12 = sq(a1,a4)
+
+ Fq2Add(e4, a4, a4);
+ Fq2Sub(e4, temp1, e4);
+ Fq2Add(e4, temp1, e4);
+ Fq2Add(e4, temp1, e4);
+ Fq2Add(e1, a1, a1);
+ Fq2Add(e1, temp2, e1);
+ Fq2Add(e1, temp2, e1);
+ Fq2Add(e1, temp2, e1);
+
+ Fq2Add(e2, a2, a2);
+ Fq2Sub(e2, temp3, e2);
+ Fq2Add(e2, temp3, e2);
+ Fq2Add(e2, temp3, e2);
+ Fq2Add(e5, a5, a5);
+ Fq2Add(e5, temp4, e5);
+ Fq2Add(e5, temp4, e5);
+ Fq2Add(e5, temp4, e5);
+}
+
+void Fq12MulSpecial(Fq12Elem* result, Fq12Elem const* left,
+ Fq12Elem const* right) {
+ Fq2Elem T3;
+ Fq2Elem* t3 = &T3;
+ Fq2Elem const* b0 = &(right->z0.y0);
+ Fq2Elem const* b1 = &right->z1.y0;
+ Fq2Elem const* b3 = &right->z1.y1;
+ Fq6Elem T0;
+ Fq6Elem T1;
+ Fq6Elem T2;
+ Fq6Elem* t0 = &T0;
+ Fq6Elem* t1 = &T1;
+ Fq6Elem* t2 = &T2;
+ Fq6Elem const* a0 = &left->z0;
+ Fq6Elem const* a1 = &left->z1;
+ Fq6Elem* r0 = &result->z0;
+ Fq6Elem* r1 = &result->z1;
+
+#if defined(DEBUG)
+ // validate algorithm precondition
+ if (!Fq2IsZero(&right->z0.y1) || !Fq2IsZero(&right->z0.y2) ||
+ !Fq2IsZero(&right->z1.y2)) {
+ memset(&result, 0xff, sizeof(result));
+ return;
+ }
+#endif // defined(DEBUG)
+
+ Fq6Add(t0, a0, a1);
+ Fq2Add(t3, b0, b1);
+ Fq6MulScalar(t0, t0, t3);
+
+ Fq6MulScalar(t2, a1, b3);
+ Fq6MulV(t2, t2);
+
+ Fq6MulScalar(t1, a1, b1);
+ Fq6Sub(t0, t0, t1);
+ Fq6Add(t2, t2, t1);
+ Fq6MulV(t2, t2);
+
+ Fq6MulScalar(t1, a0, b0);
+ Fq6Add(t2, t2, t1);
+ Fq6Sub(t0, t0, t1);
+
+ Fq6MulScalar(t1, a0, b3);
+ Fq6MulV(t1, t1);
+ Fq6Add(r1, t1, t0);
+ Fq6Cp(r0, t2);
+}
+
+void Fq12Cp(Fq12Elem* result, Fq12Elem const* in) {
+ Fq6Cp(&result->z0, &in->z0);
+ Fq6Cp(&result->z1, &in->z1);
+}
+
+void Fq12Clear(Fq12Elem* result) {
+ Fq6Clear(&result->z0);
+ Fq6Clear(&result->z1);
+}
diff --git a/epid/member/tiny/math/src/fq2.c b/epid/member/tiny/math/src/fq2.c
new file mode 100644
index 0000000..754c334
--- /dev/null
+++ b/epid/member/tiny/math/src/fq2.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.
+############################################################################*/
+/// Implementation of Fq2 math
+/*! \file */
+
+#include "epid/member/tiny/math/fq2.h"
+
+#include "epid/member/tiny/math/fq.h"
+#include "epid/member/tiny/math/mathtypes.h"
+
+void Fq2Cp(Fq2Elem* result, Fq2Elem const* in) {
+ FqCp(&(result->x0), &(in->x0));
+ FqCp(&(result->x1), &(in->x1));
+}
+
+void Fq2Set(Fq2Elem* result, uint32_t in) {
+ FqSet(&(result->x0), in);
+ FqClear(&(result->x1));
+}
+
+void Fq2Clear(Fq2Elem* result) {
+ FqClear(&result->x0);
+ FqClear(&result->x1);
+}
+
+void Fq2Add(Fq2Elem* result, Fq2Elem const* left, Fq2Elem const* right) {
+ FqAdd(&(result->x0), &(left->x0), &(right->x0));
+ FqAdd(&(result->x1), &(left->x1), &(right->x1));
+}
+
+void Fq2Exp(Fq2Elem* result, Fq2Elem const* base, VeryLargeInt const* exp) {
+ int i, j;
+ Fq2Elem tmp;
+ Fq2Elem tmp2;
+ Fq2Elem* temp = &tmp;
+ Fq2Elem* temp2 = &tmp2;
+ FqSet(&(temp->x0), 1);
+ FqClear(&(temp->x1));
+ for (i = NUM_ECC_DIGITS - 1; i >= 0; i--) {
+ for (j = 31; j >= 0; j--) {
+ Fq2Square(temp, temp);
+ Fq2Mul(temp2, temp, base);
+
+ Fq2CondSet(temp, temp2, temp, (int)((exp->word[i] >> j) & (0x1)));
+ }
+ }
+ Fq2Cp(result, temp);
+}
+
+void Fq2Sub(Fq2Elem* result, Fq2Elem const* left, Fq2Elem const* right) {
+ FqSub(&(result->x0), &(left->x0), &(right->x0));
+ FqSub(&(result->x1), &(left->x1), &(right->x1));
+}
+
+void Fq2Mul(Fq2Elem* result, Fq2Elem const* left, Fq2Elem const* right) {
+ FqElem A;
+ FqElem B;
+ FqElem* a = &A;
+ FqElem* b = &B;
+
+ FqAdd(a, &left->x0, &left->x1);
+ FqAdd(b, &right->x0, &right->x1);
+ FqMul(a, a, b);
+ FqMul(&result->x0, &left->x0, &right->x0);
+ FqSub(a, a, &result->x0);
+ FqMul(b, &left->x1, &right->x1);
+ FqSub(&result->x1, a, b);
+ FqNeg(b, b); // b = b*beta
+ FqAdd(&result->x0, &result->x0, b);
+}
+
+void Fq2Inv(Fq2Elem* result, Fq2Elem const* in) {
+ FqElem tmp;
+ FqElem tmp2;
+ FqElem* temp = &tmp;
+ FqElem* temp2 = &tmp2;
+ FqSquare(temp, &in->x1);
+ FqSquare(temp2, &in->x0);
+ FqAdd(temp, temp, temp2);
+ FqInv(temp, temp);
+ FqMul(&result->x0, temp, &in->x0);
+ FqNeg(temp, temp);
+ FqMul(&result->x1, temp, &in->x1);
+}
+
+void Fq2Neg(Fq2Elem* result, Fq2Elem const* in) {
+ FqNeg(&(result->x0), &(in->x0));
+ FqNeg(&(result->x1), &(in->x1));
+}
+
+void Fq2Conj(Fq2Elem* result, Fq2Elem const* in) {
+ FqCp(&result->x0, &in->x0);
+ FqNeg(&result->x1, &in->x1);
+}
+
+void Fq2Square(Fq2Elem* result, Fq2Elem const* in) {
+ FqElem tmpa;
+ FqElem* temp_a = &tmpa;
+ FqElem tmpb;
+ FqElem* temp_b = &tmpb;
+ FqAdd(temp_a, &in->x0, &in->x1);
+ FqMul(temp_b, &in->x0, &in->x1);
+ FqSub(&result->x0, &in->x0, &in->x1);
+ FqMul(&result->x0, temp_a, &result->x0);
+ FqAdd(&result->x1, temp_b, temp_b);
+}
+
+void Fq2MulScalar(Fq2Elem* result, Fq2Elem const* left, FqElem const* right) {
+ FqMul(&(result->x0), &(left->x0), right);
+ FqMul(&(result->x1), &(left->x1), right);
+}
+
+void Fq2CondSet(Fq2Elem* result, Fq2Elem const* true_val,
+ Fq2Elem const* false_val, int truth_val) {
+ FqCondSet(&(result->x0), &(true_val->x0), &(false_val->x0), truth_val);
+ FqCondSet(&(result->x1), &(true_val->x1), &(false_val->x1), truth_val);
+}
+
+int Fq2Eq(Fq2Elem const* left, Fq2Elem const* right) {
+ return FqEq(&(left->x0), &(right->x0)) && FqEq(&(left->x1), &(right->x1));
+}
+
+void Fq2MulXi(Fq2Elem* result, Fq2Elem const* in) {
+ // has the same effect as Fq2Mul(result, in, &Fq2xi) with better speed, low
+ // space;
+ FqElem tmp;
+ FqElem* temp = &tmp;
+ FqAdd(temp, &in->x0, &in->x0);
+ FqSub(temp, temp, &in->x1);
+ FqAdd(&result->x1, &in->x1, &in->x1);
+ FqAdd(&result->x1, &result->x1, &in->x0);
+ FqCp(&result->x0, temp);
+}
+
+int Fq2IsZero(Fq2Elem const* value) {
+ return FqIsZero(&value->x0) && FqIsZero(&value->x1);
+}
diff --git a/epid/member/tiny/math/src/fq6.c b/epid/member/tiny/math/src/fq6.c
new file mode 100644
index 0000000..b013037
--- /dev/null
+++ b/epid/member/tiny/math/src/fq6.c
@@ -0,0 +1,192 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Implementation of Fq6 math
+/*! \file */
+
+#include "epid/member/tiny/math/fq6.h"
+
+#include "epid/member/tiny/math/fq2.h"
+#include "epid/member/tiny/math/mathtypes.h"
+
+void Fq6Add(Fq6Elem* result, Fq6Elem const* left, Fq6Elem const* right) {
+ Fq2Add(&result->y0, &left->y0, &right->y0);
+ Fq2Add(&result->y1, &left->y1, &right->y1);
+ Fq2Add(&result->y2, &left->y2, &right->y2);
+}
+
+void Fq6Sub(Fq6Elem* result, Fq6Elem const* left, Fq6Elem const* right) {
+ Fq2Sub(&result->y0, &left->y0, &right->y0);
+ Fq2Sub(&result->y1, &left->y1, &right->y1);
+ Fq2Sub(&result->y2, &left->y2, &right->y2);
+}
+
+void Fq6Mul(Fq6Elem* result, Fq6Elem const* left, Fq6Elem const* right) {
+ Fq2Elem tmpa;
+ Fq2Elem tmpb;
+ Fq2Elem tmpc;
+ Fq2Elem tmpd;
+ Fq2Elem tmpe;
+ Fq2Elem* temp_a = &tmpa;
+ Fq2Elem* temp_b = &tmpb;
+ Fq2Elem* temp_c = &tmpc;
+ Fq2Elem* temp_d = &tmpd;
+ Fq2Elem* temp_e = &tmpe;
+ Fq2Mul(temp_a, &left->y0, &right->y0); // temp_a = t0 = a[0] * b[0]
+ Fq2Mul(temp_b, &left->y1, &right->y1); // temp_b = t1
+ Fq2Mul(temp_c, &left->y2, &right->y2); // temp_c = t2
+ Fq2Add(temp_d, &left->y1, &left->y2); // temp_d = t3
+ Fq2Add(temp_e, &right->y1, &right->y2); // temp_e = t4
+ Fq2Mul(temp_d, temp_d, temp_e); // temp_d = t3
+ Fq2Sub(temp_d, temp_d, temp_b);
+ Fq2Sub(temp_d, temp_d, temp_c);
+ Fq2MulXi(temp_e, temp_d);
+ Fq2Add(temp_d, &left->y0, &left->y1);
+ Fq2Add(&result->y1, &right->y0, &right->y1); // &result->y1 = t4
+ Fq2Mul(temp_d, temp_d, &result->y1);
+ Fq2MulXi(&result->y1, temp_c); // result->y1 = Fq2.mulXi(t2)
+ Fq2Add(&result->y1, &result->y1, temp_d);
+ Fq2Sub(&result->y1, &result->y1, temp_a);
+ Fq2Sub(&result->y1, &result->y1, temp_b);
+ Fq2Add(temp_d, &left->y0, &left->y2);
+ Fq2Sub(temp_b, temp_b, temp_c);
+ Fq2Add(temp_c, &right->y0, &right->y2);
+ Fq2Add(&result->y0, temp_e, temp_a); // temp_e = e[0], reordered instruction
+ Fq2Mul(temp_d, temp_d, temp_c);
+ Fq2Sub(temp_d, temp_d, temp_a);
+ Fq2Add(&result->y2, temp_d, temp_b);
+}
+
+void Fq6Inv(Fq6Elem* result, Fq6Elem const* in) {
+ Fq2Elem tmpa;
+ Fq2Elem tmpb;
+ Fq2Elem tmpc;
+ Fq2Elem tmpd;
+ Fq2Elem* temp_a = &tmpa;
+ Fq2Elem* temp_b = &tmpb;
+ Fq2Elem* temp_c = &tmpc;
+ Fq2Elem* temp_d = &tmpd;
+ Fq2Square(temp_a, &in->y0);
+ Fq2Mul(temp_d, &in->y1, &in->y2);
+ Fq2MulXi(temp_d, temp_d);
+ Fq2Sub(temp_a, temp_a, temp_d);
+ Fq2Square(temp_b, &in->y2);
+ Fq2Mul(temp_d, &in->y0, &in->y1);
+ Fq2MulXi(temp_b, temp_b);
+ Fq2Sub(temp_b, temp_b, temp_d);
+ Fq2Square(temp_c, &in->y1);
+ Fq2Mul(temp_d, &in->y0, &in->y2);
+ Fq2Sub(temp_c, temp_c, temp_d);
+ // using the results as temporary variables
+ Fq2Mul(&result->y0, &in->y0, temp_a);
+ Fq2Mul(&result->y1, &in->y1, temp_c);
+ Fq2Mul(&result->y2, &in->y2, temp_b);
+ Fq2MulXi(&result->y1, &result->y1);
+ Fq2MulXi(&result->y2, &result->y2);
+ Fq2Add(temp_d, &result->y0, &result->y1);
+ Fq2Add(temp_d, temp_d, &result->y2);
+ Fq2Inv(temp_d, temp_d);
+ Fq2Mul(&result->y0, temp_a, temp_d);
+ Fq2Mul(&result->y1, temp_b, temp_d);
+ Fq2Mul(&result->y2, temp_c, temp_d);
+}
+
+void Fq6Neg(Fq6Elem* result, Fq6Elem const* in) {
+ Fq2Neg(&result->y0, &in->y0);
+ Fq2Neg(&result->y1, &in->y1);
+ Fq2Neg(&result->y2, &in->y2);
+}
+
+void Fq6Clear(Fq6Elem* result) {
+ Fq2Clear(&result->y0);
+ Fq2Clear(&result->y1);
+ Fq2Clear(&result->y2);
+}
+
+void Fq6MulScalar(Fq6Elem* result, Fq6Elem const* in, Fq2Elem const* scalar) {
+ Fq2Mul(&result->y0, &in->y0, scalar);
+ Fq2Mul(&result->y1, &in->y1, scalar);
+ Fq2Mul(&result->y2, &in->y2, scalar);
+}
+
+void Fq6MulV(Fq6Elem* result, Fq6Elem const* in) {
+ Fq2Elem tmp;
+ Fq2Elem* temp = &tmp;
+ Fq2MulXi(temp, &in->y2);
+ Fq2Cp(&result->y2, &in->y1);
+ Fq2Cp(&result->y1, &in->y0);
+ Fq2Cp(&result->y0, temp);
+}
+
+int Fq6Eq(Fq6Elem const* left, Fq6Elem const* right) {
+ return Fq2Eq(&left->y0, &right->y0) && Fq2Eq(&left->y1, &right->y1) &&
+ Fq2Eq(&left->y2, &right->y2);
+}
+
+int Fq6IsZero(Fq6Elem const* in) {
+ return Fq2IsZero(&in->y0) && Fq2IsZero(&in->y1) && Fq2IsZero(&in->y2);
+}
+
+void Fq6Square(Fq6Elem* result, Fq6Elem const* in) {
+ Fq2Elem T0;
+ Fq2Elem T2;
+ Fq2Elem T3;
+ Fq2Elem* t0 = &T0;
+ Fq2Elem* t1 = &result->y1;
+ Fq2Elem* t2 = &T2;
+ Fq2Elem* t3 = &T3;
+ Fq2Add(t0, &in->y1, &in->y2);
+ Fq2Square(t3, &in->y1);
+ Fq2Add(t1, &in->y0, &in->y1);
+ Fq2Add(t2, &in->y0, &in->y2);
+ Fq2Square(t0, t0);
+ Fq2Square(t1, t1);
+ Fq2Square(t2, t2);
+
+ // using result from Fq2Square(t3, in->y1):
+ Fq2Sub(t0, t0, t3);
+ Fq2Sub(t1, t1, t3);
+ Fq2Add(t2, t2, t3);
+
+ Fq2Square(t3, &in->y2);
+ Fq2Sub(t0, t0, t3);
+ Fq2Sub(t2, t2, t3);
+ Fq2MulXi(t3, t3);
+ Fq2Add(t1, t1, t3);
+
+ Fq2Square(t3, &in->y0);
+ Fq2MulXi(t0, t0);
+ Fq2Add(&result->y0, t0, t3);
+ Fq2Sub(&result->y1, t1, t3);
+ Fq2Sub(&result->y2, t2, t3);
+}
+
+void Fq6Cp(Fq6Elem* result, Fq6Elem const* in) {
+ Fq2Cp(&result->y0, &in->y0);
+ Fq2Cp(&result->y1, &in->y1);
+ Fq2Cp(&result->y2, &in->y2);
+}
+
+void Fq6CondSet(Fq6Elem* result, Fq6Elem const* true_val,
+ Fq6Elem const* false_val, int truth_val) {
+ Fq2CondSet(&result->y0, &true_val->y0, &false_val->y0, truth_val);
+ Fq2CondSet(&result->y1, &true_val->y1, &false_val->y1, truth_val);
+ Fq2CondSet(&result->y2, &true_val->y2, &false_val->y2, truth_val);
+}
+
+void Fq6Set(Fq6Elem* result, uint32_t in) {
+ Fq6Clear(result);
+ Fq2Set(&result->y0, in);
+}
diff --git a/epid/member/tiny/math/src/hashwrap.c b/epid/member/tiny/math/src/hashwrap.c
new file mode 100644
index 0000000..7f3c8be
--- /dev/null
+++ b/epid/member/tiny/math/src/hashwrap.c
@@ -0,0 +1,86 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Implementation of hash wrap function
+/*! \file */
+#include "epid/member/tiny/math/hashwrap.h"
+
+void tinysha_init(HashAlg sha_type, tiny_sha* s) {
+ switch (sha_type) {
+#ifdef SHA512_SUPPORT
+ case kSha512:
+ tinysha512_init(&s->sha_state_t.sha512s);
+ break;
+#endif
+#ifdef SHA256_SUPPORT
+ case kSha256:
+ tc_sha256_init(&s->sha_state_t.sha256s);
+ break;
+#endif
+ default:
+ s->hash_alg = kInvalidHashAlg;
+ return;
+ }
+ s->hash_alg = sha_type;
+}
+
+void tinysha_update(tiny_sha* s, void const* data, size_t data_length) {
+ switch (s->hash_alg) {
+#ifdef SHA512_SUPPORT
+ case kSha512:
+ tinysha512_update(&s->sha_state_t.sha512s, data, data_length);
+ break;
+#endif
+#ifdef SHA256_SUPPORT
+ case kSha256:
+ tc_sha256_update(&s->sha_state_t.sha256s, data, data_length);
+ break;
+#endif
+ default:
+ break;
+ }
+}
+
+void tinysha_final(unsigned char* digest, tiny_sha* s) {
+ switch (s->hash_alg) {
+#ifdef SHA512_SUPPORT
+ case kSha512:
+ tinysha512_final(digest, &s->sha_state_t.sha512s);
+ break;
+#endif
+#ifdef SHA256_SUPPORT
+ case kSha256:
+ tc_sha256_final(digest, &s->sha_state_t.sha256s);
+ break;
+#endif
+ default:
+ break;
+ }
+}
+
+size_t tinysha_digest_size(tiny_sha* s) {
+ switch (s->hash_alg) {
+#ifdef SHA512_SUPPORT
+ case kSha512:
+ return SHA512_DIGEST_SIZE;
+#endif
+#ifdef SHA256_SUPPORT
+ case kSha256:
+ return SHA256_DIGEST_SIZE;
+#endif
+ default:
+ return 0;
+ }
+}
diff --git a/epid/member/tiny/math/src/pairing.c b/epid/member/tiny/math/src/pairing.c
new file mode 100644
index 0000000..6b2f261
--- /dev/null
+++ b/epid/member/tiny/math/src/pairing.c
@@ -0,0 +1,300 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Implementation of Tate pairing
+/*! \file */
+
+#include "epid/member/tiny/math/pairing.h"
+#include "epid/member/tiny/math/efq2.h"
+#include "epid/member/tiny/math/fq.h"
+#include "epid/member/tiny/math/fq12.h"
+#include "epid/member/tiny/math/fq2.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/vli.h"
+
+static const VeryLargeInt epid_e = {{0xf2788803, 0x7886dcf9, 0x2dc401c0,
+ 0xd77a10ff, 0x27bd9b6f, 0x367ba865,
+ 0xaaaa2822, 0x2aaaaaaa}};
+static const VeryLargeInt epid_t = {{0x30B0A801, 0x6882F5C0, 0, 0, 0, 0, 0, 0}};
+static const Fq2Elem epid_xi = {
+ {{{0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}},
+ {{{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}}};
+static const int neg = 1;
+
+void PairingInit(PairingState* state) {
+ int i;
+ Fq2Exp(&state->g[0][0], &epid_xi, &epid_e);
+ for (i = 1; i < 5; i++) {
+ Fq2Mul(&state->g[0][i], &state->g[0][i - 1], &state->g[0][0]);
+ }
+ for (i = 0; i < 5; i++) {
+ FqSquare(&state->g[1][i].x0, &state->g[0][i].x0);
+ FqSquare(&state->g[1][i].x1, &state->g[0][i].x1);
+ FqAdd(&state->g[1][i].x0, &state->g[1][i].x0, &state->g[1][i].x1);
+ FqClear(&state->g[1][i].x1);
+ Fq2Mul(&state->g[2][i], &state->g[0][i], &state->g[1][i]);
+ }
+}
+
+static void piOp(EccPointFq2* Qout, EccPointFq2 const* Qin, int e,
+ PairingState const* scratch) {
+ if (e == 1) {
+ Fq2Conj(&Qout->x, &Qin->x);
+ Fq2Conj(&Qout->y, &Qin->y);
+ } else {
+ Fq2Cp(&Qout->x, &Qin->x);
+ Fq2Cp(&Qout->y, &Qin->y);
+ }
+ Fq2Mul(&Qout->x, &Qout->x, &scratch->g[e - 1][1]);
+ Fq2Mul(&Qout->y, &Qout->y, &scratch->g[e - 1][2]);
+}
+
+/*
+ * Computes the Frobenius endomorphism Pout = Pin^(p^e)
+ */
+static void frob_op(Fq12Elem* Pout, Fq12Elem const* Pin, int e,
+ PairingState const* state) {
+ if (e == 1 || e == 3) {
+ Fq2Conj(&Pout->z0.y0, &Pin->z0.y0);
+ Fq2Conj(&Pout->z1.y0, &Pin->z1.y0);
+ Fq2Conj(&Pout->z0.y1, &Pin->z0.y1);
+ Fq2Conj(&Pout->z1.y1, &Pin->z1.y1);
+ Fq2Conj(&Pout->z0.y2, &Pin->z0.y2);
+ Fq2Conj(&Pout->z1.y2, &Pin->z1.y2);
+ } else {
+ Fq2Cp(&Pout->z0.y0, &Pin->z0.y0);
+ Fq2Cp(&Pout->z1.y0, &Pin->z1.y0);
+ Fq2Cp(&Pout->z0.y1, &Pin->z0.y1);
+ Fq2Cp(&Pout->z1.y1, &Pin->z1.y1);
+ Fq2Cp(&Pout->z0.y2, &Pin->z0.y2);
+ Fq2Cp(&Pout->z1.y2, &Pin->z1.y2);
+ }
+ Fq2Mul(&Pout->z1.y0, &Pout->z1.y0, &state->g[e - 1][0]);
+ Fq2Mul(&Pout->z0.y1, &Pout->z0.y1, &state->g[e - 1][1]);
+ Fq2Mul(&Pout->z1.y1, &Pout->z1.y1, &state->g[e - 1][2]);
+ Fq2Mul(&Pout->z0.y2, &Pout->z0.y2, &state->g[e - 1][3]);
+ Fq2Mul(&Pout->z1.y2, &Pout->z1.y2, &state->g[e - 1][4]);
+}
+
+static void finalExp(Fq12Elem* f, PairingState const* state) {
+ Fq12Elem t3;
+ Fq12Elem t2;
+ Fq12Elem t1;
+ Fq12Elem t0;
+
+ Fq12Conj(&t1, f);
+ Fq12Inv(&t2, f);
+ Fq12Mul(f, &t1, &t2);
+ frob_op(&t2, f, 2, state);
+ Fq12Mul(f, f, &t2);
+ Fq12ExpCyc(&t1, f, &epid_t);
+ if (neg) {
+ Fq12Conj(&t1, &t1);
+ }
+ Fq12ExpCyc(&t3, &t1, &epid_t);
+ if (neg) {
+ Fq12Conj(&t3, &t3);
+ }
+ Fq12ExpCyc(&t0, &t3, &epid_t);
+ if (neg) {
+ Fq12Conj(&t0, &t0);
+ }
+ frob_op(&t2, &t0, 1, state);
+ Fq12Mul(&t2, &t2, &t0);
+ Fq12Conj(&t2, &t2);
+ Fq12SqCyc(&t0, &t2);
+ frob_op(&t2, &t3, 1, state);
+ Fq12Mul(&t2, &t2, &t1);
+ Fq12Conj(&t2, &t2);
+ Fq12Mul(&t0, &t0, &t2);
+ Fq12Conj(&t2, &t3);
+ Fq12Mul(&t0, &t0, &t2);
+ frob_op(&t1, &t1, 1, state);
+ Fq12Conj(&t1, &t1);
+ Fq12Mul(&t1, &t1, &t2);
+ Fq12Mul(&t1, &t1, &t0);
+ frob_op(&t2, &t3, 2, state);
+ Fq12Mul(&t0, &t0, &t2);
+ Fq12SqCyc(&t1, &t1);
+ Fq12Mul(&t1, &t1, &t0);
+ Fq12SqCyc(&t1, &t1);
+ Fq12Conj(&t2, f);
+ Fq12Mul(&t0, &t1, &t2);
+ frob_op(&t2, f, 1, state);
+ Fq12Mul(&t1, &t1, &t2);
+ frob_op(&t2, f, 2, state);
+ Fq12Mul(&t1, &t1, &t2);
+ frob_op(&t2, f, 3, state);
+ Fq12Mul(&t1, &t1, &t2);
+ Fq12SqCyc(&t0, &t0);
+ Fq12Mul(f, &t1, &t0);
+}
+
+static void pair_tangent(Fq12Elem* f, Fq2Elem* X, Fq2Elem* Y, Fq2Elem* Z,
+ Fq2Elem* Z2, EccPointFq const* P) {
+ Fq2Mul(&f->z0.y0, X, X);
+ Fq2Add(&f->z0.y2, &f->z0.y0, &f->z0.y0);
+ Fq2Add(&f->z0.y2, &f->z0.y2, &f->z0.y0);
+ Fq2Add(&f->z1.y1, X, &f->z0.y2);
+ Fq2Mul(&f->z1.y1, &f->z1.y1, &f->z1.y1);
+ Fq2Sub(&f->z1.y1, &f->z1.y1, &f->z0.y0);
+ Fq2Mul(&f->z0.y1, Y, Y);
+ Fq2Add(&f->z1.y0, &f->z0.y1, X);
+ Fq2Mul(&f->z1.y0, &f->z1.y0, &f->z1.y0);
+ Fq2Sub(&f->z1.y0, &f->z1.y0, &f->z0.y0);
+ Fq2Mul(&f->z0.y0, &f->z0.y1, &f->z0.y1);
+ Fq2Sub(&f->z1.y0, &f->z1.y0, &f->z0.y0);
+ Fq2Add(&f->z1.y0, &f->z1.y0, &f->z1.y0);
+ Fq2Mul(&f->z1.y2, &f->z0.y2, &f->z0.y2);
+ Fq2Add(Z, Y, Z);
+ Fq2Mul(Z, Z, Z);
+ Fq2Sub(Z, Z, &f->z0.y1);
+ Fq2Sub(Z, Z, Z2);
+ Fq2Add(&f->z0.y1, &f->z0.y1, &f->z0.y1);
+ Fq2Add(&f->z0.y1, &f->z0.y1, &f->z0.y1);
+ Fq2Sub(&f->z1.y1, &f->z1.y1, &f->z1.y2);
+ Fq2Sub(&f->z1.y1, &f->z1.y1, &f->z0.y1);
+ Fq2Sub(X, &f->z1.y2, &f->z1.y0);
+ Fq2Sub(X, X, &f->z1.y0);
+ Fq2Add(&f->z0.y0, &f->z0.y0, &f->z0.y0);
+ Fq2Add(&f->z0.y0, &f->z0.y0, &f->z0.y0);
+ Fq2Add(&f->z0.y0, &f->z0.y0, &f->z0.y0);
+ Fq2Sub(Y, &f->z1.y0, X);
+ Fq2Mul(Y, Y, &f->z0.y2);
+ Fq2Sub(Y, Y, &f->z0.y0);
+ Fq2Mul(&f->z1.y0, &f->z0.y2, Z2);
+ Fq2Neg(&f->z1.y0, &f->z1.y0);
+ Fq2Add(&f->z1.y0, &f->z1.y0, &f->z1.y0);
+ Fq2MulScalar(&f->z1.y0, &f->z1.y0, &P->x);
+ Fq2Mul(&f->z0.y0, Z, Z2);
+ Fq2Add(&f->z0.y0, &f->z0.y0, &f->z0.y0);
+ Fq2MulScalar(&f->z0.y0, &f->z0.y0, &P->y);
+ Fq2Mul(Z2, Z, Z);
+ Fq2Clear(&f->z0.y1);
+ Fq2Clear(&f->z0.y2);
+ Fq2Clear(&f->z1.y2);
+ Fq2Square(Z2, Z);
+}
+
+static void pair_line(Fq12Elem* f, Fq2Elem* X, Fq2Elem* Y, Fq2Elem* Z,
+ Fq2Elem* Z2, EccPointFq const* P, EccPointFq2 const* Q) {
+ Fq2Mul(&f->z0.y1, &Q->x, Z2);
+ Fq2Add(&f->z1.y0, &Q->y, Z);
+ Fq2Mul(&f->z1.y0, &f->z1.y0, &f->z1.y0);
+ Fq2Square(&f->z0.y0, &Q->y);
+ Fq2Sub(&f->z1.y0, &f->z1.y0, &f->z0.y0);
+ Fq2Sub(&f->z1.y0, &f->z1.y0, Z2);
+ Fq2Mul(&f->z1.y0, &f->z1.y0, Z2);
+ Fq2Sub(&f->z0.y1, &f->z0.y1, X);
+ Fq2Mul(&f->z0.y2, &f->z0.y1, &f->z0.y1);
+ Fq2Add(Z, Z, &f->z0.y1);
+ Fq2Square(Z, Z);
+ Fq2Sub(Z, Z, Z2);
+ Fq2Sub(Z, Z, &f->z0.y2);
+ Fq2Mul(Z2, Z, Z);
+ Fq2Add(&f->z1.y2, &Q->y, Z);
+ Fq2Mul(&f->z1.y2, &f->z1.y2, &f->z1.y2);
+ Fq2Sub(&f->z1.y2, &f->z1.y2, &f->z0.y0);
+ Fq2Sub(&f->z1.y2, &f->z1.y2, Z2);
+ Fq2Sub(&f->z1.y0, &f->z1.y0, Y);
+ Fq2Sub(&f->z1.y0, &f->z1.y0, Y);
+ Fq2Mul(&f->z1.y1, &f->z1.y0, &Q->x);
+ Fq2Add(&f->z1.y1, &f->z1.y1, &f->z1.y1);
+ Fq2Sub(&f->z1.y1, &f->z1.y1, &f->z1.y2);
+ Fq2Add(&f->z0.y2, &f->z0.y2, &f->z0.y2);
+ Fq2Add(&f->z0.y2, &f->z0.y2, &f->z0.y2);
+ Fq2Mul(&f->z0.y1, &f->z0.y2, &f->z0.y1);
+ Fq2Mul(&f->z0.y2, X, &f->z0.y2);
+ Fq2Mul(X, &f->z1.y0, &f->z1.y0);
+ Fq2Sub(X, X, &f->z0.y1);
+ Fq2Sub(X, X, &f->z0.y2);
+ Fq2Sub(X, X, &f->z0.y2);
+ Fq2Sub(&f->z0.y2, &f->z0.y2, X);
+ Fq2Mul(&f->z0.y2, &f->z0.y2, &f->z1.y0);
+ Fq2Mul(&f->z0.y1, Y, &f->z0.y1);
+ Fq2Add(&f->z0.y1, &f->z0.y1, &f->z0.y1);
+ Fq2Sub(Y, &f->z0.y2, &f->z0.y1);
+ Fq2MulScalar(&f->z0.y0, Z, &P->y);
+ Fq2Add(&f->z0.y0, &f->z0.y0, &f->z0.y0);
+ Fq2Neg(&f->z1.y0, &f->z1.y0);
+ Fq2MulScalar(&f->z1.y0, &f->z1.y0, &P->x);
+ Fq2Add(&f->z1.y0, &f->z1.y0, &f->z1.y0);
+ Fq2Clear(&f->z0.y1);
+ Fq2Clear(&f->z0.y2);
+ Fq2Clear(&f->z1.y2);
+}
+
+void PairingCompute(Fq12Elem* d, EccPointFq const* P, EccPointFq2 const* Q,
+ PairingState const* state) {
+ Fq2Elem X;
+ Fq2Elem Y;
+ Fq2Elem Z;
+ Fq2Elem Z2;
+ EccPointFq2 Qp;
+ Fq12Elem f;
+ VeryLargeInt s;
+ const VeryLargeInt two = {{2}};
+ uint32_t i;
+
+ VliAdd(&s, &epid_t, &epid_t); // s = 2*t
+ VliAdd(&s, &s, &epid_t); // s = 3*t
+ VliAdd(&s, &s, &s); // s = 6*t
+ if (neg) {
+ VliSub(&s, &s, &two);
+ } else {
+ VliAdd(&s, &s, &two);
+ }
+ Fq2Cp(&X, &Q->x);
+ Fq2Cp(&Y, &Q->y);
+ Fq2Set(&Z, 1);
+ Fq2Set(&Z2, 1);
+ Fq12Set(d, 1);
+
+ Fq12Clear(&f);
+ // s has 66 bits, 0 through 65, so starting point is bit 64
+ i = 65;
+ while (i > 0) {
+ i -= 1;
+ pair_tangent(&f, &X, &Y, &Z, &Z2, P);
+ Fq12Square(d, d);
+ Fq12MulSpecial(d, d, &f);
+ if (VliTestBit(&s, i)) {
+ pair_line(&f, &X, &Y, &Z, &Z2, P, Q);
+ Fq12MulSpecial(d, d, &f);
+ }
+ }
+ if (neg) {
+ Fq2Neg(&Y, &Y);
+ Fq12Conj(d, d);
+ }
+ piOp(&Qp, Q, 1, state);
+ pair_line(&f, &X, &Y, &Z, &Z2, P, &Qp);
+ Fq12MulSpecial(d, d, &f);
+ piOp(&Qp, Q, 2, state);
+ Fq2Neg(&Qp.y, &Qp.y);
+ pair_line(&f, &X, &Y, &Z, &Z2, P, &Qp);
+ Fq12MulSpecial(d, d, &f);
+ finalExp(d, state);
+ // s doesn't have secret information; no need to clear it.
+ Fq12Clear(&f);
+ Fq2Clear(&X);
+ Fq2Clear(&Y);
+ Fq2Clear(&Z);
+ Fq2Clear(&Z2);
+ Fq2Clear(&Qp.x);
+ Fq2Clear(&Qp.y);
+}
diff --git a/epid/member/tiny/math/src/serialize.c b/epid/member/tiny/math/src/serialize.c
new file mode 100644
index 0000000..3cdc5e9
--- /dev/null
+++ b/epid/member/tiny/math/src/serialize.c
@@ -0,0 +1,232 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Implementation of de/serialize functionality.
+/*! \file */
+
+#include "epid/member/tiny/math/serialize.h"
+#include <stddef.h>
+#include <stdint.h>
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/stdlib/endian.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+#if !defined(UNOPTIMIZED_SERIALIZATION)
+void SwapNativeAndPortableLayout(void* dest, size_t dest_size, void const* src,
+ size_t src_size) {
+ size_t i, j;
+#if defined(DEBUG)
+ if (dest_size != src_size || 0 != src_size % 32) {
+ memset(dest, 0xff, dest_size);
+ return;
+ }
+#else // defined(DEBUG)
+ (void)dest_size;
+#endif // defined(DEBUG)
+ for (i = 0; i < src_size; i += 32) {
+ for (j = 0; j < 32 / 2; j += sizeof(uint32_t)) {
+ uint32_t tmp = htobe32(
+ *(uint32_t*)((uint8_t*)src + i + j)); // handle src==dest case
+ *(uint32_t*)((uint8_t*)dest + i + j) =
+ htobe32(*(uint32_t*)((uint8_t*)src + i + 32 - sizeof(uint32_t) - j));
+ *(uint32_t*)((uint8_t*)dest + i + 32 - sizeof(uint32_t) - j) = tmp;
+ }
+ }
+}
+#endif // !defined(UNOPTIMIZED_SERIALIZATION)
+
+void* Uint32Serialize(OctStr32* dest, uint32_t src) {
+ int i;
+ for (i = 0; i < 4; i++)
+ dest->data[i] =
+ (char)((src >> (24 - 8 * i)) &
+ 0x000000FF); // get the ith byte of num, in little-endian order
+ return dest->data + 4;
+}
+
+void const* Uint32Deserialize(uint32_t* dest, OctStr32 const* src) {
+ int i;
+ *dest = 0;
+ for (i = 0; i < 4; i++) {
+ *dest <<= 8;
+ *dest |= (uint32_t)(*(&src->data[i]) & 0x000000FF);
+ }
+ return src->data + 4;
+}
+
+void* VliSerialize(BigNumStr* dest, VeryLargeInt const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ int i;
+ for (i = NUM_ECC_DIGITS - 1; i >= 0; i--) {
+ dest = Uint32Serialize((OctStr32*)dest, src->word[i]);
+ }
+ return dest;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return dest + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* VliDeserialize(VeryLargeInt* dest, BigNumStr const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ int i;
+ for (i = NUM_ECC_DIGITS - 1; i >= 0; i--) {
+ src = Uint32Deserialize(dest->word + i, (OctStr32 const*)src);
+ }
+ return src;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void* FqSerialize(FqElemStr* dest, FqElem const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ dest = VliSerialize((BigNumStr*)dest, &src->limbs);
+ return dest;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return dest + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* FqDeserialize(FqElem* dest, FqElemStr const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ src = VliDeserialize(&dest->limbs, (BigNumStr const*)src);
+ return src;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+#if defined(UNOPTIMIZED_SERIALIZATION)
+static void* Fq2Serialize(Fq2ElemStr* dest, Fq2Elem const* src) {
+ FqSerialize(&dest->a[0], &src->x0);
+ FqSerialize(&dest->a[1], &src->x1);
+ return dest + sizeof(*dest);
+}
+
+static void const* Fq2Deserialize(Fq2Elem* dest, Fq2ElemStr const* src) {
+ FqDeserialize(&dest->x0, &src->a[0]);
+ FqDeserialize(&dest->x1, &src->a[1]);
+ return src + sizeof(*src);
+}
+
+static void* Fq6Serialize(Fq6ElemStr* dest, Fq6Elem const* src) {
+ Fq2Serialize(&dest->a[0], &src->y0);
+ Fq2Serialize(&dest->a[1], &src->y1);
+ Fq2Serialize(&dest->a[2], &src->y2);
+ return dest + sizeof(*dest);
+}
+
+static void const* Fq6Deserialize(Fq6Elem* dest, Fq6ElemStr const* src) {
+ Fq2Deserialize(&dest->y0, &src->a[0]);
+ Fq2Deserialize(&dest->y1, &src->a[1]);
+ Fq2Deserialize(&dest->y2, &src->a[2]);
+ return src + sizeof(*src);
+}
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+
+void const* Fq12Deserialize(Fq12Elem* dest, Fq12ElemStr const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ Fq6Deserialize(&dest->z0, &src->a[0]);
+ Fq6Deserialize(&dest->z1, &src->a[1]);
+ return src + sizeof(*src);
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void* Fq12Serialize(Fq12ElemStr* dest, Fq12Elem const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ Fq6Serialize(&dest->a[0], &src->z0);
+ Fq6Serialize(&dest->a[1], &src->z1);
+ return dest + sizeof(*dest);
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return dest + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void* FpSerialize(FpElemStr* dest, FpElem const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ dest = VliSerialize((BigNumStr*)dest, &src->limbs);
+ return dest;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return dest + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* FpDeserialize(FpElem* dest, FpElemStr const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ src = VliDeserialize(&dest->limbs, (BigNumStr const*)src);
+ return src;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void* EFqSerialize(G1ElemStr* dest, EccPointFq const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ dest = FqSerialize((FqElemStr*)dest, &src->x);
+ dest = FqSerialize((FqElemStr*)dest, &src->y);
+ return dest;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return dest + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* EFqDeserialize(EccPointFq* dest, G1ElemStr const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ src = FqDeserialize(&dest->x, (FqElemStr const*)src);
+ src = FqDeserialize(&dest->y, (FqElemStr const*)src);
+ return src;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void* EFq2Serialize(G2ElemStr* dest, EccPointFq2 const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ dest = FqSerialize((FqElemStr*)dest, &src->x.x0);
+ dest = FqSerialize((FqElemStr*)dest, &src->x.x1);
+ dest = FqSerialize((FqElemStr*)dest, &src->y.x0);
+ dest = FqSerialize((FqElemStr*)dest, &src->y.x1);
+ return dest;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return dest + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* EFq2Deserialize(EccPointFq2* dest, G2ElemStr const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ src = FqDeserialize(&dest->x.x0, (FqElemStr const*)src);
+ src = FqDeserialize(&dest->x.x1, (FqElemStr const*)src);
+ src = FqDeserialize(&dest->y.x0, (FqElemStr const*)src);
+ src = FqDeserialize(&dest->y.x1, (FqElemStr const*)src);
+ return src;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
diff --git a/epid/member/tiny/math/src/sha256.c b/epid/member/tiny/math/src/sha256.c
new file mode 100644
index 0000000..22b6fd1
--- /dev/null
+++ b/epid/member/tiny/math/src/sha256.c
@@ -0,0 +1,225 @@
+/*############################################################################
+# 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 (C) 2017 by Intel Corporation, 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 Intel Corporation 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.
+ */
+/// A SHA-256 implementation.
+/*! \file */
+
+#include "epid/member/tiny/math/sha256.h"
+
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static void sha256_compress(unsigned int* iv, const uint8_t* data);
+
+void tc_sha256_init(sha256_state* s) {
+ /*
+ * Setting the initial state values.
+ * These values correspond to the first 32 bits of the fractional parts
+ * of the square roots of the first 8 primes: 2, 3, 5, 7, 11, 13, 17
+ * and 19.
+ */
+ (void)memset((uint8_t*)s, 0x00, sizeof(*s));
+ s->iv[0] = 0x6a09e667;
+ s->iv[1] = 0xbb67ae85;
+ s->iv[2] = 0x3c6ef372;
+ s->iv[3] = 0xa54ff53a;
+ s->iv[4] = 0x510e527f;
+ s->iv[5] = 0x9b05688c;
+ s->iv[6] = 0x1f83d9ab;
+ s->iv[7] = 0x5be0cd19;
+}
+
+void tc_sha256_update(sha256_state* s, const uint8_t* data, size_t datalen) {
+ while (datalen-- > 0) {
+ s->leftover[s->leftover_offset++] = *(data++);
+ if (s->leftover_offset >= SHA256_BLOCK_SIZE) {
+ sha256_compress(s->iv, s->leftover);
+ s->leftover_offset = 0;
+ s->bits_hashed += (SHA256_BLOCK_SIZE << 3);
+ }
+ }
+}
+
+void tc_sha256_final(uint8_t* digest, sha256_state* s) {
+ unsigned int i;
+
+ s->bits_hashed += (s->leftover_offset << 3);
+
+ s->leftover[s->leftover_offset++] = 0x80; /* always room for one byte */
+ if (s->leftover_offset > (sizeof(s->leftover) - 8)) {
+ /* there is not room for all the padding in this block */
+ (void)memset(s->leftover + s->leftover_offset, 0x00,
+ sizeof(s->leftover) - s->leftover_offset);
+ sha256_compress(s->iv, s->leftover);
+ s->leftover_offset = 0;
+ }
+
+ /* add the padding and the length in big-Endian format */
+ (void)memset(s->leftover + s->leftover_offset, 0x00,
+ sizeof(s->leftover) - 8 - s->leftover_offset);
+ s->leftover[sizeof(s->leftover) - 1] = (uint8_t)(s->bits_hashed);
+ s->leftover[sizeof(s->leftover) - 2] = (uint8_t)(s->bits_hashed >> 8);
+ s->leftover[sizeof(s->leftover) - 3] = (uint8_t)(s->bits_hashed >> 16);
+ s->leftover[sizeof(s->leftover) - 4] = (uint8_t)(s->bits_hashed >> 24);
+ s->leftover[sizeof(s->leftover) - 5] = (uint8_t)(s->bits_hashed >> 32);
+ s->leftover[sizeof(s->leftover) - 6] = (uint8_t)(s->bits_hashed >> 40);
+ s->leftover[sizeof(s->leftover) - 7] = (uint8_t)(s->bits_hashed >> 48);
+ s->leftover[sizeof(s->leftover) - 8] = (uint8_t)(s->bits_hashed >> 56);
+
+ /* hash the padding and length */
+ sha256_compress(s->iv, s->leftover);
+
+ /* copy the iv out to digest */
+ for (i = 0; i < SHA256_STATE_BLOCKS; ++i) {
+ unsigned int t = *((unsigned int*)&s->iv[i]);
+ *digest++ = (uint8_t)(t >> 24);
+ *digest++ = (uint8_t)(t >> 16);
+ *digest++ = (uint8_t)(t >> 8);
+ *digest++ = (uint8_t)(t);
+ }
+
+ /* destroy the current state */
+ (void)memset(s, 0, sizeof(*s));
+}
+
+/*
+ * Initializing SHA-256 Hash constant words K.
+ * These values correspond to the first 32 bits of the fractional parts of the
+ * cube roots of the first 64 primes between 2 and 311.
+ */
+static const unsigned int k256[64] = {
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
+ 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
+ 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
+ 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
+ 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
+ 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,
+ 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
+ 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
+ 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2};
+
+static unsigned int ROTR(unsigned int a, unsigned int n) {
+ return (((a) >> n) | ((a) << (32 - n)));
+}
+
+#define Sigma0(a) (ROTR((a), 2) ^ ROTR((a), 13) ^ ROTR((a), 22))
+#define Sigma1(a) (ROTR((a), 6) ^ ROTR((a), 11) ^ ROTR((a), 25))
+#define sigma0(a) (ROTR((a), 7) ^ ROTR((a), 18) ^ ((a) >> 3))
+#define sigma1(a) (ROTR((a), 17) ^ ROTR((a), 19) ^ ((a) >> 10))
+
+#define Ch(a, b, c) (((a) & (b)) ^ ((~(a)) & (c)))
+#define Maj(a, b, c) (((a) & (b)) ^ ((a) & (c)) ^ ((b) & (c)))
+
+static unsigned int BigEndian(const uint8_t** c) {
+ unsigned int n = 0;
+
+ n = (((unsigned int)(*((*c)++))) << 24);
+ n |= ((unsigned int)(*((*c)++)) << 16);
+ n |= ((unsigned int)(*((*c)++)) << 8);
+ n |= ((unsigned int)(*((*c)++)));
+ return n;
+}
+
+static void sha256_compress(unsigned int* iv, const uint8_t* data) {
+ unsigned int a, b, c, d, e, f, g, h;
+ unsigned int s0, s1;
+ unsigned int t1, t2;
+ unsigned int work_space[16];
+ unsigned int n;
+ unsigned int i;
+
+ a = iv[0];
+ b = iv[1];
+ c = iv[2];
+ d = iv[3];
+ e = iv[4];
+ f = iv[5];
+ g = iv[6];
+ h = iv[7];
+
+ for (i = 0; i < 16; ++i) {
+ n = BigEndian(&data);
+ t1 = work_space[i] = n;
+ t1 += h + Sigma1(e) + Ch(e, f, g) + k256[i];
+ t2 = Sigma0(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + t1;
+ d = c;
+ c = b;
+ b = a;
+ a = t1 + t2;
+ }
+
+ for (; i < 64; ++i) {
+ s0 = work_space[(i + 1) & 0x0f];
+ s0 = sigma0(s0);
+ s1 = work_space[(i + 14) & 0x0f];
+ s1 = sigma1(s1);
+
+ t1 = work_space[i & 0xf] += s0 + s1 + work_space[(i + 9) & 0xf];
+ t1 += h + Sigma1(e) + Ch(e, f, g) + k256[i];
+ t2 = Sigma0(a) + Maj(a, b, c);
+ h = g;
+ g = f;
+ f = e;
+ e = d + t1;
+ d = c;
+ c = b;
+ b = a;
+ a = t1 + t2;
+ }
+
+ iv[0] += a;
+ iv[1] += b;
+ iv[2] += c;
+ iv[3] += d;
+ iv[4] += e;
+ iv[5] += f;
+ iv[6] += g;
+ iv[7] += h;
+}
diff --git a/epid/member/tiny/math/src/sha512.c b/epid/member/tiny/math/src/sha512.c
new file mode 100644
index 0000000..e18cd03
--- /dev/null
+++ b/epid/member/tiny/math/src/sha512.c
@@ -0,0 +1,169 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// A SHA-512 implementation.
+/*! \file */
+
+#include "epid/member/tiny/math/sha512.h"
+
+#include <stdint.h>
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static void sha512_compress(uint64_t* iv, void const* in);
+
+void tinysha512_init(sha512_state* s) {
+ s->iv[0] = 0x6a09e667f3bcc908ULL;
+ s->iv[1] = 0xbb67ae8584caa73bULL;
+ s->iv[2] = 0x3c6ef372fe94f82bULL;
+ s->iv[3] = 0xa54ff53a5f1d36f1ULL;
+ s->iv[4] = 0x510e527fade682d1ULL;
+ s->iv[5] = 0x9b05688c2b3e6c1fULL;
+ s->iv[6] = 0x1f83d9abfb41bd6bULL;
+ s->iv[7] = 0x5be0cd19137e2179ULL;
+
+ s->bits_hashed_high = s->bits_hashed_low = (uint64_t)0;
+ s->leftover_offset = 0;
+}
+
+void tinysha512_update(sha512_state* s, void const* data, size_t data_length) {
+ unsigned char const* tmp_data = (unsigned char const*)data;
+
+ while (data_length-- > 0) {
+ s->leftover[s->leftover_offset++] = *(tmp_data++);
+ if (s->leftover_offset >= SHA512_BLOCK_SIZE) {
+ sha512_compress(s->iv, s->leftover);
+ s->leftover_offset = 0;
+ s->bits_hashed_low += (SHA512_BLOCK_SIZE << 3);
+ }
+ }
+}
+
+void tinysha512_final(unsigned char* digest, sha512_state* s) {
+ size_t i, j;
+
+ s->bits_hashed_low += (s->leftover_offset << 3);
+
+ s->leftover[s->leftover_offset++] = 0x80;
+ /* there is always room for one byte */
+ if (s->leftover_offset > (sizeof(s->leftover) - 16)) {
+ /* the data's bit length cannot be encoded in the last block */
+ (void)memset(s->leftover + s->leftover_offset, 0x00,
+ sizeof(s->leftover) - s->leftover_offset);
+ sha512_compress(s->iv, s->leftover);
+ s->leftover_offset = 0;
+ }
+
+ (void)memset(s->leftover + s->leftover_offset, 0x00,
+ sizeof(s->leftover) - 16 - s->leftover_offset);
+ for (i = 0; i < 8; i++) {
+ s->leftover[sizeof(s->leftover) - (i + 1)] =
+ (unsigned char)(s->bits_hashed_low >> (8 * i));
+ s->leftover[sizeof(s->leftover) - (i + 1) - 8] =
+ (unsigned char)(s->bits_hashed_high >> (8 * i));
+ }
+ sha512_compress(s->iv, s->leftover);
+
+ for (i = 0; i < SHA512_DIGEST_WORDS; ++i) {
+ uint64_t w = s->iv[i];
+ for (j = 0; j < 8; j++) {
+ digest[j] = (unsigned char)(w >> (8 * (7 - j)));
+ }
+ digest += 8;
+ }
+}
+
+#define B(x, j) \
+ (((uint64_t)(*(((unsigned char const*)(&x)) + j))) << ((7 - j) * 8))
+
+static uint64_t pull64(const uint64_t x) {
+ int16_t i;
+ uint64_t result = 0;
+ for (i = 0; i < 8; i++) result |= B(x, i);
+ return result;
+}
+static uint64_t ROTR(const uint64_t x, unsigned char s) {
+ return (x >> s) | (x << (64 - s));
+}
+
+#define Sigma0(x) (ROTR((x), 28) ^ ROTR((x), 34) ^ ROTR((x), 39))
+
+#define Sigma1(x) (ROTR((x), 14) ^ ROTR((x), 18) ^ ROTR((x), 41))
+#define sigma0(x) (ROTR((x), 1) ^ ROTR((x), 8) ^ ((x) >> 7))
+#define sigma1(x) (ROTR((x), 19) ^ ROTR((x), 61) ^ ((x) >> 6))
+
+#define Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z)))
+#define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
+
+static const uint64_t k512[80] = {
+ 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
+ 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
+ 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL,
+ 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,
+ 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL,
+ 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL,
+ 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL,
+ 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,
+ 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL,
+ 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL,
+ 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL,
+ 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,
+ 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL,
+ 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL,
+ 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL,
+ 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,
+ 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL,
+ 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL,
+ 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL,
+ 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,
+ 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL,
+ 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL,
+ 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL,
+ 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL,
+ 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL,
+ 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
+ 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL};
+
+static void sha512_compress(uint64_t* iv, void const* in) {
+ const uint64_t* w = (const uint64_t*)in;
+ uint64_t a, e, t;
+ uint64_t work_space[80 + 9];
+ uint64_t* work_ptr;
+ int i;
+ volatile int j;
+
+ work_ptr = work_space + 80;
+ // j is declared volatile to prevent the optimizer from replacing the for loop
+ // with a memcpy
+ for (j = 0; j < 8; j++) work_ptr[j] = iv[j];
+
+ for (i = 0; i < 80; i++, work_ptr--) {
+ if (i < 16) {
+ t = pull64(w[i]);
+ } else {
+ t = sigma0(work_ptr[8 + 16 - 1]);
+ t += sigma1(work_ptr[8 + 16 - 14]);
+ t += work_ptr[8 + 16] + work_ptr[8 + 16 - 9];
+ }
+ work_ptr[8] = t;
+ t += work_ptr[7] + Sigma1(work_ptr[4]) +
+ Ch(work_ptr[4], work_ptr[5], work_ptr[6]) + k512[i];
+ e = work_ptr[3] + t;
+ a = t + Sigma0(work_ptr[0]) + Maj(work_ptr[0], work_ptr[1], work_ptr[2]);
+ work_ptr[-1] = a;
+ work_ptr[3] = e;
+ }
+
+ for (i = 0; i < 8; i++) iv[i] += work_ptr[i];
+}
diff --git a/epid/member/tiny/math/src/vli.c b/epid/member/tiny/math/src/vli.c
new file mode 100644
index 0000000..1ec9400
--- /dev/null
+++ b/epid/member/tiny/math/src/vli.c
@@ -0,0 +1,316 @@
+/*############################################################################
+# 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 (c) 2013, Kenneth MacKay
+All rights reserved.
+https://github.com/kmackay/micro-ecc
+
+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.
+
+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 HOLDER 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.
+
+===============================================================================
+*/
+/// Implementation of Large Integer math
+
+#include "epid/member/tiny/math/vli.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/serialize.h"
+
+uint32_t VliAdd(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right) {
+ uint32_t carry = 0;
+ uint32_t i;
+ for (i = 0; i < NUM_ECC_DIGITS; ++i) {
+ uint32_t sum = left->word[i] + right->word[i] + carry;
+ carry = (sum < left->word[i]) | ((sum == left->word[i]) && carry);
+ result->word[i] = sum;
+ }
+ return carry;
+}
+
+void VliMul(VeryLargeIntProduct* result, VeryLargeInt const* left,
+ VeryLargeInt const* right) {
+ uint64_t tmp_r1 = 0;
+ uint32_t tmp_r2 = 0;
+ uint32_t i, k;
+ /* Compute each digit of result in sequence, maintaining the carries. */
+ for (k = 0; k < (uint32_t)(NUM_ECC_DIGITS * 2 - 1); ++k) {
+ uint32_t min_idx =
+ (k < (uint32_t)NUM_ECC_DIGITS ? 0 : (k + 1) - NUM_ECC_DIGITS);
+ for (i = min_idx; i <= k && i < (uint32_t)NUM_ECC_DIGITS; ++i) {
+ uint64_t product = (uint64_t)left->word[i] * right->word[k - i];
+ tmp_r1 += product;
+ tmp_r2 += (tmp_r1 < product);
+ }
+ result->word[k] = (uint32_t)tmp_r1;
+ tmp_r1 = (tmp_r1 >> 32) | (((uint64_t)tmp_r2) << 32);
+ tmp_r2 = 0;
+ }
+ result->word[NUM_ECC_DIGITS * 2 - 1] = (uint32_t)tmp_r1;
+}
+
+void VliRShift(VeryLargeInt* result, VeryLargeInt const* in, uint32_t shift) {
+ uint32_t i;
+ for (i = 0; i < NUM_ECC_DIGITS - 1; i++) {
+ result->word[i] = (in->word[i] >> shift) | in->word[i + 1] << (32 - shift);
+ }
+ result->word[NUM_ECC_DIGITS - 1] = in->word[NUM_ECC_DIGITS - 1] >> shift;
+}
+
+uint32_t VliSub(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right) {
+ uint32_t borrow = 0;
+
+ int i;
+ for (i = 0; i < NUM_ECC_DIGITS; ++i) {
+ uint32_t diff = left->word[i] - right->word[i] - borrow;
+ borrow = (diff > left->word[i]) | ((diff == left->word[i]) && borrow);
+ result->word[i] = diff;
+ }
+ return borrow;
+}
+
+void VliSet(VeryLargeInt* result, VeryLargeInt const* in) {
+ uint32_t i;
+ for (i = 0; i < NUM_ECC_DIGITS; ++i) {
+ result->word[i] = in->word[i];
+ }
+}
+
+void VliClear(VeryLargeInt* result) {
+ uint32_t i;
+ for (i = 0; i < NUM_ECC_DIGITS; ++i) {
+ result->word[i] = 0;
+ }
+}
+
+int VliIsZero(VeryLargeInt const* in) {
+ uint32_t i, acc = 0;
+ for (i = 0; i < NUM_ECC_DIGITS; ++i) {
+ acc += (in->word[i] != 0);
+ }
+ return (!acc);
+}
+
+void VliCondSet(VeryLargeInt* result, VeryLargeInt const* true_val,
+ VeryLargeInt const* false_val, int truth_val) {
+ int i;
+ for (i = 0; i < NUM_ECC_DIGITS; i++)
+ result->word[i] = (!truth_val) * false_val->word[i] +
+ (truth_val != 0) * true_val->word[i];
+}
+
+uint32_t VliTestBit(VeryLargeInt const* in, uint32_t bit) {
+ return ((in->word[bit >> 5] >> (bit & 31)) &
+ 1); // p_bit % 32 = p_bit & 0x0000001F = 31
+}
+
+int VliRand(VeryLargeInt* result, BitSupplier rnd_func, void* rnd_param) {
+ uint32_t t[NUM_ECC_DIGITS] = {0};
+ if (rnd_func(t, sizeof(VeryLargeInt) * 8, rnd_param)) {
+ return 0;
+ }
+ VliDeserialize(result, (BigNumStr const*)t);
+ return 1;
+}
+
+int VliCmp(VeryLargeInt const* left, VeryLargeInt const* right) {
+ int i, cmp = 0;
+ for (i = NUM_ECC_DIGITS - 1; i >= 0; --i) {
+ cmp |=
+ ((left->word[i] > right->word[i]) - (left->word[i] < right->word[i])) *
+ (!cmp);
+ }
+ return cmp;
+}
+
+void VliModAdd(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right, VeryLargeInt const* mod) {
+ VeryLargeInt tmp;
+ uint32_t carry = VliAdd(result, left, right);
+ carry = VliSub(&tmp, result, mod) - carry;
+ VliCondSet(result, result, &tmp, carry);
+}
+
+void VliModSub(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right, VeryLargeInt const* mod) {
+ VeryLargeInt tmp;
+ uint32_t borrow = VliSub(result, left, right);
+ VliAdd(&tmp, result, mod);
+ VliCondSet(result, &tmp, result, borrow);
+}
+
+void VliModMul(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right, VeryLargeInt const* mod) {
+ VeryLargeIntProduct product;
+ VliMul(&product, left, right);
+ VliModBarrett(result, &product, mod);
+}
+
+static void vliSquare(VeryLargeIntProduct* p_result,
+ VeryLargeInt const* p_left) {
+ uint64_t tmp_r1 = 0;
+ uint32_t tmp_r2 = 0;
+ uint32_t i, k;
+ for (k = 0; k < NUM_ECC_DIGITS * 2 - 1; ++k) {
+ uint32_t min_idx = (k < NUM_ECC_DIGITS ? 0 : (k + 1) - NUM_ECC_DIGITS);
+ for (i = min_idx; i <= k && i <= k - i; ++i) {
+ uint64_t l_product = (uint64_t)p_left->word[i] * p_left->word[k - i];
+ if (i < k - i) {
+ tmp_r2 += l_product >> 63;
+ l_product *= 2;
+ }
+ tmp_r1 += l_product;
+ tmp_r2 += (tmp_r1 < l_product);
+ }
+ p_result->word[k] = (uint32_t)tmp_r1;
+ tmp_r1 = (tmp_r1 >> 32) | (((uint64_t)tmp_r2) << 32);
+ tmp_r2 = 0;
+ }
+
+ p_result->word[NUM_ECC_DIGITS * 2 - 1] = (uint32_t)tmp_r1;
+}
+
+void VliModExp(VeryLargeInt* result, VeryLargeInt const* base,
+ VeryLargeInt const* exp, VeryLargeInt const* mod) {
+ VeryLargeInt acc, tmp;
+ VeryLargeIntProduct product;
+ uint32_t j;
+ int i;
+ VliClear(&acc);
+ acc.word[0] = 1;
+ for (i = NUM_ECC_DIGITS - 1; i >= 0; i--) {
+ for (j = 1U << 31; j > 0; j = j >> 1) {
+ vliSquare(&product, &acc);
+ VliModBarrett(&acc, &product, mod);
+ VliMul(&product, &acc, base);
+ VliModBarrett(&tmp, &product, mod);
+ VliCondSet(&acc, &tmp, &acc, j & (exp->word[i]));
+ }
+ }
+ VliSet(result, &acc);
+}
+
+void VliModInv(VeryLargeInt* result, VeryLargeInt const* input,
+ VeryLargeInt const* mod) {
+ VeryLargeInt power;
+ VliSet(&power, mod);
+ power.word[0] -= 2;
+ VliModExp(result, input, &power, mod);
+}
+
+void VliModSquare(VeryLargeInt* result, VeryLargeInt const* input,
+ VeryLargeInt const* mod) {
+ VeryLargeIntProduct product;
+ vliSquare(&product, input);
+ VliModBarrett(result, &product, mod);
+}
+
+/* Computes p_result = p_in << c, returning carry.
+ * Can modify in place (if p_result == p_in). 0 < p_shift < 32. */
+static uint32_t vliLShift(VeryLargeIntProduct* p_result,
+ VeryLargeIntProduct const* p_in, uint32_t p_shift) {
+ int i;
+ uint32_t carry = p_in->word[NUM_ECC_DIGITS * 2 - 1];
+ for (i = NUM_ECC_DIGITS * 2 - 1; i > 0; --i)
+ p_result->word[i] =
+ ((p_in->word[i] << p_shift) | (p_in->word[i - 1] >> (32 - p_shift)));
+ p_result->word[0] = p_in->word[0] << p_shift;
+ return carry >> (32 - p_shift);
+}
+
+static void vliScalarMult(VeryLargeInt* p_result, VeryLargeInt* p_left,
+ uint32_t p_right) {
+ int i;
+ uint64_t tmpresult;
+ uint32_t left = 0, right;
+ for (i = 0; i < NUM_ECC_DIGITS - 1; i++) {
+ tmpresult = p_left->word[i] * ((uint64_t)p_right);
+ right = left + ((uint32_t)tmpresult);
+ left = (right < left) + ((uint32_t)(tmpresult >> 32));
+ p_result->word[i] = right;
+ }
+ p_result->word[NUM_ECC_DIGITS - 1] = left;
+}
+
+static void vliProdRShift(VeryLargeIntProduct* result,
+ VeryLargeIntProduct const* in, uint32_t shift,
+ uint32_t len) {
+ uint32_t i;
+ for (i = 0; i < len - 1; i++) {
+ result->word[i] = (in->word[i] >> shift) | in->word[i + 1] << (32 - shift);
+ }
+ result->word[len - 1] = in->word[len - 1] >> shift;
+}
+
+/* WARNING THIS METHOD MAKES STRONG ASSUMPTIONS ABOUT THE INVOLVED PRIMES
+ * All primes used for computations in Intel(R) EPID 2.0 begin with 32 ones.
+ * This method assumes 2^256 - p_mod
+ * begins with 32 zeros, and is tuned to this assumption. Violating this
+ * assumption will cause it not
+ * to work. It also assumes that it does not end with 32 zeros.
+ */
+void VliModBarrett(VeryLargeInt* result, VeryLargeIntProduct const* input,
+ VeryLargeInt const* mod) {
+ int i;
+ VeryLargeIntProduct tmpprod;
+ VeryLargeInt negprime, linear;
+ uint32_t carry = 0;
+ VliSet((VeryLargeInt*)&tmpprod.word[0], (VeryLargeInt const*)&input->word[0]);
+ VliSet((VeryLargeInt*)&tmpprod.word[NUM_ECC_DIGITS],
+ (VeryLargeInt const*)&input->word[NUM_ECC_DIGITS]);
+ // negative prime is ~q + 1, so we store this in
+ for (i = 0; i < NUM_ECC_DIGITS - 1; i++) negprime.word[i] = ~mod->word[i];
+ negprime.word[0]++;
+ for (i = 0; i < NUM_ECC_DIGITS; i++) {
+ vliScalarMult(&linear, &negprime, tmpprod.word[2 * NUM_ECC_DIGITS - 1]);
+ tmpprod.word[2 * NUM_ECC_DIGITS - 1] = 0;
+ tmpprod.word[2 * NUM_ECC_DIGITS - 1] =
+ VliAdd((VeryLargeInt*)&tmpprod.word[NUM_ECC_DIGITS - 1],
+ (VeryLargeInt const*)&tmpprod.word[7], &linear);
+ vliLShift(&tmpprod, &tmpprod, 31);
+ }
+ // shift the 256+32-NUM_ECC_DIGITS-1 bits in the largest 9 limbs back to the
+ // base
+ vliProdRShift(&tmpprod,
+ (VeryLargeIntProduct const*)&tmpprod.word[NUM_ECC_DIGITS - 1],
+ (31 * 8) % 32, NUM_ECC_DIGITS + 1);
+ vliScalarMult(&linear, &negprime, tmpprod.word[NUM_ECC_DIGITS]);
+ carry = VliAdd((VeryLargeInt*)&tmpprod.word[0],
+ (VeryLargeInt const*)&tmpprod.word[0],
+ (VeryLargeInt const*)&linear);
+ carry |= (-1 < VliCmp((VeryLargeInt const*)&tmpprod.word[0], mod));
+ vliScalarMult(&linear, &negprime, carry);
+ VliAdd(result, (VeryLargeInt const*)&tmpprod.word[0], &linear);
+}
diff --git a/epid/member/tiny/math/unittests/cmp-testhelper.cc b/epid/member/tiny/math/unittests/cmp-testhelper.cc
new file mode 100644
index 0000000..8956f75
--- /dev/null
+++ b/epid/member/tiny/math/unittests/cmp-testhelper.cc
@@ -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.
+############################################################################*/
+/// Comparators for tiny math types.
+/*! \file */
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+
+#include <cstring>
+
+extern "C" {
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/efq2.h"
+#include "epid/member/tiny/math/mathtypes.h"
+}
+
+bool operator==(VeryLargeInt const& lhs, VeryLargeInt const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(VeryLargeIntProduct const& lhs,
+ VeryLargeIntProduct const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+bool operator==(FpElem const& lhs, FpElem const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(FqElem const& lhs, FqElem const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(Fq2Elem const& lhs, Fq2Elem const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(Fq6Elem const& lhs, Fq6Elem const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(Fq12Elem const& lhs, Fq12Elem const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(EccPointFq const& lhs, EccPointFq const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(EccPointJacobiFq const& lhs, EccPointJacobiFq const& rhs) {
+ return 0 != EFqEq(&lhs, &rhs);
+}
+
+bool operator==(EccPointFq2 const& lhs, EccPointFq2 const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(EccPointJacobiFq2 const& lhs, EccPointJacobiFq2 const& rhs) {
+ return 0 != EFq2Eq(&lhs, &rhs);
+}
diff --git a/epid/member/tiny/math/unittests/cmp-testhelper.h b/epid/member/tiny/math/unittests/cmp-testhelper.h
new file mode 100644
index 0000000..c8a688f
--- /dev/null
+++ b/epid/member/tiny/math/unittests/cmp-testhelper.h
@@ -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.
+############################################################################*/
+/// Comparators for tiny math types.
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_UNITTESTS_CMP_TESTHELPER_H_
+#define EPID_MEMBER_TINY_MATH_UNITTESTS_CMP_TESTHELPER_H_
+
+typedef struct VeryLargeInt VeryLargeInt;
+typedef struct VeryLargeIntProduct VeryLargeIntProduct;
+typedef struct FpElem FpElem;
+typedef struct FqElem FqElem;
+typedef struct Fq2Elem Fq2Elem;
+typedef struct Fq6Elem Fq6Elem;
+typedef struct Fq12Elem Fq12Elem;
+typedef struct EccPointFq EccPointFq;
+typedef struct EccPointJacobiFq EccPointJacobiFq;
+typedef struct EccPointFq2 EccPointFq2;
+typedef struct EccPointJacobiFq2 EccPointJacobiFq2;
+
+/// compares VeryLargeInt values
+bool operator==(VeryLargeInt const& lhs, VeryLargeInt const& rhs);
+bool operator==(VeryLargeIntProduct const& lhs, VeryLargeIntProduct const& rhs);
+
+/// compares FpElem values
+bool operator==(FpElem const& lhs, FpElem const& rhs);
+
+/// compares FqElem values
+bool operator==(FqElem const& lhs, FqElem const& rhs);
+
+/// compares Fq2Elem values
+bool operator==(Fq2Elem const& lhs, Fq2Elem const& rhs);
+
+/// compares Fq6Elem values
+bool operator==(Fq6Elem const& lhs, Fq6Elem const& rhs);
+
+/// compares Fq12Elem values
+bool operator==(Fq12Elem const& lhs, Fq12Elem const& rhs);
+
+/// compares EccPointFq values
+bool operator==(EccPointFq const& lhs, EccPointFq const& rhs);
+
+/// compares EccPointJacobiFq values
+bool operator==(EccPointJacobiFq const& lhs, EccPointJacobiFq const& rhs);
+
+/// compares EccPointFq2 values
+bool operator==(EccPointFq2 const& lhs, EccPointFq2 const& rhs);
+
+/// compares EccPointJacobiFq2 values
+bool operator==(EccPointJacobiFq2 const& lhs, EccPointJacobiFq2 const& rhs);
+
+#endif // EPID_MEMBER_TINY_MATH_UNITTESTS_CMP_TESTHELPER_H_
diff --git a/epid/member/tiny/math/unittests/efq-test.cc b/epid/member/tiny/math/unittests/efq-test.cc
new file mode 100644
index 0000000..b33e5d6
--- /dev/null
+++ b/epid/member/tiny/math/unittests/efq-test.cc
@@ -0,0 +1,714 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of EFq implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+#include <cstring>
+#include <random>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+#include "epid/member/tiny/math/unittests/onetimepad.h"
+
+extern "C" {
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/fq.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/vli.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// EFqMulSSCM
+TEST(TinyEFqTest, EFqMulSSCMWorks) {
+ const EccPointJacobiFq expected = {
+ {0xacd848b1, 0xe3d60553, 0x69271cd1, 0x7cf6090e, 0x16c63bcd, 0xdb0c6cf0,
+ 0x2ab60283, 0x38fc72a8},
+ {0xf7e0f7d1, 0x6b0cf194, 0x5cf18c77, 0x82a4b960, 0xa6c40a30, 0xf0b3b20f,
+ 0x5f1a477b, 0x7e2a6668},
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}};
+ const EccPointJacobiFq left = {
+ {0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357, 0x4780716c,
+ 0xffd94b0f, 0x5e643124},
+ {0x5e9cb480, 0x6d4aaf9c, 0x99f1f606, 0x222d89b0, 0x30b79eab, 0x88844bd6,
+ 0xc65e7c30, 0x4830c4ec},
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}};
+ const FpElem power = {0x0adf9a12, 0x5cbc9ef4, 0x91762984, 0xa08a22fb,
+ 0x52a6fddf, 0xf51e743e, 0x7b47b24b, 0x389f865f};
+
+ EccPointJacobiFq actual = {0};
+
+ EFqMulSSCM(&actual, &left, &power);
+ EXPECT_EQ(expected, actual);
+}
+
+TEST(TinyEFqTest, EFqMulSSCMWorksInPlace) {
+ const EccPointJacobiFq expected = {
+ {0xacd848b1, 0xe3d60553, 0x69271cd1, 0x7cf6090e, 0x16c63bcd, 0xdb0c6cf0,
+ 0x2ab60283, 0x38fc72a8},
+ {0xf7e0f7d1, 0x6b0cf194, 0x5cf18c77, 0x82a4b960, 0xa6c40a30, 0xf0b3b20f,
+ 0x5f1a477b, 0x7e2a6668},
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}};
+ EccPointJacobiFq left = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x5e9cb480, 0x6d4aaf9c, 0x99f1f606, 0x222d89b0,
+ 0x30b79eab, 0x88844bd6, 0xc65e7c30, 0x4830c4ec},
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000}};
+ const FpElem power = {0x0adf9a12, 0x5cbc9ef4, 0x91762984, 0xa08a22fb,
+ 0x52a6fddf, 0xf51e743e, 0x7b47b24b, 0x389f865f};
+
+ EFqMulSSCM(&left, &left, &power);
+ EXPECT_EQ(expected, left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqMultiExp
+
+TEST(TinyEFqTest, EFqAffineExpWorks) {
+ EccPointFq efq_left = {0};
+ EccPointFq efq_right = {{{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6,
+ 0x0ac0b46b, 0x557a5f30, 0xaf075250, 0x786528cb}}};
+
+ EccPointFq efq_expect = {{{0x79171d4b, 0x0f5ac562, 0x3b911d03, 0x0992a2dc,
+ 0x3130dd84, 0x16344c80, 0x436ca13c, 0xaf1d9819}},
+ {{0x742268cd, 0x070b4ac7, 0x7f2b13b7, 0xe167da7f,
+ 0xd84d16af, 0x9e824ebe, 0x6b5dc0f0, 0x90bd1aa3}}};
+
+ FpElem fp_exp = {3};
+
+ EFqAffineExp(&efq_left, &efq_right, &fp_exp);
+
+ EXPECT_EQ(efq_expect, efq_left);
+}
+TEST(TinyEFqTest, EFqAffineExpWorksInPlace) {
+ EccPointFq efq_right = {{{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6,
+ 0x0ac0b46b, 0x557a5f30, 0xaf075250, 0x786528cb}}};
+
+ EccPointFq efq_expect = {{{0x79171d4b, 0x0f5ac562, 0x3b911d03, 0x0992a2dc,
+ 0x3130dd84, 0x16344c80, 0x436ca13c, 0xaf1d9819}},
+ {{0x742268cd, 0x070b4ac7, 0x7f2b13b7, 0xe167da7f,
+ 0xd84d16af, 0x9e824ebe, 0x6b5dc0f0, 0x90bd1aa3}}};
+
+ FpElem fp_exp = {3};
+
+ EFqAffineExp(&efq_right, &efq_right, &fp_exp);
+
+ EXPECT_EQ(efq_expect, efq_right);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqAffineMultiExp
+TEST(TinyEFqTest, EFqAffineMultiExpWorks) {
+ // eFq2^3*eFq2^3
+ EccPointFq efq_left = {0};
+ EccPointFq efq_right = {{{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6,
+ 0x0ac0b46b, 0x557a5f30, 0xaf075250, 0x786528cb}}};
+
+ EccPointFq efq_expect = {{{0x1a178986, 0xeeb06c08, 0x857d79f0, 0x246d0ed6,
+ 0xed31a3b2, 0x7bf832a0, 0x81a8a27b, 0x3d0cab80}},
+ {{0xfe2a1509, 0x41cda394, 0x42b33efb, 0x2811fa22,
+ 0x0ad56486, 0xe52b1a56, 0xf6dc881c, 0x6fee593f}}};
+
+ FpElem fp_exp = {3};
+
+ EFqAffineMultiExp(&efq_left, &efq_right, &fp_exp, &efq_right, &fp_exp);
+
+ EXPECT_EQ(efq_expect, efq_left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqMultiExp
+TEST(TinyEFqTest, EFqMultiExpWorks) {
+ EccPointFq efq_left = {0};
+ EccPointFq efq_right = {{{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6,
+ 0x0ac0b46b, 0x557a5f30, 0xaf075250, 0x786528cb}}};
+
+ EccPointFq efq_expect = {{{0x1a178986, 0xeeb06c08, 0x857d79f0, 0x246d0ed6,
+ 0xed31a3b2, 0x7bf832a0, 0x81a8a27b, 0x3d0cab80}},
+ {{0xfe2a1509, 0x41cda394, 0x42b33efb, 0x2811fa22,
+ 0x0ad56486, 0xe52b1a56, 0xf6dc881c, 0x6fee593f}}};
+
+ EccPointJacobiFq efqj_left = {0};
+ EccPointJacobiFq efqj_right;
+
+ FpElem fp_exp = {3};
+
+ EFqFromAffine(&efqj_right, &efq_right);
+ EFqMultiExp(&efqj_left, &efqj_right, &fp_exp, &efqj_right, &fp_exp);
+ EFqToAffine(&efq_left, &efqj_left);
+
+ EXPECT_EQ(efq_expect, efq_left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqAffineAdd
+TEST(TinyEFqTest, EFqAffineAddWorks) {
+ EccPointFq efq_left = {{{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6,
+ 0x0ac0b46b, 0x557a5f30, 0xaf075250, 0x786528cb}}};
+
+ EccPointFq const efq_expect = {
+ {{0x7305f782, 0x84101559, 0xe065da04, 0xfd373fcf, 0x31d2f725, 0x9b420bdc,
+ 0x622ac9c3, 0xba0ef378}},
+ {{0x97b2adf0, 0x2935c14b, 0xfc6415b0, 0x48ba036a, 0x61ca7383, 0xcff7f03d,
+ 0x23a2c3e6, 0x0df0d4a5}}};
+
+ EFqAffineAdd(&efq_left, &efq_left, &efq_left);
+ EXPECT_EQ(efq_expect, efq_left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqAffineDbl
+TEST(TinyEFqTest, EFqAffineDblWorks) {
+ EccPointFq efq_left = {{{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6,
+ 0x0ac0b46b, 0x557a5f30, 0xaf075250, 0x786528cb}}};
+
+ EccPointFq const efq_expect = {
+ {{0x7305f782, 0x84101559, 0xe065da04, 0xfd373fcf, 0x31d2f725, 0x9b420bdc,
+ 0x622ac9c3, 0xba0ef378}},
+ {{0x97b2adf0, 0x2935c14b, 0xfc6415b0, 0x48ba036a, 0x61ca7383, 0xcff7f03d,
+ 0x23a2c3e6, 0x0df0d4a5}}};
+
+ EFqAffineDbl(&efq_left, &efq_left);
+ EXPECT_EQ(efq_expect, efq_left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqDbl
+TEST(TinyEFqTest, EFqDblWorks) {
+ EccPointJacobiFq efqj_left = {
+ {{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1, 0xe3401760, 0x66eb7d52,
+ 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6, 0x0ac0b46b, 0x557a5f30,
+ 0xaf075250, 0x786528cb}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+
+ EccPointJacobiFq const efqj_expect = {
+ {{0x7305f782, 0x84101559, 0xe065da04, 0xfd373fcf, 0x31d2f725, 0x9b420bdc,
+ 0x622ac9c3, 0xba0ef378}},
+ {{0x97b2adf0, 0x2935c14b, 0xfc6415b0, 0x48ba036a, 0x61ca7383, 0xcff7f03d,
+ 0x23a2c3e6, 0x0df0d4a5}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EFqDbl(&efqj_left, &efqj_left);
+ EXPECT_EQ(efqj_expect, efqj_left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqAdd
+TEST(TinyEFqTest, EFqAddWorks) {
+ EccPointJacobiFq efqj_left = {
+ {{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1, 0xe3401760, 0x66eb7d52,
+ 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6, 0x0ac0b46b, 0x557a5f30,
+ 0xaf075250, 0x786528cb}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+
+ EccPointJacobiFq const efqj_expect = {
+ {{0x7305f782, 0x84101559, 0xe065da04, 0xfd373fcf, 0x31d2f725, 0x9b420bdc,
+ 0x622ac9c3, 0xba0ef378}},
+ {{0x97b2adf0, 0x2935c14b, 0xfc6415b0, 0x48ba036a, 0x61ca7383, 0xcff7f03d,
+ 0x23a2c3e6, 0x0df0d4a5}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+
+ EFqAdd(&efqj_left, &efqj_left, &efqj_left);
+ EXPECT_EQ(efqj_expect, efqj_left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqRand
+
+// Checks if EFqRand can generate points with Y >= q+1
+TEST(TinyEFqTest, EFqRandCanGenerateBigY) {
+ OneTimePad otp({
+ 0x25, 0xeb, 0x8c, 0x48, 0xff, 0x89, 0xcb, 0x85, 0x4f, 0xc0, 0x90, 0x81,
+ 0xcc, 0x47, 0xed, 0xfc, 0x86, 0x19, 0xb2, 0x14, 0xfe, 0x65, 0x92, 0xd4,
+ 0x8b, 0xfc, 0xea, 0x9c, 0x9d, 0x8e, 0x32, 0x44, 0xd7, 0xd7, 0xe9, 0xf1,
+ 0xf7, 0xde, 0x60, 0x56, 0x8d, 0xe9, 0x89, 0x07, 0x3f, 0x3d, 0x16, 0x39,
+ });
+
+ // expected.y >= q+1
+ EccPointFq expected = {{0xd78542d3, 0xf824c127, 0x81eea621, 0x6990833d,
+ 0x9d843df6, 0x3df36126, 0x435e8eda, 0x2d267586},
+ {0x1B8DC14B, 0x5967C520, 0x61CECE5D, 0x0290B5BC,
+ 0x49278859, 0x2C523D9A, 0x6D0AE6DE, 0xAE5590C9}};
+
+ EccPointFq actual = {0};
+ EXPECT_TRUE(EFqRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+ EXPECT_EQ(384u, otp.BitsConsumed());
+}
+
+// Checks if EFqRand can generate points with Y <= q-1
+TEST(TinyEFqTest, EFqRandCanGenerateSmallY) {
+ OneTimePad otp({
+ 0x47, 0xe7, 0xb0, 0x36, 0x0f, 0x85, 0x91, 0xaa, 0x14, 0x76, 0xb0, 0x16,
+ 0xe5, 0x8d, 0xf1, 0x72, 0x61, 0xb5, 0x54, 0x0a, 0x60, 0xb7, 0x3d, 0x38,
+ 0xd9, 0x95, 0xe7, 0x60, 0xf9, 0xd3, 0x19, 0xf1, 0x8e, 0x8d, 0xd4, 0x74,
+ 0x2b, 0x86, 0xcd, 0xb8, 0xbb, 0x8f, 0x18, 0xfb, 0x89, 0xc2, 0xc7, 0x35,
+ });
+
+ // expected.y <= q-1
+ EccPointFq expected = {{0x5f65199e, 0x59366f56, 0xb1d35d89, 0xf42fdc1f,
+ 0x07fd66d6, 0x95f32cb3, 0xc4ef7101, 0xeb426988},
+ {0x834171f5, 0xca1c1f05, 0xdcb4d142, 0xbe060756,
+ 0x9185652b, 0xb3b9ede1, 0x671f682e, 0x22d0c94c}};
+
+ EccPointFq actual = {0};
+ EXPECT_TRUE(EFqRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+ EXPECT_EQ(384u, otp.BitsConsumed());
+}
+
+TEST(TinyEFqTest, EFqRandWorksForFailedSquareRoot) {
+ // Only last 48 bytes of the given otp will result in x such that
+ // Fq.sqrt of (x^3 + a*x + b) exists.
+ OneTimePad otp({
+ 0x01, 0x80, 0x3c, 0xd1, 0x08, 0xd8, 0x8d, 0x73, 0xaf, 0xea, 0x79, 0xc8,
+ 0x1e, 0x47, 0x83, 0xc6, 0x95, 0x31, 0x39, 0x03, 0xc4, 0x18, 0xf1, 0x2b,
+ 0x4c, 0x1a, 0x34, 0x50, 0x6d, 0x73, 0x29, 0xd2, 0x0f, 0x40, 0xc4, 0x19,
+ 0x6f, 0xe2, 0xd7, 0x87, 0x1a, 0x99, 0x68, 0x16, 0x09, 0xc3, 0xe7, 0x7e,
+ 0x17, 0x7d, 0x64, 0x9b, 0xa5, 0x39, 0x53, 0xa6, 0x88, 0x20, 0xa2, 0x0a,
+ 0x17, 0x8f, 0xef, 0x57, 0x19, 0xc7, 0xf3, 0x5c, 0x4a, 0xbe, 0x2e, 0xa0,
+ 0xd8, 0x97, 0xb7, 0x41, 0x71, 0x4d, 0x03, 0x80, 0xf8, 0xfd, 0xcd, 0x06,
+ 0x34, 0xd5, 0xc6, 0x02, 0x4c, 0xdb, 0x95, 0xcb, 0x07, 0x4d, 0xc8, 0x4b,
+ 0x4c, 0x2b, 0x14, 0x1e, 0x24, 0x67, 0x07, 0x2d, 0xc4, 0x39, 0xf0, 0xfc,
+ 0xd2, 0x60, 0x0d, 0x0a, 0x17, 0x7c, 0x51, 0x87, 0x79, 0x98, 0xca, 0xdc,
+ 0x94, 0xa0, 0x8c, 0xc1, 0x5e, 0x3c, 0xe9, 0x98, 0x52, 0x73, 0x61, 0x82,
+ 0xec, 0xdc, 0x67, 0x62, 0x0a, 0xb6, 0x60, 0xe9, 0x52, 0xd6, 0xc6, 0xc2,
+ 0x47, 0xe7, 0xb0, 0x36, 0x0f, 0x85, 0x91, 0xaa, 0x14, 0x76, 0xb0, 0x16,
+ 0xe5, 0x8d, 0xf1, 0x72, 0x61, 0xb5, 0x54, 0x0a, 0x60, 0xb7, 0x3d, 0x38,
+ 0xd9, 0x95, 0xe7, 0x60, 0xf9, 0xd3, 0x19, 0xf1, 0x8e, 0x8d, 0xd4, 0x74,
+ 0x2b, 0x86, 0xcd, 0xb8, 0xbb, 0x8f, 0x18, 0xfb, 0x89, 0xc2, 0xc7, 0x35,
+ });
+
+ EccPointFq expected = {{0x5f65199e, 0x59366f56, 0xb1d35d89, 0xf42fdc1f,
+ 0x07fd66d6, 0x95f32cb3, 0xc4ef7101, 0xeb426988},
+ {0x834171f5, 0xca1c1f05, 0xdcb4d142, 0xbe060756,
+ 0x9185652b, 0xb3b9ede1, 0x671f682e, 0x22d0c94c}};
+
+ EccPointFq actual = {0};
+
+ EXPECT_TRUE(EFqRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+ EXPECT_EQ(1536u, otp.BitsConsumed());
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqSet
+
+TEST(TinyEFqTest, EFqSetWorks) {
+ EccPointJacobiFq efqj_left = {0};
+ EccPointJacobiFq const efqj_expect = {{{1}}, {{2}}, {{1}}};
+
+ FqElem x = {1};
+ FqElem y = {2};
+
+ EFqSet(&efqj_left, &x, &y);
+ EXPECT_EQ(efqj_expect, efqj_left);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqIsInf
+TEST(TinyEFqTest, EFqIsInfPasses) {
+ EccPointJacobiFq const efqj_inf = {{{0}}, {{1}}, {{0}}};
+
+ EXPECT_TRUE(EFqIsInf(&efqj_inf));
+}
+
+TEST(TinyEFqTest, EFqIsInfFails) {
+ EccPointJacobiFq const efqj_noninf = {{{1}}, {{2}}, {{1}}};
+
+ EXPECT_FALSE(EFqIsInf(&efqj_noninf));
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqFromAffine
+TEST(TinyEFqTest, FqFromAffineWorks) {
+ EccPointJacobiFq efqj_left = {0};
+ EccPointJacobiFq const efqj_expect = {{{1}}, {{2}}, {{1}}};
+ EccPointFq efq_left = {{{1}}, {{2}}};
+
+ EFqFromAffine(&efqj_left, &efq_left);
+ EXPECT_EQ(efqj_expect, efqj_left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFqToAffine
+
+TEST(TinyEFqTest, EFqToAffineWorks) {
+ EccPointFq efq_left = {0};
+ EccPointFq const efq_expect = {{{1}}, {{2}}};
+ EccPointJacobiFq efqj_left = {{{1}}, {{2}}, {{1}}};
+
+ EFqToAffine(&efq_left, &efqj_left);
+ EXPECT_EQ(efq_expect, efq_left);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqNeg
+
+TEST(TinyEFqTest, EFqNegWorks) {
+ EccPointJacobiFq efqj_left = {0};
+ EccPointJacobiFq efqj_right = {
+ {{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1, 0xe3401760, 0x66eb7d52,
+ 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6, 0x0ac0b46b, 0x557a5f30,
+ 0xaf075250, 0x786528cb}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+
+ EccPointJacobiFq const efqj_expect = {
+ {{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1, 0xe3401760, 0x66eb7d52,
+ 0x918d50a7, 0x12a65bd6}},
+ {{0x8f98a4d1, 0x0a561b5c, 0xa50112b5, 0x226c8304, 0xe3b0f033, 0xf16b932e,
+ 0x50f59e7c, 0x879ad734}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EFqNeg(&efqj_left, &efqj_right);
+
+ EXPECT_EQ(efqj_expect, efqj_left);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqEq
+
+TEST(TinyEFqTest, EFqEqPasses) {
+ EccPointJacobiFq const efqj_left = {{{1}}, {{2}}, {{1}}};
+
+ EccPointJacobiFq const efqj_right = {{{1}}, {{2}}, {{1}}};
+
+ EXPECT_TRUE(EFqEq(&efqj_left, &efqj_right));
+}
+
+TEST(TinyEFqTest, EFqEqFails) {
+ EccPointJacobiFq const efqj_left = {{{1}}, {{2}}, {{1}}};
+
+ EccPointJacobiFq const efqj_right = {
+ {{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1, 0xe3401760, 0x66eb7d52,
+ 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6, 0x0ac0b46b, 0x557a5f30,
+ 0xaf075250, 0x786528cb}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+
+ EXPECT_FALSE(EFqEq(&efqj_left, &efqj_right));
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqHash
+
+TEST(TinyEFqTest, EFqHashWithSha512Works) {
+ EccPointFq efq_result = {0};
+ EccPointFq efq_expect = {{{0x992a96e4, 0x42f7b394, 0xf3bada9c, 0xb4033d83,
+ 0x21979b9b, 0xbc82a6a2, 0x55555586, 0x8c62a02d}},
+ {{0x406c8f03, 0xe691d8f3, 0xadf2f27b, 0x69540cc6,
+ 0xe02b87f7, 0x217d5424, 0x17b9fbe5, 0x4c0ea762}}};
+ unsigned char const msg_buf[] = {'a', 'b', 'c'};
+ size_t len = sizeof(msg_buf);
+ HashAlg hashalg = kSha512;
+ EXPECT_TRUE(EFqHash(&efq_result, msg_buf, len, hashalg));
+ EXPECT_EQ(efq_expect, efq_result);
+}
+
+TEST(TinyEFqTest, EFqHashWithSha256Works) {
+ EccPointFq efq_result = {0};
+ EccPointFq efq_expect = {{{0x8008953d, 0xd54a103c, 0x70e6186b, 0x54f5a62a,
+ 0xadbe836e, 0xf3716581, 0x88ff2562, 0x2ebb504d}},
+ {{0xdc48f9f7, 0x48aa0d6c, 0x623e2c1f, 0x7ecdf02e,
+ 0x07f07a32, 0xbd6738b1, 0xb13f3cb4, 0x8a43a104}}};
+ unsigned char const msg_buf[] = {'a', 'b', 'c'};
+ size_t len = sizeof(msg_buf);
+ HashAlg hashalg = kSha256;
+ EXPECT_TRUE(EFqHash(&efq_result, msg_buf, len, hashalg));
+ EXPECT_EQ(efq_expect, efq_result);
+}
+
+TEST(TinyEFqTest, HashWorksForResultYSmallerThanHalfOfQAndEven) {
+ std::vector<uint8_t> msg = {'a', 'a', 'd'};
+ EccPointFq result;
+ EccPointFq expected = {{0xb315d67e, 0x1924ae56, 0xcf527861, 0xebb789b6,
+ 0x3f429d2a, 0xb193bf9a, 0x6bd8502f, 0x5e73be39},
+ {0x0bd51968, 0x0f13472d, 0xc96b5096, 0xa9cd4491,
+ 0x4ab668cf, 0x2123d56c, 0xf30af180, 0x0db43c33}};
+ EXPECT_TRUE(EFqHash(&result, msg.data(), msg.size(), kSha512));
+ EXPECT_EQ(expected, result);
+}
+TEST(TinyEFqTest, HashWorksForResultYSmallerThanHalfOfQAndOdd) {
+ std::vector<uint8_t> msg = {'a', 'a', 'c'};
+ EccPointFq result;
+ EccPointFq expected = {{0x81D359E2, 0xF438B2AC, 0xAA4342EB, 0x80042B18,
+ 0x850E1C62, 0x90860717, 0xC79A1AB8, 0xF8F4F2F6},
+ {0xC1A2BA30, 0x369C0D70, 0x03EAF9DD, 0x4F93FC67,
+ 0xBB6E5D10, 0x441B22F9, 0xEC70C946, 0xE8D39BD4}};
+ EXPECT_TRUE(EFqHash(&result, msg.data(), msg.size(), kSha512));
+ EXPECT_EQ(expected, result);
+}
+
+TEST(TinyEFqTest, HashWorksForResultYLargerThanHalfOfQAndOdd) {
+ std::vector<uint8_t> msg = {'a', 'a', 'b'};
+ EccPointFq result;
+ EccPointFq expected = {{0x31F874DA, 0x62DB014E, 0x4A4FC69A, 0xC1DCC122,
+ 0xC423DAF8, 0x27AB3AAC, 0xF1DE0993, 0x07906282},
+ {0x8DA507A4, 0x568E1D1E, 0x6D373E90, 0x99A18DA4,
+ 0xC5717AA2, 0x98C222F5, 0x0A2ADDF2, 0xA1212A44}};
+ EFqHash(&result, msg.data(), msg.size(), kSha512);
+ EXPECT_EQ(expected, result);
+}
+
+TEST(TinyEFqTest, HashWorksForResultYLargerThanHalfOfQAndEven) {
+ std::vector<uint8_t> msg = {'a', 'a', 'e'};
+ EccPointFq result;
+ EccPointFq expected = {{0xA798F97C, 0xF24EC264, 0xD4C051F4, 0xBA4A5B45,
+ 0xD2CF5996, 0x121A3F66, 0x222279F0, 0x208E4FD4},
+ {0x3C816617, 0x6CF621EB, 0x8B8DAFC4, 0x63EB39C7,
+ 0xE6C8AF5C, 0x32C732D0, 0xC5C46152, 0x114E8AE0}};
+ EFqHash(&result, msg.data(), msg.size(), kSha512);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqCp
+
+TEST(TinyEFqTest, EFqCpWorks) {
+ const EccPointFq ecfq_point = {
+ {{0x76ABB18A, 0x92C0F7B9, 0x2C1A37E0, 0x7FDF6CA1, 0xE3401760, 0x66EB7D52,
+ 0x918D50A7, 0x12A65BD6}},
+ {{0x1F3A8B42, 0xC8D3127F, 0x6D96F7CD, 0xEA6FE2F6, 0x0AC0B46B, 0x557A5F30,
+ 0xAF075250, 0x786528CB}}};
+ EccPointFq result_ecfq_point = {0};
+ EFqCp(&result_ecfq_point, &ecfq_point);
+ EXPECT_EQ(ecfq_point, result_ecfq_point);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqEqAffine
+
+TEST(TinyEFqTest, EFqEqAffinePasses) {
+ EccPointFq efq_left = {{{1}}, {{2}}};
+ EccPointFq efq_right = {{{1}}, {{2}}};
+
+ EXPECT_TRUE(EFqEqAffine(&efq_left, &efq_right));
+}
+
+TEST(TinyEFqTest, EFqEqAffineFails) {
+ EccPointFq efq_left = {{{1}}, {{2}}};
+ EccPointFq efq_right = {{{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6}},
+ {{0x8f98a4d1, 0x0a561b5c, 0xa50112b5, 0x226c8304,
+ 0xe3b0f033, 0xf16b932e, 0x50f59e7c, 0x879ad734}}};
+
+ EXPECT_FALSE(EFqEqAffine(&efq_left, &efq_right));
+}
+////////////////////////////////////////////////////////////////////////
+// EFqCondSet
+
+TEST(TinyEFqTest, EFqCondSetWorksForTrue) {
+#define TRUE 1
+ EccPointJacobiFq efqj_left = {0};
+ EccPointJacobiFq efqj_right = {
+ {{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1, 0xe3401760, 0x66eb7d52,
+ 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6, 0x0ac0b46b, 0x557a5f30,
+ 0xaf075250, 0x786528cb}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EccPointJacobiFq efqj_expect = {{{1}}, {{2}}, {{1}}};
+
+ EFqCondSet(&efqj_left, &efqj_expect, &efqj_right, TRUE);
+ EXPECT_EQ(efqj_left, efqj_expect);
+}
+
+TEST(TinyEFqTest, EFqCondSetWorksForFalse) {
+#define FALSE 0
+ EccPointJacobiFq efqj_left = {0};
+ EccPointJacobiFq efqj_right = {{{1}}, {{2}}, {{1}}};
+ EccPointJacobiFq efqj_expect = {
+ {{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1, 0xe3401760, 0x66eb7d52,
+ 0x918d50a7, 0x12a65bd6}},
+ {{0x1f3a8b42, 0xc8d3127f, 0x6d96f7cd, 0xea6fe2f6, 0x0ac0b46b, 0x557a5f30,
+ 0xaf075250, 0x786528cb}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+
+ EFqCondSet(&efqj_left, &efqj_right, &efqj_expect, FALSE);
+ EXPECT_EQ(efqj_left, efqj_expect);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqJCp
+
+TEST(TinyEFqTest, EFqJCpWorks) {
+ const EccPointJacobiFq efqj = {{{1}}, {{2}}, {{1}}};
+ EccPointJacobiFq efqj_result = {0};
+ EFqJCp(&efqj_result, &efqj);
+ EXPECT_EQ(efqj, efqj_result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqInf
+
+TEST(TinyEFqTest, EFqInfWorks) {
+ EccPointJacobiFq efqj_left;
+ EccPointJacobiFq efqj_expect = {{{0}}, {{1}}, {{0}}};
+ EFqInf(&efqj_left);
+
+ EXPECT_EQ(efqj_expect, efqj_left);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqOnCurve
+
+TEST(TinyEFqTest, EFqOnCurvePasses) {
+ const EccPointFq ecfq_point = {
+ {{0x76ABB18A, 0x92C0F7B9, 0x2C1A37E0, 0x7FDF6CA1, 0xE3401760, 0x66EB7D52,
+ 0x918D50A7, 0x12A65BD6}},
+ {{0x1F3A8B42, 0xC8D3127F, 0x6D96F7CD, 0xEA6FE2F6, 0x0AC0B46B, 0x557A5F30,
+ 0xAF075250, 0x786528CB}}};
+ EXPECT_EQ(1, EFqOnCurve(&ecfq_point));
+}
+
+TEST(TinyEFqTest, EFqOnCurveFails) {
+ EccPointFq bad_ecfq_point = {
+ {{0x76ABB18A, 0x92C0F7B9, 0x2C1A37E0, 0x7FDF6CA1, 0xE3401760, 0x66EB7D52,
+ 0x918D50A7, 0x12A65BD6}},
+ {{0x1F3A8B42, 0xC8D3127F, 0x6D96F7CD, 0xEA6FE2F6, 0x0AC0B46B, 0x557A5F30,
+ 0xAF075250, 0x786528CB}}};
+ uint8_t* ecpq_vec = (uint8_t*)bad_ecfq_point.x.limbs.word;
+ ecpq_vec[31]++;
+ EXPECT_EQ(0, EFqOnCurve(&bad_ecfq_point));
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqJOnCurve
+
+TEST(TinyEFqTest, EFqJOnCurvePasses) {
+ EccPointJacobiFq efqj = {{{1}}, {{2}}, {{1}}};
+
+ EXPECT_TRUE(EFqJOnCurve(&efqj));
+}
+
+TEST(TinyEFqTest, EFqJOnCurveFails) {
+ EccPointJacobiFq efqj = {{{1}}, {{4}}, {{1}}};
+
+ EXPECT_FALSE(EFqJOnCurve(&efqj));
+}
+
+TEST(TinyEFqTest, EFqJOnCurveAcceptsPointAtInfinity) {
+ EccPointJacobiFq infinity = {{{0}}, {{1}}, {{0}}};
+
+ EXPECT_TRUE(EFqJOnCurve(&infinity));
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqJRand
+
+// Checks if EFqJRand can generate points with Y >= q+1
+TEST(TinyEFqTest, EFqJRandCanGenerateBigY) {
+ OneTimePad otp({
+ 0x25, 0xeb, 0x8c, 0x48, 0xff, 0x89, 0xcb, 0x85, 0x4f, 0xc0, 0x90, 0x81,
+ 0xcc, 0x47, 0xed, 0xfc, 0x86, 0x19, 0xb2, 0x14, 0xfe, 0x65, 0x92, 0xd4,
+ 0x8b, 0xfc, 0xea, 0x9c, 0x9d, 0x8e, 0x32, 0x44, 0xd7, 0xd7, 0xe9, 0xf1,
+ 0xf7, 0xde, 0x60, 0x56, 0x8d, 0xe9, 0x89, 0x07, 0x3f, 0x3d, 0x16, 0x39,
+ });
+
+ // expected.y >= q+1
+ EccPointJacobiFq expected = {
+ {0xd78542d3, 0xf824c127, 0x81eea621, 0x6990833d, 0x9d843df6, 0x3df36126,
+ 0x435e8eda, 0x2d267586},
+ {0x1B8DC14B, 0x5967C520, 0x61CECE5D, 0x0290B5BC, 0x49278859, 0x2C523D9A,
+ 0x6D0AE6DE, 0xAE5590C9},
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}};
+
+ EccPointJacobiFq actual = {0};
+ EXPECT_TRUE(EFqJRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+ EXPECT_EQ(384u, otp.BitsConsumed());
+}
+
+// Checks if EFqJRand can generate points with Y <= q-1
+TEST(TinyEFqTest, EFqJRandCanGenerateSmallY) {
+ OneTimePad otp({
+ 0x47, 0xe7, 0xb0, 0x36, 0x0f, 0x85, 0x91, 0xaa, 0x14, 0x76, 0xb0, 0x16,
+ 0xe5, 0x8d, 0xf1, 0x72, 0x61, 0xb5, 0x54, 0x0a, 0x60, 0xb7, 0x3d, 0x38,
+ 0xd9, 0x95, 0xe7, 0x60, 0xf9, 0xd3, 0x19, 0xf1, 0x8e, 0x8d, 0xd4, 0x74,
+ 0x2b, 0x86, 0xcd, 0xb8, 0xbb, 0x8f, 0x18, 0xfb, 0x89, 0xc2, 0xc7, 0x35,
+ });
+
+ // expected.y <= q-1
+ EccPointJacobiFq expected = {
+ {0x5f65199e, 0x59366f56, 0xb1d35d89, 0xf42fdc1f, 0x07fd66d6, 0x95f32cb3,
+ 0xc4ef7101, 0xeb426988},
+ {0x834171f5, 0xca1c1f05, 0xdcb4d142, 0xbe060756, 0x9185652b, 0xb3b9ede1,
+ 0x671f682e, 0x22d0c94c},
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}};
+
+ EccPointJacobiFq actual = {0};
+ EXPECT_TRUE(EFqJRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+ EXPECT_EQ(384u, otp.BitsConsumed());
+}
+
+TEST(TinyEFqTest, EFqJRandWorksForFailedSquareRoot) {
+ // Only last 48 bytes of the given otp will result in x such that
+ // Fq.sqrt of (x^3 + a*x + b) exists.
+ OneTimePad otp({
+ 0x01, 0x80, 0x3c, 0xd1, 0x08, 0xd8, 0x8d, 0x73, 0xaf, 0xea, 0x79, 0xc8,
+ 0x1e, 0x47, 0x83, 0xc6, 0x95, 0x31, 0x39, 0x03, 0xc4, 0x18, 0xf1, 0x2b,
+ 0x4c, 0x1a, 0x34, 0x50, 0x6d, 0x73, 0x29, 0xd2, 0x0f, 0x40, 0xc4, 0x19,
+ 0x6f, 0xe2, 0xd7, 0x87, 0x1a, 0x99, 0x68, 0x16, 0x09, 0xc3, 0xe7, 0x7e,
+ 0x17, 0x7d, 0x64, 0x9b, 0xa5, 0x39, 0x53, 0xa6, 0x88, 0x20, 0xa2, 0x0a,
+ 0x17, 0x8f, 0xef, 0x57, 0x19, 0xc7, 0xf3, 0x5c, 0x4a, 0xbe, 0x2e, 0xa0,
+ 0xd8, 0x97, 0xb7, 0x41, 0x71, 0x4d, 0x03, 0x80, 0xf8, 0xfd, 0xcd, 0x06,
+ 0x34, 0xd5, 0xc6, 0x02, 0x4c, 0xdb, 0x95, 0xcb, 0x07, 0x4d, 0xc8, 0x4b,
+ 0x4c, 0x2b, 0x14, 0x1e, 0x24, 0x67, 0x07, 0x2d, 0xc4, 0x39, 0xf0, 0xfc,
+ 0xd2, 0x60, 0x0d, 0x0a, 0x17, 0x7c, 0x51, 0x87, 0x79, 0x98, 0xca, 0xdc,
+ 0x94, 0xa0, 0x8c, 0xc1, 0x5e, 0x3c, 0xe9, 0x98, 0x52, 0x73, 0x61, 0x82,
+ 0xec, 0xdc, 0x67, 0x62, 0x0a, 0xb6, 0x60, 0xe9, 0x52, 0xd6, 0xc6, 0xc2,
+ 0x47, 0xe7, 0xb0, 0x36, 0x0f, 0x85, 0x91, 0xaa, 0x14, 0x76, 0xb0, 0x16,
+ 0xe5, 0x8d, 0xf1, 0x72, 0x61, 0xb5, 0x54, 0x0a, 0x60, 0xb7, 0x3d, 0x38,
+ 0xd9, 0x95, 0xe7, 0x60, 0xf9, 0xd3, 0x19, 0xf1, 0x8e, 0x8d, 0xd4, 0x74,
+ 0x2b, 0x86, 0xcd, 0xb8, 0xbb, 0x8f, 0x18, 0xfb, 0x89, 0xc2, 0xc7, 0x35,
+ });
+
+ EccPointJacobiFq expected = {
+ {0x5f65199e, 0x59366f56, 0xb1d35d89, 0xf42fdc1f, 0x07fd66d6, 0x95f32cb3,
+ 0xc4ef7101, 0xeb426988},
+ {0x834171f5, 0xca1c1f05, 0xdcb4d142, 0xbe060756, 0x9185652b, 0xb3b9ede1,
+ 0x671f682e, 0x22d0c94c},
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}};
+
+ EccPointJacobiFq actual = {0};
+
+ EXPECT_TRUE(EFqJRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+ EXPECT_EQ(1536u, otp.BitsConsumed());
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/efq2-test.cc b/epid/member/tiny/math/unittests/efq2-test.cc
new file mode 100644
index 0000000..0aef737
--- /dev/null
+++ b/epid/member/tiny/math/unittests/efq2-test.cc
@@ -0,0 +1,406 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of EFq2 implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+
+extern "C" {
+#include "epid/member/tiny/math/efq2.h"
+#include "epid/member/tiny/math/mathtypes.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// EFq2IsInf
+
+TEST(TinyEFq2Test, EFq2IsInfAcceptsPointAtInfinity) {
+ const EccPointJacobiFq2 infinity = {
+ {{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}},
+ {{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EXPECT_TRUE(EFq2IsInf(&infinity));
+}
+
+TEST(TinyEFq2Test, EFq2IsInfRejectsPointNotAtInfinity) {
+ const EccPointJacobiFq2 left = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EXPECT_FALSE(EFq2IsInf(&left));
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2FromAffine
+
+TEST(TinyEFq2Test, EFq2FromAffineWorks) {
+ const EccPointJacobiFq2 expected = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const EccPointFq2 left_affine = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}}};
+ EccPointJacobiFq2 actual = {0};
+ EFq2FromAffine(&actual, &left_affine);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2ToAffine
+
+TEST(TinyEFq2Test, EFq2ToAffineWorks) {
+ const EccPointFq2 expected = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}}};
+ const EccPointJacobiFq2 left = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EccPointFq2 actual = {0};
+ EFq2ToAffine(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2Dbl
+
+TEST(TinyEFq2Test, EFq2DblWorks) {
+ const EccPointJacobiFq2 expected = {
+ {{0xca2899c2, 0x38294bdb, 0xcf0b6b44, 0x270787b1, 0x28e6e40a, 0x2b848c15,
+ 0x03729665, 0xd042f637},
+ {0xda226e33, 0x9e951b73, 0x7df4afb1, 0x4b44fcd5, 0x133d08f1, 0x703ec2c1,
+ 0x93fe9a4c, 0x014c1d38}},
+ {{0xbd697392, 0x2bed001e, 0xde312107, 0x1c7a00ac, 0xc1c7c40e, 0xd720bece,
+ 0x6e98a67e, 0xaac006b6},
+ {0x43a25c32, 0x51296e80, 0x318d99a6, 0xd60e60d3, 0xdb3084d0, 0x0625d792,
+ 0x25f4ca7e, 0x0a310fe4}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const EccPointJacobiFq2 left = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EccPointJacobiFq2 actual = {0};
+ EFq2Dbl(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2Add
+
+TEST(TinyEFq2Test, EFq2AddWorks) {
+ const EccPointJacobiFq2 expected = {
+ {{0x39d576f0, 0x314c3e0a, 0xdc7933c4, 0xb93a1af7, 0xa0b903f1, 0xd5648523,
+ 0x4745740d, 0xcd182581},
+ {0x32365bad, 0x8351f42f, 0xd587f58a, 0x46b5c664, 0x11a71e4f, 0x8fde4189,
+ 0xa0dbb9b6, 0x35a921cf}},
+ {{0xb1d07f87, 0x27fca861, 0xeb87751b, 0x40dee15b, 0x7abc2d89, 0xde6431b7,
+ 0x23bcc963, 0x79a7d75a},
+ {0x5adc76e4, 0xb6a78fa4, 0xb4e50dbd, 0xd503cacd, 0xf188a97f, 0xc89769d8,
+ 0xd3da3cb0, 0x4e50dbe9}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const EccPointJacobiFq2 left = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const EccPointJacobiFq2 right = {
+ {{0x4103138f, 0xfa13e67e, 0x6837bfdf, 0x00565944, 0x11264453, 0x23f40661,
+ 0x673da0e0, 0xed12700d},
+ {0x98f68547, 0x9cb87218, 0xc5ec70e5, 0x0c893388, 0x21dd4d22, 0x53386c5c,
+ 0x2b310753, 0xeca20f0e}},
+ {{0x17a5237e, 0x3f8bfc68, 0xfd8f3ccc, 0xa630561a, 0xbf57703a, 0x68135f32,
+ 0xe230d781, 0xd544af99},
+ {0x92ebeb94, 0x99b0cff6, 0xeebac3e7, 0x7d7aa73f, 0x7064674d, 0x25d8834a,
+ 0x7c64ff8b, 0x97e6a2ac}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EccPointJacobiFq2 actual = {0};
+ EFq2Add(&actual, &left, &right);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2Neg
+
+TEST(TinyEFq2Test, EFq2NegWorks) {
+ const EccPointJacobiFq2 expected = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x876cdaca, 0x1d7a77aa, 0x730fb243, 0x1817c20a, 0x66f6a147, 0x7a82f2b1,
+ 0xb83b6256, 0x08963678},
+ {0xd6e605ff, 0x3585805b, 0x9ecba21a, 0x921d0bd7, 0x033c1324, 0x8b6f68a7,
+ 0xb9cb5b5f, 0xb8809ef0}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const EccPointJacobiFq2 left = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EccPointJacobiFq2 actual = {0};
+ EFq2Neg(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2MulSSCM
+
+TEST(TinyEFq2Test, EFq2MultSSCMWorks) {
+ const EccPointJacobiFq2 expected = {
+ {{0x75e057c7, 0x324aeb39, 0x0246ce8a, 0xe467356d, 0x4fcae21a, 0xeb58c86e,
+ 0x12447362, 0x1c02af0c},
+ {0xfc9e5806, 0x790f79e8, 0xeffb940f, 0x44b942aa, 0xce364572, 0x8f1d0b6d,
+ 0xf2238fe0, 0x4c281551}},
+ {{0x8e525052, 0x840bf78d, 0xf0a1e53a, 0xd43b1688, 0x1566bee6, 0x715cb6d2,
+ 0x27f8a10c, 0x62806aa5},
+ {0xfe573502, 0x1b24a341, 0xffab4d71, 0x445e2e0c, 0x7f3aa342, 0x3013d966,
+ 0x69b239fa, 0x074a471c}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const EccPointJacobiFq2 left = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const FpElem power = {0xeb515e82, 0xda641a2f, 0x642e3fdc, 0x242d1caf,
+ 0xfd1cd76b, 0x60558750, 0x13fd607c, 0xd4a85a40};
+ EccPointJacobiFq2 actual = {0};
+ EFq2MulSSCM(&actual, &left, &power);
+ EXPECT_EQ(expected, actual);
+}
+
+TEST(TinyEFq2Test, EFq2MultSSCMWorksInPlace) {
+ const EccPointJacobiFq2 expected = {
+ {{0x75e057c7, 0x324aeb39, 0x0246ce8a, 0xe467356d, 0x4fcae21a, 0xeb58c86e,
+ 0x12447362, 0x1c02af0c},
+ {0xfc9e5806, 0x790f79e8, 0xeffb940f, 0x44b942aa, 0xce364572, 0x8f1d0b6d,
+ 0xf2238fe0, 0x4c281551}},
+ {{0x8e525052, 0x840bf78d, 0xf0a1e53a, 0xd43b1688, 0x1566bee6, 0x715cb6d2,
+ 0x27f8a10c, 0x62806aa5},
+ {0xfe573502, 0x1b24a341, 0xffab4d71, 0x445e2e0c, 0x7f3aa342, 0x3013d966,
+ 0x69b239fa, 0x074a471c}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EccPointJacobiFq2 left = {{{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790,
+ 0x5303da83, 0x693bbb16, 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c,
+ 0xa7b61e37, 0x209517cf, 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0,
+ 0x877b0357, 0xcc62ffad, 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23,
+ 0xeb35917a, 0xbb7689b7, 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000}}};
+ const FpElem power = {0xeb515e82, 0xda641a2f, 0x642e3fdc, 0x242d1caf,
+ 0xfd1cd76b, 0x60558750, 0x13fd607c, 0xd4a85a40};
+ EFq2MulSSCM(&left, &left, &power);
+ EXPECT_EQ(expected, left);
+}
+////////////////////////////////////////////////////////////////////////
+// EFq2Eq
+
+TEST(TinyEFq2Test, EFq2EqConfirmsPointsAreEqual) {
+ const EccPointJacobiFq2 left = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const EccPointJacobiFq2 left_2 = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EXPECT_TRUE(EFq2Eq(&left, &left_2));
+}
+
+TEST(TinyEFq2Test, EFq2EqDeniesPointsAreEqual) {
+ const EccPointJacobiFq2 left = {
+ {{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790, 0x5303da83, 0x693bbb16,
+ 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c, 0xa7b61e37, 0x209517cf,
+ 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0, 0x877b0357, 0xcc62ffad,
+ 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23, 0xeb35917a, 0xbb7689b7,
+ 0x4631956d, 0x477f610f}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ const EccPointJacobiFq2 right = {
+ {{0x4103138f, 0xfa13e67e, 0x6837bfdf, 0x00565944, 0x11264453, 0x23f40661,
+ 0x673da0e0, 0xed12700d},
+ {0x98f68547, 0x9cb87218, 0xc5ec70e5, 0x0c893388, 0x21dd4d22, 0x53386c5c,
+ 0x2b310753, 0xeca20f0e}},
+ {{0x17a5237e, 0x3f8bfc68, 0xfd8f3ccc, 0xa630561a, 0xbf57703a, 0x68135f32,
+ 0xe230d781, 0xd544af99},
+ {0x92ebeb94, 0x99b0cff6, 0xeebac3e7, 0x7d7aa73f, 0x7064674d, 0x25d8834a,
+ 0x7c64ff8b, 0x97e6a2ac}},
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+ EXPECT_FALSE(EFq2Eq(&left, &right));
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2OnCurve
+
+TEST(TinyEFq2Test, EFq2OnCurveConfirmsPointOnCurve) {
+ const EccPointFq2 left = {{{0xbf501131, 0x84025734, 0xe72a81d4, 0x0a3da790,
+ 0x5303da83, 0x693bbb16, 0x679b2a8a, 0x06f54dd4},
+ {0xa15aebed, 0x5eabe073, 0x5585c8aa, 0xc27f168c,
+ 0xa7b61e37, 0x209517cf, 0x534cd776, 0x4759d7f6}},
+ {{0x27665549, 0xb5aeb631, 0x9f88583f, 0xf4c4a3f0,
+ 0x877b0357, 0xcc62ffad, 0x47c18e76, 0xf769c987},
+ {0xd7ed2a14, 0x9da3ad7f, 0x73cc6868, 0x7abf5a23,
+ 0xeb35917a, 0xbb7689b7, 0x4631956d, 0x477f610f}}};
+ EXPECT_TRUE(EFq2OnCurve(&left));
+}
+
+TEST(TinyEFq2Test, EFq2OnCurveRejectsPointOffCurve) {
+ const EccPointFq2 invalid = {
+ {{0x705eb0a4, 0xf30863e3, 0x6127e751, 0x15adee42, 0xb00baac0, 0x194dee74,
+ 0xb39bf2f3, 0x88b75019},
+ {0x60d7ec1d, 0xd80f96dd, 0x731c01d7, 0xbf697161, 0x087e5f87, 0x91f4fe08,
+ 0xd1942d15, 0x62b03177}},
+ {{0x38f6d02a, 0xae5274db, 0xb7eddcf3, 0xcf4ff611, 0x589140a6, 0xcbacb49c,
+ 0x48c50543, 0x1da802e9},
+ {0x45b0c6f3, 0x52393bf1, 0xc70746b0, 0xa08caeba, 0x5cb44254, 0x53ebeb2a,
+ 0x620ea440, 0x2c3a40f1}}};
+ EXPECT_FALSE(EFq2OnCurve(&invalid));
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/fp-test.cc b/epid/member/tiny/math/unittests/fp-test.cc
new file mode 100644
index 0000000..b13d233
--- /dev/null
+++ b/epid/member/tiny/math/unittests/fp-test.cc
@@ -0,0 +1,263 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of Fp implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+#include "epid/member/tiny/math/unittests/onetimepad.h"
+
+extern "C" {
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/mathtypes.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// FpInField
+
+TEST(TinyFpTest, FpInFieldPasses) {
+ FpElem zero = {0};
+ FpElem p_minus_one = {{0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB,
+ 0xEE71A49E, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ EXPECT_TRUE(FpInField(&zero));
+ EXPECT_TRUE(FpInField(&p_minus_one));
+}
+
+TEST(TinyFpTest, FpInFieldFails) {
+ FpElem p = {{0xD10B500D, 0xF62D536C, 0x1299921A, 0x0CDC65FB, 0xEE71A49E,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ EXPECT_FALSE(FpInField(&p));
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpAdd
+
+TEST(TinyFpTest, FpAddWorks) {
+ FpElem result = {0}, expected = {0}, left = {0}, right = {0};
+ left.limbs.word[5] = 1;
+ right.limbs.word[5] = 2;
+ expected.limbs.word[5] = 3;
+ FpAdd(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+
+ FpElem p_minus_one = {0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB,
+ 0xEE71A49E, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ right = {2, 0, 0, 0, 0, 0, 0, 0};
+ expected = {1, 0, 0, 0, 0, 0, 0, 0};
+ FpAdd(&result, &p_minus_one, &right);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpMul
+
+TEST(TinyFpTest, FpMultWorks) {
+ FpElem left = {0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124};
+ FpElem right = {0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6,
+ 0x2b477bd2, 0xf9d48534, 0xff7929a0, 0xd4745161};
+ FpElem expected = {0x3f172ebf, 0xf2219fce, 0x73591802, 0x7a7dbc7f,
+ 0xf82ed0df, 0xb8c0c56d, 0x3395ff68, 0x83d64983};
+ FpElem result = {0};
+ FpMul(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpSub
+
+TEST(TinyFpTest, FpSubWorks) {
+ FpElem result = {0}, expected = {0}, left = {0}, right = {0};
+ left.limbs.word[4] = 2;
+ right.limbs.word[4] = 1;
+ expected.limbs.word[4] = 1;
+ FpSub(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+
+ left = {1, 0, 0, 0, 0, 0, 0, 0};
+ right = {2, 0, 0, 0, 0, 0, 0, 0};
+ FpElem p_minus_one = {0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB,
+ 0xEE71A49E, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ FpSub(&result, &left, &right);
+ EXPECT_EQ(p_minus_one, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpExp
+TEST(TinyFpTest, FpExpWorks) {
+ FpElem result = {0}, expected = {0}, in = {0};
+ VeryLargeInt exp = {0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB,
+ 0xEE71A49E, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ in.limbs.word[0] = 1;
+ expected.limbs.word[0] = 1;
+ FpExp(&result, &in, &exp);
+ EXPECT_EQ(expected, result);
+
+ exp = {4, 0, 0, 0, 0, 0, 0, 0};
+ in = {{0x0000007B, 0, 0, 0, 0, 0, 0, 0}};
+ expected = {{0x0DA48871, 0, 0, 0, 0, 0, 0, 0}};
+ FpExp(&result, &in, &exp);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpNeg
+TEST(TinyFpTest, FpNegWorks) {
+ FpElem const pairing_p = {{0xD10B500D, 0xF62D536C, 0x1299921A, 0x0CDC65FB,
+ 0xEE71A49E, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FpElem neg_value = {0};
+ FpElem one = {{1, 0, 0, 0, 0, 0, 0, 0}};
+ FpElem minus_one = pairing_p;
+ --minus_one.limbs.word[0];
+ FpNeg(&neg_value, &one);
+ EXPECT_EQ(minus_one, neg_value);
+
+ FpElem value = {{0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB, 0xEE71A49E,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FpNeg(&neg_value, &value);
+ FpNeg(&neg_value, &neg_value);
+ EXPECT_EQ(value, neg_value);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpEq
+
+TEST(TinyFpTest, FpEqPasses) {
+ FpElem a = {{0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB, 0xEE71A49E,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FpElem c = {{0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB, 0xEE71A49E,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ EXPECT_TRUE(FpEq(&a, &c));
+}
+
+TEST(TinyFpTest, FpEqFails) {
+ FpElem a = {{0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB, 0xEE71A49E,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FpElem b = {{0, 0, 0, 0, 0, 0, 1, 0}};
+ EXPECT_FALSE(FpEq(&a, &b));
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpInv
+
+TEST(TinyFpTest, FpInvWorks) {
+ FpElem a = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124}};
+ FpElem expected = {{0xd97deaf7, 0xa6011d83, 0x3c381713, 0x92472e34,
+ 0x997861e8, 0xc1dfdc87, 0x157eb11b, 0xc9cd1238}};
+ FpElem result;
+ FpInv(&result, &a);
+ EXPECT_EQ(result, expected);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpRand
+
+TEST(TinyFpTest, FpRandConsumes384BitsOfEntropy) {
+ OneTimePad otp(64);
+ FpElem actual = {0};
+ EXPECT_TRUE(FpRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(384u, otp.BitsConsumed());
+}
+
+TEST(TinyFpTest, FpRandWorks) {
+ OneTimePad otp({// slen bits
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // p + 1
+ 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, 0x0E});
+ FpElem expected = {{1, 0, 0, 0, 0, 0, 0, 0}};
+ FpElem actual = {0};
+ EXPECT_TRUE(FpRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpRandNonzero
+
+TEST(TinyFpTest, FpRandNonzeroConsumes384BitsOfEntropy) {
+ OneTimePad otp(64);
+ FpElem actual = {0};
+ EXPECT_TRUE(FpRandNonzero(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(384u, otp.BitsConsumed());
+}
+
+TEST(TinyFpTest, FpRandNonzeroWorks) {
+ OneTimePad otp({// slen bits
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // p - 1
+ 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, 0x0C});
+ FpElem expected = {{1, 0, 0, 0, 0, 0, 0, 0}};
+ FpElem actual = {0};
+ EXPECT_TRUE(FpRandNonzero(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpClear
+
+TEST(TinyFpTest, FpClearWorks) {
+ FpElem zero = {0};
+ FpElem a = {{0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB, 0xEE71A49E,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FpClear(&a);
+ EXPECT_EQ(zero, a);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpSet
+
+TEST(TinyFpTest, FpSetWorks) {
+ uint32_t small = 0xffffffff;
+ FpElem expected = {{small, 0, 0, 0, 0, 0, 0, 0}};
+ FpElem result = {{0xD10B500C, 0xF62D536C, 0x1299921A, 0x0CDC65FB, 0xEE71A49E,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FpSet(&result, small);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpFromHash
+
+TEST(TinyFpTest, FpFromHashWorks) {
+ FpElem p_mod_p;
+ FpElem zero = {0};
+ uint8_t p_str[32] = {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};
+ FpFromHash(&p_mod_p, p_str, sizeof(p_str));
+ EXPECT_EQ(zero, p_mod_p);
+
+ FpElem one = {{1, 0, 0, 0, 0, 0, 0, 0}};
+ uint8_t one_str[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+ FpElem one_mod_p;
+ FpFromHash(&one_mod_p, one_str, sizeof(one_str));
+ EXPECT_EQ(one, one_mod_p);
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/fq-test.cc b/epid/member/tiny/math/unittests/fq-test.cc
new file mode 100644
index 0000000..4db75e2
--- /dev/null
+++ b/epid/member/tiny/math/unittests/fq-test.cc
@@ -0,0 +1,329 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of Fq implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+#include "epid/member/tiny/math/unittests/onetimepad.h"
+
+extern "C" {
+#include "epid/member/tiny/math/fq.h"
+#include "epid/member/tiny/math/mathtypes.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// FqInField
+
+TEST(TinyFqTest, FqInFieldPasses) {
+ FqElem zero = {0};
+ FqElem q_minus_one = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ EXPECT_TRUE(FqInField(&zero));
+ EXPECT_TRUE(FqInField(&q_minus_one));
+}
+
+TEST(TinyFqTest, FqInFieldFails) {
+ FqElem q = {{0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ EXPECT_FALSE(FqInField(&q));
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqAdd
+
+TEST(TinyFqTest, FqAddWorks) {
+ FqElem result = {0}, expected = {0}, left = {0}, right = {0};
+ left.limbs.word[5] = 1;
+ right.limbs.word[5] = 2;
+ expected.limbs.word[5] = 3;
+ FqAdd(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+
+ FqElem q_minus_one = {0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ right = {2, 0, 0, 0, 0, 0, 0, 0};
+ expected = {1, 0, 0, 0, 0, 0, 0, 0};
+ FqAdd(&result, &q_minus_one, &right);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqSub
+
+TEST(TinyFqTest, FqSubWorks) {
+ FqElem result = {0}, expected = {0}, left = {0}, right = {0};
+ left.limbs.word[4] = 2;
+ right.limbs.word[4] = 1;
+ expected.limbs.word[4] = 1;
+ FqSub(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+
+ left = {1, 0, 0, 0, 0, 0, 0, 0};
+ right = {2, 0, 0, 0, 0, 0, 0, 0};
+ FqElem q_minus_one = {0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ FqSub(&result, &left, &right);
+ EXPECT_EQ(q_minus_one, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqMul
+
+TEST(TinyFqTest, FqMulWorks) {
+ FqElem left = {0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124};
+ FqElem right = {0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6,
+ 0x2b477bd2, 0xf9d48534, 0xff7929a0, 0xd4745161};
+ FqElem expected = {0x28f2f1dd, 0x2cb2b611, 0xa24767b3, 0x4e880c0e,
+ 0xed7f7b9e, 0x6ff4a7f2, 0x25fb15d0, 0x7b8c4fed};
+ FqElem result = {0};
+ FqMul(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqExp
+TEST(TinyFqTest, FqExpWorks) {
+ FqElem result = {0}, expected = {0}, in = {0};
+ VeryLargeInt exp = {0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ in.limbs.word[0] = 1;
+ expected.limbs.word[0] = 1;
+ FqExp(&result, &in, &exp);
+ EXPECT_EQ(expected, result);
+
+ exp = {4, 0, 0, 0, 0, 0, 0, 0};
+ in = {{0x0000007B, 0, 0, 0, 0, 0, 0, 0}};
+ expected = {{0x0DA48871, 0, 0, 0, 0, 0, 0, 0}};
+ FqExp(&result, &in, &exp);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqCp
+
+TEST(TinyFqTest, FqCpWorks) {
+ FqElem a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem result = {0};
+ FqCp(&result, &a);
+ EXPECT_EQ(a, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqIsZero
+
+TEST(TinyFqTest, FqIsZeroPasses) {
+ FqElem zero = {0};
+ EXPECT_TRUE(FqIsZero(&zero));
+}
+
+TEST(TinyFqTest, FqIsZeroFails) {
+ FqElem non_zero = {{0, 0, 0, 0, 0, 0, 1, 0}};
+ EXPECT_FALSE(FqIsZero(&non_zero));
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqInv
+
+TEST(TinyFqTest, FqInvWorks) {
+ FqElem a = {{0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1, 0xe3401760,
+ 0x66eb7d52, 0x918d50a7, 0x12a65bd6}};
+ FqElem expected = {{0x5a686df6, 0x56b6ab63, 0xdf907c6f, 0x44ad8d51,
+ 0xa5513462, 0xc597ef78, 0x93711b39, 0x15171a1e}};
+ FqElem result;
+ FqInv(&result, &a);
+ EXPECT_EQ(result, expected);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqNeg
+TEST(TinyFqTest, FqNegWorks) {
+ FqElem const pairing_q = {{0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem neg_value = {0};
+ FqElem one = {{1, 0, 0, 0, 0, 0, 0, 0}};
+ FqElem minus_one = pairing_q;
+ --minus_one.limbs.word[0];
+ FqNeg(&neg_value, &one);
+ EXPECT_EQ(minus_one, neg_value);
+
+ FqElem value = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqNeg(&neg_value, &value);
+ FqNeg(&neg_value, &neg_value);
+ EXPECT_EQ(value, neg_value);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqSquare
+
+TEST(TinyFqTest, FqSquareWorks) {
+ FqElem const pairing_q = {{0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem four = {{4, 0, 0, 0, 0, 0, 0, 0}}, result = {0};
+ FqElem minus_two = pairing_q;
+ minus_two.limbs.word[0] -= 2;
+ FqSquare(&result, &minus_two);
+ EXPECT_EQ(four, result);
+
+ FqElem in = {{0x00003039, 0, 0, 0, 0, 0, 0, 0}};
+ FqElem expected = {{0x09156CB1, 0, 0, 0, 0, 0, 0, 0}};
+ FqSquare(&result, &in);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqClear
+
+TEST(TinyFqTest, FqClearWorks) {
+ FqElem zero = {0};
+ FqElem a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqClear(&a);
+ EXPECT_EQ(zero, a);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqSet
+
+TEST(TinyFqTest, FqSetWorks) {
+ uint32_t small = 0xffffffff;
+ FqElem expected = {{small, 0, 0, 0, 0, 0, 0, 0}};
+ FqElem result = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqSet(&result, small);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqEq
+
+TEST(TinyFqTest, FqEqPasses) {
+ FqElem a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem c = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ EXPECT_TRUE(FqEq(&a, &c));
+}
+
+TEST(TinyFqTest, FqEqFails) {
+ FqElem a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem b = {{0, 0, 0, 0, 0, 0, 1, 0}};
+ EXPECT_FALSE(FqEq(&a, &b));
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqCondSet
+
+TEST(TinyFqTest, FqCondSetWorksForTrue) {
+ FqElem a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem b = {{0, 0, 0, 0, 0, 0, 1, 0}};
+ FqElem result = {0};
+ FqCondSet(&result, &a, &b, true);
+ EXPECT_EQ(a, result);
+}
+
+TEST(TinyFqTest, FqCondSetWorksForFalse) {
+ FqElem a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem b = {{0, 0, 0, 0, 0, 0, 1, 0}};
+ FqElem result = {0};
+ FqCondSet(&result, &a, &b, false);
+ EXPECT_EQ(b, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqSqrt
+
+TEST(TinyFqTest, FqSqrtWorks) {
+ FqElem actual = {0};
+ FqElem in = {0x02869F4A, 0xDF28D8AC, 0x2B4BD20F, 0xB158EA77,
+ 0x89D86073, 0x4D6F2CE1, 0x0211F496, 0x9C977A80};
+ FqElem expected = {0x0E41765B, 0x7E2AEDF6, 0x7C01BC1B, 0xB1C0F3E4,
+ 0x95CB5637, 0x8B275494, 0x3FBF1556, 0x8DAE1450};
+
+ EXPECT_TRUE(FqSqrt(&actual, &in));
+ EXPECT_EQ(expected, actual);
+}
+TEST(TinyFqTest, FqSqrtWorksForFour) {
+ FqElem actual = {0};
+ FqElem in = {0x00000004, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000};
+ FqElem expected = {0xAED33011, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ EXPECT_TRUE(FqSqrt(&actual, &in));
+ EXPECT_EQ(expected, actual);
+}
+TEST(TinyFqTest, FqSqrtFailsForFive) {
+ FqElem actual = {0};
+ FqElem in = {0x00000005, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000};
+ EXPECT_FALSE(FqSqrt(&actual, &in));
+}
+////////////////////////////////////////////////////////////////////////
+// FqRand
+
+TEST(TinyFqTest, FqRandConsumes384BitsOfEntropy) {
+ OneTimePad otp(64);
+ FqElem actual = {0};
+ EXPECT_TRUE(FqRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(384u, otp.BitsConsumed());
+}
+
+TEST(TinyFqTest, FqRandWorks) {
+ OneTimePad otp({// slen bits
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ // q + 1
+ 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, 0x14});
+ FqElem expected = {{1, 0, 0, 0, 0, 0, 0, 0}};
+ FqElem actual = {0};
+ EXPECT_TRUE(FqRand(&actual, OneTimePad::Generate, &otp));
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqFromHash
+
+TEST(TinyFqTest, FqFromHashWorks) {
+ FqElem q_mod_q;
+ FqElem zero = {0};
+ uint8_t q_str[32] = {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};
+ FqFromHash(&q_mod_q, q_str, sizeof(q_str));
+ EXPECT_EQ(zero, q_mod_q);
+
+ FqElem one = {{1, 0, 0, 0, 0, 0, 0, 0}};
+ uint8_t one_str[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1};
+ FqElem one_mod_q;
+ FqFromHash(&one_mod_q, one_str, sizeof(one_str));
+ EXPECT_EQ(one, one_mod_q);
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/fq12-test.cc b/epid/member/tiny/math/unittests/fq12-test.cc
new file mode 100644
index 0000000..9ec6d66
--- /dev/null
+++ b/epid/member/tiny/math/unittests/fq12-test.cc
@@ -0,0 +1,1058 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of Fq12 implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+
+extern "C" {
+#include "epid/member/tiny/math/fq12.h"
+#include "epid/member/tiny/math/mathtypes.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Add
+
+TEST(TinyFq12Test, Fq12AddWorks) {
+ Fq12Elem expected = {{{{0xf8898202, 0xb45883e0, 0x8d18168d, 0xf67a4288,
+ 0xec7c2a8a, 0xfa6f0441, 0xff5583e2, 0x32d88286},
+ {0x304722d5, 0x113e09d3, 0xeaf32297, 0x32d71c16,
+ 0x1cb0685b, 0xe3315524, 0xafd38377, 0xfeae3272}},
+ {{0xc82d8518, 0x99cec06c, 0xe8d7d62b, 0x2f00d5c5,
+ 0x0620146e, 0x2741e62b, 0x9e7557ca, 0xeb019297},
+ {0x15cfc66e, 0x55ba87c0, 0xf1060150, 0xb91180f6,
+ 0xb0d77f5f, 0xc7fa8733, 0x7dc697f1, 0x1e6b8e24}},
+ {{0x1400db26, 0x0760a0b1, 0x1a64565f, 0x27b5641e,
+ 0xd96484ed, 0x54b02297, 0xa2a57172, 0xc3a04c1c},
+ {0x17ff87fb, 0x6294fcdb, 0x8f7c4bc2, 0xd0802fe6,
+ 0xee3d7f1b, 0xf19d63af, 0xdb1d00ae, 0x80df53e6}}},
+ {{{0xc8c6cded, 0x0a290583, 0xd4ab7f8b, 0x867f6ac5,
+ 0x791662bb, 0x893f1baa, 0xfc911068, 0xe97be9e3},
+ {0xdb9666f2, 0x1ff150ee, 0xd8691261, 0x5efee8a7,
+ 0x0c67c4e5, 0x1501f7e4, 0xde7e72d8, 0x01ab1a71}},
+ {{0x85a5659c, 0xcfd4464f, 0xea3b0e64, 0x4a85994f,
+ 0x0e842121, 0x939ca516, 0x55e1a4b6, 0xb92af8fa},
+ {0xb2bfc7eb, 0x71e5dd9d, 0x16b23032, 0x8590e174,
+ 0x88a246af, 0x7d317c63, 0xc8f3a39a, 0x903a091d}},
+ {{0xf0df5efe, 0x5a88ee12, 0xb0d81569, 0x70172a9f,
+ 0xa330fbf2, 0x36a7ea66, 0x95287dc2, 0x99c6386b},
+ {0x875888c7, 0xa3fa338b, 0x52d41dbe, 0x36960893,
+ 0xfdf09874, 0x3986d2ba, 0xa9eb891e, 0x5cf05c6f}}}};
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem right = {{{{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6,
+ 0x2b477bd2, 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966,
+ 0xe7d31209, 0xc7786143, 0x91b441f6, 0x7409d67d}},
+ {{0xc763c01c, 0x8d45cdc1, 0xe46054e2, 0xc6216337,
+ 0x97589d24, 0xe57d5f07, 0xeec3f4b6, 0xfe2a593f},
+ {0x96748337, 0x31fbd2e4, 0x72e72c33, 0x96fe633a,
+ 0x4f48fed2, 0xf6a92484, 0x5e7de24a, 0x8a963657}},
+ {{0x48a24137, 0xc529544f, 0xe83111bc, 0xbd151156,
+ 0x6b0c7ee2, 0x1bc18974, 0x01193d6b, 0x6b716d4d},
+ {0x90c2469b, 0xb1ae7b57, 0x22ce6905, 0x58c5a086,
+ 0xc750dfa2, 0x28ea9d9d, 0x6134f34f, 0x68cf7885}}},
+ {{{0x771f4d50, 0x113c642f, 0x983d5b97, 0xd8fed4c2,
+ 0x166e53b0, 0x4797d81c, 0x9955788c, 0xbd7c6c23},
+ {0xd9d2246a, 0x092e1780, 0xd8a1ac25, 0xc23607e5,
+ 0x8c58b02e, 0x2c543c7e, 0x4c082083, 0xc4577f4d}},
+ {{0xb433c5de, 0x6ab7893e, 0x5ff5e970, 0x24de35b6,
+ 0x65b8022c, 0x89c649d3, 0x7629ec0b, 0x6046bfbd},
+ {0xcdab3158, 0xefd0e691, 0xeb7ca8b3, 0xbbe4015c,
+ 0xcb5d6828, 0xd313d3ec, 0x0b0125d2, 0xac823c7f}},
+ {{0x3e500486, 0xd17db7a2, 0x8d174e88, 0x8504ae57,
+ 0x1d09fdcb, 0xeda97288, 0xd8a573c9, 0x32233b3f},
+ {0x41145b9e, 0x4f61f713, 0xd1caf67d, 0x3299a2ff,
+ 0x3586b78d, 0x6b31995f, 0xe51708e4, 0x9eab4090}}}};
+ Fq12Elem actual = {0};
+ Fq12Add(&actual, &left, &right);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Sub
+
+TEST(TinyFq12Test, Fq12SubWorks) {
+ Fq12Elem expected = {{{{0x4d162b42, 0x9377da5b, 0x1d041212, 0xda2d8e91,
+ 0x72d07c24, 0x9491de97, 0x005d123b, 0x89efdfc3},
+ {0x69ff7029, 0x1ffd54c7, 0x2a986659, 0x3830a949,
+ 0x4d0a4447, 0x5440929c, 0x8c6aff8a, 0x169a8577}},
+ {{0x970c6506, 0x259580a0, 0x4547416c, 0xbc76db4c,
+ 0xb4522362, 0xea130cd9, 0xc0e74ff6, 0xeeace017},
+ {0x97b9f013, 0xc4ec0fd2, 0x1dcfb36c, 0x97f1207d,
+ 0x00b72659, 0x218e308a, 0xc0c7c429, 0x093f2175}},
+ {{0x318f88cb, 0x503725ee, 0x5c9a3d68, 0xba67a76b,
+ 0xf1bd2bc6, 0x6413020d, 0xa06fe769, 0xecbd7182},
+ {0xa54e2ad8, 0xd2613407, 0x5c778439, 0x2bd154d5,
+ 0x4e0d6476, 0xe6ae1ad3, 0x18b00add, 0xaf4062dc}}},
+ {{{0x895b6360, 0xbad96b00, 0xb6c8d2df, 0xe15e273b,
+ 0x3aab5ff8, 0x40f55dd1, 0xc9e3101d, 0x6e83119c},
+ {0x85987e44, 0xb3e77da4, 0x4c55cf1c, 0xf44ba4d2,
+ 0xd099adc5, 0x4a2563a4, 0x4668136c, 0x78fc1bd7}},
+ {{0xcc1109f3, 0xcd8e61ad, 0x3ce74606, 0x0da593de,
+ 0x3185c168, 0xc6f603ce, 0x698abd6c, 0xf89d797f},
+ {0xc63c954e, 0x656d3e55, 0x5250e94d, 0x1aa544b5,
+ 0xe0591afd, 0x1defc6e8, 0xb2ee48c2, 0x3735901f}},
+ {{0x743f55f2, 0xb78d7ece, 0x96a97857, 0x660dcdf0,
+ 0x691d005b, 0x5b550556, 0xe3dd962e, 0x357fc1eb},
+ {0xb403019e, 0xd85f7340, 0xc1d63b46, 0xde3f288e,
+ 0x8154cdf8, 0xaa09925b, 0xdfba6822, 0x1f99db4d}}}};
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem right = {{{{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6,
+ 0x2b477bd2, 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966,
+ 0xe7d31209, 0xc7786143, 0x91b441f6, 0x7409d67d}},
+ {{0xc763c01c, 0x8d45cdc1, 0xe46054e2, 0xc6216337,
+ 0x97589d24, 0xe57d5f07, 0xeec3f4b6, 0xfe2a593f},
+ {0x96748337, 0x31fbd2e4, 0x72e72c33, 0x96fe633a,
+ 0x4f48fed2, 0xf6a92484, 0x5e7de24a, 0x8a963657}},
+ {{0x48a24137, 0xc529544f, 0xe83111bc, 0xbd151156,
+ 0x6b0c7ee2, 0x1bc18974, 0x01193d6b, 0x6b716d4d},
+ {0x90c2469b, 0xb1ae7b57, 0x22ce6905, 0x58c5a086,
+ 0xc750dfa2, 0x28ea9d9d, 0x6134f34f, 0x68cf7885}}},
+ {{{0x771f4d50, 0x113c642f, 0x983d5b97, 0xd8fed4c2,
+ 0x166e53b0, 0x4797d81c, 0x9955788c, 0xbd7c6c23},
+ {0xd9d2246a, 0x092e1780, 0xd8a1ac25, 0xc23607e5,
+ 0x8c58b02e, 0x2c543c7e, 0x4c082083, 0xc4577f4d}},
+ {{0xb433c5de, 0x6ab7893e, 0x5ff5e970, 0x24de35b6,
+ 0x65b8022c, 0x89c649d3, 0x7629ec0b, 0x6046bfbd},
+ {0xcdab3158, 0xefd0e691, 0xeb7ca8b3, 0xbbe4015c,
+ 0xcb5d6828, 0xd313d3ec, 0x0b0125d2, 0xac823c7f}},
+ {{0x3e500486, 0xd17db7a2, 0x8d174e88, 0x8504ae57,
+ 0x1d09fdcb, 0xeda97288, 0xd8a573c9, 0x32233b3f},
+ {0x41145b9e, 0x4f61f713, 0xd1caf67d, 0x3299a2ff,
+ 0x3586b78d, 0x6b31995f, 0xe51708e4, 0x9eab4090}}}};
+ Fq12Elem actual = {0};
+ Fq12Sub(&actual, &left, &right);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Square
+
+TEST(TinyFq12Test, Fq12SquareWorks) {
+ Fq12Elem expected = {{{{0xb2718e2f, 0x5acdc81c, 0x00964828, 0x20087676,
+ 0x5ae15b61, 0x4fd4da11, 0xe092dfeb, 0x58534fb6},
+ {0xccc9dc07, 0x1004c642, 0x4d95229d, 0x82350b1c,
+ 0x9771ce95, 0xd9a24ede, 0xbd10467b, 0xc7ed3445}},
+ {{0xbde22884, 0x8354762f, 0x86ba1554, 0x63db32bb,
+ 0x0bae02fd, 0x6d0d96e8, 0xcf9ffd11, 0xb8fe4b31},
+ {0x2d04f196, 0x23e1a987, 0x99e976e3, 0xa037f309,
+ 0xe90221d9, 0x201fec2a, 0x46d79de9, 0xc93a6bd2}},
+ {{0x5c58af07, 0xd9343489, 0xb4f19136, 0xff508b82,
+ 0xc14265f4, 0xa4d22c7b, 0x6e928f38, 0xe279749e},
+ {0xa1d790b2, 0xcf37602c, 0xc842e733, 0x72c2773a,
+ 0xc4d0ad50, 0x707594fb, 0x969b8864, 0x0979561b}}},
+ {{{0x24a687fb, 0xfb396e79, 0xc34718eb, 0x2b491ee6,
+ 0xba812deb, 0xc6dfa2d8, 0x4c2bd958, 0x692fc435},
+ {0x0b3d5a09, 0xb3310b79, 0xcb0179fe, 0x8e8a4e82,
+ 0x79cf9278, 0x1b884773, 0xe7bfdc35, 0xb64b17bf}},
+ {{0x7928c472, 0xbc2fe39f, 0xa4eff880, 0xd700813f,
+ 0x555725f0, 0x43a4f63e, 0x857b8b39, 0x96614e14},
+ {0x0ba1d9bb, 0x78f7e930, 0x13c1d603, 0xe2f9587b,
+ 0x19c67a04, 0x3931bdf3, 0x3c6271ae, 0xdde60cd5}},
+ {{0xa376e35d, 0xd157352f, 0x040e0af6, 0x0e36afd1,
+ 0x9cfbfb84, 0x9cd3d83a, 0x94b83ec5, 0x1de41161},
+ {0xf1424d67, 0x5ecaee6f, 0x25a809b2, 0x00abd96d,
+ 0x2b2da6c7, 0xbcfeab22, 0x6072fb3a, 0x75474592}}}};
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+
+ Fq12Elem actual = {0};
+ Fq12Square(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Mul
+
+TEST(TinyFq12Test, Fq12MultWorks) {
+ Fq12Elem expected = {{{{0x054b2248, 0x40490d13, 0xa309fba1, 0xcda4a1ef,
+ 0xe6efd6b9, 0x6dbdd131, 0xfde112e9, 0xaf90b12e},
+ {0x4e21c944, 0x03e20ec3, 0xed4543f5, 0x7a577659,
+ 0x81d1fd42, 0xea9a8c1c, 0x791b36af, 0x870740ff}},
+ {{0x8d2c2a6e, 0xe8ce5ca0, 0xe528c957, 0x84cd9406,
+ 0x34a3c63a, 0x2b928ab5, 0x66655119, 0x91ff61ee},
+ {0x4c30c782, 0x4fd5522a, 0xfd8d17f1, 0xa3a6f430,
+ 0x37bf9b7b, 0x72928155, 0x66037689, 0x4c8e67bc}},
+ {{0x35a5ce87, 0x1b25e22e, 0x2313705b, 0x9e3e6eb6,
+ 0x8675e450, 0x33d9cdc4, 0x569c1b3e, 0xd9027fce},
+ {0x4f74f503, 0xecbc164d, 0x48ce7250, 0x32b9fb72,
+ 0x8b726b18, 0xc0872542, 0xcb8d6a0b, 0xfecc8ed3}}},
+ {{{0x1a907f78, 0x04356cb2, 0x03360ad2, 0xba867ae8,
+ 0xa1d5266f, 0xb5896fcf, 0x7013d8a3, 0x587b138f},
+ {0x30de9fe0, 0xacde6ad3, 0xdb1dcd3d, 0x765f2eac,
+ 0x7f665d4e, 0xedc431a0, 0xd9057e43, 0x1bd63b89}},
+ {{0x16e913c4, 0xdc0a393e, 0xa9780dac, 0xa0e35293,
+ 0x99e4eb2f, 0x80654405, 0x9a51d4b9, 0x890d2fa3},
+ {0x7a415a23, 0x7252917f, 0xb05a73ac, 0xe8a7f092,
+ 0x9e68afd0, 0xfe5b63d2, 0x68ecfa20, 0xe3a9f4e0}},
+ {{0x3a77ca45, 0x282422b7, 0x613276da, 0x5bc45097,
+ 0x95ea8ee4, 0x4a7a7633, 0xc9bb3324, 0xe396b7b4},
+ {0xf37c26a1, 0x8009faaa, 0x0779b7c1, 0x6ef10242,
+ 0xcd5a86eb, 0x2dd2897e, 0x2b5f0b01, 0x0b79178d}}}};
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem right = {{{{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6,
+ 0x2b477bd2, 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966,
+ 0xe7d31209, 0xc7786143, 0x91b441f6, 0x7409d67d}},
+ {{0xc763c01c, 0x8d45cdc1, 0xe46054e2, 0xc6216337,
+ 0x97589d24, 0xe57d5f07, 0xeec3f4b6, 0xfe2a593f},
+ {0x96748337, 0x31fbd2e4, 0x72e72c33, 0x96fe633a,
+ 0x4f48fed2, 0xf6a92484, 0x5e7de24a, 0x8a963657}},
+ {{0x48a24137, 0xc529544f, 0xe83111bc, 0xbd151156,
+ 0x6b0c7ee2, 0x1bc18974, 0x01193d6b, 0x6b716d4d},
+ {0x90c2469b, 0xb1ae7b57, 0x22ce6905, 0x58c5a086,
+ 0xc750dfa2, 0x28ea9d9d, 0x6134f34f, 0x68cf7885}}},
+ {{{0x771f4d50, 0x113c642f, 0x983d5b97, 0xd8fed4c2,
+ 0x166e53b0, 0x4797d81c, 0x9955788c, 0xbd7c6c23},
+ {0xd9d2246a, 0x092e1780, 0xd8a1ac25, 0xc23607e5,
+ 0x8c58b02e, 0x2c543c7e, 0x4c082083, 0xc4577f4d}},
+ {{0xb433c5de, 0x6ab7893e, 0x5ff5e970, 0x24de35b6,
+ 0x65b8022c, 0x89c649d3, 0x7629ec0b, 0x6046bfbd},
+ {0xcdab3158, 0xefd0e691, 0xeb7ca8b3, 0xbbe4015c,
+ 0xcb5d6828, 0xd313d3ec, 0x0b0125d2, 0xac823c7f}},
+ {{0x3e500486, 0xd17db7a2, 0x8d174e88, 0x8504ae57,
+ 0x1d09fdcb, 0xeda97288, 0xd8a573c9, 0x32233b3f},
+ {0x41145b9e, 0x4f61f713, 0xd1caf67d, 0x3299a2ff,
+ 0x3586b78d, 0x6b31995f, 0xe51708e4, 0x9eab4090}}}};
+ Fq12Elem actual = {0};
+ Fq12Mul(&actual, &left, &right);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Inv
+
+TEST(TinyFq12Test, Fq12InvWorks) {
+ Fq12Elem expected = {{{{0xcf7ba426, 0x4bb2c4c3, 0xfb50fa73, 0xb70c280d,
+ 0xb5cf02c7, 0xb047bc29, 0x7cd8b4d1, 0xc238e14d},
+ {0xd1bc45de, 0xc113277d, 0x5189b836, 0x49694d5b,
+ 0xc4084edb, 0xc837f717, 0xf65566eb, 0x519dad22}},
+ {{0x62b12d6e, 0xc2a49558, 0x0f36f3b8, 0x2274fc44,
+ 0xd7ef63a2, 0x7a0f59da, 0xc4fa06c3, 0x812be980},
+ {0xc887fc84, 0xbeb1803c, 0x5ec3d49f, 0x7c32ae46,
+ 0x97fb66b2, 0x470acb13, 0x2e9d2992, 0x88dd93d5}},
+ {{0x47087924, 0x143c1bba, 0x4fe23ddb, 0x6be4e322,
+ 0x3cabd640, 0xdf2f66c9, 0x2d309380, 0xa244260f},
+ {0xf899db8a, 0xb5a83982, 0x264e1961, 0xe8a8ce8c,
+ 0xe94ceacf, 0xd18bd271, 0x67f10894, 0xc82e0f88}}},
+ {{{0x61170257, 0x9740a14e, 0xdd90ec1f, 0xfc1a7d8b,
+ 0x2a37d62c, 0xa6577bc2, 0xe610b5d6, 0xe0b70389},
+ {0x8192b447, 0x2fd37cbc, 0xc3f80c5b, 0x618f95a1,
+ 0x21e22c0c, 0xf35bd82b, 0xbf635e7d, 0x990ac1f2}},
+ {{0x790d6584, 0xf40c0f6e, 0x83ca3d0f, 0x96f7c28d,
+ 0x8a2662fa, 0xc83bfe45, 0x8be01843, 0x87a00b86},
+ {0x6020320a, 0x73199db4, 0x4d5dd850, 0x14cf247d,
+ 0x34fb1d44, 0x8ababc0d, 0x7c849de5, 0x81226e85}},
+ {{0x6453b966, 0xbbd595ea, 0x704c45e2, 0x5d4cd2a1,
+ 0x8ee6cc5e, 0x336a21d8, 0x87955196, 0xc9e0915a},
+ {0x83330d6a, 0x200dbac0, 0x6b9e8ee8, 0xe6a33cf8,
+ 0x4dc48908, 0xd0a02fdb, 0x0f715987, 0x5f4b9d5b}}}};
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem actual = {0};
+ Fq12Inv(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Neg
+
+TEST(TinyFq12Test, Fq12NegWorks) {
+ Fq12Elem expected = {{{{0x8c035971, 0xaf40febd, 0x3d89f632, 0x24887d6e,
+ 0x3ecb5147, 0xff6580f2, 0x0023a5bd, 0xa19bcedb},
+ {0x61afe694, 0xba8b7e8e, 0x07d2460a, 0xd758834b,
+ 0xb9944e4d, 0x2b2cfe7e, 0xe1ddaf4c, 0x755ba40a}},
+ {{0xff363b04, 0xf3770d54, 0xfb887eb6, 0x97208d71,
+ 0x913888b6, 0xbe3b78dc, 0x504e9cec, 0x1328c6a8},
+ {0x80a4bcc9, 0xdc414b24, 0x81e12ae2, 0xddece243,
+ 0x9e717f72, 0x2eae9d50, 0xe0b74a59, 0x6c2aa832}},
+ {{0xe3749624, 0x90f1e179, 0xe064c5e0, 0xa23c1333,
+ 0x80199e94, 0x0df7593b, 0x5e70bcc6, 0xa7d12130},
+ {0x2795eeb3, 0x2242ac58, 0xa5ea27c6, 0x9521d69a,
+ 0xc7850525, 0x7e332c4c, 0x8614e36d, 0xe7f0249e}}},
+ {{{0x5d2baf76, 0xda3c8c87, 0xd629e68e, 0x5f5bcff7,
+ 0x8bc99594, 0x053eaed0, 0x9cc158f1, 0xd400823f},
+ {0xfe3bbd78, 0xe93cc691, 0x003899c3, 0x63371f3e,
+ 0x7ff0eb49, 0x1752449a, 0x6d89adab, 0xc2ac64db}},
+ {{0xdd619055, 0x6e0c70ca, 0x8852e58e, 0xe7350261,
+ 0x45a585a9, 0x3d0f971c, 0x20453822, 0xa71bc6c3},
+ {0x1aeb696d, 0x7deb08f4, 0xd4ca7881, 0x36531fe8,
+ 0x42bb2179, 0x55e25789, 0x420d8238, 0x1c483361}},
+ {{0xfc43d59b, 0x4a1df76a, 0xeed743a2, 0x21c9e9b2,
+ 0x684aa678, 0xfde77a80, 0x4379e6d4, 0x985d02d4},
+ {0xb9bbd2d7, 0xab67c387, 0x7ef6d8be, 0xfc039a6c,
+ 0x37961f18, 0x31aac6a4, 0x3b2b7fc6, 0x41bae421}}}};
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem actual = {0};
+ Fq12Neg(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Set
+
+TEST(TinyFq12Test, Fq12SetWorks) {
+ Fq12Elem result = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem expected = {{{{0x00000010, 0}, {0}}}};
+ uint32_t val = 0x10;
+ Fq12Set(&result, val);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Exp
+
+TEST(TinyFq12Test, Fq12ExpWorks) {
+ Fq12Elem expected = {{{{0x07770c93, 0x5820d5a9, 0x65189432, 0x5f5d67ff,
+ 0xe257644a, 0x41318fa0, 0x6ab6be96, 0xf104adf8},
+ {0x6d5cae3a, 0x2e43c14b, 0xede9dbfe, 0x6743d276,
+ 0x35d13a61, 0xf25d3672, 0x6a36930c, 0x9bdbed9d}},
+ {{0x12fc551f, 0x9ff0f349, 0x4131b828, 0x50c353ed,
+ 0x785d7e8b, 0xbb894c96, 0xee86c2d1, 0x8af21330},
+ {0x45a7337a, 0xb0f0d8c5, 0xacfb0dbd, 0x1f775366,
+ 0x12303719, 0x6f7208bd, 0x68c1bf17, 0x14b60ae7}},
+ {{0xcdf00f9c, 0xbd6529d8, 0x693b8a51, 0xcb9eb968,
+ 0x46c25f48, 0x39cbf307, 0xd7283cd4, 0x8cbb7dd9},
+ {0xb18b24c2, 0x5a98714f, 0x0782ea19, 0x8af18c94,
+ 0x22373570, 0xe24e7fef, 0x0510369a, 0xc5399438}}},
+ {{{0x141a7578, 0x05e94e05, 0x08ec385f, 0x3a5ae1ef,
+ 0xccd4f61a, 0x3291d9f6, 0xb7b07242, 0xb1742404},
+ {0xec5f69b1, 0x68fbad6b, 0x167e8ec8, 0x67c97e56,
+ 0x1ac21584, 0x783e2b30, 0x8c2dd9dd, 0xd4ed7488}},
+ {{0xb591926f, 0x97f68a1f, 0xd3bccfb8, 0x9a58152b,
+ 0x9e12cf14, 0x0a82dfd6, 0x8c246e88, 0x94bcbc8a},
+ {0xa95962fe, 0x342b7e99, 0xddc1c0d9, 0x15a4e0f8,
+ 0x64475d29, 0xbce1bd39, 0xa79dd2ee, 0xee505176}},
+ {{0xdb49f8cf, 0x10cdb302, 0xf5c48053, 0x83ce1f18,
+ 0x988d4d5c, 0xd305fb4e, 0xbb11f2bb, 0x2f391894},
+ {0x084c02ad, 0x26eae084, 0x4d81e78d, 0x9750454d,
+ 0xdb062196, 0xae6ad23e, 0x18588c31, 0xb3d78420}}}};
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ VeryLargeInt exponent = {0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6};
+ Fq12Elem actual = {0};
+ Fq12Exp(&actual, &left, &exponent);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12MultiExp
+
+TEST(TinyFq12Test, Fq12MultiExpWorks) {
+ Fq12Elem expected = {{{{0x9b800ac0, 0x1fb360b8, 0x9af601c4, 0x4931f447,
+ 0x31152f7c, 0x7f6b2489, 0x2fbeed91, 0xcc7a6ac0},
+ {0xb76c0d77, 0x5b09b4be, 0x4a8fc1d4, 0x2e5222d1,
+ 0x6b6e41e6, 0x9ea53fff, 0x6daabae4, 0x591274a2}},
+ {{0xb669c611, 0xc8b0430b, 0xa7c054c3, 0x360bd4bc,
+ 0xf09ef81c, 0x4d5bb8b1, 0x9333c78f, 0x32ff73b8},
+ {0x90ec74e4, 0xe1e77b28, 0xb453b94a, 0xf7bf242c,
+ 0xdbee7487, 0x29b8c962, 0x31bcb2b5, 0x06737ced}},
+ {{0x26f4def9, 0xc706336d, 0x18aae9bf, 0x9b568de1,
+ 0x4e0fa721, 0x10695d37, 0x44a446e4, 0x1f90fc31},
+ {0xec9525dc, 0x4f63a5d6, 0x07e9f19c, 0x982ac0b8,
+ 0x818c07fc, 0x2603a2c4, 0x44e6a144, 0xb8a617a5}}},
+ {{{0x34f08dcb, 0x0afd33cc, 0x38921139, 0x10c707ef,
+ 0x1bcd1d79, 0x1cee939a, 0x08831471, 0x2318f2b4},
+ {0x8e4f9261, 0x37304a70, 0xb24df55d, 0xd93a8a20,
+ 0x32ff13b2, 0x342ce4a7, 0x25185cd0, 0xd974dca3}},
+ {{0x0a83a8aa, 0xf2e71e4e, 0x0e0af78b, 0x85363dfa,
+ 0xf825e945, 0x01d733f5, 0xf54d7f42, 0x3c77fa71},
+ {0xb5a7931b, 0x25c5c577, 0x6d21b52e, 0xbc951e9b,
+ 0x51dd45b9, 0x743e886f, 0x6bc839d4, 0xd7deccd5}},
+ {{0x947af194, 0xd0239f95, 0x1dde9421, 0x59369d3e,
+ 0xd9863881, 0xb9c24b75, 0xcbdb4021, 0x4c940810},
+ {0x96070307, 0x4f68fbf2, 0x5a719a10, 0x73b7cc22,
+ 0x4ef192e7, 0xbb5b635e, 0xdeb5746b, 0x89b5a530}}}};
+ Fq12Elem pairing_out = {{{{0x50ab7bc6, 0xd28d33ca, 0xa7de4ce1, 0x162996ed,
+ 0xad5ee231, 0x4fc0a501, 0x468be932, 0xba101ff6},
+ {0x14d36207, 0x34c44c84, 0xdfa22b9e, 0x1f4d1fc0,
+ 0xcb0454f2, 0xc4077c42, 0xebde30b6, 0x15eb79f4}},
+ {{0xf91d7519, 0xc456caad, 0xb908d0d3, 0x31b0be8c,
+ 0x1c0def81, 0x80e14649, 0x4657b6e7, 0xf18b84d1},
+ {0xec73b557, 0xf8acbc05, 0x2e5f0a7e, 0xf485e0eb,
+ 0x6fd516b6, 0xb7190100, 0xc1fa4e50, 0x3fee7c43}},
+ {{0xb3ebe0e5, 0xc572866a, 0xa10be392, 0x2d6f653d,
+ 0x138bb1b6, 0x87cf70ba, 0xbbef8650, 0xe3b31829},
+ {0x4ba31303, 0x8d1afe6e, 0xe7138780, 0x36a08173,
+ 0xcdc3182a, 0x1ecb0486, 0xd5a961a5, 0xda0e5787}}},
+ {{{0x0b13b454, 0xa62f5fbf, 0xa4bed641, 0xd3632805,
+ 0xe8010941, 0x72cebb51, 0x8aaa0095, 0x669e804d},
+ {0xe49b7149, 0x8fc69d31, 0x956d88ab, 0x265c926b,
+ 0x3bb2f1d4, 0xbfc206ea, 0x6f29d6da, 0x5b5065dc}},
+ {{0x0ff0848e, 0x1f3fdf5c, 0xb3533098, 0x1a434003,
+ 0xc80d2a60, 0x4ac6aa4a, 0xc99fbca8, 0xe0ce978f},
+ {0x3357d172, 0xf5f8a018, 0x5908b3da, 0xe540395c,
+ 0xb654a226, 0x89cef58e, 0x47786d9f, 0x5a5d41d2}},
+ {{0x788a3989, 0x49a5f719, 0x5a0042e3, 0x92f94303,
+ 0x1bd0e6c8, 0x81c5ac15, 0xe8a05ec8, 0xbbba6ced},
+ {0x6d17dc8e, 0xaf351b75, 0xba6e2c36, 0x2a04ea26,
+ 0x421e1737, 0x16fd0bfe, 0x4bb33376, 0x32aebf4d}}}};
+ Fq12Elem pairing_inv = {{{{0x50ab7bc6, 0xd28d33ca, 0xa7de4ce1, 0x162996ed,
+ 0xad5ee231, 0x4fc0a501, 0x468be932, 0xba101ff6},
+ {0x14d36207, 0x34c44c84, 0xdfa22b9e, 0x1f4d1fc0,
+ 0xcb0454f2, 0xc4077c42, 0xebde30b6, 0x15eb79f4}},
+ {{0xf91d7519, 0xc456caad, 0xb908d0d3, 0x31b0be8c,
+ 0x1c0def81, 0x80e14649, 0x4657b6e7, 0xf18b84d1},
+ {0xec73b557, 0xf8acbc05, 0x2e5f0a7e, 0xf485e0eb,
+ 0x6fd516b6, 0xb7190100, 0xc1fa4e50, 0x3fee7c43}},
+ {{0xb3ebe0e5, 0xc572866a, 0xa10be392, 0x2d6f653d,
+ 0x138bb1b6, 0x87cf70ba, 0xbbef8650, 0xe3b31829},
+ {0x4ba31303, 0x8d1afe6e, 0xe7138780, 0x36a08173,
+ 0xcdc3182a, 0x1ecb0486, 0xd5a961a5, 0xda0e5787}}},
+ {{{0xa3bf7bbf, 0x2cf9ce1c, 0x6dd93441, 0x39793df5,
+ 0x06709b5d, 0xd417370d, 0x7552f037, 0x99617fb2},
+ {0xca37beca, 0x436290a9, 0x7d2a81d7, 0xe67fd38f,
+ 0xb2beb2ca, 0x8723eb74, 0x90d319f2, 0xa4af9a23}},
+ {{0x9ee2ab85, 0xb3e94e7f, 0x5f44d9ea, 0xf29925f7,
+ 0x26647a3e, 0xfc1f4814, 0x365d3424, 0x1f316870},
+ {0x7b7b5ea1, 0xdd308dc3, 0xb98f56a7, 0x279c2c9e,
+ 0x381d0278, 0xbd16fcd0, 0xb884832d, 0xa5a2be2d}},
+ {{0x3648f68a, 0x898336c2, 0xb897c79f, 0x79e322f7,
+ 0xd2a0bdd6, 0xc5204649, 0x175c9204, 0x44459312},
+ {0x41bb5385, 0x23f41266, 0x5829de4c, 0xe2d77bd4,
+ 0xac538d67, 0x2fe8e660, 0xb449bd57, 0xcd5140b2}}}};
+ VeryLargeInt exponent = {0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6};
+ Fq12Elem b1 = pairing_inv;
+ Fq12Elem b2 = pairing_out;
+ Fq12Elem b3 = pairing_out;
+ VeryLargeInt e1 = exponent;
+ VeryLargeInt e2 = {0};
+ VeryLargeInt e3 = exponent;
+ // pairing_out^exp * pairing_out^(-exp) * pairing_out^0 * pairing_out^exp ==
+ // pairing_out^exp
+ Fq12Elem actual = {0};
+ Fq12MultiExp(&actual, &pairing_out, &exponent, &b1, &e1, &b2, &e2, &b3, &e3);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Eq
+
+TEST(TinyFq12Test, Fq12EqPasses) {
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem left2 = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ EXPECT_TRUE(Fq12Eq(&left, &left2));
+}
+
+TEST(TinyFq12Test, Fq12EqFails) {
+ Fq12Elem left = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem right = {{{{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6,
+ 0x2b477bd2, 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966,
+ 0xe7d31209, 0xc7786143, 0x91b441f6, 0x7409d67d}},
+ {{0xc763c01c, 0x8d45cdc1, 0xe46054e2, 0xc6216337,
+ 0x97589d24, 0xe57d5f07, 0xeec3f4b6, 0xfe2a593f},
+ {0x96748337, 0x31fbd2e4, 0x72e72c33, 0x96fe633a,
+ 0x4f48fed2, 0xf6a92484, 0x5e7de24a, 0x8a963657}},
+ {{0x48a24137, 0xc529544f, 0xe83111bc, 0xbd151156,
+ 0x6b0c7ee2, 0x1bc18974, 0x01193d6b, 0x6b716d4d},
+ {0x90c2469b, 0xb1ae7b57, 0x22ce6905, 0x58c5a086,
+ 0xc750dfa2, 0x28ea9d9d, 0x6134f34f, 0x68cf7885}}},
+ {{{0x771f4d50, 0x113c642f, 0x983d5b97, 0xd8fed4c2,
+ 0x166e53b0, 0x4797d81c, 0x9955788c, 0xbd7c6c23},
+ {0xd9d2246a, 0x092e1780, 0xd8a1ac25, 0xc23607e5,
+ 0x8c58b02e, 0x2c543c7e, 0x4c082083, 0xc4577f4d}},
+ {{0xb433c5de, 0x6ab7893e, 0x5ff5e970, 0x24de35b6,
+ 0x65b8022c, 0x89c649d3, 0x7629ec0b, 0x6046bfbd},
+ {0xcdab3158, 0xefd0e691, 0xeb7ca8b3, 0xbbe4015c,
+ 0xcb5d6828, 0xd313d3ec, 0x0b0125d2, 0xac823c7f}},
+ {{0x3e500486, 0xd17db7a2, 0x8d174e88, 0x8504ae57,
+ 0x1d09fdcb, 0xeda97288, 0xd8a573c9, 0x32233b3f},
+ {0x41145b9e, 0x4f61f713, 0xd1caf67d, 0x3299a2ff,
+ 0x3586b78d, 0x6b31995f, 0xe51708e4, 0x9eab4090}}}};
+ EXPECT_FALSE(Fq12Eq(&left, &right));
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Conj
+
+TEST(TinyFq12Test, Fq12ConjWorks) {
+ Fq12Elem expected = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x5d2baf76, 0xda3c8c87, 0xd629e68e, 0x5f5bcff7,
+ 0x8bc99594, 0x053eaed0, 0x9cc158f1, 0xd400823f},
+ {0xfe3bbd78, 0xe93cc691, 0x003899c3, 0x63371f3e,
+ 0x7ff0eb49, 0x1752449a, 0x6d89adab, 0xc2ac64db}},
+ {{0xdd619055, 0x6e0c70ca, 0x8852e58e, 0xe7350261,
+ 0x45a585a9, 0x3d0f971c, 0x20453822, 0xa71bc6c3},
+ {0x1aeb696d, 0x7deb08f4, 0xd4ca7881, 0x36531fe8,
+ 0x42bb2179, 0x55e25789, 0x420d8238, 0x1c483361}},
+ {{0xfc43d59b, 0x4a1df76a, 0xeed743a2, 0x21c9e9b2,
+ 0x684aa678, 0xfde77a80, 0x4379e6d4, 0x985d02d4},
+ {0xb9bbd2d7, 0xab67c387, 0x7ef6d8be, 0xfc039a6c,
+ 0x37961f18, 0x31aac6a4, 0x3b2b7fc6, 0x41bae421}}}};
+ Fq12Elem input = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0,
+ 0x34dd5651, 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889,
+ 0x5d391be8, 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7,
+ 0x5000252c, 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7,
+ 0x6e58060a, 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60,
+ 0x26ec9f79, 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603,
+ 0x62a80f0a, 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd,
+ 0x6e80b955, 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399,
+ 0xa8cc1ef5, 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612,
+ 0xabb68325, 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48,
+ 0x8626fe26, 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e,
+ 0xb6db8586, 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem actual = {0};
+ Fq12Conj(&actual, &input);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12ExpCyc
+
+TEST(TinyFq12Test, Fq12ExpCycWorks) {
+ Fq12Elem expected = {{{{0x44415742, 0xce586503, 0xe5cc514f, 0x731d97a3,
+ 0xe8c98357, 0xb1de361d, 0x15cf9bfc, 0x4ca54124},
+ {0x7decae5a, 0x572ae946, 0x4244f518, 0x1490b9e4,
+ 0xbbbafdb2, 0xb2d13f3f, 0xae1de024, 0xe224dc2f}},
+ {{0x876377f0, 0x2c75d3ab, 0x5aa65a1d, 0x42ff41fa,
+ 0x2729ff86, 0x8f76d40f, 0x2c224666, 0xce3d5926},
+ {0x4f0b47eb, 0xa45887d9, 0xf4407be2, 0xaaedbf4a,
+ 0x9f8a426e, 0x809a601a, 0xea000edd, 0x4fe97056}},
+ {{0x7eb3ea97, 0xd6769b11, 0x2f2bed07, 0x6fbb5801,
+ 0x1e67136e, 0x2fd1e9a3, 0x242559de, 0x5a018155},
+ {0xb66ad800, 0x51924848, 0xdecddaa8, 0x3eed0649,
+ 0xcf7f3edb, 0x17dcaa6e, 0x27cd41c7, 0x055a6039}}},
+ {{{0x09d45f4f, 0x3d360f00, 0x7561c4fb, 0x70500d0f,
+ 0x20851a64, 0x5c5ed2a6, 0x6118fe9e, 0xfa05dc75},
+ {0x57b872d1, 0x9a19e54d, 0x3395e069, 0x29d98c64,
+ 0xcdbdda55, 0x001f07e7, 0x8aeaca7f, 0x747c1dc8}},
+ {{0x0c0cb22d, 0x75ca59be, 0x202684e4, 0xec1b56c5,
+ 0x46434c3f, 0x55f52f7a, 0xfcb5686b, 0x0a1172be},
+ {0xf0b043af, 0xbb2ae039, 0xccbdac3c, 0x8f42a6f2,
+ 0x06c264ab, 0xa47599b7, 0xc6a8c454, 0xa5b257e3}},
+ {{0x8700f8b7, 0x4090b69d, 0x20e35539, 0xfd30e911,
+ 0xa08ecbf5, 0xb038eb7b, 0x6ea872c3, 0xdfa0f669},
+ {0x5600be7b, 0x43ec3905, 0xc830ae6e, 0xd9780bec,
+ 0xe7d288c3, 0xcff72a6e, 0x059b9c31, 0x66ebb803}}}};
+ Fq12Elem input = {{{{0x4200e30a, 0xebf627b9, 0x607ebce6, 0x7848a894,
+ 0xe1b736d1, 0x4c9dd307, 0x9e1301e3, 0x07256eb7},
+ {0xe17a0b54, 0x0e02f2d5, 0x3df772e0, 0x9155aaa2,
+ 0x3c5ffcc6, 0x8427940b, 0x362f51ee, 0x331e0c73}},
+ {{0x954eecdb, 0x970bc820, 0x92d1776a, 0x02f81e51,
+ 0x8a7a9216, 0x6172111f, 0x9bd29665, 0x9612d47d},
+ {0x8fceb2c7, 0xb3f7eced, 0xa3d0a21e, 0xd66c6583,
+ 0xf273f385, 0x827df9e6, 0x503de81c, 0x5b2cae32}},
+ {{0xf08207ed, 0x7ab76686, 0xb681b701, 0x9d19d066,
+ 0x81956e08, 0x2ca17f37, 0x65d1d24e, 0x0cff7cb8},
+ {0xf9cd6e9e, 0x4821363b, 0xb0bc2b8c, 0xa380ecbb,
+ 0x7b04aea0, 0x396f0948, 0x93619efe, 0x42aa1fd4}}},
+ {{{0x805b8aa4, 0x23ab6f9a, 0x937ea209, 0x9dba1ab2,
+ 0x426d02b7, 0x36782ff4, 0xe371d373, 0x66873347},
+ {0x51d27dea, 0xd40cd434, 0xd5627a4d, 0xbcc747de,
+ 0xa54b31ec, 0x3e2c2fa4, 0x4f07b689, 0xb33b79bc}},
+ {{0xfeea300c, 0x26ab30d9, 0x92c098e9, 0x192c191b,
+ 0xeefd498c, 0x3cd4e4ac, 0xe9a3f142, 0x00bdca46},
+ {0xeb1edad0, 0xd4c2439e, 0x51025e46, 0x006cfb7c,
+ 0x04b6efda, 0x159f7c19, 0xa1085a5e, 0x459833d5}},
+ {{0xeb08632d, 0x3c4ecf58, 0x02624178, 0xf65dbcf5,
+ 0xeb320af5, 0xce34c3db, 0x799ea805, 0x1f944aa2},
+ {0x6f488ba6, 0x07f9f8dc, 0x690e6d4b, 0xa45b11be,
+ 0x8d39f017, 0x96619fec, 0x6100af71, 0x16201c36}}}};
+ VeryLargeInt pairing_t = {0x30b0a801, 0x6882f5c0, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000};
+ Fq12Elem actual = {0};
+ Fq12ExpCyc(&actual, &input, &pairing_t);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12SqCyc
+
+TEST(TinyFq12Test, Fq12SqCycWorks) {
+ const Fq12Elem a = {{{{0x4200e30a, 0xebf627b9, 0x607ebce6, 0x7848a894,
+ 0xe1b736d1, 0x4c9dd307, 0x9e1301e3, 0x07256eb7},
+ {0xe17a0b54, 0x0e02f2d5, 0x3df772e0, 0x9155aaa2,
+ 0x3c5ffcc6, 0x8427940b, 0x362f51ee, 0x331e0c73}},
+ {{0x954eecdb, 0x970bc820, 0x92d1776a, 0x02f81e51,
+ 0x8a7a9216, 0x6172111f, 0x9bd29665, 0x9612d47d},
+ {0x8fceb2c7, 0xb3f7eced, 0xa3d0a21e, 0xd66c6583,
+ 0xf273f385, 0x827df9e6, 0x503de81c, 0x5b2cae32}},
+ {{0xf08207ed, 0x7ab76686, 0xb681b701, 0x9d19d066,
+ 0x81956e08, 0x2ca17f37, 0x65d1d24e, 0x0cff7cb8},
+ {0xf9cd6e9e, 0x4821363b, 0xb0bc2b8c, 0xa380ecbb,
+ 0x7b04aea0, 0x396f0948, 0x93619efe, 0x42aa1fd4}}},
+ {{{0x805b8aa4, 0x23ab6f9a, 0x937ea209, 0x9dba1ab2,
+ 0x426d02b7, 0x36782ff4, 0xe371d373, 0x66873347},
+ {0x51d27dea, 0xd40cd434, 0xd5627a4d, 0xbcc747de,
+ 0xa54b31ec, 0x3e2c2fa4, 0x4f07b689, 0xb33b79bc}},
+ {{0xfeea300c, 0x26ab30d9, 0x92c098e9, 0x192c191b,
+ 0xeefd498c, 0x3cd4e4ac, 0xe9a3f142, 0x00bdca46},
+ {0xeb1edad0, 0xd4c2439e, 0x51025e46, 0x006cfb7c,
+ 0x04b6efda, 0x159f7c19, 0xa1085a5e, 0x459833d5}},
+ {{0xeb08632d, 0x3c4ecf58, 0x02624178, 0xf65dbcf5,
+ 0xeb320af5, 0xce34c3db, 0x799ea805, 0x1f944aa2},
+ {0x6f488ba6, 0x07f9f8dc, 0x690e6d4b, 0xa45b11be,
+ 0x8d39f017, 0x96619fec, 0x6100af71, 0x16201c36}}}};
+ const Fq12Elem expected = {
+ {{{0x526a44b5, 0x9ad9e0d5, 0x7fc8d87d, 0xdac7f569, 0xb7160629, 0xc5073804,
+ 0x217aac0c, 0x71b7efa7},
+ {0xd0accd40, 0x66aed48f, 0x3e8cb003, 0x54d56ad9, 0x5f6d6996, 0x0be42117,
+ 0xa36948ed, 0xbb155b11}},
+ {{0x806eec23, 0xf4e66785, 0xaffdc175, 0xa19e8e95, 0xa11edc9d, 0xfad5f701,
+ 0x4bf831bc, 0xe743b59e},
+ {0xfc57a415, 0xb843987c, 0x3aabe4e3, 0xb23ed43d, 0xc418a1cd, 0xc46cc003,
+ 0xb646c6b0, 0x32af93c9}},
+ {{0x20c76439, 0xc9915b9f, 0x34fae4ad, 0x952c702a, 0xf2edbbd9, 0x06aa03db,
+ 0x10219f83, 0x905d0b4c},
+ {0xab64286e, 0xb368606d, 0xa469d731, 0xbc1f7604, 0xeae89f06, 0xd6d6b335,
+ 0x68da2258, 0x4ab0021e}}},
+ {{{0xa69a08d7, 0xbac72f6e, 0xaf9c76c7, 0x67d54f71, 0x41aea080, 0x36129b92,
+ 0xd25549e1, 0xa261f5ef},
+ {0xd663885e, 0xd0de96b5, 0x6631c5ab, 0x1826eea2, 0xab116580, 0xc41e9bd7,
+ 0x935a4539, 0x1283ccf4}},
+ {{0xc279b3a5, 0x750dcbe7, 0x8f96e4ba, 0xd3321942, 0xf837f073, 0x11ed32b8,
+ 0x26691990, 0x06c077da},
+ {0x4d690c41, 0x47d447a7, 0xb0ecd6ca, 0xbab6e94b, 0xb1984cb4, 0xb104eb7f,
+ 0xd0b8e924, 0xe8c70bef}},
+ {{0x1c750b7c, 0x9923d34c, 0xc88a0dda, 0x2e14c6ca, 0x6748bad3, 0x50d05e2b,
+ 0x14f32504, 0x2dc7a9d3},
+ {0xa1c4328d, 0x9e8f16d8, 0xd31d739a, 0x0c9da028, 0x613f8c91, 0x75fbf7f3,
+ 0x78575301, 0x496c9a7b}}}};
+ Fq12Elem res;
+ Fq12SqCyc(&res, &a);
+ EXPECT_EQ(expected, res);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12MulSpecial
+
+TEST(TinyFq12Test, Fq12MulSpecialWorks) {
+ const Fq12Elem left = {{{{0xbee28a1d, 0x57d6402c, 0x61cd0458, 0x194e2452,
+ 0x1c223de9, 0x6546ced9, 0xdcd0878f, 0xc55048e3},
+ {0x6a8d5fe2, 0xfcf17083, 0xb608693b, 0x981bd9fe,
+ 0x54a9e8fa, 0x0e8250f4, 0x93430f47, 0xf862d9af}},
+ {{0x57975e42, 0xf57416a0, 0x08a35031, 0x9d28f11c,
+ 0xa9467df1, 0x58159cfa, 0x48cb43f1, 0x7f6f1e63},
+ {0xb6199d76, 0xf0ee74eb, 0xc2413051, 0x5ee7af00,
+ 0xed646e81, 0xa34adbc8, 0xb30cb947, 0xc256758a}},
+ {{0xd2100f2c, 0x34bef28c, 0xe6ffd998, 0x3f8de361,
+ 0x711229db, 0x143ccdbf, 0x4fad6107, 0x35365f92},
+ {0xea2fbf36, 0x14a160b2, 0x5051bd0f, 0x6f056434,
+ 0x2d53ef9f, 0x00d84656, 0xc8535c97, 0x23aaa4e4}}},
+ {{{0xfa291b36, 0xdff94440, 0xc016a92d, 0xe44a0e69,
+ 0xdb2d97f6, 0xb1747475, 0x1cbc7fc4, 0x0e94ef53},
+ {0x0ea6037c, 0x9a639210, 0xd84404c5, 0x4b8c16ef,
+ 0xfc9e6161, 0x3914ae4c, 0xd1b76423, 0x63ef638b}},
+ {{0xfbe030a1, 0x2a114147, 0x6639fbac, 0x0349a4a5,
+ 0x5c7d47de, 0x63888f75, 0x7224cc85, 0x4c1bfeb3},
+ {0xb214f453, 0x403afc2f, 0xa61d5e45, 0x4392c48a,
+ 0xc4f5aec3, 0xce77b85a, 0xc8d59c7e, 0xd0060196}},
+ {{0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000}}}};
+ const Fq12Elem right = {{{{0xd878f624, 0xb6e07457, 0x64c79fdf, 0x0b8cebe9,
+ 0x97be762b, 0xbc4aea64, 0xf72d75cc, 0xdc8ed85d},
+ {0x65847e3a, 0x2a2ff0f3, 0x87af7204, 0xfb4cba91,
+ 0x0df3d736, 0x77e1a4e0, 0x138efcca, 0xc427f6ab}},
+ {{0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000}},
+ {{0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000}}},
+ {{{0x163784b5, 0x2a7d4fd5, 0x1f5a1a18, 0xe89cba68,
+ 0xc233b435, 0xa20456c0, 0x6397ae08, 0x7b76d157},
+ {0xb68f8337, 0x079302c1, 0x99e4326a, 0xc14686de,
+ 0x866e7108, 0x685e797e, 0x3a4b03e5, 0x9aab4042}},
+ {{0x2cd4fe4d, 0xb4660e9a, 0xf99f415d, 0x627f9703,
+ 0x902301e4, 0xcf3c4224, 0xaca9779d, 0x917a2609},
+ {0x9da1e8ac, 0xadb15382, 0x6d31577a, 0xcfd95901,
+ 0xf4fdf69b, 0x8ebf8ef3, 0xc15f4a65, 0x0d6458ec}},
+ {{0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000}}}};
+ const Fq12Elem expected = {
+ {{{0x9f8d4cd8, 0x00fcb121, 0xb1383622, 0xff83d7d7, 0xa4b229fb, 0xcece9321,
+ 0x81ef1f73, 0x05137d4e},
+ {0x9f6177a7, 0x050a266e, 0x73bb8d3b, 0xc99e1d33, 0x678d1f52, 0xc63568f1,
+ 0x1920273f, 0x11a25307}},
+ {{0xcf70c64d, 0x99892381, 0xf6f6a6de, 0xfec24fa5, 0x8d18873e, 0x4f621aad,
+ 0x7d3599d0, 0x128407fe},
+ {0x33e6c086, 0xa85bf06c, 0x2edfd568, 0xc2426dbe, 0xdbbd397c, 0x2b6e80b2,
+ 0x63dd5f45, 0x98bc904e}},
+ {{0xb56c9e77, 0x84063128, 0x830da180, 0xa3d9be01, 0x7ec1cfe7, 0x817c7cc1,
+ 0x409da3aa, 0xb05dcc43},
+ {0x356380bf, 0x72eb335a, 0xb6f2b26c, 0x080613dc, 0x67720d78, 0x488a988f,
+ 0xee0e1bff, 0x0758479e}}},
+ {{{0xa640a57d, 0xc171805c, 0xd1c81064, 0xef2644a8, 0xe28b6e89, 0xd031ff2f,
+ 0xf734a21b, 0x0d8e465e},
+ {0x609de07b, 0x1d248226, 0x19fed7c8, 0x2b378e3d, 0xd55d1461, 0x719d0037,
+ 0x6fe515b8, 0x34f03c08}},
+ {{0xdcdcb9d0, 0x814badfe, 0x01405a2a, 0x2e1a5295, 0x3d08cb46, 0xd0dc0d2b,
+ 0x4ca64738, 0x2b2e5180},
+ {0x503385b0, 0x030d5f71, 0xd24ad48c, 0x4f246e0b, 0x9e904a36, 0x302748d6,
+ 0x1c034d23, 0xf6aa74f6}},
+ {{0x05fc0305, 0xfb7ba8fd, 0x4a8425a1, 0xd69ff60a, 0x356d1941, 0x4559a790,
+ 0xcf1088e9, 0x63784e99},
+ {0xa8a6d207, 0x6e6ed383, 0xf8a9804e, 0x0be13d11, 0xcef9010b, 0x90c8c91a,
+ 0x0b1302ef, 0xe2ce5b67}}}};
+ Fq12Elem res;
+ Fq12MulSpecial(&res, &left, &right);
+ EXPECT_EQ(expected, res);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Cp
+
+TEST(TinyFq12Test, Fq12CpWorks) {
+ Fq12Elem a = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603, 0x62a80f0a,
+ 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd, 0x6e80b955,
+ 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399, 0xa8cc1ef5,
+ 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612, 0xabb68325,
+ 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48, 0x8626fe26,
+ 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e, 0xb6db8586,
+ 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Elem result = {0};
+ Fq12Cp(&result, &a);
+ EXPECT_EQ(a, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Clear
+
+TEST(TinyFq12Test, Fq12ClearWorks) {
+ Fq12Elem zero = {0};
+ Fq12Elem a = {{{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}},
+ {{{0x51a7809d, 0xf8eca154, 0x3c6e23f3, 0xad809603, 0x62a80f0a,
+ 0x41a7438e, 0x633b97dc, 0x2bff7dc0},
+ {0xb097729b, 0xe9ec6749, 0x125f70be, 0xa9a546bd, 0x6e80b955,
+ 0x2f93adc4, 0x92734322, 0x3d539b24}},
+ {{0xd1719fbe, 0x651cbd10, 0x8a4524f4, 0x25a76399, 0xa8cc1ef5,
+ 0x09d65b42, 0xdfb7b8ab, 0x58e4393c},
+ {0x93e7c6a6, 0x553e24e7, 0x3dcd9201, 0xd6894612, 0xabb68325,
+ 0xf1039ad5, 0xbdef6e94, 0xe3b7cc9e}},
+ {{0xb28f5a78, 0x890b3670, 0x23c0c6e0, 0xeb127c48, 0x8626fe26,
+ 0x48fe77de, 0xbc8309f8, 0x67a2fd2b},
+ {0xf5175d3c, 0x27c16a53, 0x93a131c4, 0x10d8cb8e, 0xb6db8586,
+ 0x153b2bba, 0xc4d17107, 0xbe451bde}}}};
+ Fq12Clear(&a);
+ EXPECT_EQ(zero, a);
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/fq2-test.cc b/epid/member/tiny/math/unittests/fq2-test.cc
new file mode 100644
index 0000000..3e33b63
--- /dev/null
+++ b/epid/member/tiny/math/unittests/fq2-test.cc
@@ -0,0 +1,352 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of Fq2 implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+
+extern "C" {
+#include "epid/member/tiny/math/fq2.h"
+#include "epid/member/tiny/math/mathtypes.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Cp
+
+TEST(TinyFq2Test, Fq2CpWorks) {
+ FqElem fq = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq2Elem a = {fq, fq};
+ Fq2Elem result = {0};
+ Fq2Cp(&result, &a);
+ EXPECT_EQ(a, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Set
+
+TEST(TinyFq2Test, Fq2SetWorks) {
+ uint32_t small = 0xffffffff;
+ Fq2Elem expected = {0};
+ expected.x0.limbs.word[0] = small;
+ FqElem fq = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq2Elem result = {fq, fq};
+ Fq2Set(&result, small);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Clear
+
+TEST(TinyFq2Test, Fq2ClearWorks) {
+ Fq2Elem expected = {0};
+ FqElem fq = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq2Elem result = {fq, fq};
+ Fq2Clear(&result);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Add
+
+TEST(TinyFq2Test, Fq2AddWorks) {
+ Fq2Elem result = {0};
+ Fq2Elem left = {{0, 0, 0, 0, 0, 5, 0, 0}, {0, 0, 0, 0, 0, 0, 9, 0}};
+ Fq2Elem right = {{0, 0, 0, 0, 0, 20, 0, 0}, {0, 0, 0, 0, 0, 0, 30, 0}};
+ Fq2Elem expected = {{0, 0, 0, 0, 0, 25, 0, 0}, {0, 0, 0, 0, 0, 0, 39, 0}};
+ Fq2Add(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Exp
+
+TEST(TinyFq2Test, Fq2ExpWorks) {
+ Fq2Elem one = {1};
+ Fq2Elem in = {0};
+ VeryLargeInt exp = {0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ Fq2Elem result = {{0xb06f3418, 0x16043dfc, 0x7884a9ca, 0x0ab1a427, 0x309307b5,
+ 0x23133f6d, 0x250c3dc4, 0x005c4818},
+ {0x3b6f652c, 0x6435c0fd, 0x509b8d30, 0x13fe4bef, 0x5f4ffc14,
+ 0x81dde5fd, 0x02b77b89, 0x5b38b2a5}};
+ Fq2Exp(&result, &in, &exp);
+ EXPECT_EQ(in, result);
+
+ in = {exp, exp};
+ exp = {0};
+ Fq2Exp(&result, &in, &exp);
+ EXPECT_EQ(one, result);
+
+ exp = {2};
+ in = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357, 0x4780716c,
+ 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651, 0x1bb8f3e0,
+ 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Elem expected = {{0xb06f3418, 0x16043dfc, 0x7884a9ca, 0x0ab1a427,
+ 0x309307b5, 0x23133f6d, 0x250c3dc4, 0x005c4818},
+ {0x3b6f652c, 0x6435c0fd, 0x509b8d30, 0x13fe4bef,
+ 0x5f4ffc14, 0x81dde5fd, 0x02b77b89, 0x5b38b2a5}};
+ Fq2Exp(&result, &in, &exp);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Sub
+
+TEST(TinyFq2Test, Fq2SubWorks) {
+ Fq2Elem result = {0};
+ Fq2Elem left = {{0, 0, 0, 0, 0, 20, 0, 0}, {0, 0, 0, 0, 0, 0, 30, 0}};
+ Fq2Elem right = {{0, 0, 0, 0, 0, 5, 0, 0}, {0, 0, 0, 0, 0, 0, 9, 0}};
+ Fq2Elem expected = {{0, 0, 0, 0, 0, 15, 0, 0}, {0, 0, 0, 0, 0, 0, 21, 0}};
+ Fq2Sub(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Mul
+
+TEST(TinyFq2Test, Fq2MultWorks) {
+ Fq2Elem expected = {{0x37861727, 0x52822db7, 0x8005ec64, 0xc0b0bc96,
+ 0xd60e07a4, 0x65eee0a2, 0x780dbc26, 0x7b36e4cb},
+ {0x8201d4ed, 0xbf8ed473, 0xc5c09cbe, 0xba9d0095,
+ 0x3d91414a, 0xa8ebb728, 0x66bc029b, 0x5b6ca52b}};
+ Fq2Elem left = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Elem right = {{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6, 0x2b477bd2,
+ 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966, 0xe7d31209,
+ 0xc7786143, 0x91b441f6, 0x7409d67d}};
+ Fq2Elem actual = {0};
+ Fq2Mul(&actual, &left, &right);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Inv
+
+TEST(TinyFq2Test, Fq2InvWorks) {
+ Fq2Elem expected = {{0xffa2241d, 0x37481517, 0x4bc3ad3a, 0x3c57cefe,
+ 0xb7a57680, 0xaef8eb15, 0x6a1f7923, 0x2e6a7077},
+ {0xdc8eb865, 0xe264dc4c, 0xa2a174dc, 0xa18b8fe8,
+ 0x31ee8433, 0xdea6fa81, 0x7ec16a0e, 0x1b0f8f81}};
+ Fq2Elem left = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Elem actual = {0};
+ Fq2Inv(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+TEST(TinyFq2Test, Fq2InvWorksInPlace) {
+ Fq2Elem expected = {{0xffa2241d, 0x37481517, 0x4bc3ad3a, 0x3c57cefe,
+ 0xb7a57680, 0xaef8eb15, 0x6a1f7923, 0x2e6a7077},
+ {0xdc8eb865, 0xe264dc4c, 0xa2a174dc, 0xa18b8fe8,
+ 0x31ee8433, 0xdea6fa81, 0x7ec16a0e, 0x1b0f8f81}};
+ Fq2Elem left = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Inv(&left, &left);
+ EXPECT_EQ(expected, left);
+}
+////////////////////////////////////////////////////////////////////////
+// Fq2Neg
+
+TEST(TinyFq2Test, Fq2NegWorks) {
+ FqElem const q = {{0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq2Elem neg_value = {0};
+ Fq2Elem one = {{1}, {1}};
+ Fq2Elem minus_one = {q, q};
+ --minus_one.x0.limbs.word[0];
+ --minus_one.x1.limbs.word[0];
+ Fq2Neg(&neg_value, &one);
+ EXPECT_EQ(minus_one, neg_value);
+
+ Fq2Elem value = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF},
+ {0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq2Neg(&neg_value, &value);
+ Fq2Neg(&neg_value, &neg_value);
+ EXPECT_EQ(value, neg_value);
+ value = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Elem expected = {{0x8c035971, 0xaf40febd, 0x3d89f632, 0x24887d6e,
+ 0x3ecb5147, 0xff6580f2, 0x0023a5bd, 0xa19bcedb},
+ {0x61afe694, 0xba8b7e8e, 0x07d2460a, 0xd758834b,
+ 0xb9944e4d, 0x2b2cfe7e, 0xe1ddaf4c, 0x755ba40a}};
+ Fq2Neg(&neg_value, &value);
+ EXPECT_EQ(expected, neg_value);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Conj
+
+TEST(TinyFq2Test, Fq2ConjWorks) {
+ Fq2Elem expected = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c,
+ 0xafa65357, 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x61afe694, 0xba8b7e8e, 0x07d2460a, 0xd758834b,
+ 0xb9944e4d, 0x2b2cfe7e, 0xe1ddaf4c, 0x755ba40a}};
+ Fq2Elem left = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Elem actual = {0};
+ Fq2Conj(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Square
+
+TEST(TinyFq2Test, Fq2SquareWorks) {
+ Fq2Elem expected = {{0xb06f3418, 0x16043dfc, 0x7884a9ca, 0x0ab1a427,
+ 0x309307b5, 0x23133f6d, 0x250c3dc4, 0x005c4818},
+ {0x3b6f652c, 0x6435c0fd, 0x509b8d30, 0x13fe4bef,
+ 0x5f4ffc14, 0x81dde5fd, 0x02b77b89, 0x5b38b2a5}};
+ Fq2Elem result = {0};
+ Fq2Elem in = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Square(&result, &in);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2MulScalar
+
+TEST(TinyFq2Test, Fq2MulScalarWorks) {
+ Fq2Elem expected = {{0x28f2f1dd, 0x2cb2b611, 0xa24767b3, 0x4e880c0e,
+ 0xed7f7b9e, 0x6ff4a7f2, 0x25fb15d0, 0x7b8c4fed},
+ {0}};
+ Fq2Elem left = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0}};
+ FqElem scalar = {0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6,
+ 0x2b477bd2, 0xf9d48534, 0xff7929a0, 0xd4745161};
+ Fq2Elem actual = {0};
+ Fq2MulScalar(&actual, &left, &scalar);
+ EXPECT_EQ(expected, actual);
+}
+
+TEST(TinyFq2Test, Fq2MulScalarWorksInPlace) {
+ Fq2Elem expected = {{0x28f2f1dd, 0x2cb2b611, 0xa24767b3, 0x4e880c0e,
+ 0xed7f7b9e, 0x6ff4a7f2, 0x25fb15d0, 0x7b8c4fed},
+ {0}};
+ Fq2Elem left = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0}};
+ FqElem scalar = {0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6,
+ 0x2b477bd2, 0xf9d48534, 0xff7929a0, 0xd4745161};
+ Fq2MulScalar(&left, &left, &scalar);
+ EXPECT_EQ(expected, left);
+}
+////////////////////////////////////////////////////////////////////////
+// Fq2CondSet
+
+TEST(TinyFq2Test, Fq2CondSetWorksForTrue) {
+ Fq2Elem a = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e64364},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Elem b = {{0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 1, 0}};
+ Fq2Elem result = {0};
+ Fq2CondSet(&result, &a, &b, true);
+ EXPECT_EQ(a, result);
+}
+
+TEST(TinyFq2Test, Fq2CondSetWorksForFalse) {
+ Fq2Elem a = {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e64364},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}};
+ Fq2Elem b = {{0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 1, 0}};
+ Fq2Elem result = {0};
+ Fq2CondSet(&result, &a, &b, false);
+ EXPECT_EQ(b, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2Eq
+
+TEST(TinyFq2Test, Fq2EqPasses) {
+ FqElem fq_a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem fq_b = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq2Elem a = {fq_a, fq_a};
+ Fq2Elem b = {fq_b, fq_b};
+ EXPECT_TRUE(Fq2Eq(&a, &b));
+}
+
+TEST(TinyFq2Test, Fq2EqFails) {
+ FqElem fq_a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem fq_b = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq2Elem a = {fq_a, fq_a};
+ Fq2Elem b = {fq_b, fq_b};
+ --b.x1.limbs.word[5];
+ EXPECT_FALSE(Fq2Eq(&a, &b));
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2MulXi
+
+TEST(TinyFq2Test, Fq2MultXiWorks) {
+ const Fq2Elem a = {{0xbca2b7aa, 0xc0e43294, 0x6199e561, 0xefdb7a39,
+ 0xd57bcbba, 0x03154f2a, 0xdf9e1797, 0xf52d29c1},
+ {0x77cb909b, 0x906d8657, 0xfea2ffb3, 0x7810e964,
+ 0x022e47c1, 0x862bdbe6, 0xe4f5d59b, 0xa677247d}};
+ const Fq2Elem expected = {{0x52a6aea6, 0x1e31b0f6, 0xb1f8c08d, 0x5ac9a512,
+ 0xba57ab15, 0x3918d010, 0xda4968c5, 0x43e32f05},
+ {0x4e9378ba, 0x3b6ce38c, 0x39afcfc3, 0xc644810d,
+ 0xfcf511ff, 0x81a12238, 0xa98fe133, 0x421b72bd}};
+
+ Fq2Elem res;
+ Fq2MulXi(&res, &a);
+ EXPECT_EQ(expected, res);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq2IsZero
+
+TEST(TinyFq2Test, Fq2IsZeroPasses) {
+ Fq2Elem zero = {0};
+ EXPECT_TRUE(Fq2IsZero(&zero));
+}
+
+TEST(TinyFq2Test, Fq2IsZeroFails) {
+ Fq2Elem non_zero = {0};
+ ++non_zero.x0.limbs.word[6];
+ EXPECT_FALSE(Fq2IsZero(&non_zero));
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/fq6-test.cc b/epid/member/tiny/math/unittests/fq6-test.cc
new file mode 100644
index 0000000..5a47bbf
--- /dev/null
+++ b/epid/member/tiny/math/unittests/fq6-test.cc
@@ -0,0 +1,452 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of Fq6 implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+
+extern "C" {
+#include "epid/member/tiny/math/fq6.h"
+#include "epid/member/tiny/math/mathtypes.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Add
+
+TEST(TinyFq6Test, Fq6AddWorks) {
+ Fq6Elem expected = {{{0xf8898202, 0xb45883e0, 0x8d18168d, 0xf67a4288,
+ 0xec7c2a8a, 0xfa6f0441, 0xff5583e2, 0x32d88286},
+ {0x304722d5, 0x113e09d3, 0xeaf32297, 0x32d71c16,
+ 0x1cb0685b, 0xe3315524, 0xafd38377, 0xfeae3272}},
+ {{0xc82d8518, 0x99cec06c, 0xe8d7d62b, 0x2f00d5c5,
+ 0x0620146e, 0x2741e62b, 0x9e7557ca, 0xeb019297},
+ {0x15cfc66e, 0x55ba87c0, 0xf1060150, 0xb91180f6,
+ 0xb0d77f5f, 0xc7fa8733, 0x7dc697f1, 0x1e6b8e24}},
+ {{0x1400db26, 0x0760a0b1, 0x1a64565f, 0x27b5641e,
+ 0xd96484ed, 0x54b02297, 0xa2a57172, 0xc3a04c1c},
+ {0x17ff87fb, 0x6294fcdb, 0x8f7c4bc2, 0xd0802fe6,
+ 0xee3d7f1b, 0xf19d63af, 0xdb1d00ae, 0x80df53e6}}};
+ Fq6Elem left = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}};
+ Fq6Elem right = {{{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6, 0x2b477bd2,
+ 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966, 0xe7d31209,
+ 0xc7786143, 0x91b441f6, 0x7409d67d}},
+ {{0xc763c01c, 0x8d45cdc1, 0xe46054e2, 0xc6216337, 0x97589d24,
+ 0xe57d5f07, 0xeec3f4b6, 0xfe2a593f},
+ {0x96748337, 0x31fbd2e4, 0x72e72c33, 0x96fe633a, 0x4f48fed2,
+ 0xf6a92484, 0x5e7de24a, 0x8a963657}},
+ {{0x48a24137, 0xc529544f, 0xe83111bc, 0xbd151156, 0x6b0c7ee2,
+ 0x1bc18974, 0x01193d6b, 0x6b716d4d},
+ {0x90c2469b, 0xb1ae7b57, 0x22ce6905, 0x58c5a086, 0xc750dfa2,
+ 0x28ea9d9d, 0x6134f34f, 0x68cf7885}}};
+ Fq6Elem actual = {0};
+ Fq6Add(&actual, &left, &right);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Sub
+
+TEST(TinyFq6Test, Fq6SubWorks) {
+ Fq6Elem expected = {{{0x4d162b42, 0x9377da5b, 0x1d041212, 0xda2d8e91,
+ 0x72d07c24, 0x9491de97, 0x005d123b, 0x89efdfc3},
+ {0x69ff7029, 0x1ffd54c7, 0x2a986659, 0x3830a949,
+ 0x4d0a4447, 0x5440929c, 0x8c6aff8a, 0x169a8577}},
+ {{0x970c6506, 0x259580a0, 0x4547416c, 0xbc76db4c,
+ 0xb4522362, 0xea130cd9, 0xc0e74ff6, 0xeeace017},
+ {0x97b9f013, 0xc4ec0fd2, 0x1dcfb36c, 0x97f1207d,
+ 0x00b72659, 0x218e308a, 0xc0c7c429, 0x093f2175}},
+ {{0x318f88cb, 0x503725ee, 0x5c9a3d68, 0xba67a76b,
+ 0xf1bd2bc6, 0x6413020d, 0xa06fe769, 0xecbd7182},
+ {0xa54e2ad8, 0xd2613407, 0x5c778439, 0x2bd154d5,
+ 0x4e0d6476, 0xe6ae1ad3, 0x18b00add, 0xaf4062dc}}};
+ Fq6Elem left = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}};
+ Fq6Elem right = {{{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6, 0x2b477bd2,
+ 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966, 0xe7d31209,
+ 0xc7786143, 0x91b441f6, 0x7409d67d}},
+ {{0xc763c01c, 0x8d45cdc1, 0xe46054e2, 0xc6216337, 0x97589d24,
+ 0xe57d5f07, 0xeec3f4b6, 0xfe2a593f},
+ {0x96748337, 0x31fbd2e4, 0x72e72c33, 0x96fe633a, 0x4f48fed2,
+ 0xf6a92484, 0x5e7de24a, 0x8a963657}},
+ {{0x48a24137, 0xc529544f, 0xe83111bc, 0xbd151156, 0x6b0c7ee2,
+ 0x1bc18974, 0x01193d6b, 0x6b716d4d},
+ {0x90c2469b, 0xb1ae7b57, 0x22ce6905, 0x58c5a086, 0xc750dfa2,
+ 0x28ea9d9d, 0x6134f34f, 0x68cf7885}}};
+ Fq6Elem actual = {0};
+ Fq6Sub(&actual, &left, &right);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Mul
+
+TEST(TinyFq6Test, Fq6MultWorks) {
+ Fq6Elem expected = {{{0xf45502f6, 0x81c1eb6d, 0xb43cb376, 0xd0da40d4,
+ 0xd6156988, 0x6cd4b676, 0x68079d3e, 0x5030f7d9},
+ {0x8e5857ea, 0x042705fb, 0xac87e99c, 0x10dba783,
+ 0xc8a7141b, 0xf742b852, 0x007d20f9, 0x0f6497d4}},
+ {{0xf30a6588, 0xa558efef, 0xe2dac9b0, 0x1586ed6a,
+ 0x21de4041, 0xc02e9d19, 0x6707fbb5, 0xbe0be53f},
+ {0x13920431, 0x4935916a, 0x939a8ef8, 0x12230898,
+ 0xecbf17a9, 0x0934361c, 0x148c5974, 0x73a766d6}},
+ {{0xb989db6c, 0xc1c3c771, 0xc1a12757, 0xad67b5d9,
+ 0xed10d66b, 0x9611f300, 0x3874e3cf, 0x9384e9bf},
+ {0x7acace21, 0x0efe39f0, 0x495ed747, 0xd48f3503,
+ 0x6b032eeb, 0xb6430ee5, 0x1a864a16, 0xe497f2b6}}};
+ Fq6Elem left = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}};
+ Fq6Elem right = {{{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6, 0x2b477bd2,
+ 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966, 0xe7d31209,
+ 0xc7786143, 0x91b441f6, 0x7409d67d}},
+ {{0xc763c01c, 0x8d45cdc1, 0xe46054e2, 0xc6216337, 0x97589d24,
+ 0xe57d5f07, 0xeec3f4b6, 0xfe2a593f},
+ {0x96748337, 0x31fbd2e4, 0x72e72c33, 0x96fe633a, 0x4f48fed2,
+ 0xf6a92484, 0x5e7de24a, 0x8a963657}},
+ {{0x48a24137, 0xc529544f, 0xe83111bc, 0xbd151156, 0x6b0c7ee2,
+ 0x1bc18974, 0x01193d6b, 0x6b716d4d},
+ {0x90c2469b, 0xb1ae7b57, 0x22ce6905, 0x58c5a086, 0xc750dfa2,
+ 0x28ea9d9d, 0x6134f34f, 0x68cf7885}}};
+ Fq6Elem actual = {0};
+ Fq6Mul(&actual, &left, &right);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Inv
+
+TEST(TinyFq6Test, Fq6InvWorks) {
+ Fq6Elem expected = {{{0x4b9d2361, 0x22a3edb2, 0x4234b1bc, 0x15d4ba45,
+ 0x035c34fb, 0xd041dd56, 0x0ac1e096, 0x0352ad8d},
+ {0x4e25c70f, 0x3dc912a9, 0x97a1aa56, 0x32b6e93d,
+ 0x19c793ce, 0x951b4bb8, 0x3982345f, 0xec9e815e}},
+ {{0x3d413679, 0x4cdeca84, 0x33e1c617, 0xc8851545,
+ 0x51625f1e, 0xcb8421ce, 0xd0a7ea78, 0xbb8a0cd6},
+ {0x77d7ca2e, 0x6a51fadc, 0xec063983, 0xf9a311be,
+ 0x28fe40b2, 0x30433e0f, 0x1ed97598, 0x9a82a67f}},
+ {{0x58db3fa8, 0xa999913c, 0x5bef2263, 0x1dba2103,
+ 0x0082518b, 0x3d5a20fc, 0x41913c0f, 0x708bddf4},
+ {0x20a372b3, 0x2ebb41eb, 0x9fdb3fa2, 0x473986ff,
+ 0x0f5835a9, 0x06121385, 0x8e24ac7e, 0x95b8ca14}}};
+ Fq6Elem left = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}};
+ Fq6Elem actual = {0};
+ Fq6Inv(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Neg
+
+TEST(TinyFq6Test, Fq6NegWorks) {
+ Fq6Elem expected = {{{0x8c035971, 0xaf40febd, 0x3d89f632, 0x24887d6e,
+ 0x3ecb5147, 0xff6580f2, 0x0023a5bd, 0xa19bcedb},
+ {0x61afe694, 0xba8b7e8e, 0x07d2460a, 0xd758834b,
+ 0xb9944e4d, 0x2b2cfe7e, 0xe1ddaf4c, 0x755ba40a}},
+ {{0xff363b04, 0xf3770d54, 0xfb887eb6, 0x97208d71,
+ 0x913888b6, 0xbe3b78dc, 0x504e9cec, 0x1328c6a8},
+ {0x80a4bcc9, 0xdc414b24, 0x81e12ae2, 0xddece243,
+ 0x9e717f72, 0x2eae9d50, 0xe0b74a59, 0x6c2aa832}},
+ {{0xe3749624, 0x90f1e179, 0xe064c5e0, 0xa23c1333,
+ 0x80199e94, 0x0df7593b, 0x5e70bcc6, 0xa7d12130},
+ {0x2795eeb3, 0x2242ac58, 0xa5ea27c6, 0x9521d69a,
+ 0xc7850525, 0x7e332c4c, 0x8614e36d, 0xe7f0249e}}};
+ Fq6Elem left = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}};
+ Fq6Elem actual = {0};
+ Fq6Neg(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Clear
+
+TEST(TinyFq6Test, Fq6ClearWorks) {
+ Fq6Elem expected = {0};
+ FqElem fq = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq6Elem result = {fq, fq, fq, fq, fq, fq};
+ Fq6Clear(&result);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6MulScalar
+
+TEST(TinyFq6Test, Fq6MulScalarWorks) {
+ Fq6Elem expected = {{{0x37861727, 0x52822db7, 0x8005ec64, 0xc0b0bc96,
+ 0xd60e07a4, 0x65eee0a2, 0x780dbc26, 0x7b36e4cb},
+ {0x8201d4ed, 0xbf8ed473, 0xc5c09cbe, 0xba9d0095,
+ 0x3d91414a, 0xa8ebb728, 0x66bc029b, 0x5b6ca52b}},
+ {{0x37861727, 0x52822db7, 0x8005ec64, 0xc0b0bc96,
+ 0xd60e07a4, 0x65eee0a2, 0x780dbc26, 0x7b36e4cb},
+ {0x8201d4ed, 0xbf8ed473, 0xc5c09cbe, 0xba9d0095,
+ 0x3d91414a, 0xa8ebb728, 0x66bc029b, 0x5b6ca52b}},
+ {{0}, {0}}};
+ Fq6Elem left = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0}, {0}}};
+ Fq2Elem scalar = {{0x848cdb73, 0x6399829e, 0xcaa20cc0, 0x1b02bff6, 0x2b477bd2,
+ 0xf9d48534, 0xff7929a0, 0xd4745161},
+ {0xe323d956, 0xf8a05a85, 0xe02d5e1e, 0xfd533966, 0xe7d31209,
+ 0xc7786143, 0x91b441f6, 0x7409d67d}};
+ Fq6Elem actual = {0};
+ Fq6MulScalar(&actual, &left, &scalar);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6MulV
+
+TEST(TinyFq6Test, Fq6MulVWorks) {
+ const Fq6Elem a = {{{0x747a9232, 0xb91bf0cd, 0x1c5aa24e, 0x1c3c7860,
+ 0x40b4d7ca, 0x26094519, 0xe29e50db, 0x67da0b88},
+ {0x1e540333, 0xc03c243c, 0x55d91627, 0xfcc36017,
+ 0x5876fc39, 0xf0590ba2, 0x47ce59ac, 0x9cc0760e}},
+ {{0xaf2c16be, 0x4036bf3d, 0xd8ecc7eb, 0x4fdd0128,
+ 0x4faf6ca1, 0xc55bc411, 0xa26b3ac5, 0x1338fc1c},
+ {0x0936baf1, 0xc2254b98, 0x84993186, 0xa7a46e79,
+ 0xf2ed3380, 0xa1a5dad1, 0x2046667a, 0x348362a5}},
+ {{0xbca2b7aa, 0xc0e43294, 0x6199e561, 0xefdb7a39,
+ 0xd57bcbba, 0x03154f2a, 0xdf9e1797, 0xf52d29c1},
+ {0x77cb909b, 0x906d8657, 0xfea2ffb3, 0x7810e964,
+ 0x022e47c1, 0x862bdbe6, 0xe4f5d59b, 0xa677247d}}};
+ const Fq6Elem expected = {{{0x52a6aea6, 0x1e31b0f6, 0xb1f8c08d, 0x5ac9a512,
+ 0xba57ab15, 0x3918d010, 0xda4968c5, 0x43e32f05},
+ {0x4e9378ba, 0x3b6ce38c, 0x39afcfc3, 0xc644810d,
+ 0xfcf511ff, 0x81a12238, 0xa98fe133, 0x421b72bd}},
+ {{0x747a9232, 0xb91bf0cd, 0x1c5aa24e, 0x1c3c7860,
+ 0x40b4d7ca, 0x26094519, 0xe29e50db, 0x67da0b88},
+ {0x1e540333, 0xc03c243c, 0x55d91627, 0xfcc36017,
+ 0x5876fc39, 0xf0590ba2, 0x47ce59ac, 0x9cc0760e}},
+ {{0xaf2c16be, 0x4036bf3d, 0xd8ecc7eb, 0x4fdd0128,
+ 0x4faf6ca1, 0xc55bc411, 0xa26b3ac5, 0x1338fc1c},
+ {0x0936baf1, 0xc2254b98, 0x84993186, 0xa7a46e79,
+ 0xf2ed3380, 0xa1a5dad1, 0x2046667a, 0x348362a5}}};
+
+ Fq6Elem res;
+ Fq6MulV(&res, &a);
+ EXPECT_EQ(expected, res);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Eq
+
+TEST(TinyFq6Test, Fq6EqPasses) {
+ FqElem fq_a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem fq_b = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq6Elem a = {fq_a, fq_a, fq_a, fq_a, fq_a, fq_a};
+ Fq6Elem b = {fq_b, fq_b, fq_b, fq_b, fq_b, fq_b};
+ EXPECT_TRUE(Fq6Eq(&a, &b));
+}
+
+TEST(TinyFq6Test, Fq6EqFails) {
+ FqElem fq_a = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ FqElem fq_b = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq6Elem a = {fq_a, fq_a, fq_a, fq_a, fq_a, fq_a};
+ Fq6Elem b = {fq_b, fq_b, fq_b, fq_b, fq_b, fq_b};
+ --b.y2.x1.limbs.word[5];
+ EXPECT_FALSE(Fq6Eq(&a, &b));
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6IsZero
+
+TEST(TinyFq6Test, Fq6IsZeroPasses) {
+ Fq6Elem zero = {0};
+ EXPECT_TRUE(Fq6IsZero(&zero));
+}
+
+TEST(TinyFq6Test, Fq6IsZeroFails) {
+ Fq6Elem non_zero = {0};
+ ++non_zero.y2.x1.limbs.word[4];
+ EXPECT_FALSE(Fq6IsZero(&non_zero));
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Square
+
+TEST(TinyFq6Test, Fq6SquareWorks) {
+ Fq6Elem expected = {{{0xd33e098c, 0xf56a0ddf, 0x1a07b1f1, 0x5c9f80e4,
+ 0x0f4cab4b, 0x18c856b8, 0x4c614650, 0xdd44c9f1},
+ {0x5210a238, 0x934c3474, 0x8d6f7915, 0x7bfe3252,
+ 0x907c0c7d, 0x6cb28259, 0xeab6a4de, 0xb37400f3}},
+ {{0xed8e6c82, 0xfcb0be62, 0x686dcd3b, 0xfdfbb0b6,
+ 0x30744d0a, 0x408cd48e, 0x1cd63084, 0xa246ad21},
+ {0xc823a4b3, 0x4add0b26, 0x68c1bd68, 0x67140391,
+ 0xb0fe9dd7, 0xbae08890, 0xac5aac76, 0xb2547efa}},
+ {{0xb1eae872, 0xc22e7b27, 0x3b972d7a, 0x894e0e3a,
+ 0xbc67f9b5, 0xc8a56674, 0x82ba5f56, 0xfbeb546b},
+ {0x6e6c8c17, 0x634cdd65, 0xc3678b6f, 0x08e820dc,
+ 0x166dbab9, 0xb0c34885, 0x0b952acd, 0xffc1173e}}};
+ Fq6Elem left = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e643124},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c612, 0x79e80d5f, 0x180fdb61}}};
+ Fq6Elem actual = {0};
+ Fq6Square(&actual, &left);
+ EXPECT_EQ(expected, actual);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Cp
+
+TEST(TinyFq6Test, Fq6CpWorks) {
+ FqElem fq = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq6Elem a = {fq, fq, fq, fq, fq, fq};
+ Fq6Elem result = {0};
+ Fq6Cp(&result, &a);
+ EXPECT_EQ(a, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6CondSet
+
+TEST(TinyFq6Test, Fq6CondSetWorksForTrue) {
+ Fq6Elem a = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e64364},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c66, 0x79e80d5f, 0x180fdb61}}};
+ Fq6Elem b = {{{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0}},
+ {{0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}},
+ {{0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}}};
+
+ Fq6Elem result = {0};
+ Fq6CondSet(&result, &a, &b, true);
+ EXPECT_EQ(a, result);
+}
+
+TEST(TinyFq6Test, Fq6CondSetWorksForFalse) {
+ Fq6Elem a = {{{0x22cfd6a2, 0x23e82f1e, 0xd50e1450, 0xe853e88c, 0xafa65357,
+ 0x4780716c, 0xffd94b0f, 0x5e64364},
+ {0x4d23497f, 0x189daf4d, 0x0ac5c478, 0x3583e2b0, 0x34dd5651,
+ 0x1bb8f3e0, 0x1e1f4181, 0x8aa45bf5}},
+ {{0xaf9cf50f, 0xdfb22086, 0x170f8bcb, 0x75bbd889, 0x5d391be8,
+ 0x88aa7982, 0xafae53e0, 0xecd73957},
+ {0x2e2e734a, 0xf6e7e2b7, 0x90b6df9f, 0x2eef83b7, 0x5000252c,
+ 0x1837550e, 0x1f45a674, 0x93d557cd}},
+ {{0xcb5e99ef, 0x42374c61, 0x323344a2, 0x6aa052c7, 0x6e58060a,
+ 0x38ee9923, 0xa18c3407, 0x582edecf},
+ {0x873d4160, 0xb0e68183, 0x6cade2bc, 0x77ba8f60, 0x26ec9f79,
+ 0xc8b2c66, 0x79e80d5f, 0x180fdb61}}};
+ Fq6Elem b = {{{1, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0}},
+ {{0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}},
+ {{0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}}};
+
+ Fq6Elem result = {0};
+ Fq6CondSet(&result, &a, &b, false);
+ EXPECT_EQ(b, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq6Set
+
+TEST(TinyFq6Test, Fq6SetWorks) {
+ uint32_t small = 0xffffffff;
+ Fq6Elem expected = {0};
+ expected.y0.x0.limbs.word[0] = small;
+ FqElem fq = {{0xAED33012, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}};
+ Fq6Elem result = {fq, fq, fq, fq, fq, fq};
+ Fq6Set(&result, small);
+ EXPECT_EQ(expected, result);
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/internal/onetimepad-test.cc b/epid/member/tiny/math/unittests/internal/onetimepad-test.cc
new file mode 100644
index 0000000..66907e0
--- /dev/null
+++ b/epid/member/tiny/math/unittests/internal/onetimepad-test.cc
@@ -0,0 +1,130 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests for OneTimePad.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+#include "epid/member/tiny/math/unittests/onetimepad.h"
+
+namespace {
+
+TEST(OneTimePadTest, GenerateFailsWhenDefaultConstructedWithoutInit) {
+ OneTimePad otp;
+ EXPECT_EQ(0u, otp.BitsConsumed());
+ std::vector<unsigned int> actual({0, 0});
+ EXPECT_NE(0, OneTimePad::Generate(actual.data(), 8, &otp));
+}
+
+TEST(OneTimePadTest, GeneratesCorrectDataWhenConstructedWithUint8s) {
+ std::vector<unsigned int> actual1({0, 0});
+ std::vector<unsigned int> actual2({0, 0});
+ const std::vector<unsigned int> expected1({0x07050301, 0});
+ const std::vector<unsigned int> expected2({0x0e0c0a09, 0});
+ OneTimePad otp({0x01, 0x03, 0x05, 0x07, 0x09, 0x0a, 0x0c, 0x0e});
+ EXPECT_EQ(0u, otp.BitsConsumed());
+ EXPECT_EQ(0, OneTimePad::Generate(actual1.data(), 32, &otp));
+ EXPECT_EQ(expected1, actual1);
+ EXPECT_EQ(32u, otp.BitsConsumed());
+ EXPECT_EQ(0, OneTimePad::Generate(actual2.data(), 32, &otp));
+ EXPECT_EQ(expected2, actual2);
+ EXPECT_EQ(64u, otp.BitsConsumed());
+}
+
+TEST(OneTimePadTest, GeneratesCorrectDataWhenInitilizedWithUint8s) {
+ std::vector<unsigned int> actual1({0, 0});
+ std::vector<unsigned int> actual2({0, 0});
+ const std::vector<unsigned int> expected1({0x07050301, 0});
+ const std::vector<unsigned int> expected2({0x0e0c0a09, 0});
+ OneTimePad otp;
+ otp.InitUint8({0x01, 0x03, 0x05, 0x07, 0x09, 0x0a, 0x0c, 0x0e});
+ EXPECT_EQ(0u, otp.BitsConsumed());
+ EXPECT_EQ(0, OneTimePad::Generate(actual1.data(), 32, &otp));
+ EXPECT_EQ(expected1, actual1);
+ EXPECT_EQ(32u, otp.BitsConsumed());
+ EXPECT_EQ(0, OneTimePad::Generate(actual2.data(), 32, &otp));
+ EXPECT_EQ(expected2, actual2);
+ EXPECT_EQ(64u, otp.BitsConsumed());
+}
+TEST(OneTimePadTest, GeneratesCorrectDataWhenInitilizedWithUint32s) {
+ std::vector<uint32_t> actual({0x00});
+ const std::vector<uint32_t> expected({0x01});
+ std::vector<uint32_t> actual2({0x00});
+ const std::vector<uint32_t> expected2({0x01020304});
+ OneTimePad otp({0x01, 0x03, 0x05, 0x07, 0x09, 0x0a, 0x0c, 0x0e});
+ otp.InitUint32({0x01, 0x01020304});
+ EXPECT_EQ(0u, otp.BitsConsumed());
+ EXPECT_EQ(0, OneTimePad::Generate(actual.data(), 32, &otp));
+ EXPECT_EQ(32u, otp.BitsConsumed());
+ EXPECT_EQ(expected, actual);
+ EXPECT_EQ(0, OneTimePad::Generate(actual2.data(), 32, &otp));
+ EXPECT_EQ(expected2, actual2);
+ EXPECT_EQ(64u, otp.BitsConsumed());
+}
+TEST(OneTimePadTest, GeneratesSingleBytesCorrectly) {
+ OneTimePad otp({0x01, 0x03, 0x05, 0x07, 0x09, 0x0a, 0x0c, 0x0e});
+ std::vector<uint8_t> expected1({0x01, 0x00, 0x00, 0x00});
+ std::vector<uint8_t> expected2({0x03, 0x00, 0x00, 0x00});
+ std::vector<uint8_t> expected3({0x05, 0x00, 0x00, 0x00});
+ std::vector<uint8_t> actual({0, 0, 0, 0});
+ EXPECT_EQ(0, OneTimePad::Generate((uint32_t*)actual.data(), 8, &otp));
+ EXPECT_EQ(8u, otp.BitsConsumed());
+ EXPECT_EQ(expected1, actual);
+ EXPECT_EQ(0, OneTimePad::Generate((uint32_t*)actual.data(), 8, &otp));
+ EXPECT_EQ(16u, otp.BitsConsumed());
+ EXPECT_EQ(expected2, actual);
+ EXPECT_EQ(0, OneTimePad::Generate((uint32_t*)actual.data(), 8, &otp));
+ EXPECT_EQ(24u, otp.BitsConsumed());
+ EXPECT_EQ(expected3, actual);
+}
+
+TEST(OneTimePadTest, GenerateRejectsNullPtr) {
+ OneTimePad otp(8);
+ EXPECT_NE(0, OneTimePad::Generate(nullptr, 32, &otp));
+}
+TEST(OneTimePadTest, GenerateRejectsNegativeBits) {
+ OneTimePad otp(8);
+ std::vector<unsigned int> actual({0, 0});
+ EXPECT_NE(0, OneTimePad::Generate(actual.data(), -32, &otp));
+}
+TEST(OneTimePadTest, GenerateRejectsZeroBits) {
+ OneTimePad otp(8);
+ std::vector<unsigned int> actual({0, 0});
+ EXPECT_NE(0, OneTimePad::Generate(actual.data(), 0, &otp));
+}
+TEST(OneTimePadTest, GenerateRejectsTooLargeRequest) {
+ OneTimePad otp(8);
+ std::vector<unsigned int> actual({0, 0});
+ EXPECT_EQ(0, OneTimePad::Generate(actual.data(), 32, &otp));
+ EXPECT_EQ(0, OneTimePad::Generate(actual.data(), 32, &otp));
+ EXPECT_NE(0, OneTimePad::Generate(actual.data(), 32, &otp));
+}
+
+TEST(OneTimePadTest, GenerateRejectsUnsupportedBitRequest) {
+ OneTimePad otp(8);
+ std::vector<unsigned int> actual({0, 0});
+ EXPECT_NE(0, OneTimePad::Generate(actual.data(), 31, &otp));
+}
+
+TEST(OneTimePadTest, GenerateCoddlesDevelopersWhoDoNotCheckReturnValues) {
+ OneTimePad otp(4);
+ uint32_t word;
+ EXPECT_EQ(0, OneTimePad::Generate(&word, 32, &otp));
+ EXPECT_NE(0, OneTimePad::Generate(&word, 32, &otp));
+ EXPECT_THROW(OneTimePad::Generate(&word, 32, &otp), std::runtime_error);
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/main-testhelper.cc b/epid/member/tiny/math/unittests/main-testhelper.cc
new file mode 100644
index 0000000..c67c612
--- /dev/null
+++ b/epid/member/tiny/math/unittests/main-testhelper.cc
@@ -0,0 +1,24 @@
+/*############################################################################
+ # 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 tiny math unit tests
+/*! \file */
+
+#include <gtest/gtest.h>
+
+int main(int argc, char* argv[]) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/epid/member/tiny/math/unittests/onetimepad.h b/epid/member/tiny/math/unittests/onetimepad.h
new file mode 100644
index 0000000..24215e1
--- /dev/null
+++ b/epid/member/tiny/math/unittests/onetimepad.h
@@ -0,0 +1,122 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// One time pad class
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_UNITTESTS_ONETIMEPAD_H_
+#define EPID_MEMBER_TINY_MATH_UNITTESTS_ONETIMEPAD_H_
+
+#include <climits> // for CHAR_BIT
+#include <cstdint>
+#include <random>
+#include <stdexcept>
+#include <vector>
+
+#if defined(_WIN32) || defined(_WIN64)
+#define __STDCALL __stdcall
+#else
+#define __STDCALL
+#endif
+
+/// One time pad with Bitsupplier interface
+class OneTimePad {
+ public:
+ /// Default constructor
+ OneTimePad() : bytes_consumed_(0), reported_having_no_data_(false) {}
+ /// Construct using mersenne twister
+ explicit OneTimePad(size_t num_bytes)
+ : bytes_consumed_(0), reported_having_no_data_(false) {
+ data_.resize(num_bytes);
+ std::mt19937 generator;
+ generator.seed(1);
+ for (size_t i = 0; i < num_bytes; i++)
+ data_[i] = static_cast<uint8_t>(generator() & 0x000000ff);
+ }
+ /// Construct with data
+ explicit OneTimePad(std::vector<uint8_t> const& uint8_data)
+ : reported_having_no_data_(false) {
+ InitUint8(uint8_data);
+ }
+ /// Re-initialize with unit8 data
+ void InitUint8(std::vector<uint8_t> const& uint8_data) {
+ if (uint8_data.size() > SIZE_MAX / CHAR_BIT)
+ throw std::invalid_argument("input exceeded SIZE_MAX bits");
+ bytes_consumed_ = 0;
+ data_.clear();
+ data_ = uint8_data;
+ reported_having_no_data_ = false;
+ }
+ /// Re-initialize with unit32 data
+ void InitUint32(std::vector<uint32_t> const& uint32_data) {
+ if (uint32_data.size() * sizeof(uint32_t) > SIZE_MAX / CHAR_BIT)
+ throw std::invalid_argument("input exceeded SIZE_MAX bits");
+ bytes_consumed_ = 0;
+ data_.clear();
+ for (auto u32 : uint32_data) {
+ data_.push_back((uint8_t)(u32 & 0xFF));
+ data_.push_back((uint8_t)((u32 & 0xFF00) >> 8));
+ data_.push_back((uint8_t)((u32 & 0xFF0000) >> 16));
+ data_.push_back((uint8_t)((u32 & 0xFF000000) >> 24));
+ reported_having_no_data_ = false;
+ }
+ }
+ /// Destructor
+ ~OneTimePad() {}
+ /// returns bits consumed
+ size_t BitsConsumed() const { return bytes_consumed_ * CHAR_BIT; }
+ /// Generates random number
+ static int __STDCALL Generate(unsigned int* random_data, int num_bits,
+ void* user_data) {
+ size_t num_bytes = num_bits / CHAR_BIT;
+ size_t extra_bits = num_bits % CHAR_BIT;
+ uint8_t* random_bytes = reinterpret_cast<uint8_t*>(random_data);
+ OneTimePad* myprng = (OneTimePad*)user_data;
+ if ((!random_data) || (num_bits <= 0)) {
+ return -5; // bad arg
+ }
+ if (myprng->reported_having_no_data_) {
+ throw std::runtime_error(
+ "request for random data after being informed random data was "
+ "exhausted");
+ }
+ if ((size_t)num_bits > myprng->BitsAvailable()) {
+ // cause an exception to be thrown on next invocation
+ myprng->reported_having_no_data_ = true;
+ return -1; // out of random data
+ }
+ if (0 != extra_bits) {
+ // can only handle even number of byte requests
+ return -5;
+ }
+
+ for (unsigned int n = 0; n < num_bytes; n++) {
+ random_bytes[n] = myprng->data_[myprng->bytes_consumed_++];
+ }
+ return 0;
+ }
+
+ private:
+ /// returns bits available
+ size_t BitsAvailable() const {
+ return (data_.size() - bytes_consumed_) * CHAR_BIT;
+ }
+
+ size_t bytes_consumed_ = 0;
+ std::vector<uint8_t> data_;
+ bool reported_having_no_data_ = false;
+};
+
+#endif // EPID_MEMBER_TINY_MATH_UNITTESTS_ONETIMEPAD_H_
diff --git a/epid/member/tiny/math/unittests/pairing-test.cc b/epid/member/tiny/math/unittests/pairing-test.cc
new file mode 100644
index 0000000..c976334
--- /dev/null
+++ b/epid/member/tiny/math/unittests/pairing-test.cc
@@ -0,0 +1,79 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of pairing implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+
+extern "C" {
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/pairing.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// PairingCompute
+
+TEST(TinyPairingTest, PairingComputeWorks) {
+ const EccPointFq a = {{0xf67c8483, 0xbaceaf8d, 0xfcaa5567, 0x8ac94411,
+ 0x7d91c375, 0x0fcaa603, 0x210f0997, 0xd7e2f937},
+ {0x0f93424b, 0x88e246d6, 0x4859033f, 0x3ff08258,
+ 0xf613c944, 0xaf6cd00a, 0x9f0d2673, 0x04b7a6ff}};
+ const EccPointFq2 b = {{{0xa3c3fd4c, 0xad5323dc, 0x3770e217, 0x91a68d51,
+ 0xdcfbda35, 0x6fb2b5c1, 0xbc72b09c, 0x3f4cb52d},
+ {0xb6f87404, 0xb8fb89d1, 0xb0c1d7f9, 0x49dff54f,
+ 0x7fb08a69, 0x5e8ef4ce, 0xcb35f350, 0x90fa4fa2}},
+ {{0xc801fb5b, 0xfbbd005f, 0x1620b9cc, 0x444c5486,
+ 0x083e43a1, 0x80f44b97, 0x62f3175a, 0xefc66005},
+ {0xeb618b01, 0x448994a3, 0x3aca949c, 0xdfba9b6f,
+ 0x35140ec9, 0xa2aa865a, 0xe20470eb, 0xc16e2b46}}};
+ const Fq12Elem expected = {
+ {{{0x50ab7bc6, 0xd28d33ca, 0xa7de4ce1, 0x162996ed, 0xad5ee231, 0x4fc0a501,
+ 0x468be932, 0xba101ff6},
+ {0x14d36207, 0x34c44c84, 0xdfa22b9e, 0x1f4d1fc0, 0xcb0454f2, 0xc4077c42,
+ 0xebde30b6, 0x15eb79f4}},
+ {{0xf91d7519, 0xc456caad, 0xb908d0d3, 0x31b0be8c, 0x1c0def81, 0x80e14649,
+ 0x4657b6e7, 0xf18b84d1},
+ {0xec73b557, 0xf8acbc05, 0x2e5f0a7e, 0xf485e0eb, 0x6fd516b6, 0xb7190100,
+ 0xc1fa4e50, 0x3fee7c43}},
+ {{0xb3ebe0e5, 0xc572866a, 0xa10be392, 0x2d6f653d, 0x138bb1b6, 0x87cf70ba,
+ 0xbbef8650, 0xe3b31829},
+ {0x4ba31303, 0x8d1afe6e, 0xe7138780, 0x36a08173, 0xcdc3182a, 0x1ecb0486,
+ 0xd5a961a5, 0xda0e5787}}},
+ {{{0x0b13b454, 0xa62f5fbf, 0xa4bed641, 0xd3632805, 0xe8010941, 0x72cebb51,
+ 0x8aaa0095, 0x669e804d},
+ {0xe49b7149, 0x8fc69d31, 0x956d88ab, 0x265c926b, 0x3bb2f1d4, 0xbfc206ea,
+ 0x6f29d6da, 0x5b5065dc}},
+ {{0x0ff0848e, 0x1f3fdf5c, 0xb3533098, 0x1a434003, 0xc80d2a60, 0x4ac6aa4a,
+ 0xc99fbca8, 0xe0ce978f},
+ {0x3357d172, 0xf5f8a018, 0x5908b3da, 0xe540395c, 0xb654a226, 0x89cef58e,
+ 0x47786d9f, 0x5a5d41d2}},
+ {{0x788a3989, 0x49a5f719, 0x5a0042e3, 0x92f94303, 0x1bd0e6c8, 0x81c5ac15,
+ 0xe8a05ec8, 0xbbba6ced},
+ {0x6d17dc8e, 0xaf351b75, 0xba6e2c36, 0x2a04ea26, 0x421e1737, 0x16fd0bfe,
+ 0x4bb33376, 0x32aebf4d}}}};
+
+ PairingState ps;
+ PairingInit(&ps);
+ Fq12Elem res = {0};
+ PairingCompute(&res, &a, &b, &ps);
+ EXPECT_EQ(expected, res);
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/serialize-test.cc b/epid/member/tiny/math/unittests/serialize-test.cc
new file mode 100644
index 0000000..66e188b
--- /dev/null
+++ b/epid/member/tiny/math/unittests/serialize-test.cc
@@ -0,0 +1,423 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of serialization implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+#include <stdint.h>
+#include <cstring>
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+
+extern "C" {
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/serialize.h"
+}
+
+bool operator==(OctStr32 const& lhs, OctStr32 const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(BigNumStr const& lhs, BigNumStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(FpElemStr const& lhs, FpElemStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(FqElemStr const& lhs, FqElemStr 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));
+}
+
+bool operator==(G2ElemStr const& lhs, G2ElemStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(Fq12ElemStr const& lhs, Fq12ElemStr const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+namespace {
+////////////////////////////////////////////////////////////////////////
+// Uint32Serialize
+
+TEST(TinySerializeTest, Uint32SerializeWorks) {
+ OctStr32 octstr = {0};
+ const OctStr32 expected_octstr = {0x01, 0x02, 0x03, 0x04};
+ const uint32_t num = 0x01020304;
+ Uint32Serialize(&octstr, num);
+ EXPECT_EQ(expected_octstr, octstr);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Uint32Deserialize
+
+TEST(TinySerializeTest, Uint32DeserializeWorks) {
+ const OctStr32 octstr = {0x01, 0x02, 0x03, 0x04};
+ uint32_t num = 0;
+ const uint32_t expected_num = 0x01020304;
+ Uint32Deserialize(&num, &octstr);
+ EXPECT_EQ(expected_num, num);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliSerialize
+
+TEST(TinySerializeTest, VliSerializeWorks) {
+ const VeryLargeInt vli = {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
+ 0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20};
+ BigNumStr serialize_vli = {0};
+ const BigNumStr expected_serialize_vli = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ VliSerialize(&serialize_vli, &vli);
+ EXPECT_EQ(expected_serialize_vli, serialize_vli);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliDeserialize
+
+TEST(TinySerializeTest, VliDeserializeWorks) {
+ VeryLargeInt vli = {0};
+ const VeryLargeInt expected_vli = {0x01020304, 0x05060708, 0x090A0B0C,
+ 0x0D0E0F10, 0x11121314, 0x15161718,
+ 0x191A1B1C, 0x1D1E1F20};
+ const BigNumStr serialize_vli = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ VliDeserialize(&vli, &serialize_vli);
+ EXPECT_EQ(expected_vli, vli);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqSerialize
+
+TEST(TinySerializeTest, FqSerializeWorks) {
+ const FqElem fqelm = {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
+ 0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20};
+ FqElemStr serialize_fqelm = {0};
+ const FqElemStr expected_serialize_fqelm = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ FqSerialize(&serialize_fqelm, &fqelm);
+ EXPECT_EQ(expected_serialize_fqelm, serialize_fqelm);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FqDeserialize
+
+TEST(TinySerializeTest, FqDeserializeWorks) {
+ const FqElemStr serialize_fqelm = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ FqElem fqelm = {0};
+ const FqElem expected_fqelm = {0x01020304, 0x05060708, 0x090A0B0C,
+ 0x0D0E0F10, 0x11121314, 0x15161718,
+ 0x191A1B1C, 0x1D1E1F20};
+ FqDeserialize(&fqelm, &serialize_fqelm);
+ EXPECT_EQ(expected_fqelm, fqelm);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Serialize
+
+TEST(TinySerializeTest, Fq12SerializeWorks) {
+ const Fq12Elem fq12elm = {
+ {{
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ },
+ {
+ {0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x04000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ },
+ {
+ {0x00000000, 0x00000005, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000600, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ }},
+ {{
+ {0x00000000, 0x00070000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x08000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ },
+ {
+ {0x00000000, 0x00000000, 0x00000009, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000A00, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ },
+ {
+ {0x00000000, 0x00000000, 0x000B0000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x0C000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ }}};
+ Fq12ElemStr serialized_fq12elm = {0};
+ const Fq12ElemStr expected_serialized_fq12elm = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, 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, 0x04, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+ Fq12Serialize(&serialized_fq12elm, &fq12elm);
+ EXPECT_EQ(expected_serialized_fq12elm, serialized_fq12elm);
+}
+
+////////////////////////////////////////////////////////////////////////
+// Fq12Deserialize
+
+TEST(TinySerializeTest, Fq12DeserializeWorks) {
+ const Fq12ElemStr serialized_fq12elm = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 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, 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, 0x04, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+ Fq12Elem fq12elm = {0};
+ const Fq12Elem expected_fq12elm = {
+ {{
+ {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000200, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ },
+ {
+ {0x00030000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x04000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ },
+ {
+ {0x00000000, 0x00000005, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000600, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ }},
+ {{
+ {0x00000000, 0x00070000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x08000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ },
+ {
+ {0x00000000, 0x00000000, 0x00000009, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x00000A00, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ },
+ {
+ {0x00000000, 0x00000000, 0x000B0000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ {0x00000000, 0x00000000, 0x0C000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000},
+ }}};
+ Fq12Deserialize(&fq12elm, &serialized_fq12elm);
+ EXPECT_EQ(expected_fq12elm, fq12elm);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpSerialize
+
+TEST(TinySerializeTest, FpSerializeWorks) {
+ const FpElem fpelm = {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
+ 0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20};
+ FpElemStr serialize_fpelm = {0};
+ const FpElemStr expected_serialize_fpelm = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ FpSerialize(&serialize_fpelm, &fpelm);
+ EXPECT_EQ(expected_serialize_fpelm, serialize_fpelm);
+}
+
+////////////////////////////////////////////////////////////////////////
+// FpDeserialize
+
+TEST(TinySerializeTest, FpDeserializeWorks) {
+ const FpElemStr serialize_fpelm = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ FpElem fpelm = {0};
+ const FpElem expected_fpelm = {0x01020304, 0x05060708, 0x090A0B0C,
+ 0x0D0E0F10, 0x11121314, 0x15161718,
+ 0x191A1B1C, 0x1D1E1F20};
+ FpDeserialize(&fpelm, &serialize_fpelm);
+ EXPECT_EQ(expected_fpelm, fpelm);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqSerialize
+
+TEST(TinySerializeTest, EFqSerializeWorks) {
+ const FqElem fqelm = {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
+ 0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20};
+ const EccPointFq efq_point = {fqelm, fqelm};
+ const FqElemStr serialize_fqelm = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ G1ElemStr efq_point_serialize = {0};
+ const G1ElemStr expected_efq_point_serialize = {serialize_fqelm,
+ serialize_fqelm};
+ EFqSerialize(&efq_point_serialize, &efq_point);
+ EXPECT_EQ(expected_efq_point_serialize, efq_point_serialize);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFqDeserialize
+
+TEST(TinySerializeTest, EFqDeserializeWorks) {
+ const FqElemStr serialize_fqelm = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ const G1ElemStr serialize_efq_point = {serialize_fqelm, serialize_fqelm};
+ EccPointFq efq_point = {0};
+ const FqElem fqelm = {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
+ 0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20};
+ const EccPointFq expected_efq_point = {fqelm, fqelm};
+ EFqDeserialize(&efq_point, &serialize_efq_point);
+ EXPECT_EQ(expected_efq_point, efq_point);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2Serialize
+
+TEST(TinySerializeTest, EFq2SerializeWorks) {
+ const FqElem fqelm = {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
+ 0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20};
+ const EccPointFq2 efq2_point = {{fqelm, fqelm}, {fqelm, fqelm}};
+ const FqElemStr serialize_fqelm = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ G2ElemStr efq2_point_serialize = {0};
+ const G2ElemStr expected_efq2_point_serialize = {
+ {serialize_fqelm, serialize_fqelm}, {serialize_fqelm, serialize_fqelm}};
+ EFq2Serialize(&efq2_point_serialize, &efq2_point);
+ EXPECT_EQ(expected_efq2_point_serialize, efq2_point_serialize);
+}
+
+////////////////////////////////////////////////////////////////////////
+// EFq2Deserialize
+
+TEST(TinySerializeTest, EFq2DeserializeWorks) {
+ const FqElemStr serialize_fqelm = {
+ 0x1D, 0x1E, 0x1F, 0x20, 0x19, 0x1A, 0x1B, 0x1C, 0x15, 0x16, 0x17,
+ 0x18, 0x11, 0x12, 0x13, 0x14, 0x0D, 0x0E, 0x0F, 0x10, 0x09, 0x0A,
+ 0x0B, 0x0C, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04};
+ const G2ElemStr serialize_efq2_point = {{serialize_fqelm, serialize_fqelm},
+ {serialize_fqelm, serialize_fqelm}};
+ EccPointFq2 efq2_point = {0};
+ const FqElem fqelm = {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
+ 0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20};
+ const EccPointFq2 expected_efq2_point = {{fqelm, fqelm}, {fqelm, fqelm}};
+ EFq2Deserialize(&efq2_point, &serialize_efq2_point);
+ EXPECT_EQ(expected_efq2_point, efq2_point);
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/sha256-test.cc b/epid/member/tiny/math/unittests/sha256-test.cc
new file mode 100644
index 0000000..532c27e
--- /dev/null
+++ b/epid/member/tiny/math/unittests/sha256-test.cc
@@ -0,0 +1,350 @@
+/*############################################################################
+# 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 (C) 2017 by Intel Corporation, 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 Intel Corporation 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.
+ */
+
+/*
+ DESCRIPTION
+ This module tests the following SHA256 routines:
+
+ Scenarios tested include:
+ - NIST SHA256 test vectors
+*/
+#include <gtest/gtest.h>
+
+namespace {
+extern "C" {
+#include "epid/member/tiny/math/sha256.h"
+}
+
+TEST(TinySha256Test, tc_sha256_update_SucceedsGivenZeroMessageLength) {
+ const uint8_t expected[32] = {0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14,
+ 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24,
+ 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c,
+ 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55};
+ const char* m = "";
+ sha256_state s;
+ uint8_t digest[32];
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, (const uint8_t*)m, 0);
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+/*
+ * NIST SHA256 test vector 1.
+ */
+TEST(TinySha256Test, tc_sha256_WorksGivenNistTestVector1) {
+ const uint8_t expected[32] = {0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea,
+ 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23,
+ 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c,
+ 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad};
+ const char* m = "abc";
+ uint8_t digest[32];
+ sha256_state s;
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, (const uint8_t*)m, strlen(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+/*
+ * NIST SHA256 test vector 2.
+ */
+TEST(TinySha256Test, tc_sha256_WorksGivenNistTestVector2) {
+ const uint8_t expected[32] = {0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8,
+ 0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39,
+ 0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67,
+ 0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1};
+ const char* m = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+ uint8_t digest[32];
+ sha256_state s;
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, (const uint8_t*)m, strlen(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven1NonZeroChar) {
+ const uint8_t expected[32] = {0x68, 0x32, 0x57, 0x20, 0xaa, 0xbd, 0x7c, 0x82,
+ 0xf3, 0x0f, 0x55, 0x4b, 0x31, 0x3d, 0x05, 0x70,
+ 0xc9, 0x5a, 0xcc, 0xbb, 0x7d, 0xc4, 0xb5, 0xaa,
+ 0xe1, 0x12, 0x04, 0xc0, 0x8f, 0xfe, 0x73, 0x2b};
+ const uint8_t m[1] = {0xbd};
+ uint8_t digest[32];
+ sha256_state s;
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven4NonZeroChars) {
+ const uint8_t expected[32] = {0x7a, 0xbc, 0x22, 0xc0, 0xae, 0x5a, 0xf2, 0x6c,
+ 0xe9, 0x3d, 0xbb, 0x94, 0x43, 0x3a, 0x0e, 0x0b,
+ 0x2e, 0x11, 0x9d, 0x01, 0x4f, 0x8e, 0x7f, 0x65,
+ 0xbd, 0x56, 0xc6, 0x1c, 0xcc, 0xcd, 0x95, 0x04};
+ const uint8_t m[4] = {0xc9, 0x8c, 0x8e, 0x55};
+ uint8_t digest[32];
+ sha256_state s;
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven55ZeroChars) {
+ const uint8_t expected[32] = {0x02, 0x77, 0x94, 0x66, 0xcd, 0xec, 0x16, 0x38,
+ 0x11, 0xd0, 0x78, 0x81, 0x5c, 0x63, 0x3f, 0x21,
+ 0x90, 0x14, 0x13, 0x08, 0x14, 0x49, 0x00, 0x2f,
+ 0x24, 0xaa, 0x3e, 0x80, 0xf0, 0xb8, 0x8e, 0xf7};
+ uint8_t m[55];
+ uint8_t digest[32];
+ sha256_state s;
+
+ (void)memset(m, 0x00, sizeof(m));
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven56ZeroChars) {
+ const uint8_t expected[32] = {0xd4, 0x81, 0x7a, 0xa5, 0x49, 0x76, 0x28, 0xe7,
+ 0xc7, 0x7e, 0x6b, 0x60, 0x61, 0x07, 0x04, 0x2b,
+ 0xbb, 0xa3, 0x13, 0x08, 0x88, 0xc5, 0xf4, 0x7a,
+ 0x37, 0x5e, 0x61, 0x79, 0xbe, 0x78, 0x9f, 0xbb};
+ uint8_t m[56];
+ uint8_t digest[32];
+ sha256_state s;
+
+ (void)memset(m, 0x00, sizeof(m));
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven57ZeroChars) {
+ const uint8_t expected[32] = {0x65, 0xa1, 0x6c, 0xb7, 0x86, 0x13, 0x35, 0xd5,
+ 0xac, 0xe3, 0xc6, 0x07, 0x18, 0xb5, 0x05, 0x2e,
+ 0x44, 0x66, 0x07, 0x26, 0xda, 0x4c, 0xd1, 0x3b,
+ 0xb7, 0x45, 0x38, 0x1b, 0x23, 0x5a, 0x17, 0x85};
+ uint8_t m[57];
+ uint8_t digest[32];
+ sha256_state s;
+
+ (void)memset(m, 0x00, sizeof(m));
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven64ZeroChars) {
+ const uint8_t expected[32] = {0xf5, 0xa5, 0xfd, 0x42, 0xd1, 0x6a, 0x20, 0x30,
+ 0x27, 0x98, 0xef, 0x6e, 0xd3, 0x09, 0x97, 0x9b,
+ 0x43, 0x00, 0x3d, 0x23, 0x20, 0xd9, 0xf0, 0xe8,
+ 0xea, 0x98, 0x31, 0xa9, 0x27, 0x59, 0xfb, 0x4b};
+ uint8_t m[64];
+ uint8_t digest[32];
+ sha256_state s;
+
+ (void)memset(m, 0x00, sizeof(m));
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven1000ZeroChars) {
+ const uint8_t expected[32] = {0x54, 0x1b, 0x3e, 0x9d, 0xaa, 0x09, 0xb2, 0x0b,
+ 0xf8, 0x5f, 0xa2, 0x73, 0xe5, 0xcb, 0xd3, 0xe8,
+ 0x01, 0x85, 0xaa, 0x4e, 0xc2, 0x98, 0xe7, 0x65,
+ 0xdb, 0x87, 0x74, 0x2b, 0x70, 0x13, 0x8a, 0x53};
+ uint8_t m[1000];
+ uint8_t digest[32];
+ sha256_state s;
+
+ (void)memset(m, 0x00, sizeof(m));
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven1000NonZeroChars) {
+ const uint8_t expected[32] = {0xc2, 0xe6, 0x86, 0x82, 0x34, 0x89, 0xce, 0xd2,
+ 0x01, 0x7f, 0x60, 0x59, 0xb8, 0xb2, 0x39, 0x31,
+ 0x8b, 0x63, 0x64, 0xf6, 0xdc, 0xd8, 0x35, 0xd0,
+ 0xa5, 0x19, 0x10, 0x5a, 0x1e, 0xad, 0xd6, 0xe4};
+ uint8_t m[1000];
+ uint8_t digest[32];
+ sha256_state s;
+
+ (void)memset(m, 0x41, sizeof(m));
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven1005NonZeroChars) {
+ const uint8_t expected[32] = {0xf4, 0xd6, 0x2d, 0xde, 0xc0, 0xf3, 0xdd, 0x90,
+ 0xea, 0x13, 0x80, 0xfa, 0x16, 0xa5, 0xff, 0x8d,
+ 0xc4, 0xc5, 0x4b, 0x21, 0x74, 0x06, 0x50, 0xf2,
+ 0x4a, 0xfc, 0x41, 0x20, 0x90, 0x35, 0x52, 0xb0};
+ uint8_t m[1005];
+ uint8_t digest[32];
+ sha256_state s;
+
+ (void)memset(m, 0x55, sizeof(m));
+
+ tc_sha256_init(&s);
+ tc_sha256_update(&s, m, sizeof(m));
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test, tc_sha256_WorksGiven1000ZeroCharsUpdated1000Times) {
+ const uint8_t expected[32] = {0xd2, 0x97, 0x51, 0xf2, 0x64, 0x9b, 0x32, 0xff,
+ 0x57, 0x2b, 0x5e, 0x0a, 0x9f, 0x54, 0x1e, 0xa6,
+ 0x60, 0xa5, 0x0f, 0x94, 0xff, 0x0b, 0xee, 0xdf,
+ 0xb0, 0xb6, 0x92, 0xb9, 0x24, 0xcc, 0x80, 0x25};
+ uint8_t m[1000];
+ uint8_t digest[32];
+ sha256_state s;
+ unsigned int i;
+
+ (void)memset(m, 0x00, sizeof(m));
+
+ tc_sha256_init(&s);
+ for (i = 0; i < 1000; ++i) {
+ tc_sha256_update(&s, m, sizeof(m));
+ }
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test,
+ DISABLED_SLOW_tc_sha256_WorksGiven32768NonZeroCharsUpdated16384Times) {
+ const uint8_t expected[32] = {0x15, 0xa1, 0x86, 0x8c, 0x12, 0xcc, 0x53, 0x95,
+ 0x1e, 0x18, 0x23, 0x44, 0x27, 0x74, 0x47, 0xcd,
+ 0x09, 0x79, 0x53, 0x6b, 0xad, 0xcc, 0x51, 0x2a,
+ 0xd2, 0x4c, 0x67, 0xe9, 0xb2, 0xd4, 0xf3, 0xdd};
+ uint8_t m[32768];
+ uint8_t digest[32];
+ sha256_state s;
+ unsigned int i;
+
+ (void)memset(m, 0x5a, sizeof(m));
+
+ tc_sha256_init(&s);
+ for (i = 0; i < 16384; ++i) {
+ tc_sha256_update(&s, m, sizeof(m));
+ }
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha256Test,
+ DISABLED_SLOW_tc_sha256_WorksGiven32768NonZeroCharsUpdated33280Times) {
+ const uint8_t expected[32] = {0x46, 0x1c, 0x19, 0xa9, 0x3b, 0xd4, 0x34, 0x4f,
+ 0x92, 0x15, 0xf5, 0xec, 0x64, 0x35, 0x70, 0x90,
+ 0x34, 0x2b, 0xc6, 0x6b, 0x15, 0xa1, 0x48, 0x31,
+ 0x7d, 0x27, 0x6e, 0x31, 0xcb, 0xc2, 0x0b, 0x53};
+ uint8_t m[32768];
+ uint8_t digest[32];
+ sha256_state s;
+ unsigned int i;
+
+ (void)memset(m, 0x00, sizeof(m));
+
+ tc_sha256_init(&s);
+ for (i = 0; i < 33280; ++i) {
+ tc_sha256_update(&s, m, sizeof(m));
+ }
+ tc_sha256_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+} // namespace
diff --git a/epid/member/tiny/math/unittests/sha512-test.cc b/epid/member/tiny/math/unittests/sha512-test.cc
new file mode 100644
index 0000000..654c057
--- /dev/null
+++ b/epid/member/tiny/math/unittests/sha512-test.cc
@@ -0,0 +1,108 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of SHA-512 implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+
+namespace {
+extern "C" {
+#include "epid/member/tiny/math/sha512.h"
+}
+
+TEST(TinySha512Test, WorksGivenTinyTestVector1) {
+ const uint8_t expected[SHA512_DIGEST_SIZE] = {
+ 0xdd, 0xaf, 0x35, 0xa1, 0x93, 0x61, 0x7a, 0xba, 0xcc, 0x41, 0x73,
+ 0x49, 0xae, 0x20, 0x41, 0x31, 0x12, 0xe6, 0xfa, 0x4e, 0x89, 0xa9,
+ 0x7e, 0xa2, 0x0a, 0x9e, 0xee, 0xe6, 0x4b, 0x55, 0xd3, 0x9a, 0x21,
+ 0x92, 0x99, 0x2a, 0x27, 0x4f, 0xc1, 0xa8, 0x36, 0xba, 0x3c, 0x23,
+ 0xa3, 0xfe, 0xeb, 0xbd, 0x45, 0x4d, 0x44, 0x23, 0x64, 0x3c, 0xe8,
+ 0x0e, 0x2a, 0x9a, 0xc9, 0x4f, 0xa5, 0x4c, 0xa4, 0x9f};
+ const char* m = "abc";
+ uint8_t digest[SHA512_DIGEST_SIZE];
+ sha512_state s;
+
+ tinysha512_init(&s);
+ tinysha512_update(&s, (const uint8_t*)m, strlen(m));
+ tinysha512_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha512Test, WorksGivenTinyTestVector2) {
+ const uint8_t expected[SHA512_DIGEST_SIZE] = {
+ 0xcf, 0x83, 0xe1, 0x35, 0x7e, 0xef, 0xb8, 0xbd, 0xf1, 0x54, 0x28,
+ 0x50, 0xd6, 0x6d, 0x80, 0x07, 0xd6, 0x20, 0xe4, 0x05, 0x0b, 0x57,
+ 0x15, 0xdc, 0x83, 0xf4, 0xa9, 0x21, 0xd3, 0x6c, 0xe9, 0xce, 0x47,
+ 0xd0, 0xd1, 0x3c, 0x5d, 0x85, 0xf2, 0xb0, 0xff, 0x83, 0x18, 0xd2,
+ 0x87, 0x7e, 0xec, 0x2f, 0x63, 0xb9, 0x31, 0xbd, 0x47, 0x41, 0x7a,
+ 0x81, 0xa5, 0x38, 0x32, 0x7a, 0xf9, 0x27, 0xda, 0x3e};
+ const char* m = "";
+ uint8_t digest[SHA512_DIGEST_SIZE];
+ sha512_state s;
+
+ tinysha512_init(&s);
+ tinysha512_update(&s, (const uint8_t*)m, strlen(m));
+ tinysha512_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha512Test, WorksGivenTinyTestVector3) {
+ const uint8_t expected[SHA512_DIGEST_SIZE] = {
+ 0x20, 0x4a, 0x8f, 0xc6, 0xdd, 0xa8, 0x2f, 0x0a, 0x0c, 0xed, 0x7b,
+ 0xeb, 0x8e, 0x08, 0xa4, 0x16, 0x57, 0xc1, 0x6e, 0xf4, 0x68, 0xb2,
+ 0x28, 0xa8, 0x27, 0x9b, 0xe3, 0x31, 0xa7, 0x03, 0xc3, 0x35, 0x96,
+ 0xfd, 0x15, 0xc1, 0x3b, 0x1b, 0x07, 0xf9, 0xaa, 0x1d, 0x3b, 0xea,
+ 0x57, 0x78, 0x9c, 0xa0, 0x31, 0xad, 0x85, 0xc7, 0xa7, 0x1d, 0xd7,
+ 0x03, 0x54, 0xec, 0x63, 0x12, 0x38, 0xca, 0x34, 0x45};
+ const char* m = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
+ uint8_t digest[SHA512_DIGEST_SIZE];
+ sha512_state s;
+
+ tinysha512_init(&s);
+ tinysha512_update(&s, (const uint8_t*)m, strlen(m));
+ tinysha512_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+TEST(TinySha512Test, WorksGivenTinyTestVector4) {
+ const uint8_t expected[SHA512_DIGEST_SIZE] = {
+ 0x8e, 0x95, 0x9b, 0x75, 0xda, 0xe3, 0x13, 0xda, 0x8c, 0xf4, 0xf7,
+ 0x28, 0x14, 0xfc, 0x14, 0x3f, 0x8f, 0x77, 0x79, 0xc6, 0xeb, 0x9f,
+ 0x7f, 0xa1, 0x72, 0x99, 0xae, 0xad, 0xb6, 0x88, 0x90, 0x18, 0x50,
+ 0x1d, 0x28, 0x9e, 0x49, 0x00, 0xf7, 0xe4, 0x33, 0x1b, 0x99, 0xde,
+ 0xc4, 0xb5, 0x43, 0x3a, 0xc7, 0xd3, 0x29, 0xee, 0xb6, 0xdd, 0x26,
+ 0x54, 0x5e, 0x96, 0xe5, 0x5b, 0x87, 0x4b, 0xe9, 0x09};
+ const char* m =
+ "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnop"
+ "jklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu";
+ uint8_t digest[SHA512_DIGEST_SIZE];
+ sha512_state s;
+
+ tinysha512_init(&s);
+ tinysha512_update(&s, (const uint8_t*)m, strlen(m));
+ tinysha512_final(digest, &s);
+ EXPECT_TRUE(0 == memcmp(expected, digest, sizeof(digest)))
+ << digest << std::endl
+ << expected;
+}
+
+} // namespace
diff --git a/epid/member/tiny/math/unittests/utest.parts b/epid/member/tiny/math/unittests/utest.parts
new file mode 100644
index 0000000..2709baf
--- /dev/null
+++ b/epid/member/tiny/math/unittests/utest.parts
@@ -0,0 +1,47 @@
+# pylint:disable=I0011,W0401,W0614,C0103,E0602
+############################################################################
+# 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.
+############################################################################
+"""Build configuration for unit test of tiny math library.
+"""
+Import('*')
+env.PartName('utest')
+
+env.DependsOn([Component('gtest'),
+ Component(env.subst('${PART_PARENT_NAME}'))])
+
+utest_files = Pattern(src_dir='.',
+ includes=['*-test.cc',
+ '*-testhelper.cc'],
+ recursive=True).files()
+
+env.Append(CPPPATH='#')
+
+env['UNIT_TEST_TARGET_NAME'] = "${PART_PARENT_NAME}-${UNIT_TEST_TARGET}"
+
+utest = env.UnitTest('${PART_SHORT_NAME}',
+ utest_files,
+ command_args=[
+ '--gtest_filter=**',
+ '--gtest_color=yes',
+ '--gtest_print_time=1',
+ '--gtest_output=xml',
+ #'--gtest_break_on_failure',
+ #'--gtest_catch_exceptions=0',
+ ],
+ data_src=[],
+ make_pdb=(env.isConfigBasedOn('debug')),
+ INSTALL_BIN='${INSTALL_TEST_BIN}',
+ )
diff --git a/epid/member/tiny/math/unittests/vli-test.cc b/epid/member/tiny/math/unittests/vli-test.cc
new file mode 100644
index 0000000..0d15c10
--- /dev/null
+++ b/epid/member/tiny/math/unittests/vli-test.cc
@@ -0,0 +1,379 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Unit tests of large integer implementation.
+/*! \file */
+
+#include <gtest/gtest.h>
+#include <limits.h> // for CHAR_BIT
+#include <cstring>
+#include <random>
+
+#include "epid/member/tiny/math/unittests/cmp-testhelper.h"
+#include "epid/member/tiny/math/unittests/onetimepad.h"
+
+extern "C" {
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/vli.h"
+}
+
+namespace {
+
+////////////////////////////////////////////////////////////////////////
+// VliAdd
+
+TEST(TinyVliTest, VliAddWorks) {
+ VeryLargeInt result = {0};
+ VeryLargeInt expected = {0};
+ VeryLargeInt left = {0};
+ VeryLargeInt right = {0};
+ left.word[0] = 1;
+ right.word[0] = 2;
+ expected.word[0] = 3;
+ VliAdd(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+}
+TEST(TinyVliTest, VliAddCalculatesCarry) {
+ VeryLargeInt left = {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}};
+ VeryLargeInt right = {{0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1}};
+ VeryLargeInt expected = {{0x0, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1}};
+ uint32_t expected_carry = 0x1;
+ uint32_t carry = 0;
+ VeryLargeInt result = {0};
+ carry = VliAdd(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+ EXPECT_EQ(expected_carry, carry);
+}
+////////////////////////////////////////////////////////////////////////
+// VliMul
+TEST(TinyVliTest, VliMultWorks) {
+ VeryLargeIntProduct result = {0};
+ VeryLargeIntProduct expected = {0};
+ VeryLargeInt left = {0}, right = {0};
+ left.word[0] = 2;
+ right.word[0] = 2;
+ expected.word[0] = 4;
+ VliMul(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+}
+TEST(TinyVliTest, VliMultWorksWithOverflow) {
+ VeryLargeIntProduct result = {0};
+ VeryLargeIntProduct expected = {
+ {0xfffffffe, 0xfffffffd, 0xfffffffd, 0xfffffffd, 0xfffffffd, 0xfffffffd,
+ 0xfffffffd, 0xfffffffd, 0x1, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2}};
+ VeryLargeInt left = {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}};
+ VeryLargeInt right = {{0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2}};
+ VliMul(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliRShift
+TEST(TinyVliTest, VliRShiftWorks) {
+ VeryLargeInt result = {0}, expected = {0};
+ VeryLargeInt in = {0};
+ uint32_t shift = 1;
+ in.word[0] = 4;
+ expected.word[0] = 2;
+ VliRShift(&result, &in, shift);
+ EXPECT_EQ(expected, result);
+}
+TEST(TinyVliTest, VliRShiftWorksWithOverlap) {
+ VeryLargeInt result = {0}, expected = {0};
+ VeryLargeInt in = {0};
+ uint32_t shift = 4;
+ in.word[0] = 0x00000008;
+ in.word[1] = 0xffffffff;
+ expected.word[0] = 0xf0000000;
+ expected.word[1] = 0x0fffffff;
+ VliRShift(&result, &in, shift);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliSub
+TEST(TinyVliTest, VliSubWorks) {
+ VeryLargeInt result = {0}, expected = {0};
+ VeryLargeInt left = {0}, right = {0};
+ uint32_t borrow = 0;
+ uint32_t expected_borrow = 0;
+ left.word[0] = 4;
+ right.word[0] = 2;
+ expected.word[0] = 2;
+ borrow = VliSub(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+ EXPECT_EQ(expected_borrow, borrow);
+}
+TEST(TinyVliTest, VliSubWorksWithBorrow) {
+ VeryLargeInt result = {0};
+ VeryLargeInt expected = {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}};
+ VeryLargeInt left = {0}, right = {0};
+ uint32_t borrow = 0;
+ uint32_t expected_borrow = 1;
+ left.word[0] = 2;
+ right.word[0] = 3;
+ borrow = VliSub(&result, &left, &right);
+ EXPECT_EQ(expected, result);
+ EXPECT_EQ(expected_borrow, borrow);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliSet
+
+TEST(TinyVliTest, VliSetWorks) {
+ VeryLargeInt result = {0};
+ VeryLargeInt in = {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}};
+ VliSet(&result, &in);
+ EXPECT_EQ(in, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliClear
+
+TEST(TinyVliTest, VliClearWorks) {
+ VeryLargeInt expected = {0};
+ VeryLargeInt in_out = {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}};
+ VliClear(&in_out);
+ EXPECT_EQ(expected, in_out);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliIsZero
+
+TEST(TinyVliTest, VliIsZeroAcceptsZero) {
+ int is_zero = 0;
+ VeryLargeInt in_zero = {0};
+ is_zero = VliIsZero(&in_zero);
+ EXPECT_TRUE(is_zero);
+}
+TEST(TinyVliTest, VliIsZeroRejectsNonZero) {
+ int is_zero = 0;
+ VeryLargeInt in_nonzero = {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}};
+ is_zero = VliIsZero(&in_nonzero);
+ EXPECT_FALSE(is_zero);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliCondSet
+
+TEST(TinyVliTest, VliCondSetWorksForTrue) {
+ VeryLargeInt result = {0};
+ VeryLargeInt true_val = {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}};
+ VeryLargeInt false_val = {{0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
+ 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa}};
+ VliCondSet(&result, &true_val, &false_val, 1);
+ EXPECT_EQ(true_val, result);
+}
+TEST(TinyVliTest, VliCondSetWorksForFalse) {
+ VeryLargeInt result = {0};
+ VeryLargeInt true_val = {{0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
+ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff}};
+ VeryLargeInt false_val = {{0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa,
+ 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa, 0xaaaaaaaa}};
+ VliCondSet(&result, &true_val, &false_val, 0);
+ EXPECT_EQ(false_val, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliTestBit
+
+TEST(TinyVliTest, VliTestBitWorks) {
+ VeryLargeInt in = {0};
+ uint32_t bit_set = 0;
+ in.word[0] = 4;
+ bit_set = VliTestBit(&in, 1);
+ EXPECT_EQ((uint32_t)0, bit_set);
+ bit_set = VliTestBit(&in, 2);
+ EXPECT_EQ((uint32_t)1, bit_set);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliRand
+
+TEST(TinyVliTest, VliRandWorks) {
+ OneTimePad my_prng;
+ VeryLargeInt expected_rand_val1 = {{1, 0, 0, 0, 0, 0, 0, 0}};
+ my_prng.InitUint8({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});
+ VeryLargeInt rand_val1 = {0};
+ EXPECT_TRUE(VliRand(&rand_val1, &OneTimePad::Generate, &my_prng));
+ EXPECT_EQ(expected_rand_val1, rand_val1);
+ EXPECT_EQ(256u, my_prng.BitsConsumed());
+
+ VeryLargeInt expected_rand_val2 = {{0x1c6f5a0f, 0xeaa878b3, 0xc71dab6b,
+ 0x1a101ad6, 0x1fe6394f, 0x1bec36ab,
+ 0x07a3e97f, 0x36507914}};
+ VeryLargeInt rand_val2 = {0};
+ my_prng.InitUint32({0x14795036, 0x7fe9a307, 0xab36ec1b, 0x4f39e61f,
+ 0xd61a101a, 0x6bab1dc7, 0xb378a8ea, 0x0f5a6f1c});
+ EXPECT_TRUE(VliRand(&rand_val2, &OneTimePad::Generate, &my_prng));
+ EXPECT_EQ(expected_rand_val2, rand_val2);
+ EXPECT_EQ(256u, my_prng.BitsConsumed());
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliCmp
+
+TEST(TinyVliTest, VliCmpWorksForLessThan) {
+ VeryLargeInt in_val1 = {0};
+ VeryLargeInt in_val2 = {0};
+ int res = 0;
+ in_val1.word[0] = 1;
+ in_val2.word[0] = 2;
+ res = VliCmp(&in_val1, &in_val2);
+ EXPECT_EQ(-1, res);
+}
+TEST(TinyVliTest, VliCmpWorksForEqual) {
+ VeryLargeInt in_val1 = {0};
+ VeryLargeInt in_val2 = {0};
+ int res = 0;
+ in_val1.word[0] = 2;
+ in_val2.word[0] = 2;
+ res = VliCmp(&in_val1, &in_val2);
+ EXPECT_EQ(0, res);
+}
+TEST(TinyVliTest, VliCmpWorksGreaterThan) {
+ VeryLargeInt in_val1 = {0};
+ VeryLargeInt in_val2 = {0};
+ int res = 0;
+ in_val1.word[0] = 1;
+ in_val2.word[0] = 2;
+ res = VliCmp(&in_val2, &in_val1);
+ EXPECT_EQ(1, res);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliModAdd
+
+TEST(TinyVliTest, VliModAddWorks) {
+ VeryLargeInt result = {0};
+ VeryLargeInt left = {0};
+ VeryLargeInt right = {0};
+ VeryLargeInt expected = {0};
+ VeryLargeInt mod = {0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ left.word[0] = 0x9;
+ right.word[0] = 0x8;
+ expected.word[0] = 0x11;
+ VliModAdd(&result, &left, &right, &mod);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliModSub
+
+TEST(TinyVliTest, VliModSubWorks) {
+ VeryLargeInt result = {0};
+ VeryLargeInt left = {0};
+ VeryLargeInt right = {0};
+ VeryLargeInt expected = {0};
+ VeryLargeInt mod = {0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ left.word[0] = 0x18;
+ right.word[0] = 0x12;
+ expected.word[0] = 0x6;
+ VliModSub(&result, &left, &right, &mod);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliModMul
+
+TEST(TinyVliTest, VliModMultWorks) {
+ VeryLargeInt result = {0};
+ VeryLargeInt left = {0};
+ VeryLargeInt right = {0};
+ VeryLargeInt expected = {0};
+ VeryLargeInt mod = {0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ left.word[0] = 0x10;
+ right.word[0] = 0x2;
+ expected.word[0] = 0x20;
+ VliModMul(&result, &left, &right, &mod);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliModExp
+
+TEST(TinyVliTest, VliModExpWorks) {
+ VeryLargeInt result = {0};
+ VeryLargeInt base = {0};
+ VeryLargeInt exp = {0};
+ VeryLargeInt mod = {0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ VeryLargeInt expected = {0};
+ base.word[0] = 0x4;
+ exp.word[0] = 0x2;
+ expected.word[0] = 0x10;
+ VliModExp(&result, &base, &exp, &mod);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliModInv
+
+TEST(TinyVliTest, VliModInvWorks) {
+ VeryLargeInt a = {0x76abb18a, 0x92c0f7b9, 0x2c1a37e0, 0x7fdf6ca1,
+ 0xe3401760, 0x66eb7d52, 0x918d50a7, 0x12a65bd6};
+ VeryLargeInt q = {0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ VeryLargeInt expected = {0x5a686df6, 0x56b6ab63, 0xdf907c6f, 0x44ad8d51,
+ 0xa5513462, 0xc597ef78, 0x93711b39, 0x15171a1e};
+ VeryLargeInt result;
+ VliModInv(&result, &a, &q);
+ EXPECT_EQ(result, expected);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliModSquare
+
+TEST(TinyVliTest, VliModSquareWorks) {
+ VeryLargeInt result = {0};
+ VeryLargeInt input = {0};
+ VeryLargeInt mod = {0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ VeryLargeInt expected = {0};
+ input.word[0] = 0x4;
+ expected.word[0] = 0x10;
+ VliModSquare(&result, &input, &mod);
+ EXPECT_EQ(expected, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// VliModBarrett
+
+TEST(TinyVliTest, VliModBarrettWorks) {
+ VeryLargeInt result = {0};
+ VeryLargeIntProduct product = {0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF,
+ 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0};
+ VeryLargeInt mod = {0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB,
+ 0xEE71A49F, 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF};
+ VeryLargeInt expected = {0};
+ product.word[0] += 0xF;
+ expected.word[0] = 0xF;
+ VliModBarrett(&result, &product, &mod);
+ EXPECT_EQ(expected, result);
+}
+} // namespace
diff --git a/epid/member/tiny/math/vli.h b/epid/member/tiny/math/vli.h
new file mode 100644
index 0000000..5ea61db
--- /dev/null
+++ b/epid/member/tiny/math/vli.h
@@ -0,0 +1,196 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of Large Integer math
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_MATH_VLI_H_
+#define EPID_MEMBER_TINY_MATH_VLI_H_
+
+#include <stdint.h>
+#include "epid/common/bitsupplier.h"
+/// \cond
+typedef struct VeryLargeInt VeryLargeInt;
+typedef struct VeryLargeIntProduct VeryLargeIntProduct;
+/// \endcond
+
+/// Add two large integers.
+/*!
+\param[out] result target.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+
+\returns the carry portion of the addition.
+*/
+uint32_t VliAdd(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right);
+
+/// Multiply two large integers.
+/*!
+\param[out] result of multiplying left and right.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+*/
+void VliMul(VeryLargeIntProduct* result, VeryLargeInt const* left,
+ VeryLargeInt const* right);
+
+/// Right shift a large integers.
+/*!
+\param[out] result target.
+\param[in] in The value to be shifted.
+\param[in] shift The number of bits to shift.
+*/
+void VliRShift(VeryLargeInt* result, VeryLargeInt const* in, uint32_t shift);
+
+/// Subtract two large integers.
+/*!
+\param[out] result target.
+\param[in] left The operand to be subtracted from.
+\param[in] right The operand to subtract.
+\returns 1 on success, 0 on failure
+*/
+uint32_t VliSub(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right);
+
+/// Set a large integer's value.
+/*!
+\param[out] result target.
+\param[in] in value to set.
+*/
+void VliSet(VeryLargeInt* result, VeryLargeInt const* in);
+
+/// Clear a large integer's value.
+/*!
+\param[out] result value to clear.
+*/
+void VliClear(VeryLargeInt* result);
+
+/// Test if a large integer is zero.
+/*!
+\param[in] in the value to test.
+\returns A value different from zero (i.e., true) if indeed
+ the value is zero. Zero (i.e., false) otherwise.
+*/
+int VliIsZero(VeryLargeInt const* in);
+
+/// Conditionally Set a large inter's value to one of two values.
+/*!
+\param[out] result target.
+\param[in] true_val value to set if condition is true.
+\param[in] false_val value to set if condition is false.
+\param[in] truth_val value of condition.
+*/
+void VliCondSet(VeryLargeInt* result, VeryLargeInt const* true_val,
+ VeryLargeInt const* false_val, int truth_val);
+
+/// Test the value of a bit in a large integer.
+/*!
+\param[in] in the value to test.
+\param[in] bit the bit index.
+
+\returns value of the bit (1 or 0).
+*/
+uint32_t VliTestBit(VeryLargeInt const* in, uint32_t bit);
+
+/// Generate a random large integer.
+/*!
+\param[in] result the random value.
+\param[in] rnd_func Random number generator.
+\param[in] rnd_param Pass through context data for rnd_func.
+\returns A value different from zero (i.e., true) if on success.
+ Zero (i.e., false) otherwise.
+*/
+int VliRand(VeryLargeInt* result, BitSupplier rnd_func, void* rnd_param);
+
+/// compare two large integers.
+/*!
+\param[in] left the left hand value.
+\param[in] right the right hand value.
+
+\returns the sign of left - right
+*/
+int VliCmp(VeryLargeInt const* left, VeryLargeInt const* right);
+
+/// Add two large integers modulo a value.
+/*!
+\param[out] result target.
+\param[in] left The first operand to be added.
+\param[in] right The second operand to be added.
+\param[in] mod The modulo.
+*/
+void VliModAdd(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right, VeryLargeInt const* mod);
+
+/// Subtract two large integers modulo a value.
+/*!
+\param[out] result target.
+\param[in] left The operand to be subtracted from.
+\param[in] right The operand to subtract.
+\param[in] mod The modulo.
+*/
+void VliModSub(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right, VeryLargeInt const* mod);
+
+/// Multiply two large integers modulo a value.
+/*!
+\param[out] result target.
+\param[in] left The first operand to be multiplied.
+\param[in] right The second operand to be multiplied.
+\param[in] mod The modulo.
+*/
+void VliModMul(VeryLargeInt* result, VeryLargeInt const* left,
+ VeryLargeInt const* right, VeryLargeInt const* mod);
+
+/// Exponentiate a large integer modulo a value.
+/*!
+\param[out] result target.
+\param[in] base the base.
+\param[in] exp the exponent.
+\param[in] mod The modulo.
+*/
+void VliModExp(VeryLargeInt* result, VeryLargeInt const* base,
+ VeryLargeInt const* exp, VeryLargeInt const* mod);
+
+/// Invert a large integer modulo a value.
+/*!
+\param[out] result target.
+\param[in] input the value to invert.
+\param[in] mod The modulo.
+*/
+void VliModInv(VeryLargeInt* result, VeryLargeInt const* input,
+ VeryLargeInt const* mod);
+
+/// Square a large integer modulo a value.
+/*!
+\param[out] result target.
+\param[in] input the base.
+\param[in] mod The modulo.
+*/
+void VliModSquare(VeryLargeInt* result, VeryLargeInt const* input,
+ VeryLargeInt const* mod);
+
+/// Reduce a value to a modulo.
+/*!
+\param[out] result target.
+\param[in] input the base.
+\param[in] mod The modulo.
+
+\warning This function makes significant assumptions about
+the range of values input
+*/
+void VliModBarrett(VeryLargeInt* result, VeryLargeIntProduct const* input,
+ VeryLargeInt const* mod);
+
+#endif // EPID_MEMBER_TINY_MATH_VLI_H_
diff --git a/epid/member/tiny/src/allowed_basenames.c b/epid/member/tiny/src/allowed_basenames.c
new file mode 100644
index 0000000..9812988
--- /dev/null
+++ b/epid/member/tiny/src/allowed_basenames.c
@@ -0,0 +1,76 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Basename management implementation
+/*! \file */
+
+#include "epid/member/tiny/src/allowed_basenames.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+#if defined(SHA256_SUPPORT)
+#define BASENAME_SHA_ALG kSha256
+#elif defined(SHA512_SUPPORT)
+#define BASENAME_SHA_ALG kSha512
+#endif
+
+size_t BasenamesGetSize(size_t num_basenames) {
+ return sizeof(AllowedBasenames) - sizeof(sha_digest) +
+ sizeof(sha_digest) * (num_basenames);
+}
+
+void InitBasenames(AllowedBasenames* basename_container, size_t num_basenames) {
+ basename_container->current_bsn_number = 0;
+ basename_container->max_bsn_number = num_basenames;
+ memset(basename_container->basename_digest->digest, 0,
+ sizeof(basename_container->basename_digest) * num_basenames);
+}
+
+int IsBasenameAllowed(AllowedBasenames const* basename_container,
+ void const* basename, size_t length) {
+ size_t d = 0;
+ tiny_sha sha_state;
+ sha_digest digest;
+ // calculate hash of input basename
+ tinysha_init(BASENAME_SHA_ALG, &sha_state);
+ tinysha_update(&sha_state, basename, length);
+ tinysha_final(digest.digest, &sha_state);
+ // compare hash of input basename with stored hashes
+ for (d = 0; d < basename_container->current_bsn_number; d++) {
+ if (!memcmp(digest.digest, &basename_container->basename_digest[d].digest,
+ tinysha_digest_size(&sha_state))) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+int AllowBasename(AllowedBasenames* basename_container, void const* basename,
+ size_t length) {
+ tiny_sha sha_state;
+ sha_digest digest;
+ if (basename_container->max_bsn_number <=
+ basename_container->current_bsn_number) {
+ return 0;
+ }
+ // calculate hash of input basename
+ tinysha_init(BASENAME_SHA_ALG, &sha_state);
+ tinysha_update(&sha_state, basename, length);
+ tinysha_final(digest.digest, &sha_state);
+ // copy hash of input basename into digest buffer
+ basename_container->basename_digest[basename_container->current_bsn_number] =
+ digest;
+ basename_container->current_bsn_number++;
+ return 1;
+}
diff --git a/epid/member/tiny/src/allowed_basenames.h b/epid/member/tiny/src/allowed_basenames.h
new file mode 100644
index 0000000..aed9c6c
--- /dev/null
+++ b/epid/member/tiny/src/allowed_basenames.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.
+ ############################################################################*/
+/// Basename management APIs
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_SRC_ALLOWED_BASENAMES_H_
+#define EPID_MEMBER_TINY_SRC_ALLOWED_BASENAMES_H_
+
+#include <stddef.h>
+#include "epid/member/tiny/math/hashwrap.h"
+
+typedef struct AllowedBasenames {
+ size_t current_bsn_number; ///< Number of basenames registered
+ size_t max_bsn_number; ///< Maximum number of basenames to store
+ sha_digest
+ basename_digest[1]; ///< digest of registrered basenames (flexible array)
+} AllowedBasenames;
+
+/// Get allowed basenames container size
+size_t BasenamesGetSize(size_t num_basenames);
+
+/// Initilize allowed basenames container
+void InitBasenames(AllowedBasenames* basename_container, size_t num_basenames);
+
+/// Checks if given basename is allowed
+int IsBasenameAllowed(AllowedBasenames const* basename_container,
+ void const* basename, size_t length);
+
+/// Adds a new allowed basename
+int AllowBasename(AllowedBasenames* basename_container, void const* basename,
+ size_t length);
+
+#endif // EPID_MEMBER_TINY_SRC_ALLOWED_BASENAMES_H_
diff --git a/epid/member/tiny/src/context.h b/epid/member/tiny/src/context.h
new file mode 100644
index 0000000..1627026
--- /dev/null
+++ b/epid/member/tiny/src/context.h
@@ -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.
+ ############################################################################*/
+/// Member context interface.
+/*! \file */
+#ifndef EPID_MEMBER_TINY_SRC_CONTEXT_H_
+#define EPID_MEMBER_TINY_SRC_CONTEXT_H_
+#include "epid/common/bitsupplier.h"
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/src/allowed_basenames.h"
+#include "epid/member/tiny/src/native_types.h"
+
+/// Size of SigRl with zero entries
+#define MIN_SIGRL_SIZE (sizeof(SigRl) - sizeof(SigRlEntry))
+
+#ifdef USE_SIGRL_BY_REFERENCE
+
+// SIZE_MAX is not guaranteed in C89/90
+#define SIZE_T_MAX ((size_t)(-1))
+
+/// Maximum number of possible entries in SigRl used by reference
+#define MAX_SIGRL_ENTRIES ((SIZE_T_MAX - MIN_SIGRL_SIZE) / sizeof(SigRlEntry))
+
+/// Maximum space needed to store SigRl data in context
+#define SIGRL_HEAP_SIZE (0)
+
+#else // !defined(USE_SIGRL_BY_REFERENCE)
+
+#ifndef MAX_SIGRL_ENTRIES
+/// Maximum number of possible entries in SigRl copied by value
+#define MAX_SIGRL_ENTRIES (5)
+#endif
+
+/// Maximum space needed to store SigRl data in context
+#define SIGRL_HEAP_SIZE \
+ (MIN_SIGRL_SIZE + MAX_SIGRL_ENTRIES * sizeof(SigRlEntry))
+
+#endif // !defined(USE_SIGRL_BY_REFERENCE)
+
+#ifndef MAX_ALLOWED_BASENAMES
+/// Maximum number of allowed base names
+#define MAX_ALLOWED_BASENAMES (5)
+#endif
+
+/// Member context definition
+typedef struct MemberCtx {
+ GroupPubKey pub_key; ///< group public key
+ HashAlg hash_alg; ///< Hash algorithm to use
+ MembershipCredential credential; ///< Membership credential
+ FpElem f; ///< secret f value
+ NativeMemberPrecomp precomp; ///< Precomputed pairing values
+ PairingState pairing_state; ///< pairing state
+ int f_is_set; ///< f initialized
+ int is_provisioned; ///< member fully provisioned with key material
+ BitSupplier rnd_func; ///< Pseudo random number generation function
+ void* rnd_param; ///< Pointer to user context for rnd_func
+ AllowedBasenames* allowed_basenames; ///< Allowed basenames
+ SigRl* sig_rl; ///< Pointer to Signature based revocation list
+ unsigned char heap[1]; ///< Bulk storage space (flexible array)
+} MemberCtx;
+
+#endif // EPID_MEMBER_TINY_SRC_CONTEXT_H_
diff --git a/epid/member/tiny/src/createjoinrequest.c b/epid/member/tiny/src/createjoinrequest.c
new file mode 100644
index 0000000..0dee709
--- /dev/null
+++ b/epid/member/tiny/src/createjoinrequest.c
@@ -0,0 +1,121 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member CreateJoinRequest implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/hashwrap.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/src/context.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/serialize.h"
+#include "epid/member/tiny/src/validate.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static const FpElemStr epid20_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}}};
+
+static const G2ElemStr epid20_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}}}}};
+
+static const G1ElemStr epid20_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}}}};
+
+EpidStatus EPID_API EpidCreateJoinRequest(MemberCtx* ctx,
+ GroupPubKey const* pub_key,
+ IssuerNonce const* ni,
+ JoinRequest* join_request) {
+ EccPointFq F;
+ EccPointFq R_str;
+ FpElem r;
+ FpElem c;
+ FpElem t;
+ tiny_sha sha_state;
+ sha_digest digest;
+ G1ElemStr g1_str;
+ NativeGroupPubKey deserialized_pkey;
+
+ if (!ctx || !pub_key || !ni || !join_request) {
+ return kEpidBadArgErr;
+ }
+ if (!ctx->f_is_set) {
+ return kEpidBadArgErr;
+ }
+
+ GroupPubKeyDeserialize(&deserialized_pkey, pub_key);
+ if (!GroupPubKeyIsInRange(&deserialized_pkey)) {
+ return kEpidBadArgErr;
+ }
+ // pick number r between 1 - (p-1)
+ if (!FpRandNonzero(&r, ctx->rnd_func, ctx->rnd_param)) {
+ return kEpidMathErr;
+ }
+
+ // F = h1^f
+ EFqAffineExp(&F, &deserialized_pkey.h1, &ctx->f);
+ // R_str = h1^r
+ EFqAffineExp(&R_str, &deserialized_pkey.h1, &r);
+
+ // c = hash(p || g1 || g2 || h1 || h2 || w || F || R || NI) mod p
+ tinysha_init(ctx->hash_alg, &sha_state);
+ tinysha_update(&sha_state, (void const*)&epid20_p_str, sizeof(epid20_p_str));
+ tinysha_update(&sha_state, (void const*)&epid20_g1_str,
+ sizeof(epid20_g1_str));
+ tinysha_update(&sha_state, (void const*)&epid20_g2_str,
+ sizeof(epid20_g2_str));
+ tinysha_update(&sha_state, (void const*)&pub_key->h1, sizeof(pub_key->h1));
+ tinysha_update(&sha_state, (void const*)&pub_key->h2, sizeof(pub_key->h2));
+ tinysha_update(&sha_state, (void const*)&pub_key->w, sizeof(pub_key->w));
+ EFqSerialize(&join_request->F, &F);
+ tinysha_update(&sha_state, (void const*)&join_request->F,
+ sizeof(join_request->F));
+ EFqSerialize(&g1_str, &R_str);
+ tinysha_update(&sha_state, (void const*)&g1_str, sizeof(g1_str));
+ tinysha_update(&sha_state, (void const*)ni, sizeof(*ni));
+ tinysha_final(digest.digest, &sha_state);
+ FpFromHash(&c, digest.digest, tinysha_digest_size(&sha_state));
+ FpSerialize(&join_request->c, &c);
+
+ // computes s = (r + c * f) mod p
+ FpMul(&t, &c, &ctx->f);
+ FpAdd(&t, &t, &r);
+ FpSerialize(&join_request->s, &t);
+ return kEpidNoErr;
+}
diff --git a/epid/member/tiny/src/decompresskey.c b/epid/member/tiny/src/decompresskey.c
new file mode 100644
index 0000000..2af6e7d
--- /dev/null
+++ b/epid/member/tiny/src/decompresskey.c
@@ -0,0 +1,29 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member DecompressPrivKey implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+
+EpidStatus EPID_API EpidDecompressPrivKey(
+ GroupPubKey const* pub_key, CompressedPrivKey const* compressed_privkey,
+ PrivKey* priv_key) {
+ (void)pub_key;
+ (void)compressed_privkey;
+ (void)priv_key;
+ return kEpidNotImpl;
+}
diff --git a/epid/member/tiny/src/init.c b/epid/member/tiny/src/init.c
new file mode 100644
index 0000000..845d0a1
--- /dev/null
+++ b/epid/member/tiny/src/init.c
@@ -0,0 +1,94 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member Init/Deinit implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+
+#include <stdint.h>
+#include "epid/common/types.h"
+#include "epid/member/software_member.h"
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/pairing.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/src/context.h"
+#include "epid/member/tiny/src/serialize.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+EpidStatus EPID_API EpidMemberGetSize(MemberParams const* params,
+ size_t* context_size) {
+ const size_t kMinContextSize =
+ sizeof(MemberCtx) - sizeof(((MemberCtx*)0)->heap);
+ if (!params || !context_size) {
+ return kEpidBadArgErr;
+ }
+ *context_size = kMinContextSize + SIGRL_HEAP_SIZE +
+ BasenamesGetSize(MAX_ALLOWED_BASENAMES);
+ return kEpidNoErr;
+}
+
+EpidStatus EPID_API EpidMemberInit(MemberParams const* params, MemberCtx* ctx) {
+ EpidStatus sts = kEpidNoErr;
+ size_t context_size = 0;
+ if (!params || !ctx) {
+ return kEpidBadArgErr;
+ }
+
+ sts = EpidMemberGetSize(params, &context_size);
+ if (sts != kEpidNoErr) {
+ return sts;
+ }
+
+ memset(ctx, 0, context_size);
+
+ ctx->is_provisioned = 0;
+ ctx->f_is_set = 0;
+
+ // set the default hash algorithm to sha512
+ ctx->hash_alg = kSha512;
+ ctx->f_is_set = 0;
+ // set allowed basenames pointer to the heap
+ ctx->allowed_basenames = (AllowedBasenames*)&ctx->heap[SIGRL_HEAP_SIZE];
+ InitBasenames(ctx->allowed_basenames, MAX_ALLOWED_BASENAMES);
+ if (params->f) {
+ FpDeserialize(&ctx->f, params->f);
+ if (!FpInField(&ctx->f)) {
+ memset(&ctx->f, 0, sizeof(ctx->f));
+ return kEpidBadArgErr;
+ }
+ ctx->f_is_set = 1;
+ }
+ ctx->rnd_func = params->rnd_func;
+ ctx->rnd_param = params->rnd_param;
+ PairingInit(&ctx->pairing_state);
+ return kEpidNoErr;
+}
+
+void EPID_API EpidMemberDeinit(MemberCtx* ctx) {
+ (void)ctx;
+ return;
+}
+
+EpidStatus EPID_API EpidMemberCreate(MemberParams const* params,
+ MemberCtx** ctx) {
+ (void)params;
+ (void)ctx;
+ return kEpidNotImpl;
+}
+
+void EPID_API EpidMemberDelete(MemberCtx** ctx) { (void)ctx; }
diff --git a/epid/member/tiny/src/native_types.h b/epid/member/tiny/src/native_types.h
new file mode 100644
index 0000000..1ce611a
--- /dev/null
+++ b/epid/member/tiny/src/native_types.h
@@ -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.
+ ############################################################################*/
+/// Types in the native format
+/*! \file */
+#ifndef EPID_MEMBER_TINY_SRC_NATIVE_TYPES_H_
+#define EPID_MEMBER_TINY_SRC_NATIVE_TYPES_H_
+
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/mathtypes.h"
+
+/// Group public key in unserialized format
+typedef struct NativeGroupPubKey {
+ GroupId gid; ///< group ID
+ EccPointFq h1; ///< an element in G1
+ EccPointFq h2; ///< an element in G1
+ EccPointFq2 w; ///< an element in G2
+} NativeGroupPubKey;
+
+/// Membership credential in unserialized format
+typedef struct NativeMembershipCredential {
+ GroupId gid; ///< group ID
+ EccPointFq A; ///< an element in G1
+ FpElem x; ///< an integer between [0, p-1]
+} NativeMembershipCredential;
+
+/// Private key in unserialized format
+typedef struct NativePrivKey {
+ NativeMembershipCredential cred; ///< membership credential
+ FpElem f; ///< an integer between [0, p-1]
+} NativePrivKey;
+
+/// Precomputed pairing values
+typedef struct NativeMemberPrecomp {
+ Fq12Elem e12; ///< an element in GT
+ Fq12Elem e22; ///< an element in GT
+ Fq12Elem e2w; ///< an element in GT
+ Fq12Elem ea2; ///< an element in GT
+} NativeMemberPrecomp;
+
+/// Intel(R) EPID Basic Signature
+typedef struct NativeBasicSignature {
+ EccPointFq B; ///< an element in G1
+ EccPointFq K; ///< an element in G1
+ EccPointFq T; ///< an element in G1
+ FpElem c; ///< an integer between [0, p-1]
+ FpElem sx; ///< an integer between [0, p-1]
+ FpElem sf; ///< an integer between [0, p-1]
+ FpElem sa; ///< an integer between [0, p-1]
+ FpElem sb; ///< an integer between [0, p-1]
+} NativeBasicSignature;
+#endif // EPID_MEMBER_TINY_SRC_NATIVE_TYPES_H_
diff --git a/epid/member/tiny/src/nrprove.c b/epid/member/tiny/src/nrprove.c
new file mode 100644
index 0000000..c912465
--- /dev/null
+++ b/epid/member/tiny/src/nrprove.c
@@ -0,0 +1,136 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny EpidNrProve implementation.
+/*! \file */
+
+#include "epid/member/tiny/src/nrprove.h"
+#include "epid/common/errors.h"
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/hashwrap.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/src/context.h"
+#include "epid/member/tiny/src/native_types.h"
+static const FpElem epid20_p = {
+ {{0xD10B500D, 0xF62D536C, 0x1299921A, 0x0CDC65FB, 0xEE71A49E, 0x46E5F25E,
+ 0xFFFCF0CD, 0xFFFFFFFF}}};
+static const EccPointFq epid20_g1 = {
+ {{{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}},
+ {{{0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}}};
+EpidStatus EpidNrProve(MemberCtx const* ctx, void const* msg, size_t msg_len,
+ NativeBasicSignature const* sig,
+ SigRlEntry const* sigrl_entry, NrProof* proof) {
+ EpidStatus sts = kEpidBadArgErr;
+ FpElem mu;
+ FpElem rmu;
+ FpElem smu;
+ FpElem nu;
+ FpElem rnu;
+ FpElem snu;
+ EccPointFq tmp_efq;
+ EccPointFq B_tick;
+ EccPointFq K_tick;
+ BigNumStr p;
+ G1ElemStr tmp_str;
+ G1ElemStr T_str;
+ G1ElemStr R1_str;
+ G1ElemStr R2_str;
+ FpElem c;
+ tiny_sha sha_state;
+ sha_digest digest;
+ EFqDeserialize(&B_tick, &sigrl_entry->b);
+ EFqDeserialize(&K_tick, &sigrl_entry->k);
+ if (!EFqOnCurve(&B_tick) || !EFqOnCurve(&K_tick) || !EFqOnCurve(&sig->B) ||
+ !EFqOnCurve(&sig->K)) {
+ return kEpidBadArgErr;
+ }
+ // 1. The member chooses random mu from [1, p-1].
+ if (!FpRandNonzero(&mu, ctx->rnd_func, ctx->rnd_param)) {
+ return kEpidMathErr;
+ }
+ // 2. The member computes nu = (- f * mu) mod p.
+ FpNeg(&rmu, &ctx->f);
+ FpMul(&nu, &rmu, &mu);
+ do {
+ // 3. The member computes T = G1.sscmMultiExp(K', mu, B', nu). If
+ // G1.isIdentity(T) = true, the member also outputs "failed".
+ if (!EFqAffineMultiExp(&tmp_efq, &K_tick, &mu, &B_tick, &nu)) {
+ sts = kEpidSigRevokedInSigRl;
+ break;
+ }
+ EFqSerialize(&T_str, &tmp_efq);
+ // 4. The member chooses rmu, rnu randomly from[1, p - 1].
+ if (!FpRandNonzero(&rmu, ctx->rnd_func, ctx->rnd_param)) {
+ sts = kEpidMathErr;
+ break;
+ }
+ if (!FpRandNonzero(&rnu, ctx->rnd_func, ctx->rnd_param)) {
+ sts = kEpidMathErr;
+ break;
+ }
+ // 5. The member computes R1 = G1.sscmMultiExp(K, rmu, B, rnu).
+ if (!EFqAffineMultiExp(&tmp_efq, &sig->K, &rmu, &sig->B, &rnu)) {
+ break;
+ }
+ EFqSerialize(&R1_str, &tmp_efq);
+ // 6. The member computes R2 = G1.sscmMultiExp(K', rmu, B', rnu).
+ if (!EFqAffineMultiExp(&tmp_efq, &K_tick, &rmu, &B_tick, &rnu)) {
+ break;
+ }
+ EFqSerialize(&R2_str, &tmp_efq);
+ // 7. The member computes c = Fp.hash(p || g1 || B || K || B' || K' || T ||
+ // R1 || R2 || m)
+ tinysha_init(ctx->hash_alg, &sha_state);
+ VliSerialize(&p, &(epid20_p.limbs));
+ tinysha_update(&sha_state, (void const*)&p, sizeof(p));
+ EFqSerialize(&tmp_str, &epid20_g1);
+ tinysha_update(&sha_state, (void const*)&tmp_str, sizeof(tmp_str));
+ EFqSerialize(&tmp_str, &sig->B);
+ tinysha_update(&sha_state, (void const*)&tmp_str, sizeof(tmp_str));
+ EFqSerialize(&tmp_str, &sig->K);
+ tinysha_update(&sha_state, (void const*)&tmp_str, sizeof(tmp_str));
+ tinysha_update(&sha_state, (void const*)&sigrl_entry->b,
+ sizeof(sigrl_entry->b));
+ tinysha_update(&sha_state, (void const*)&sigrl_entry->k,
+ sizeof(sigrl_entry->k));
+ tinysha_update(&sha_state, (void const*)&T_str, sizeof(T_str));
+ tinysha_update(&sha_state, (void const*)&R1_str, sizeof(R1_str));
+ tinysha_update(&sha_state, (void const*)&R2_str, sizeof(R2_str));
+ tinysha_update(&sha_state, msg, msg_len);
+ tinysha_final(digest.digest, &sha_state);
+ FpFromHash(&c, digest.digest, tinysha_digest_size(&sha_state));
+ // 8. The member computes smu = (rmu + c * mu) mod p.
+ FpMul(&smu, &c, &mu);
+ FpAdd(&smu, &rmu, &smu);
+ // 9. The member computes snu = (rnu + c * nu) mod p.
+ FpMul(&snu, &c, &nu);
+ FpAdd(&snu, &rnu, &snu);
+ // 10. The member outputs proof = (T, c, smu, snu), a non - revoked proof
+ FpSerialize(&proof->c, &c);
+ FpSerialize(&proof->smu, &smu);
+ FpSerialize(&proof->snu, &snu);
+ proof->T = T_str;
+ sts = kEpidNoErr;
+ } while (0);
+ FpClear(&mu);
+ FpClear(&nu);
+ FpClear(&rmu);
+ FpClear(&rnu);
+ return sts;
+}
diff --git a/epid/member/tiny/src/nrprove.h b/epid/member/tiny/src/nrprove.h
new file mode 100644
index 0000000..b6e200a
--- /dev/null
+++ b/epid/member/tiny/src/nrprove.h
@@ -0,0 +1,66 @@
+/*############################################################################
+ # 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_TINY_SRC_NRPROVE_H_
+#define EPID_MEMBER_TINY_SRC_NRPROVE_H_
+
+#include <stddef.h>
+#include "epid/common/errors.h"
+
+/// \cond
+typedef struct MemberCtx MemberCtx;
+typedef struct NativeBasicSignature NativeBasicSignature;
+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] 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 EpidMemberInit
+ \see EpidSignBasic
+ */
+EpidStatus EpidNrProve(MemberCtx const* ctx, void const* msg, size_t msg_len,
+ NativeBasicSignature const* sig,
+ SigRlEntry const* sigrl_entry, NrProof* proof);
+
+#endif // EPID_MEMBER_TINY_SRC_NRPROVE_H_
diff --git a/epid/member/tiny/src/presig.c b/epid/member/tiny/src/presig.c
new file mode 100644
index 0000000..a27c78b
--- /dev/null
+++ b/epid/member/tiny/src/presig.c
@@ -0,0 +1,31 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Precomputed signature management implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+
+EpidStatus EPID_API EpidAddPreSigs(MemberCtx* ctx, size_t number_presigs) {
+ (void)ctx;
+ (void)number_presigs;
+ return kEpidNotImpl;
+}
+
+size_t EPID_API EpidGetNumPreSigs(MemberCtx const* ctx) {
+ (void)ctx;
+ return 0;
+}
diff --git a/epid/member/tiny/src/presig_compute.c b/epid/member/tiny/src/presig_compute.c
new file mode 100644
index 0000000..2093ad9
--- /dev/null
+++ b/epid/member/tiny/src/presig_compute.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.
+############################################################################*/
+/// Precomputed signature computation.
+/*! \file */
+
+#include "epid/member/tiny/src/presig_compute.h"
+
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/fq12.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/math/vli.h"
+#include "epid/member/tiny/src/context.h"
+
+static const EccPointFq epid20_g1 = {
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}},
+ {{0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+static const FpElem epid20_p = {{0xD10B500D, 0xF62D536C, 0x1299921A, 0x0CDC65FB,
+ 0xEE71A49E, 0x46E5F25E, 0xFFFCF0CD,
+ 0xFFFFFFFF}};
+
+EpidStatus EpidMemberComputePreSig(MemberCtx const* ctx,
+ PreComputedSignatureData* presig) {
+ /* B and K are not computed by this precomputation.
+ *This differs from the Intel(R) EPID 2.0 spec.
+ *On IoT and especially accelerated platforms,
+ *the extra latency is likely less expensive
+ *than the space and possibly redundant computation
+ *needed to compute and store these values.
+ */
+ EpidStatus sts = kEpidMathErr;
+ EccPointFq t;
+
+ EccPointJacobiFq tmp1;
+ EccPointJacobiFq tmp2;
+ do {
+ if (!FpRandNonzero(&presig->a, ctx->rnd_func, ctx->rnd_param)) {
+ break;
+ }
+
+ // T = A * h2^a
+ EFqDeserialize(&t, &ctx->pub_key.h2);
+ EFqFromAffine(&tmp1, &t);
+ EFqMulSSCM(&tmp2, &tmp1, &presig->a);
+ EFqDeserialize(&t, &ctx->credential.A);
+ EFqFromAffine(&tmp1, &t);
+ EFqAdd(&tmp2, &tmp2, &tmp1);
+ if (EFqToAffine(&presig->T, &tmp2) != 1) {
+ break;
+ }
+
+ FpDeserialize((FpElem*)&t.x, &ctx->credential.x);
+ FpMul(&presig->b, &presig->a, (FpElem*)&t.x);
+
+ if (!FpRandNonzero(&presig->rx, ctx->rnd_func, ctx->rnd_param)) {
+ break;
+ }
+ if (!FpRandNonzero(&presig->rf, ctx->rnd_func, ctx->rnd_param)) {
+ break;
+ }
+ if (!FpRandNonzero(&presig->ra, ctx->rnd_func, ctx->rnd_param)) {
+ break;
+ }
+ if (!FpRandNonzero(&presig->rb, ctx->rnd_func, ctx->rnd_param)) {
+ break;
+ }
+ VliSub(&t.x.limbs, &epid20_p.limbs,
+ &presig->rx.limbs); // FpNeg(&t.x, rx), but this is fast.
+ FpMul((FpElem*)&t.y, &presig->a, &presig->rx);
+ FpSub((FpElem*)&t.y, &presig->rb, (FpElem*)&t.y);
+
+ // R2 = ea2^&t.x * e12^rf * e22 ^ &t.y * e2w ^ ra
+ Fq12MultiExp(&presig->R2, &ctx->precomp.ea2, &t.x.limbs, &ctx->precomp.e12,
+ &presig->rf.limbs, &ctx->precomp.e22, &t.y.limbs,
+ &ctx->precomp.e2w, &presig->ra.limbs);
+ sts = kEpidNoErr;
+ } while (0);
+
+ // Zero sensitive stack variables
+ FpClear((FpElem*)&t.x);
+ FpClear((FpElem*)&t.y);
+ EFqFromAffine(&tmp1, &epid20_g1);
+ EFqFromAffine(&tmp2, &epid20_g1);
+ return sts;
+}
diff --git a/epid/member/tiny/src/presig_compute.h b/epid/member/tiny/src/presig_compute.h
new file mode 100644
index 0000000..3c98301
--- /dev/null
+++ b/epid/member/tiny/src/presig_compute.h
@@ -0,0 +1,51 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Precomputed signature computation.
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_SRC_PRESIG_COMPUTE_H_
+#define EPID_MEMBER_TINY_SRC_PRESIG_COMPUTE_H_
+
+#include "epid/common/errors.h"
+#include "epid/member/tiny/math/mathtypes.h"
+
+/// \cond
+typedef struct MembershipCredentialData MembershipCredentialData;
+typedef struct MemberPairPrecomp MemberPairPrecomp;
+typedef struct MemberCtx MemberCtx;
+/// \endcond
+
+/*! Tiny pre-computed signature.
+B and K values are not included into signeture pre-computation,
+as compared with Intel(R) EPID 2.0 spec, to favor small size.
+*/
+typedef struct PreComputedSignatureData {
+ EccPointFq T; ///< an element in G1
+ EccPointFq R1; ///< an element in G1
+ Fq12Elem R2; ///< an element in G1
+ FpElem a; ///< an integer between [0, p-1]
+ FpElem b; ///< an integer between [0, p-1]
+ FpElem rx; ///< an integer between [0, p-1]
+ FpElem rf; ///< an integer between [0, p-1]
+ FpElem ra; ///< an integer between [0, p-1]
+ FpElem rb; ///< an integer between [0, p-1]
+} PreComputedSignatureData;
+
+/// Performs signature pre-computation
+EpidStatus EpidMemberComputePreSig(MemberCtx const* ctx,
+ PreComputedSignatureData* presig);
+
+#endif // EPID_MEMBER_TINY_SRC_PRESIG_COMPUTE_H_
diff --git a/epid/member/tiny/src/provisioncompressed.c b/epid/member/tiny/src/provisioncompressed.c
new file mode 100644
index 0000000..8aa0eec
--- /dev/null
+++ b/epid/member/tiny/src/provisioncompressed.c
@@ -0,0 +1,31 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member ProvisionCompressed implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+
+EpidStatus EPID_API
+EpidProvisionCompressed(MemberCtx* ctx, GroupPubKey const* pub_key,
+ CompressedPrivKey const* compressed_privkey,
+ MemberPrecomp const* precomp_str) {
+ (void)ctx;
+ (void)pub_key;
+ (void)compressed_privkey;
+ (void)precomp_str;
+ return kEpidNotImpl;
+}
diff --git a/epid/member/tiny/src/provisioncredential.c b/epid/member/tiny/src/provisioncredential.c
new file mode 100644
index 0000000..a1c68fc
--- /dev/null
+++ b/epid/member/tiny/src/provisioncredential.c
@@ -0,0 +1,81 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member ProvisionCredentialal implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include "epid/member/api.h"
+#include "epid/member/software_member.h"
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/efq2.h"
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/pairing.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/src/context.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/serialize.h"
+#include "epid/member/tiny/src/validate.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static EccPointFq2 const epid20_g2 = {
+ {{{{0xBF282394, 0xF6021343, 0x3D32470E, 0xD25D5268, 0x743CCF22, 0x21670413,
+ 0x4AA3DA05, 0xE20171C5}}},
+ {{{0xBAA189BE, 0x7DF7B212, 0x289653E2, 0x43433BF6, 0x4FBB5656, 0x46CCDC25,
+ 0x53A85A80, 0x592D1EF6}}}},
+ {{{{0xDD2335AE, 0x414DB822, 0x4D916838, 0x55E8B59A, 0x312826BD, 0xC621E703,
+ 0x51FFD350, 0xAE60A4E7}}},
+ {{{0x51B92421, 0x2C90FE89, 0x9093D613, 0x2CDC6181, 0x7645E253, 0xF80274F8,
+ 0x89AFE5AD, 0x1AB442F9}}}}};
+
+EpidStatus EPID_API EpidProvisionCredential(
+ MemberCtx* ctx, GroupPubKey const* pub_key,
+ MembershipCredential const* credential, MemberPrecomp const* precomp_str) {
+ NativeGroupPubKey native_pub_key;
+ NativeMembershipCredential native_cred;
+ if (!pub_key || !credential || !ctx) {
+ return kEpidBadArgErr;
+ }
+ if (0 != memcmp(&pub_key->gid, &credential->gid, sizeof(GroupId))) {
+ return kEpidBadArgErr;
+ }
+ GroupPubKeyDeserialize(&native_pub_key, pub_key);
+ MembershipCredentialDeserialize(&native_cred, credential);
+ if (!GroupPubKeyIsInRange(&native_pub_key) ||
+ !MembershipCredentialIsInRange(&native_cred) || !ctx->f_is_set ||
+ !MembershipCredentialIsInGroup(&native_cred, &ctx->f, &native_pub_key,
+ &ctx->pairing_state)) {
+ return kEpidBadArgErr;
+ }
+
+ ctx->credential = *credential;
+ ctx->pub_key = *pub_key;
+ ctx->is_provisioned = 1;
+
+ if (precomp_str) {
+ PreCompDeserialize(&ctx->precomp, precomp_str);
+ } else {
+ PairingCompute(&ctx->precomp.ea2, &native_cred.A, &epid20_g2,
+ &ctx->pairing_state);
+ PairingCompute(&ctx->precomp.e12, &native_pub_key.h1, &epid20_g2,
+ &ctx->pairing_state);
+ PairingCompute(&ctx->precomp.e22, &native_pub_key.h2, &epid20_g2,
+ &ctx->pairing_state);
+ PairingCompute(&ctx->precomp.e2w, &native_pub_key.h2, &native_pub_key.w,
+ &ctx->pairing_state);
+ }
+ return kEpidNoErr;
+}
diff --git a/epid/member/tiny/src/provisionkey.c b/epid/member/tiny/src/provisionkey.c
new file mode 100644
index 0000000..74971b2
--- /dev/null
+++ b/epid/member/tiny/src/provisionkey.c
@@ -0,0 +1,90 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member ProvisionKey implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include "epid/member/api.h"
+#include "epid/member/software_member.h"
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/efq2.h"
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/pairing.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/src/context.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/serialize.h"
+#include "epid/member/tiny/src/validate.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static EccPointFq2 const epid20_g2 = {
+ {{{{0xBF282394, 0xF6021343, 0x3D32470E, 0xD25D5268, 0x743CCF22, 0x21670413,
+ 0x4AA3DA05, 0xE20171C5}}},
+ {{{0xBAA189BE, 0x7DF7B212, 0x289653E2, 0x43433BF6, 0x4FBB5656, 0x46CCDC25,
+ 0x53A85A80, 0x592D1EF6}}}},
+ {{{{0xDD2335AE, 0x414DB822, 0x4D916838, 0x55E8B59A, 0x312826BD, 0xC621E703,
+ 0x51FFD350, 0xAE60A4E7}}},
+ {{{0x51B92421, 0x2C90FE89, 0x9093D613, 0x2CDC6181, 0x7645E253, 0xF80274F8,
+ 0x89AFE5AD, 0x1AB442F9}}}}};
+
+EpidStatus EPID_API EpidProvisionKey(MemberCtx* ctx, GroupPubKey const* pub_key,
+ PrivKey const* priv_key,
+ MemberPrecomp const* precomp_str) {
+ NativeGroupPubKey native_pub_key;
+ NativePrivKey native_priv_key;
+ if (!pub_key || !priv_key || !ctx) {
+ return kEpidBadArgErr;
+ }
+ if (0 != memcmp(&pub_key->gid, &priv_key->gid, sizeof(GroupId))) {
+ return kEpidBadArgErr;
+ }
+ GroupPubKeyDeserialize(&native_pub_key, pub_key);
+ if (!GroupPubKeyIsInRange(&native_pub_key)) {
+ return kEpidBadArgErr;
+ }
+
+ PrivKeyDeserialize(&native_priv_key, priv_key);
+ if (!PrivKeyIsInRange(&native_priv_key) ||
+ !PrivKeyIsInGroup(&native_priv_key, &native_pub_key,
+ &ctx->pairing_state)) {
+ memset(&native_priv_key.f, 0, sizeof(native_priv_key.f));
+ return kEpidBadArgErr;
+ }
+ ctx->f = native_priv_key.f;
+ memset(&native_priv_key.f, 0, sizeof(native_priv_key.f));
+ ctx->f_is_set = 1;
+
+ ctx->credential.gid = priv_key->gid;
+ ctx->credential.A = priv_key->A;
+ ctx->credential.x = priv_key->x;
+ ctx->pub_key = *pub_key;
+ ctx->is_provisioned = 1;
+
+ if (precomp_str) {
+ PreCompDeserialize(&ctx->precomp, precomp_str);
+ } else {
+ PairingCompute(&ctx->precomp.ea2, &native_priv_key.cred.A, &epid20_g2,
+ &ctx->pairing_state);
+ PairingCompute(&ctx->precomp.e12, &native_pub_key.h1, &epid20_g2,
+ &ctx->pairing_state);
+ PairingCompute(&ctx->precomp.e22, &native_pub_key.h2, &epid20_g2,
+ &ctx->pairing_state);
+ PairingCompute(&ctx->precomp.e2w, &native_pub_key.h2, &native_pub_key.w,
+ &ctx->pairing_state);
+ }
+ return kEpidNoErr;
+}
diff --git a/epid/member/tiny/src/registerbasename.c b/epid/member/tiny/src/registerbasename.c
new file mode 100644
index 0000000..f253650
--- /dev/null
+++ b/epid/member/tiny/src/registerbasename.c
@@ -0,0 +1,47 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member RegisterBaseName implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include "epid/member/api.h"
+#include "epid/member/tiny/src/allowed_basenames.h"
+#include "epid/member/tiny/src/context.h"
+
+EpidStatus EPID_API EpidRegisterBasename(MemberCtx* ctx, void const* basename,
+ size_t basename_len) {
+ if (basename_len == 0) {
+ return kEpidBadArgErr;
+ }
+ if (!ctx || !basename) {
+ return kEpidBadArgErr;
+ }
+
+ if (IsBasenameAllowed(ctx->allowed_basenames, basename, basename_len)) {
+ return kEpidDuplicateErr;
+ }
+ return AllowBasename(ctx->allowed_basenames, basename, basename_len)
+ ? kEpidNoErr
+ : kEpidNoMemErr;
+}
+
+EpidStatus EPID_API EpidClearRegisteredBasenames(MemberCtx* ctx) {
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+ InitBasenames(ctx->allowed_basenames, MAX_ALLOWED_BASENAMES);
+ return kEpidNoErr;
+}
diff --git a/epid/member/tiny/src/serialize.c b/epid/member/tiny/src/serialize.c
new file mode 100644
index 0000000..54b21db
--- /dev/null
+++ b/epid/member/tiny/src/serialize.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.
+ ############################################################################*/
+/// Tiny portable implementations of standard library functions
+/*! \file */
+
+#include "epid/member/tiny/src/serialize.h"
+#include <stddef.h>
+
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/signbasic.h"
+
+void* BasicSignatureSerialize(BasicSignature* dest,
+ NativeBasicSignature const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ EFqSerialize(&dest->B, &src->B);
+ EFqSerialize(&dest->K, &src->K);
+ EFqSerialize(&dest->T, &src->T);
+ FpSerialize(&dest->c, &src->c);
+ FpSerialize(&dest->sx, &src->sx);
+ FpSerialize(&dest->sf, &src->sf);
+ FpSerialize(&dest->sa, &src->sa);
+ FpSerialize(&dest->sb, &src->sb);
+ return dest + 1;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return dest + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* BasicSignatureDeserialize(NativeBasicSignature* dest,
+ BasicSignature const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ EFqDeserialize(&dest->B, &src->B);
+ EFqDeserialize(&dest->K, &src->K);
+ EFqDeserialize(&dest->T, &src->T);
+ FpDeserialize(&dest->c, &src->c);
+ FpDeserialize(&dest->sx, &src->sx);
+ FpDeserialize(&dest->sf, &src->sf);
+ FpDeserialize(&dest->sa, &src->sa);
+ FpDeserialize(&dest->sb, &src->sb);
+ return src + 1;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void* GroupPubKeySerialize(GroupPubKey* dest, NativeGroupPubKey const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ EFqSerialize(&dest->h1, &src->h1);
+ EFqSerialize(&dest->h2, &src->h2);
+ EFq2Serialize(&dest->w, &src->w);
+ dest->gid = src->gid;
+ return dest + 1;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ dest->gid = src->gid;
+ SwapNativeAndPortableLayout(
+ (uint8_t*)dest + sizeof(dest->gid), sizeof(*dest) - sizeof(dest->gid),
+ (uint8_t*)src + sizeof(src->gid), sizeof(*src) - sizeof(src->gid));
+ return dest + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* GroupPubKeyDeserialize(NativeGroupPubKey* dest,
+ GroupPubKey const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ EFqDeserialize(&dest->h1, &src->h1);
+ EFqDeserialize(&dest->h2, &src->h2);
+ EFq2Deserialize(&dest->w, &src->w);
+ dest->gid = src->gid;
+ return src + 1;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ dest->gid = src->gid;
+ SwapNativeAndPortableLayout(
+ (uint8_t*)dest + sizeof(dest->gid), sizeof(*dest) - sizeof(dest->gid),
+ (uint8_t*)src + sizeof(src->gid), sizeof(*src) - sizeof(src->gid));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* PrivKeyDeserialize(NativePrivKey* dest, PrivKey const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ EFqDeserialize(&dest->cred.A, &src->A);
+ FpDeserialize(&dest->cred.x, &src->x);
+ FpDeserialize(&dest->f, &src->f);
+ dest->cred.gid = src->gid;
+ return src + 1;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ dest->cred.gid = src->gid;
+ SwapNativeAndPortableLayout((uint8_t*)dest + sizeof(dest->cred.gid),
+ sizeof(*dest) - sizeof(dest->cred.gid),
+ (uint8_t*)src + sizeof(src->gid),
+ sizeof(*src) - sizeof(src->gid));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* PreCompDeserialize(NativeMemberPrecomp* dest,
+ MemberPrecomp const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ Fq12Deserialize(&dest->ea2, (Fq12ElemStr*)&src->ea2);
+ Fq12Deserialize(&dest->e12, (Fq12ElemStr*)&src->e12);
+ Fq12Deserialize(&dest->e22, (Fq12ElemStr*)&src->e22);
+ Fq12Deserialize(&dest->e2w, (Fq12ElemStr*)&src->e2w);
+ return src + 1;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ SwapNativeAndPortableLayout(dest, sizeof(*dest), src, sizeof(*src));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
+
+void const* MembershipCredentialDeserialize(NativeMembershipCredential* dest,
+ MembershipCredential const* src) {
+#if defined(UNOPTIMIZED_SERIALIZATION)
+ EFqDeserialize(&dest->A, &src->A);
+ FpDeserialize(&dest->x, &src->x);
+ dest->gid = src->gid;
+ return src + 1;
+#else // defined(UNOPTIMIZED_SERIALIZATION)
+ dest->gid = src->gid;
+ SwapNativeAndPortableLayout(
+ (uint8_t*)dest + sizeof(dest->gid), sizeof(*dest) - sizeof(dest->gid),
+ (uint8_t*)src + sizeof(src->gid), sizeof(*src) - sizeof(src->gid));
+ return src + 1;
+#endif // defined(UNOPTIMIZED_SERIALIZATION)
+}
diff --git a/epid/member/tiny/src/serialize.h b/epid/member/tiny/src/serialize.h
new file mode 100644
index 0000000..caed32f
--- /dev/null
+++ b/epid/member/tiny/src/serialize.h
@@ -0,0 +1,98 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Definition of de/serialize functionality.
+
+#ifndef EPID_MEMBER_TINY_SRC_SERIALIZE_H_
+#define EPID_MEMBER_TINY_SRC_SERIALIZE_H_
+
+/// \cond
+typedef struct BasicSignature BasicSignature;
+typedef struct NativeBasicSignature NativeBasicSignature;
+
+typedef struct GroupPubKey GroupPubKey;
+typedef struct NativeGroupPubKey NativeGroupPubKey;
+
+typedef struct PrivKey PrivKey;
+typedef struct NativePrivKey NativePrivKey;
+
+typedef struct MembershipCredential MembershipCredential;
+typedef struct NativeMembershipCredential NativeMembershipCredential;
+
+typedef struct MemberPrecomp MemberPrecomp;
+typedef struct NativeMemberPrecomp NativeMemberPrecomp;
+/// \endcond
+
+/// Write a basic signature to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\result pointer to next byte after final data written to dest
+*/
+void* BasicSignatureSerialize(BasicSignature* dest,
+ NativeBasicSignature const* src);
+
+/// Read a basic signature from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\result pointer to next byte after final data read from to src
+*/
+void const* BasicSignatureDeserialize(NativeBasicSignature* dest,
+ BasicSignature const* src);
+
+/// Write a group public key to a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\result pointer to next byte after final data written to dest
+*/
+void* GroupPubKeySerialize(GroupPubKey* dest, NativeGroupPubKey const* src);
+
+/// Read a group public key from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\result pointer to next byte after final data read from to src
+*/
+void const* GroupPubKeyDeserialize(NativeGroupPubKey* dest,
+ GroupPubKey const* src);
+
+/// Read a member private key from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\result pointer to next byte after final data read from to src
+*/
+void const* PrivKeyDeserialize(NativePrivKey* dest, PrivKey const* src);
+
+/// Read pairing pre-computation data from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\result pointer to next byte after final data read from to src
+*/
+void const* PreCompDeserialize(NativeMemberPrecomp* dest,
+ MemberPrecomp const* src);
+
+/// Read a membership credential from a portable buffer
+/*!
+\param[out] dest target buffer
+\param [in] src source data
+\result pointer to next byte after final data read from to src
+*/
+void const* MembershipCredentialDeserialize(NativeMembershipCredential* dest,
+ MembershipCredential const* src);
+#endif // EPID_MEMBER_TINY_SRC_SERIALIZE_H_
diff --git a/epid/member/tiny/src/sethashalg.c b/epid/member/tiny/src/sethashalg.c
new file mode 100644
index 0000000..105eba2
--- /dev/null
+++ b/epid/member/tiny/src/sethashalg.c
@@ -0,0 +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.
+ ############################################################################*/
+/// Tiny member SetHashAlg implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+
+#include "epid/member/tiny/src/context.h"
+
+EpidStatus EPID_API EpidMemberSetHashAlg(MemberCtx* ctx, HashAlg hash_alg) {
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+ if ((kSha512 != hash_alg) && (kSha256 != hash_alg)) {
+ return kEpidBadArgErr;
+ }
+ ctx->hash_alg = hash_alg;
+ return kEpidNoErr;
+}
diff --git a/epid/member/tiny/src/setsigrl.c b/epid/member/tiny/src/setsigrl.c
new file mode 100644
index 0000000..8378a9a
--- /dev/null
+++ b/epid/member/tiny/src/setsigrl.c
@@ -0,0 +1,79 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member SetSigRl implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+
+#include "epid/member/tiny/src/context.h"
+#include "epid/member/tiny/stdlib/endian.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+EpidStatus EPID_API EpidMemberSetSigRl(MemberCtx* ctx, SigRl const* sig_rl,
+ size_t sig_rl_size) {
+ uint32_t n2_in = 0;
+ size_t calculated_sig_rl_size = 0;
+ uint32_t i = 0;
+ if (!ctx || !sig_rl) {
+ return kEpidBadArgErr;
+ }
+
+ if (!ctx->is_provisioned) {
+ return kEpidOutOfSequenceError;
+ }
+
+ n2_in = be32toh(sig_rl->n2);
+
+ // sanity check SigRl size
+ if (n2_in > MAX_SIGRL_ENTRIES) {
+ return kEpidBadArgErr;
+ }
+ calculated_sig_rl_size = MIN_SIGRL_SIZE + n2_in * sizeof(sig_rl->bk[0]);
+ if (calculated_sig_rl_size != sig_rl_size) {
+ return kEpidBadArgErr;
+ }
+ // verify that gid given and gid in SigRl match
+ if (0 != memcmp(&ctx->pub_key.gid, &sig_rl->gid, sizeof(sig_rl->gid))) {
+ return kEpidBadArgErr;
+ }
+
+ // ensure version is not being reverted
+ if (ctx->sig_rl) {
+ uint32_t current_ver = be32toh(ctx->sig_rl->version);
+ uint32_t incoming_ver = be32toh(sig_rl->version);
+ if (current_ver >= incoming_ver) {
+ return kEpidBadArgErr;
+ }
+ }
+
+#ifdef USE_SIGRL_BY_REFERENCE
+ ctx->sig_rl = (SigRl*)sig_rl;
+ (void)i;
+#else
+ if (!ctx->sig_rl) {
+ ctx->sig_rl = (SigRl*)ctx->heap;
+ }
+ ctx->sig_rl->version = sig_rl->version;
+ ctx->sig_rl->n2 = sig_rl->n2;
+ memset(ctx->sig_rl->bk, 0, MAX_SIGRL_ENTRIES * sizeof(*ctx->sig_rl->bk));
+
+ for (i = 0; i < n2_in; i++) {
+ ctx->sig_rl->bk[i] = sig_rl->bk[i];
+ }
+#endif
+ return kEpidNoErr;
+}
diff --git a/epid/member/tiny/src/sign.c b/epid/member/tiny/src/sign.c
new file mode 100644
index 0000000..c6836b3
--- /dev/null
+++ b/epid/member/tiny/src/sign.c
@@ -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.
+ ############################################################################*/
+/// Tiny member sign implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+#include "epid/member/tiny/src/context.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/nrprove.h"
+#include "epid/member/tiny/src/serialize.h"
+#include "epid/member/tiny/src/signbasic.h"
+#include "epid/member/tiny/stdlib/endian.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+// SIZE_MAX is not guaranteed in C89/90
+#define SIZE_T_MAX ((size_t)(-1))
+
+size_t EPID_API EpidGetSigSize(SigRl const* sig_rl) {
+ const size_t kMinSigSize = sizeof(EpidSignature) - sizeof(NrProof);
+ if (!sig_rl) {
+ return kMinSigSize;
+ } else {
+ uint32_t n2 = be32toh(sig_rl->n2);
+ if (n2 > (SIZE_T_MAX - kMinSigSize) / sizeof(NrProof)) {
+ return kMinSigSize;
+ } else {
+ return kMinSigSize + n2 * sizeof(NrProof);
+ }
+ }
+}
+
+EpidStatus EPID_API EpidSign(MemberCtx const* ctx, void const* msg,
+ size_t msg_len, void const* basename,
+ size_t basename_len, EpidSignature* sig,
+ size_t sig_len) {
+ EpidStatus sts = kEpidErr;
+ OctStr32 octstr32_0 = {{0x00, 0x00, 0x00, 0x00}};
+ NativeBasicSignature sigma0;
+ if (!ctx || !sig) {
+ return kEpidBadArgErr;
+ }
+ if (!msg && (0 != msg_len)) {
+ // if message is non-empty it must have both length and content
+ return kEpidBadArgErr;
+ }
+ if (!ctx->is_provisioned) {
+ return kEpidOutOfSequenceError;
+ }
+ if (!basename && (0 != basename_len)) {
+ // if basename is non-empty it must have both length and content
+ return kEpidBadArgErr;
+ }
+ if (EpidGetSigSize(ctx->sig_rl) > sig_len) {
+ return kEpidBadArgErr;
+ }
+
+ // 11. The member sets sigma0 = (B, K, T, c, sx, sf, sa, sb).
+ sts = EpidSignBasic(ctx, msg, msg_len, basename, basename_len, &sigma0);
+ if (kEpidNoErr != sts) {
+ return sts;
+ }
+ BasicSignatureSerialize(&sig->sigma0, &sigma0);
+ if (ctx->sig_rl) {
+ uint32_t i = 0;
+ uint32_t num_sig_rl = 0;
+ EpidStatus nr_prove_status = kEpidNoErr;
+ // 13. If SigRL is provided as input, the member proceeds with
+ // the following steps:
+ // a. The member verifies that gid in public key and in SigRL
+ // match.
+ // This was done under EpidMemberSetSigRl function.
+ // b. The member copies RLver and n2 values in SigRL to the
+ // signature.
+ sig->rl_ver = ctx->sig_rl->version;
+ sig->n2 = ctx->sig_rl->n2;
+ // c. For i = 0, ..., n2-1, the member computes sigma[i] =
+ // nrProve(f, B, K, B[i], K[i]). The details of nrProve()
+ // will be given in the next subsection.
+ num_sig_rl = be32toh(ctx->sig_rl->n2);
+ for (i = 0; i < num_sig_rl; i++) {
+ sts = EpidNrProve(ctx, msg, msg_len, &sigma0, &ctx->sig_rl->bk[i],
+ &sig->sigma[i]);
+ if (kEpidNoErr != sts) {
+ nr_prove_status = sts;
+ }
+ }
+ if (kEpidNoErr != nr_prove_status) {
+ memset(&sig->sigma[0], 0, num_sig_rl * sizeof(sig->sigma[0]));
+ return nr_prove_status;
+ }
+ } else {
+ // 12. If SigRL is not provided as input,
+ // a. The member sets RLver = 0 and n2 = 0.
+ // b. The member outputs (sigma0, RLver, n2) and returns "succeeded".
+ sig->rl_ver = octstr32_0;
+ sig->n2 = octstr32_0;
+ }
+ // d. The member outputs (sigma0, RLver, n2, sigma[0], ...,
+ // sigma[n2-1]).
+ // e. If any of the nrProve() functions outputs "failed", the
+ // member returns "revoked", otherwise returns "succeeded".
+ return kEpidNoErr;
+}
diff --git a/epid/member/tiny/src/signbasic.c b/epid/member/tiny/src/signbasic.c
new file mode 100644
index 0000000..bc374cc
--- /dev/null
+++ b/epid/member/tiny/src/signbasic.c
@@ -0,0 +1,159 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Basic signature computation.
+/*! \file */
+
+#include "epid/member/tiny/src/signbasic.h"
+
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/hashwrap.h"
+#include "epid/member/tiny/math/serialize.h"
+#include "epid/member/tiny/src/context.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/presig_compute.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static const FpElemStr epid20_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}}};
+
+static const G2ElemStr epid20_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}}}}};
+
+static const G1ElemStr epid20_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}}}};
+
+EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
+ void const* basename, size_t basename_len,
+ NativeBasicSignature* sig) {
+ EpidStatus sts = kEpidErr;
+ PreComputedSignatureData presig;
+ tiny_sha sha_state;
+ sha_digest digest;
+ G1ElemStr g1_str;
+ Fq12ElemStr fq12_str;
+ FpElemStr fp_str;
+ FpElem x;
+
+ FpDeserialize(&x, &ctx->credential.x);
+ do {
+ sts = EpidMemberComputePreSig(ctx, &presig);
+ if (kEpidNoErr != sts) {
+ break;
+ }
+ // B <- random
+ if (basename) {
+ if (!IsBasenameAllowed(ctx->allowed_basenames, basename, basename_len)) {
+ sts = kEpidBadArgErr;
+ break;
+ }
+ /* Basename, K is linked to fixed B */
+ if (!EFqHash(&sig->B, (const unsigned char*)basename, basename_len,
+ ctx->hash_alg)) {
+ break;
+ }
+ } else {
+ /* No basename, B is random */
+ if (!EFqRand(&sig->B, ctx->rnd_func, ctx->rnd_param)) {
+ break;
+ }
+ }
+ // K <- B^f
+ // guaranteed not to fail, based on f nonzero, B not identity
+ EFqAffineExp(&sig->K, &sig->B, &ctx->f);
+ EFqCp(&sig->T, &presig.T);
+
+ // R1 = B^rf
+ // guaranteed not to fail, if rf != p or 0, but bad inputs could cause it to
+ // fail
+ if (!EFqAffineExp(&presig.R1, &sig->B, &presig.rf)) {
+ break;
+ }
+
+ // 5. The member computes
+ // t3 = Fp.hash(p || g1 || g2 || h1 || h2 || w || B || K || T || R1 || R2).
+ tinysha_init(ctx->hash_alg, &sha_state);
+
+ tinysha_update(&sha_state, (void const*)&epid20_p_str,
+ sizeof(epid20_p_str));
+ tinysha_update(&sha_state, (void const*)&epid20_g1_str,
+ sizeof(epid20_g1_str));
+ tinysha_update(&sha_state, (void const*)&epid20_g2_str,
+ sizeof(epid20_g2_str));
+ tinysha_update(&sha_state, (void const*)&ctx->pub_key.h1,
+ sizeof(ctx->pub_key.h1));
+ tinysha_update(&sha_state, (void const*)&ctx->pub_key.h2,
+ sizeof(ctx->pub_key.h2));
+ tinysha_update(&sha_state, (void const*)&ctx->pub_key.w,
+ sizeof(ctx->pub_key.w));
+ EFqSerialize(&g1_str, &sig->B);
+ tinysha_update(&sha_state, (void const*)&g1_str, sizeof(g1_str));
+ EFqSerialize(&g1_str, &sig->K);
+ tinysha_update(&sha_state, (void const*)&g1_str, sizeof(g1_str));
+ EFqSerialize(&g1_str, &sig->T);
+ tinysha_update(&sha_state, (void const*)&g1_str, sizeof(g1_str));
+ EFqSerialize(&g1_str, &presig.R1);
+ tinysha_update(&sha_state, (void const*)&g1_str, sizeof(g1_str));
+ Fq12Serialize(&fq12_str, &presig.R2);
+ tinysha_update(&sha_state, (void const*)&fq12_str, sizeof(fq12_str));
+ tinysha_final(digest.digest, &sha_state);
+ FpFromHash(&sig->c, digest.digest, tinysha_digest_size(&sha_state));
+
+ // 6. The member computes c = Fp.hash(t3 || m).
+ tinysha_init(ctx->hash_alg, &sha_state);
+ FpSerialize(&fp_str, &sig->c);
+ tinysha_update(&sha_state, (void const*)&fp_str, sizeof(fp_str));
+ tinysha_update(&sha_state, msg, msg_len);
+ tinysha_final(digest.digest, &sha_state);
+
+ FpFromHash(&sig->c, digest.digest, tinysha_digest_size(&sha_state));
+ // The variables sx, sf, sa, sb are computed from x, f, a, b with random
+ // elements
+ // This randomness allows verification but means that the s variables reveal
+ // no secret information
+ FpMul(&sig->sx, &sig->c, &x);
+ FpMul(&sig->sf, &sig->c, &ctx->f);
+ FpMul(&sig->sa, &sig->c, &presig.a);
+ FpMul(&sig->sb, &sig->c, &presig.b);
+ FpAdd(&sig->sx, &sig->sx, &presig.rx);
+ FpAdd(&sig->sf, &sig->sf, &presig.rf);
+ FpAdd(&sig->sa, &sig->sa, &presig.ra);
+ FpAdd(&sig->sb, &sig->sb, &presig.rb);
+ sts = kEpidNoErr;
+ } while (0);
+ // clearing stack-allocated variables before function return
+ (void)memset(&presig, 0, sizeof(presig));
+ return sts;
+}
diff --git a/epid/member/tiny/src/signbasic.h b/epid/member/tiny/src/signbasic.h
new file mode 100644
index 0000000..092501a
--- /dev/null
+++ b/epid/member/tiny/src/signbasic.h
@@ -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.
+############################################################################*/
+/// Basic signature computation
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_SRC_SIGNBASIC_H_
+#define EPID_MEMBER_TINY_SRC_SIGNBASIC_H_
+
+#include <stddef.h>
+
+#include "epid/common/errors.h"
+#include "epid/member/tiny/math/mathtypes.h"
+
+/// \cond
+typedef struct MemberCtx MemberCtx;
+typedef struct NativeBasicSignature NativeBasicSignature;
+/// \endcond
+
+/// Compute Intel(R) EPID Basic Signature.
+EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
+ void const* basename, size_t basename_len,
+ NativeBasicSignature* sig);
+
+#endif // EPID_MEMBER_TINY_SRC_SIGNBASIC_H_
diff --git a/epid/member/tiny/src/startup.c b/epid/member/tiny/src/startup.c
new file mode 100644
index 0000000..ce8f4ec
--- /dev/null
+++ b/epid/member/tiny/src/startup.c
@@ -0,0 +1,27 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny member Startup implementation.
+/*! \file */
+
+#define EXPORT_EPID_APIS
+#include <epid/member/api.h>
+
+EpidStatus EPID_API EpidMemberStartup(MemberCtx* ctx) {
+ if (!ctx) {
+ return kEpidBadArgErr;
+ }
+ return kEpidNoErr;
+}
diff --git a/epid/member/tiny/src/validate.c b/epid/member/tiny/src/validate.c
new file mode 100644
index 0000000..75903f1
--- /dev/null
+++ b/epid/member/tiny/src/validate.c
@@ -0,0 +1,101 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Validate native types
+/*! \file */
+
+#include "epid/member/tiny/src/validate.h"
+#include "epid/member/tiny/math/efq.h"
+#include "epid/member/tiny/math/efq2.h"
+#include "epid/member/tiny/math/fp.h"
+#include "epid/member/tiny/math/fq12.h"
+#include "epid/member/tiny/math/mathtypes.h"
+#include "epid/member/tiny/math/pairing.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+static EccPointFq2 const epid20_g2 = {
+ {{{{0xBF282394, 0xF6021343, 0x3D32470E, 0xD25D5268, 0x743CCF22, 0x21670413,
+ 0x4AA3DA05, 0xE20171C5}}},
+ {{{0xBAA189BE, 0x7DF7B212, 0x289653E2, 0x43433BF6, 0x4FBB5656, 0x46CCDC25,
+ 0x53A85A80, 0x592D1EF6}}}},
+ {{{{0xDD2335AE, 0x414DB822, 0x4D916838, 0x55E8B59A, 0x312826BD, 0xC621E703,
+ 0x51FFD350, 0xAE60A4E7}}},
+ {{{0x51B92421, 0x2C90FE89, 0x9093D613, 0x2CDC6181, 0x7645E253, 0xF80274F8,
+ 0x89AFE5AD, 0x1AB442F9}}}}};
+
+static EccPointFq const epid20_g1 = {
+ {{0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}},
+ {{0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000}}};
+
+int GroupPubKeyIsInRange(NativeGroupPubKey const* input) {
+ return EFqOnCurve(&input->h1) && EFqOnCurve(&input->h2) &&
+ EFq2OnCurve(&input->w);
+}
+
+int MembershipCredentialIsInRange(NativeMembershipCredential const* input) {
+ return EFqOnCurve(&input->A) && FpInField(&input->x);
+}
+
+int MembershipCredentialIsInGroup(NativeMembershipCredential const* input,
+ FpElem const* f,
+ NativeGroupPubKey const* pubkey,
+ PairingState const* pairing_state) {
+ EccPointJacobiFq g1;
+ EccPointJacobiFq t2;
+ EccPointFq t2_affine;
+ Fq12Elem t3;
+ Fq12Elem t4;
+ // to save stack space, reuse t4 and parts of t3
+ EccPointFq2* t1_affine = (EccPointFq2*)&t4;
+ // the following casts rely on EccPointJacobiFq2 and Fq6Elem having same size
+ EccPointJacobiFq2* w = (EccPointJacobiFq2*)&t3.z0;
+ EccPointJacobiFq2* t1 = (EccPointJacobiFq2*)&t3.z1;
+ int result = 0;
+ if (0 != memcmp(&input->gid, &pubkey->gid, sizeof(pubkey->gid))) {
+ return 0;
+ }
+ EFqFromAffine(&g1, &epid20_g1);
+ EFq2FromAffine(t1, &epid20_g2);
+ EFq2FromAffine(w, &pubkey->w);
+ EFq2MulSSCM(t1, t1, &input->x);
+ EFq2Add(t1, t1, w);
+ EFq2ToAffine(t1_affine, t1);
+ PairingCompute(&t3, &input->A, t1_affine, pairing_state);
+ EFqFromAffine(&t2, &pubkey->h1);
+ EFqMulSSCM(&t2, &t2, f);
+ EFqAdd(&t2, &t2, &g1);
+ EFqToAffine(&t2_affine, &t2);
+ PairingCompute(&t4, &t2_affine, &epid20_g2, pairing_state);
+ result = Fq12Eq(&t3, &t4);
+ memset(&t2, 0, sizeof(t2));
+ memset(&t2_affine, 0, sizeof(t2_affine));
+ memset(&t4, 0, sizeof(t4));
+ return result;
+}
+
+int PrivKeyIsInRange(NativePrivKey const* input) {
+ return EFqOnCurve(&input->cred.A) && FpInField(&input->f) &&
+ FpInField(&input->cred.x);
+}
+
+int PrivKeyIsInGroup(NativePrivKey const* input,
+ NativeGroupPubKey const* pubkey,
+ PairingState const* pairing_state) {
+ return MembershipCredentialIsInGroup(&input->cred, &input->f, pubkey,
+ pairing_state);
+}
diff --git a/epid/member/tiny/src/validate.h b/epid/member/tiny/src/validate.h
new file mode 100644
index 0000000..933ba05
--- /dev/null
+++ b/epid/member/tiny/src/validate.h
@@ -0,0 +1,86 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Validate native types
+/*! \file */
+#ifndef EPID_MEMBER_TINY_SRC_VALIDATE_H_
+#define EPID_MEMBER_TINY_SRC_VALIDATE_H_
+
+/// \cond
+typedef struct FpElem FpElem;
+
+typedef struct GroupPubKey GroupPubKey;
+typedef struct NativeGroupPubKey NativeGroupPubKey;
+
+typedef struct PrivKey PrivKey;
+typedef struct NativePrivKey NativePrivKey;
+
+typedef struct MembershipCredential MembershipCredential;
+typedef struct NativeMembershipCredential NativeMembershipCredential;
+
+typedef struct PairingState PairingState;
+/// \endcond
+
+/// Test if the elements of a Group Public Key are in appropriate ranges.
+/*!
+\param[in] input the value to test.
+\returns A value different from zero (i.e., true) if indeed
+ all elements are in range. Zero (i.e., false) otherwise.
+*/
+int GroupPubKeyIsInRange(NativeGroupPubKey const* input);
+
+/// Test if the elements of a Membership Credential are in appropriate ranges.
+/*!
+\param[in] input the value to test.
+\returns A value different from zero (i.e., true) if indeed
+ all elements are in range. Zero (i.e., false) otherwise.
+*/
+int MembershipCredentialIsInRange(NativeMembershipCredential const* input);
+
+/// Test if a Membership Credential is in fact in the specified group.
+/*!
+\param[in] input the value to test.
+\param[in] f the f value.
+\param[in] pubkey the group key.
+\param[in] pairing_state previously computed pairing state.
+\returns A value different from zero (i.e., true) if indeed
+ it is in the group. Zero (i.e., false) otherwise.
+*/
+int MembershipCredentialIsInGroup(NativeMembershipCredential const* input,
+ FpElem const* f,
+ NativeGroupPubKey const* pubkey,
+ PairingState const* pairing_state);
+
+/// Test if the elements of a Private Key are in appropriate ranges.
+/*!
+\param[in] input the value to test.
+\returns A value different from zero (i.e., true) if indeed
+ all elements are in range. Zero (i.e., false) otherwise.
+*/
+int PrivKeyIsInRange(NativePrivKey const* input);
+
+/// Test if a Private Key is in fact in the specified group.
+/*!
+\param[in] input the value to test.
+\param[in] pubkey the group key.
+\param[in] pairing_state previously computed pairing state.
+\returns A value different from zero (i.e., true) if indeed
+ it is in the group. Zero (i.e., false) otherwise.
+*/
+int PrivKeyIsInGroup(NativePrivKey const* input,
+ NativeGroupPubKey const* pubkey,
+ PairingState const* pairing_state);
+
+#endif // EPID_MEMBER_TINY_SRC_VALIDATE_H_
diff --git a/epid/member/tiny/stdlib/endian.h b/epid/member/tiny/stdlib/endian.h
new file mode 100644
index 0000000..1f606cf
--- /dev/null
+++ b/epid/member/tiny/stdlib/endian.h
@@ -0,0 +1,38 @@
+/*############################################################################
+# 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.
+############################################################################*/
+/// Convert values between host and big-/little-endian byte order.
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_STDLIB_ENDIAN_H_
+#define EPID_MEMBER_TINY_STDLIB_ENDIAN_H_
+
+#include <stdint.h>
+
+/// Transform big endian uint32_t to host uint32_t
+#define be32toh(big_endian_32bits) \
+ ((uint32_t)(((((unsigned char*)&(big_endian_32bits))[0]) << 24) + \
+ ((((unsigned char*)&(big_endian_32bits))[1]) << 16) + \
+ ((((unsigned char*)&(big_endian_32bits))[2]) << 8) + \
+ (((unsigned char*)&(big_endian_32bits))[3])))
+
+/// Transform host uint32_t to big endian uint32_t
+#define htobe32(host_32bits) \
+ (uint32_t)(((((uint32_t)(host_32bits)) & 0xFF) << 24) | \
+ ((((uint32_t)(host_32bits)) & 0xFF00) << 8) | \
+ ((((uint32_t)(host_32bits)) & 0xFF0000) >> 8) | \
+ ((((uint32_t)(host_32bits)) & 0xFF000000) >> 24))
+
+#endif // EPID_MEMBER_TINY_STDLIB_ENDIAN_H_
diff --git a/epid/member/tiny/stdlib/src/tiny_stdlib.c b/epid/member/tiny/stdlib/src/tiny_stdlib.c
new file mode 100644
index 0000000..a3faca6
--- /dev/null
+++ b/epid/member/tiny/stdlib/src/tiny_stdlib.c
@@ -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.
+ ############################################################################*/
+/// Tiny portable implementations of standard library functions
+/*! \file */
+
+#include "epid/member/tiny/stdlib/tiny_stdlib.h"
+
+#ifdef SHARED
+
+void* memset(void* ptr, int value, size_t num) {
+ unsigned char* p = ptr;
+ size_t i = num;
+ while (i != 0) {
+ i -= 1;
+ p[i] = (unsigned char)value;
+ }
+ return ptr;
+}
+
+int memcmp(const void* ptr1, const void* ptr2, size_t num) {
+ const unsigned char* p1 = (const unsigned char*)ptr1;
+ const unsigned char* p2 = (const unsigned char*)ptr2;
+ int d = 0;
+ while (num != 0 && d == 0) {
+ d = (*p1 == *p2) ? 0 : ((*p1 < *p2) ? -1 : 1);
+ p1 += 1;
+ p2 += 1;
+ num -= 1;
+ }
+ return d;
+}
+
+#endif // SHARED
diff --git a/epid/member/tiny/stdlib/tiny_stdlib.h b/epid/member/tiny/stdlib/tiny_stdlib.h
new file mode 100644
index 0000000..906a250
--- /dev/null
+++ b/epid/member/tiny/stdlib/tiny_stdlib.h
@@ -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.
+ ############################################################################*/
+/// Tiny portable implementations of standard library functions
+/*! \file */
+
+#ifndef EPID_MEMBER_TINY_STDLIB_TINY_STDLIB_H_
+#define EPID_MEMBER_TINY_STDLIB_TINY_STDLIB_H_
+
+#include <stddef.h>
+
+/// Fill block of memory
+/*!
+ * Sets the first num bytes of the block of memory pointed by ptr
+ * to the specified value (interpreted as an unsigned char)
+ *
+ * \param ptr Pointer to the block of memory to fill.
+ * \param value Value to be set. The value is passed as an int,
+ * but the function fills the block of memory using the
+ * unsigned char conversion of this value.
+ * \param num Number of bytes to be set to the value. size_t is
+ * an unsigned integral type.
+ * \result ptr is returned.
+ */
+void* memset(void* ptr, int value, size_t num);
+
+/// Compare two blocks of memory
+/*!
+ * Compares the first num bytes of the block of memory pointed by
+ * ptr1 to the first num bytes pointed by ptr2, returning zero if
+ * they all match or a value different from zero representing which
+ * is greater if they do not.
+ *
+ * Notice that, unlike strcmp, the function does not stop comparing
+ * after finding a null character.
+ *
+ * \param ptr1 Pointer to block of memory.
+ * \param ptr2 Pointer to block of memory.
+ * \param num Number of bytes to compare.
+ * \result an integral value indicating the relationship between the
+ * content of the memory blocks:
+ * \retval <0 the first byte that does not match in both memory
+ * blocks has a lower value in ptr1 than in ptr2 (if
+ * evaluated as unsigned char values)
+ * \retval 0 the contents of both memory blocks are equal
+ * \retval >0 the first byte that does not match in both memory blocks
+ * has a greater value in ptr1 than in ptr2 (if evaluated
+ * as unsigned char values)
+ */
+int memcmp(const void* ptr1, const void* ptr2, size_t num);
+
+#endif // EPID_MEMBER_TINY_STDLIB_TINY_STDLIB_H_
diff --git a/epid/member/tiny/stdlib/tiny_stdlib.parts b/epid/member/tiny/stdlib/tiny_stdlib.parts
new file mode 100644
index 0000000..0ddc8bc
--- /dev/null
+++ b/epid/member/tiny/stdlib/tiny_stdlib.parts
@@ -0,0 +1,37 @@
+# pylint:disable=I0011,W0401,W0614,C0103,E0602
+############################################################################
+# 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.
+############################################################################
+"""Build configuration for tiny standard library.
+"""
+Import('*')
+env.PartName('tiny_stdlib')
+
+include_files = Pattern(src_dir='.', includes=['*.h'], recursive=False).files()
+
+src_files = Pattern(src_dir='src', includes=['*.c'], recursive=True).files()
+
+env.Append(CPPPATH='#')
+
+if 'shared' in env['MODE']:
+ env.Append(CPPDEFINES=['SHARED'])
+
+outputs = env.Library('${PART_SHORT_NAME}', src_files)
+
+sdk_outs = env.Sdk(outputs)
+env.SdkInclude(include_files, sub_dir='${PART_SHORT_NAME}')
+
+if 'install_lib' in env['MODE'] and 'shared' not in env['MODE']:
+ env.InstallLib(outputs)
diff --git a/epid/member/tiny/unittests/allowed_basenames-test.cc b/epid/member/tiny/unittests/allowed_basenames-test.cc
new file mode 100644
index 0000000..dc4e93c
--- /dev/null
+++ b/epid/member/tiny/unittests/allowed_basenames-test.cc
@@ -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.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief Basename management unit tests.
+ */
+#ifndef SHARED
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/tiny/src/allowed_basenames.h"
+}
+
+namespace {
+
+TEST(AllowedBasenames, GetBasenamesSizeSucceeds) {
+ size_t bsn_count = 10;
+ size_t expected_bsn_size =
+ sizeof(size_t) // current_bsn_number
+ + sizeof(size_t) // max_bsn_number
+ + sizeof(sha_digest) * bsn_count; // digest * max_bsn_number
+ size_t bsn_size = BasenamesGetSize(bsn_count);
+ EXPECT_EQ(expected_bsn_size, bsn_size);
+}
+
+TEST(AllowedBasenames, ReportsRegisteredBasename) {
+ const std::vector<uint8_t> bsn0 = {'b', 's', 'n', '0'};
+ const std::vector<uint8_t> bsn1 = {'b', 's', 'n', '1'};
+
+ AllowedBasenames* base_names = nullptr;
+ std::vector<uint8_t> base_names_buf;
+ size_t bsn_size = BasenamesGetSize(2);
+ base_names_buf.resize(bsn_size);
+ memset(base_names_buf.data(), 1, bsn_size);
+ base_names = (AllowedBasenames*)&base_names_buf[0];
+ InitBasenames(base_names, 2);
+
+ EXPECT_TRUE(AllowBasename(base_names, bsn0.data(), bsn0.size()));
+ EXPECT_TRUE(AllowBasename(base_names, bsn1.data(), bsn1.size()));
+ EXPECT_TRUE(IsBasenameAllowed(base_names, bsn0.data(), bsn0.size()));
+}
+
+TEST(AllowedBasenames, ReportsUnregisteredBasename) {
+ const std::vector<uint8_t> bsn0 = {'b', 's', 'n', '0'};
+ const std::vector<uint8_t> bsn1 = {'b', 's', 'n', '1'};
+
+ AllowedBasenames* base_names = nullptr;
+ std::vector<uint8_t> base_names_buf;
+ size_t bsn_size = BasenamesGetSize(1);
+ base_names_buf.resize(bsn_size);
+ base_names = (AllowedBasenames*)&base_names_buf[0];
+ InitBasenames(base_names, 1);
+
+ EXPECT_TRUE(AllowBasename(base_names, bsn0.data(), bsn0.size()));
+ EXPECT_FALSE(IsBasenameAllowed(base_names, bsn1.data(), bsn1.size()));
+}
+
+TEST(AllowedBasenames, IsBasenameAllowedReturnsFalseWhenNoBasenamesRegistered) {
+ const std::vector<uint8_t> bsn0 = {'b', 's', 'n', '0'};
+
+ AllowedBasenames* base_names = nullptr;
+ std::vector<uint8_t> base_names_buf;
+ size_t bsn_size = BasenamesGetSize(1);
+ base_names_buf.resize(bsn_size);
+ base_names = (AllowedBasenames*)&base_names_buf[0];
+ InitBasenames(base_names, 1);
+
+ EXPECT_FALSE(IsBasenameAllowed(base_names, bsn0.data(), bsn0.size()));
+}
+
+TEST(AllowedBasenames, AllowBasenameReturnsFalseForMoreThanMaxBasenames) {
+ const std::vector<uint8_t> bsn0 = {'b', 's', 'n', '0'};
+
+ AllowedBasenames* base_names = nullptr;
+ std::vector<uint8_t> base_names_buf;
+ size_t bsn_size = BasenamesGetSize(5);
+ base_names_buf.resize(bsn_size);
+ base_names = (AllowedBasenames*)&base_names_buf[0];
+ InitBasenames(base_names, 5);
+
+ for (int n = 0; n < 5; n++) {
+ EXPECT_TRUE(AllowBasename(base_names, &n, sizeof(n)));
+ }
+ // One more basename should not fit into storage
+ EXPECT_FALSE(AllowBasename(base_names, bsn0.data(), bsn0.size()));
+}
+
+TEST(AllowedBasenames, AllowBasenameCanReturnTrue) {
+ const std::vector<uint8_t> bsn0 = {'b', 's', 'n', '0'};
+
+ AllowedBasenames* base_names = nullptr;
+ std::vector<uint8_t> base_names_buf;
+ size_t bsn_size = BasenamesGetSize(1);
+ base_names_buf.resize(bsn_size);
+ base_names = (AllowedBasenames*)&base_names_buf[0];
+ InitBasenames(base_names, 1);
+
+ EXPECT_TRUE(AllowBasename(base_names, bsn0.data(), bsn0.size()));
+}
+
+} // namespace
+#endif // SHARED
diff --git a/epid/member/tiny/unittests/context-test.cc b/epid/member/tiny/unittests/context-test.cc
new file mode 100644
index 0000000..dafa4cf
--- /dev/null
+++ b/epid/member/tiny/unittests/context-test.cc
@@ -0,0 +1,484 @@
+/*############################################################################
+ # 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 Member unit tests.
+ */
+#include <cstring>
+#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/errors-testhelper.h"
+#include "epid/common-testhelper/mem_params-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tiny/unittests/member-testhelper.h"
+
+extern "C" {
+#include "epid/member/api.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 {
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberDeinit Tests
+TEST_F(EpidMemberTest, DeinitWorksGivenNullMemberCtx) {
+ EpidMemberDeinit(nullptr);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberGetSize Tests
+TEST_F(EpidMemberTest, GetSizeFailsGivenNullParams) {
+ size_t ctx_size = 0;
+ MemberParams params = {0};
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberGetSize(&params, nullptr));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberGetSize(nullptr, &ctx_size));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberGetSize(nullptr, nullptr));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberGetSize Tests
+TEST_F(EpidMemberTest, GetSizeWorksGivenValidParams) {
+ size_t ctx_size = 0;
+ Prng my_prng;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberInit Tests
+TEST_F(EpidMemberTest, InitFailsGivenNullParameters) {
+ size_t ctx_size = 0;
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ std::vector<uint8_t> ctx_buf;
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+ ctx_buf.resize(ctx_size);
+ ctx = (MemberCtx*)&ctx_buf[0];
+
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberInit(nullptr, nullptr));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberInit(&params, nullptr));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberInit(nullptr, ctx));
+}
+
+TEST_F(EpidMemberTest, InitFailsGivenInvalidParameters) {
+ 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,
+ };
+ size_t ctx_size = 0;
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ std::vector<uint8_t> ctx_buf;
+ SetMemberParams(&Prng::Generate, &my_prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+ ctx_buf.resize(ctx_size);
+ ctx = (MemberCtx*)&ctx_buf[0];
+
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberInit(&params, ctx));
+}
+
+TEST_F(EpidMemberTest, InitSucceedsGivenValidParameters) {
+ FpElemStr f = {
+ 0x00, 0x00, 0x00, 0x00, 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,
+ };
+ size_t ctx_size = 0;
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ std::vector<uint8_t> ctx_buf;
+ SetMemberParams(&Prng::Generate, &my_prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+ ctx_buf.resize(ctx_size);
+ ctx = (MemberCtx*)&ctx_buf[0];
+
+ EXPECT_EQ(kEpidNoErr, EpidMemberInit(&params, ctx));
+ EpidMemberDeinit(ctx);
+}
+
+TEST_F(EpidMemberTest, InitSucceedsGivenValidParametersWithNoF) {
+ size_t ctx_size = 0;
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ std::vector<uint8_t> ctx_buf;
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+ ctx_buf.resize(ctx_size);
+ ctx = (MemberCtx*)&ctx_buf[0];
+
+ EXPECT_EQ(kEpidNoErr, EpidMemberInit(&params, ctx));
+ EpidMemberDeinit(ctx);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberCreate Tests
+TEST_F(EpidMemberTest, CreateIsNotImplemented) {
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidNotImpl, EpidMemberCreate(&params, &ctx));
+ EpidMemberDelete(&ctx);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberStartup
+TEST_F(EpidMemberTest, StartupFailsGivenNullParameters) {
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberStartup(nullptr));
+}
+
+TEST_F(EpidMemberTest, StartupSucceedsGivenValidParameters) {
+ Prng prng;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr, EpidProvisionKey(member, &pub_key, &priv_key, nullptr));
+
+ EXPECT_EQ(kEpidNoErr, EpidMemberStartup(member));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberSetHashAlg
+TEST_F(EpidMemberTest, SetHashAlgFailsGivenNullPtr) {
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberSetHashAlg(nullptr, kSha256));
+}
+TEST_F(EpidMemberTest, CanSetHashAlgoToSHA256) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
+ EXPECT_EQ(kEpidNoErr, EpidMemberSetHashAlg(member_ctx, kSha256));
+}
+TEST_F(EpidMemberTest, DISABLED_CanSetHashAlgoToSHA384) {
+ Prng 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(&Prng::Generate, &my_prng);
+ EXPECT_EQ(kEpidNoErr, EpidMemberSetHashAlg(member_ctx, kSha512));
+}
+TEST_F(EpidMemberTest, DISABLED_CanSetHashAlgoToSHA512256) {
+ Prng 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(&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));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberSetHashAlg(member_ctx, (HashAlg)-1));
+}
+
+TEST_F(EpidMemberTest, SetHashAlgRejectsSHA384) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberSetHashAlg(member_ctx, kSha384));
+}
+
+TEST_F(EpidMemberTest, SetHashAlgRejectsSHA512256) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberSetHashAlg(member_ctx, kSha512_256));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberSetSigRl
+TEST_F(EpidMemberTest, SetSigRlFailsGivenNullPointer) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberSetSigRl(nullptr, &srl, sizeof(SigRl)));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidMemberSetSigRl(member_ctx, nullptr, sizeof(SigRl)));
+}
+TEST_F(EpidMemberTest, SetSigRlFailsGivenZeroSize) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberSetSigRl(member_ctx, &srl, 0));
+}
+// Size parameter must be at least big enough for n2 == 0 case
+TEST_F(EpidMemberTest, SetSigRlFailsGivenTooSmallSize) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ EXPECT_EQ(
+ kEpidBadArgErr,
+ EpidMemberSetSigRl(member_ctx, &srl, (sizeof(srl) - sizeof(srl.bk)) - 1));
+ srl.n2 = this->kOctStr32_1;
+ EXPECT_EQ(
+ kEpidBadArgErr,
+ EpidMemberSetSigRl(member_ctx, &srl, (sizeof(srl) - sizeof(srl.bk)) - 1));
+}
+TEST_F(EpidMemberTest, SetSigRlFailsGivenN2TooBigForSize) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ srl.n2 = this->kOctStr32_1;
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidMemberSetSigRl(member_ctx, &srl, sizeof(srl) - sizeof(srl.bk)));
+}
+TEST_F(EpidMemberTest, SetSigRlFailsGivenN2TooSmallForSize) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberSetSigRl(member_ctx, &srl, sizeof(srl)));
+}
+TEST_F(EpidMemberTest, SetSigRlFailsGivenBadGroupId) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ srl.gid.data[0] = ~srl.gid.data[0];
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidMemberSetSigRl(member_ctx, &srl, sizeof(srl) - sizeof(srl.bk)));
+}
+TEST_F(EpidMemberTest, SetSigRlFailsGivenEmptySigRlFromDifferentGroup) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ SigRl const* sig_rl = reinterpret_cast<SigRl const*>(this->kGrpXSigRl.data());
+ size_t sig_rl_size = this->kGrpXSigRl.size();
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidMemberSetSigRl(member_ctx, sig_rl, sig_rl_size));
+}
+TEST_F(EpidMemberTest, SetSigRlFailsGivenOldVersion) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ srl.version = this->kOctStr32_1;
+ EXPECT_EQ(kEpidNoErr,
+ EpidMemberSetSigRl(member_ctx, &srl, sizeof(srl) - sizeof(srl.bk)));
+ OctStr32 octstr32_0 = {0x00, 0x00, 0x00, 0x00};
+ srl.version = octstr32_0;
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidMemberSetSigRl(member_ctx, &srl, sizeof(srl) - sizeof(srl.bk)));
+}
+TEST_F(EpidMemberTest, SetSigRlPreservesOldRlOnFailure) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGrpXKey, this->kGrpXSigrevokedMember0PrivKey,
+ &Prng::Generate, &my_prng);
+ SigRl const* sig_rl = reinterpret_cast<SigRl const*>(this->kGrpXSigRl.data());
+ size_t sig_rl_size = this->kGrpXSigRl.size();
+ EXPECT_EQ(kEpidNoErr, EpidMemberSetSigRl(member_ctx, sig_rl, sig_rl_size));
+ // wrong sigrl contains revoked member0 and has lower version
+ SigRl const* wrong_sig_rl =
+ reinterpret_cast<SigRl const*>(this->kGrpXSigRlSingleEntry.data());
+ size_t wrong_sig_rl_size = this->kGrpXSigRlSingleEntry.size();
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidMemberSetSigRl(member_ctx, wrong_sig_rl, wrong_sig_rl_size));
+ auto& msg = this->kMsg0;
+ 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);
+ // Check that sigrevoked member is still in SigRl
+ EXPECT_EQ(kEpidSigRevokedInSigRl, EpidSign(member_ctx, msg.data(), msg.size(),
+ nullptr, 0, sig, sig_len));
+}
+TEST_F(EpidMemberTest, SetSigRlFailsIfNotProvisioned) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ SigRl const* sig_rl = &srl;
+ size_t sig_rl_size = sizeof(srl) - sizeof(srl.bk);
+ EXPECT_EQ(kEpidOutOfSequenceError,
+ EpidMemberSetSigRl(member_ctx, sig_rl, sig_rl_size));
+}
+TEST_F(EpidMemberTest, SetSigRlWorksGivenValidSigRl) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGrpXKey, this->kGrpXMember0PrivKey,
+ &Prng::Generate, &my_prng);
+ SigRl const* sig_rl = reinterpret_cast<SigRl const*>(this->kGrpXSigRl.data());
+ size_t sig_rl_size = this->kGrpXSigRl.size();
+ EXPECT_EQ(kEpidNoErr, EpidMemberSetSigRl(member_ctx, sig_rl, sig_rl_size));
+}
+TEST_F(EpidMemberTest, SetSigRlWorksGivenEmptySigRl) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
+ &Prng::Generate, &my_prng);
+ uint8_t sig_rl_data_n2_zero[] = {
+ // gid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ // version
+ 0x00, 0x00, 0x00, 0x00,
+ // n2
+ 0x0, 0x00, 0x00, 0x00,
+ // not bk's
+ };
+ SigRl* sig_rl = reinterpret_cast<SigRl*>(sig_rl_data_n2_zero);
+ size_t sig_rl_size = sizeof(sig_rl_data_n2_zero);
+ EXPECT_EQ(kEpidNoErr, EpidMemberSetSigRl(member_ctx, sig_rl, sig_rl_size));
+}
+TEST_F(EpidMemberTest, SetSigRlWorksGivenSigRlWithOneEntry) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(this->kGrpXKey, this->kGrpXMember0PrivKey,
+ &Prng::Generate, &my_prng);
+ SigRl const* sig_rl =
+ reinterpret_cast<SigRl const*>(this->kGrpXSigRlSingleEntry.data());
+ size_t sig_rl_size = this->kGrpXSigRlSingleEntry.size();
+ EXPECT_EQ(kEpidNoErr, EpidMemberSetSigRl(member_ctx, sig_rl, sig_rl_size));
+}
+//////////////////////////////////////////////////////////////////////////
+// EpidRegisterBasename
+TEST_F(EpidMemberTest, RegisterBaseNameFailsGivenNullPtr) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ std::vector<uint8_t> basename = {'_', 'b', 'a', 's', 'e', 'n', 'a', 'm', 'e'};
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidRegisterBasename(member, nullptr, basename.size()));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidRegisterBasename(nullptr, basename.data(), basename.size()));
+}
+TEST_F(EpidMemberTest, RegisterBaseNameFailsGivenDuplicateBaseName) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ std::vector<uint8_t> basename = {'d', 'b', 'a', 's', 'e', 'n', 'a', 'm', 'e'};
+ EXPECT_EQ(kEpidNoErr,
+ EpidRegisterBasename(member, basename.data(), basename.size()));
+ EXPECT_EQ(kEpidDuplicateErr,
+ EpidRegisterBasename(member, basename.data(), basename.size()));
+}
+TEST_F(EpidMemberTest, RegisterBaseNameFailsGivenInvalidBaseName) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ std::vector<uint8_t> basename = {};
+ std::vector<uint8_t> basename2 = {'b', 's', 'n'};
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidRegisterBasename(member, basename.data(), basename.size()));
+ EXPECT_EQ(kEpidBadArgErr, EpidRegisterBasename(member, basename2.data(), 0));
+}
+TEST_F(EpidMemberTest, RegisterBaseNameSucceedsGivenUniqueBaseName) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ std::vector<uint8_t> basename = {'b', 's', 'n', '0', '1'};
+ 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()));
+}
+//////////////////////////////////////////////////////////////////////////
+// EpidClearRegisteredBasenames
+TEST_F(EpidMemberTest, EpidClearRegisteredBasenamesFailsGivenNullPtr) {
+ EXPECT_EQ(kEpidBadArgErr, EpidClearRegisteredBasenames(nullptr));
+}
+TEST_F(EpidMemberTest, EpidClearRegisteredBasenamesClearsBasenames) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, this->kData_0_255.data(),
+ this->kData_0_255.size()));
+ EXPECT_EQ(kEpidNoErr, EpidClearRegisteredBasenames(member));
+ // check, that after clearing EpidRegisterBasename works correctly
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, this->kData_0_255.data(),
+ this->kData_0_255.size()));
+}
+TEST_F(EpidMemberTest, EpidClearRegisteredBasenamesClearsAllBasenames) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ for (int i = 0; i < 3; ++i) {
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, &i, sizeof(i)));
+ }
+ EXPECT_EQ(kEpidNoErr, EpidClearRegisteredBasenames(member));
+ for (int i = 0; i < 3; ++i) {
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, &i, sizeof(i)));
+ }
+}
+TEST_F(EpidMemberTest,
+ EpidClearRegisteredBasenamesCausesSignWithBasenameAfterItToFail) {
+ Prng my_prng;
+ 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);
+ THROW_ON_EPIDERR(EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), sig, sig_len));
+ THROW_ON_EPIDERR(EpidClearRegisteredBasenames(member));
+ ASSERT_EQ(kEpidBadArgErr, EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), sig, sig_len));
+}
+} // namespace
diff --git a/epid/member/tiny/unittests/decompress_privkey-test.cc b/epid/member/tiny/unittests/decompress_privkey-test.cc
new file mode 100644
index 0000000..25a65ef
--- /dev/null
+++ b/epid/member/tiny/unittests/decompress_privkey-test.cc
@@ -0,0 +1,99 @@
+/*############################################################################
+ # 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 DecompressPrivKey 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/tiny/unittests/member-testhelper.h"
+
+bool operator==(PrivKey const& lhs, PrivKey const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+namespace {
+
+TEST_F(EpidMemberTest, DISABLED_DecompressPrivKeyFailsGivenNullParameters) {
+ auto const& pub_key = this->kGrpXKey;
+ auto const& compressed_privkey = this->kGrpXMember9CompressedKey;
+ PrivKey priv_key = {};
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidDecompressPrivKey(nullptr, &compressed_privkey, &priv_key));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidDecompressPrivKey(&pub_key, nullptr, &priv_key));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidDecompressPrivKey(&pub_key, &compressed_privkey, nullptr));
+}
+
+TEST_F(EpidMemberTest, DISABLED_CanDecompressPrivKeyGivenValidCompressedKey) {
+ auto const& pub_key = this->kGrpXKey;
+ auto const& compressed_privkey = this->kGrpXMember9CompressedKey;
+ auto const& expected_decompressed_key = this->kGrpXMember9PrivKey;
+ PrivKey priv_key = {};
+ EXPECT_EQ(kEpidNoErr,
+ EpidDecompressPrivKey(&pub_key, &compressed_privkey, &priv_key));
+ EXPECT_EQ(expected_decompressed_key, priv_key);
+}
+
+TEST_F(EpidMemberTest, DISABLED_DecompressPrivKeyFailsGivenKeysMissmatch) {
+ auto const& pub_key = this->kGrpYKey;
+ auto const& compressed_privkey = this->kGrpXMember9CompressedKey;
+ PrivKey priv_key = {};
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidDecompressPrivKey(&pub_key, &compressed_privkey, &priv_key));
+}
+
+TEST_F(EpidMemberTest, DISABLED_DecompressPrivKeyFailsGivenInvalidGroupKey) {
+ // Test for cases when h1 or w of group public key are invalid.
+ // Note h2 of group public key is not used for key decompression.
+ auto const& compressed_privkey = this->kGrpXMember9CompressedKey;
+ PrivKey priv_key = {};
+
+ auto pub_key_h1 = this->kGrpXKey;
+ pub_key_h1.h1.x.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidDecompressPrivKey(&pub_key_h1, &compressed_privkey, &priv_key));
+
+ auto pub_key_w = this->kGrpXKey;
+ pub_key_w.w.x[0].data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidDecompressPrivKey(&pub_key_w, &compressed_privkey, &priv_key));
+}
+
+TEST_F(EpidMemberTest,
+ DISABLED_DecompressPrivKeyFailsGivenInvalidCompressedKey) {
+ auto const& pub_key = this->kGrpXKey;
+ PrivKey priv_key = {};
+
+ auto compressed_privkey_ax = this->kGrpXMember9CompressedKey;
+ compressed_privkey_ax.ax.data.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidDecompressPrivKey(&pub_key, &compressed_privkey_ax, &priv_key));
+
+ auto compressed_privkey_seed = this->kGrpXMember9CompressedKey;
+ compressed_privkey_seed.seed.data[0]++;
+ EXPECT_EQ(kEpidBadArgErr, EpidDecompressPrivKey(
+ &pub_key, &compressed_privkey_seed, &priv_key));
+}
+
+} // namespace
diff --git a/epid/member/tiny/unittests/get_sigsize-test.cc b/epid/member/tiny/unittests/get_sigsize-test.cc
new file mode 100644
index 0000000..52657af
--- /dev/null
+++ b/epid/member/tiny/unittests/get_sigsize-test.cc
@@ -0,0 +1,94 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// GetSigSize unit tests.
+/*!\file */
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/api.h"
+}
+
+#include "epid/member/tiny/unittests/member-testhelper.h"
+
+namespace {
+
+TEST_F(EpidMemberTest, GetSigSizeReturnsSizeofBasicSigGivenNullPointer) {
+ size_t sig_size_without_sig_rl = sizeof(EpidSignature) - sizeof(NrProof);
+ EXPECT_EQ(sig_size_without_sig_rl, EpidGetSigSize(nullptr));
+}
+
+TEST_F(EpidMemberTest, GetSigSizeReturnsCorrectValueGivenValidSigRl) {
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ OctStr32 octstr32_0 = {0x00, 0x00, 0x00, 0x00};
+ OctStr32 octstr32_1 = {0x00, 0x00, 0x00, 0x01};
+ OctStr32 octstr32_2 = {0x00, 0x00, 0x00, 0x02};
+ OctStr32 octstr32_16 = {0x00, 0x00, 0x00, 0x10};
+ OctStr32 octstr32_256 = {0x00, 0x00, 0x01, 0x00};
+ OctStr32 octstr32_65536 = {0x00, 0x01, 0x00, 0x00};
+ OctStr32 octstr32_4294967295 = {0xff, 0xff, 0xff, 0xff};
+
+ size_t one_entry_size = sizeof(NrProof);
+ size_t sig_size_0_entries = sizeof(EpidSignature) - one_entry_size;
+ size_t sig_size_1_entry = sig_size_0_entries + one_entry_size;
+ size_t sig_size_2_entries = sig_size_0_entries + 2 * one_entry_size;
+ size_t sig_size_16_entries = sig_size_0_entries + 16 * one_entry_size;
+ size_t sig_size_256_entries = sig_size_0_entries + 256 * one_entry_size;
+ size_t sig_size_65536_entries = sig_size_0_entries + 65536 * one_entry_size;
+ // no entries
+ srl.n2 = octstr32_0;
+ EXPECT_EQ(sig_size_0_entries, EpidGetSigSize(&srl));
+ // 1 entry
+ srl.n2 = octstr32_1;
+ EXPECT_EQ(sig_size_1_entry, EpidGetSigSize(&srl));
+ // 2 entries
+ srl.n2 = octstr32_2;
+ EXPECT_EQ(sig_size_2_entries, EpidGetSigSize(&srl));
+ // 16 entries
+ srl.n2 = octstr32_16;
+ EXPECT_EQ(sig_size_16_entries, EpidGetSigSize(&srl));
+ // 256 entries
+ srl.n2 = octstr32_256;
+ EXPECT_EQ(sig_size_256_entries, EpidGetSigSize(&srl));
+ // 65536 entries
+ srl.n2 = octstr32_65536;
+ EXPECT_EQ(sig_size_65536_entries, EpidGetSigSize(&srl));
+ // 4294967295 entries
+ srl.n2 = octstr32_4294967295;
+#if (SIZE_MAX <= 0xFFFFFFFF) // When size_t value is 32 bit or lower
+ EXPECT_EQ(sig_size_0_entries, EpidGetSigSize(&srl));
+#else
+ size_t sig_size_4294967295_entries =
+ sig_size_0_entries + 4294967295 * one_entry_size;
+ EXPECT_EQ(sig_size_4294967295_entries, EpidGetSigSize(&srl));
+#endif
+}
+
+TEST_F(EpidMemberTest,
+ GetSigSizeReturnsCorrectValueGivenValidSigRlUsingIKGFData) {
+ const std::vector<uint8_t> sigrl_bin = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/sigrl.inc"
+ };
+
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(sigrl_bin.data());
+ size_t sig_size_3_entries =
+ sizeof(EpidSignature) - sizeof(NrProof) + 3 * sizeof(NrProof);
+ // 3 entries
+ EXPECT_EQ(sig_size_3_entries, EpidGetSigSize(sig_rl));
+}
+
+} // namespace
diff --git a/epid/member/tiny/unittests/internal/nr_prove-test.cc b/epid/member/tiny/unittests/internal/nr_prove-test.cc
new file mode 100644
index 0000000..e95cf24
--- /dev/null
+++ b/epid/member/tiny/unittests/internal/nr_prove-test.cc
@@ -0,0 +1,181 @@
+/*############################################################################
+ # 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.
+ ############################################################################*/
+/// Tiny NrProve unit tests.
+/*! \file */
+
+#ifndef SHARED
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/member/tiny/unittests/member-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/nrprove.h"
+#include "epid/member/tiny/src/serialize.h"
+#include "epid/member/tiny/src/signbasic.h"
+}
+
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+namespace {
+
+TEST_F(EpidMemberTest, NrProveFailsGivenInvalidSigRlEntry) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ auto msg = this->kTest1Msg;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ NrProof proof;
+ // make sure that can generate NrProof using incorrupt sig_rl_enty
+ THROW_ON_EPIDERR(EpidNrProve(member, msg.data(), msg.size(), &this->kBasicSig,
+ &sig_rl->bk[0], &proof));
+ 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(), &this->kBasicSig,
+ &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(), &this->kBasicSig,
+ &sig_rl_enty_invalid_b, &proof));
+}
+
+TEST_F(EpidMemberTest, NrProveFailsGivenInvalidBasicSig) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ auto msg = this->kTest1Msg;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+
+ NrProof proof;
+ // make sure that can generate NrProof using incorrupt basic sig
+ THROW_ON_EPIDERR(EpidNrProve(member, msg.data(), msg.size(), &this->kBasicSig,
+ &sig_rl->bk[0], &proof));
+ // invalid basic sig is only when K value is invalid!!
+ NativeBasicSignature basic_sig_invalid_K = this->kBasicSig;
+ basic_sig_invalid_K.K.x.limbs.word[0]++; // make it not in EC group
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidNrProve(member, msg.data(), msg.size(), &basic_sig_invalid_K,
+ &sig_rl->bk[0], &proof));
+}
+
+TEST_F(EpidMemberTest, GeneratesNrProofForEmptyMessage) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ BasicSignature basic_sig;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+
+ NrProof proof;
+
+ EXPECT_EQ(kEpidNoErr, EpidNrProve(member, nullptr, 0, &this->kBasicSig,
+ &sig_rl->bk[0], &proof));
+
+ BasicSignatureSerialize(&basic_sig, &this->kBasicSig);
+ // Check proof by doing an NrVerify
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidNoErr,
+ EpidNrVerify(ctx, &basic_sig, nullptr, 0, &sig_rl->bk[0], &proof));
+}
+
+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;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+
+ NrProof proof;
+ EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(),
+ &this->kBasicSig, &sig_rl->bk[0], &proof));
+
+ // Check proof by doing an NrVerify
+ BasicSignatureSerialize(&basic_sig, &this->kBasicSig);
+ 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);
+
+ BasicSignature basic_sig;
+ auto msg = this->kTest1Msg;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+
+ NrProof proof;
+ EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(),
+ &this->kBasicSig, &sig_rl->bk[0], &proof));
+
+ // Check proof by doing an NrVerify
+ BasicSignatureSerialize(&basic_sig, &this->kBasicSig);
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidNoErr, EpidNrVerify(ctx, &basic_sig, msg.data(), msg.size(),
+ &sig_rl->bk[0], &proof));
+}
+
+TEST_F(EpidMemberTest, GeneratesNrProofUsingSha512) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ BasicSignature basic_sig;
+ auto msg = this->kTest1Msg;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512));
+ NrProof proof;
+ EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(),
+ &this->kBasicSig, &sig_rl->bk[0], &proof));
+
+ // Check proof by doing an NrVerify
+ BasicSignatureSerialize(&basic_sig, &this->kBasicSig);
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidNoErr, EpidNrVerify(ctx, &basic_sig, msg.data(), msg.size(),
+ &sig_rl->bk[0], &proof));
+}
+
+TEST_F(EpidMemberTest, GeneratesNrProofUsingSha256) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ BasicSignature basic_sig;
+ auto msg = this->kTest1Msg;
+ SigRl const* sig_rl = reinterpret_cast<const SigRl*>(this->kSigRlData.data());
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ NrProof proof;
+ EXPECT_EQ(kEpidNoErr, EpidNrProve(member, msg.data(), msg.size(),
+ &this->kBasicSig, &sig_rl->bk[0], &proof));
+
+ // Check proof by doing an NrVerify
+ BasicSignatureSerialize(&basic_sig, &this->kBasicSig);
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidNoErr, EpidNrVerify(ctx, &basic_sig, msg.data(), msg.size(),
+ &sig_rl->bk[0], &proof));
+}
+} // namespace
+#endif // SHARED
diff --git a/epid/member/tiny/unittests/internal/presig_compute-test.cc b/epid/member/tiny/unittests/internal/presig_compute-test.cc
new file mode 100644
index 0000000..bd608fe
--- /dev/null
+++ b/epid/member/tiny/unittests/internal/presig_compute-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.
+############################################################################*/
+
+/*!
+ * \file
+ * \brief tiny EpidMemberComputePreSig unit tests.
+ */
+
+#ifndef SHARED
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/tiny/src/presig_compute.h"
+}
+
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tiny/unittests/member-testhelper.h"
+
+namespace {
+
+TEST_F(EpidMemberTest, SuccessfullyComputePresig) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ PreComputedSignatureData presig = {0};
+ EXPECT_EQ(kEpidNoErr, EpidMemberComputePreSig(member, &presig));
+}
+
+} // namespace
+#endif // SHARED
diff --git a/epid/member/tiny/unittests/internal/serialize-test.cc b/epid/member/tiny/unittests/internal/serialize-test.cc
new file mode 100644
index 0000000..bbd29f6
--- /dev/null
+++ b/epid/member/tiny/unittests/internal/serialize-test.cc
@@ -0,0 +1,409 @@
+/*############################################################################
+ # 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 native type serialization unit tests.
+ *
+ * \warning to run the tests in this file you must build a non-shared mode.
+ */
+
+#ifndef SHARED
+
+#include <cstring>
+#include <vector>
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/member/tiny/unittests/member-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/common/types.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/serialize.h"
+#include "epid/member/tiny/src/signbasic.h"
+}
+
+/// compares BasicSignature values
+bool operator==(BasicSignature const& lhs, BasicSignature const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(NativeBasicSignature const& lhs,
+ NativeBasicSignature const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(NativeGroupPubKey const& lhs, NativeGroupPubKey const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(NativePrivKey const& lhs, NativePrivKey const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+bool operator==(NativeMembershipCredential const& lhs,
+ NativeMembershipCredential const& rhs) {
+ return 0 == std::memcmp(&lhs, &rhs, sizeof(lhs));
+}
+
+namespace {
+////////////////////////////////////////////////////////////////////////
+// BasicSignatureSerialize
+
+TEST(TinySerializeTest, BasicSignatureSerializeWorks) {
+ const NativeBasicSignature serialized_BaseSig = {
+ // B
+ {{0xB315D67E, 0x1924AE56, 0xCF527861, 0xEBB789B6, 0x3F429D2A, 0xB193BF9A,
+ 0x6BD8502F, 0x5E73BE39},
+ {0x0BD51968, 0x0F13472D, 0xC96B5096, 0xA9CD4491, 0x4AB668CF, 0x2123D56C,
+ 0xF30AF180, 0x0DB43C33}},
+ // K
+ {{0x9C3524E3, 0x4E4CA66B, 0x58731363, 0xB57BC920, 0x1317EBFA, 0xBD71A2D6,
+ 0x046B29FE, 0x64B5A803},
+ {0x86A7A14A, 0xDE584912, 0xFEFD476A, 0x8559EF80, 0x34D8E1D2, 0x81F6BF1D,
+ 0xE0C42E4B, 0x477FEC10}},
+ // T
+ {{0x444DB42F, 0xB57CFAA0, 0x3FB8C069, 0x3593EC91, 0xB968BBAA, 0x02D2BFBB,
+ 0xCF2E5D4A, 0xE57236B5},
+ {0x23C435BE, 0x92D96415, 0x6A552F32, 0x5E071AA9, 0xBBC76EDC, 0xC1C5D18A,
+ 0x654CA5AE, 0xB96FEBB0}},
+ // c
+ {0xD03D247B, 0x8C2A93E5, 0xCBB14B7A, 0x85919691, 0xC7009CFC, 0xEFD5278B,
+ 0x82D2F470, 0xA2CDE297},
+ // xs
+ {0xEB24D967, 0xDC578F59, 0x58C76405, 0x1958415E, 0xF08890BD, 0xDB47D06A,
+ 0x7257B3F5, 0x6346AA98},
+ // sf
+ {0x11B85D46, 0xBEA435F3, 0x11E85329, 0xDD10B17B, 0xC41B1647, 0x268C5DDC,
+ 0x4E39F40C, 0x25421795},
+ // sa
+ {0xCDA62A84, 0x3CC19531, 0xDCC526F5, 0x3A248BB8, 0xF973B761, 0x3E009735,
+ 0x6FC46BCC, 0x4EBDEDE8},
+ // sb
+ {0x2E0B26CF, 0x6193CD96, 0xED6E97F8, 0xBB9D186E, 0xB37A5227, 0xF82B38E5,
+ 0x610CAF48, 0x92A3681B}};
+ BasicSignature result = {0};
+ const BasicSignature expected_BaseSig = {
+ // B
+ {{0x5E, 0x73, 0xBE, 0x39, 0x6B, 0xD8, 0x50, 0x2F, 0xB1, 0x93, 0xBF,
+ 0x9A, 0x3F, 0x42, 0x9D, 0x2A, 0xEB, 0xB7, 0x89, 0xB6, 0xCF, 0x52,
+ 0x78, 0x61, 0x19, 0x24, 0xAE, 0x56, 0xB3, 0x15, 0xD6, 0x7E},
+ {0x0D, 0xB4, 0x3C, 0x33, 0xF3, 0x0A, 0xF1, 0x80, 0x21, 0x23, 0xD5,
+ 0x6C, 0x4A, 0xB6, 0x68, 0xCF, 0xA9, 0xCD, 0x44, 0x91, 0xC9, 0x6B,
+ 0x50, 0x96, 0x0F, 0x13, 0x47, 0x2D, 0x0B, 0xD5, 0x19, 0x68}},
+ // K
+ {{0x64, 0xB5, 0xA8, 0x03, 0x04, 0x6B, 0x29, 0xFE, 0xBD, 0x71, 0xA2,
+ 0xD6, 0x13, 0x17, 0xEB, 0xFA, 0xB5, 0x7B, 0xC9, 0x20, 0x58, 0x73,
+ 0x13, 0x63, 0x4E, 0x4C, 0xA6, 0x6B, 0x9C, 0x35, 0x24, 0xE3},
+ {0x47, 0x7F, 0xEC, 0x10, 0xE0, 0xC4, 0x2E, 0x4B, 0x81, 0xF6, 0xBF,
+ 0x1D, 0x34, 0xD8, 0xE1, 0xD2, 0x85, 0x59, 0xEF, 0x80, 0xFE, 0xFD,
+ 0x47, 0x6A, 0xDE, 0x58, 0x49, 0x12, 0x86, 0xA7, 0xA1, 0x4A}},
+ // T
+ {{0xE5, 0x72, 0x36, 0xB5, 0xCF, 0x2E, 0x5D, 0x4A, 0x02, 0xD2, 0xBF,
+ 0xBB, 0xB9, 0x68, 0xBB, 0xAA, 0x35, 0x93, 0xEC, 0x91, 0x3F, 0xB8,
+ 0xC0, 0x69, 0xB5, 0x7C, 0xFA, 0xA0, 0x44, 0x4D, 0xB4, 0x2F},
+ {0xB9, 0x6F, 0xEB, 0xB0, 0x65, 0x4C, 0xA5, 0xAE, 0xC1, 0xC5, 0xD1,
+ 0x8A, 0xBB, 0xC7, 0x6E, 0xDC, 0x5E, 0x07, 0x1A, 0xA9, 0x6A, 0x55,
+ 0x2F, 0x32, 0x92, 0xD9, 0x64, 0x15, 0x23, 0xC4, 0x35, 0xBE}},
+ // c
+ {0xA2, 0xCD, 0xE2, 0x97, 0x82, 0xD2, 0xF4, 0x70, 0xEF, 0xD5, 0x27,
+ 0x8B, 0xC7, 0x00, 0x9C, 0xFC, 0x85, 0x91, 0x96, 0x91, 0xCB, 0xB1,
+ 0x4B, 0x7A, 0x8C, 0x2A, 0x93, 0xE5, 0xD0, 0x3D, 0x24, 0x7B},
+ // sx
+ {0x63, 0x46, 0xAA, 0x98, 0x72, 0x57, 0xB3, 0xF5, 0xDB, 0x47, 0xD0,
+ 0x6A, 0xF0, 0x88, 0x90, 0xBD, 0x19, 0x58, 0x41, 0x5E, 0x58, 0xC7,
+ 0x64, 0x05, 0xDC, 0x57, 0x8F, 0x59, 0xEB, 0x24, 0xD9, 0x67},
+ // sf
+ {0x25, 0x42, 0x17, 0x95, 0x4E, 0x39, 0xF4, 0x0C, 0x26, 0x8C, 0x5D,
+ 0xDC, 0xC4, 0x1B, 0x16, 0x47, 0xDD, 0x10, 0xB1, 0x7B, 0x11, 0xE8,
+ 0x53, 0x29, 0xBE, 0xA4, 0x35, 0xF3, 0x11, 0xB8, 0x5D, 0x46},
+ // sa
+ {0x4E, 0xBD, 0xED, 0xE8, 0x6F, 0xC4, 0x6B, 0xCC, 0x3E, 0x00, 0x97,
+ 0x35, 0xF9, 0x73, 0xB7, 0x61, 0x3A, 0x24, 0x8B, 0xB8, 0xDC, 0xC5,
+ 0x26, 0xF5, 0x3C, 0xC1, 0x95, 0x31, 0xCD, 0xA6, 0x2A, 0x84},
+ // sb
+ {0x92, 0xA3, 0x68, 0x1B, 0x61, 0x0C, 0xAF, 0x48, 0xF8, 0x2B, 0x38,
+ 0xE5, 0xB3, 0x7A, 0x52, 0x27, 0xBB, 0x9D, 0x18, 0x6E, 0xED, 0x6E,
+ 0x97, 0xF8, 0x61, 0x93, 0xCD, 0x96, 0x2E, 0x0B, 0x26, 0xCF}};
+ BasicSignatureSerialize(&result, &serialized_BaseSig);
+ EXPECT_EQ(expected_BaseSig, result);
+}
+
+////////////////////////////////////////////////////////////////////////
+// BasicSignatureDeserialize
+
+TEST(TinySerializeTest, BasicSignatureDeserializeWorks) {
+ const BasicSignature deserialized_BaseSig = {
+ // B
+ {{0x5E, 0x73, 0xBE, 0x39, 0x6B, 0xD8, 0x50, 0x2F, 0xB1, 0x93, 0xBF,
+ 0x9A, 0x3F, 0x42, 0x9D, 0x2A, 0xEB, 0xB7, 0x89, 0xB6, 0xCF, 0x52,
+ 0x78, 0x61, 0x19, 0x24, 0xAE, 0x56, 0xB3, 0x15, 0xD6, 0x7E},
+ {0x0D, 0xB4, 0x3C, 0x33, 0xF3, 0x0A, 0xF1, 0x80, 0x21, 0x23, 0xD5,
+ 0x6C, 0x4A, 0xB6, 0x68, 0xCF, 0xA9, 0xCD, 0x44, 0x91, 0xC9, 0x6B,
+ 0x50, 0x96, 0x0F, 0x13, 0x47, 0x2D, 0x0B, 0xD5, 0x19, 0x68}},
+ // K
+ {{0x64, 0xB5, 0xA8, 0x03, 0x04, 0x6B, 0x29, 0xFE, 0xBD, 0x71, 0xA2,
+ 0xD6, 0x13, 0x17, 0xEB, 0xFA, 0xB5, 0x7B, 0xC9, 0x20, 0x58, 0x73,
+ 0x13, 0x63, 0x4E, 0x4C, 0xA6, 0x6B, 0x9C, 0x35, 0x24, 0xE3},
+ {0x47, 0x7F, 0xEC, 0x10, 0xE0, 0xC4, 0x2E, 0x4B, 0x81, 0xF6, 0xBF,
+ 0x1D, 0x34, 0xD8, 0xE1, 0xD2, 0x85, 0x59, 0xEF, 0x80, 0xFE, 0xFD,
+ 0x47, 0x6A, 0xDE, 0x58, 0x49, 0x12, 0x86, 0xA7, 0xA1, 0x4A}},
+ // T
+ {{0xE5, 0x72, 0x36, 0xB5, 0xCF, 0x2E, 0x5D, 0x4A, 0x02, 0xD2, 0xBF,
+ 0xBB, 0xB9, 0x68, 0xBB, 0xAA, 0x35, 0x93, 0xEC, 0x91, 0x3F, 0xB8,
+ 0xC0, 0x69, 0xB5, 0x7C, 0xFA, 0xA0, 0x44, 0x4D, 0xB4, 0x2F},
+ {0xB9, 0x6F, 0xEB, 0xB0, 0x65, 0x4C, 0xA5, 0xAE, 0xC1, 0xC5, 0xD1,
+ 0x8A, 0xBB, 0xC7, 0x6E, 0xDC, 0x5E, 0x07, 0x1A, 0xA9, 0x6A, 0x55,
+ 0x2F, 0x32, 0x92, 0xD9, 0x64, 0x15, 0x23, 0xC4, 0x35, 0xBE}},
+ // c
+ {0xA2, 0xCD, 0xE2, 0x97, 0x82, 0xD2, 0xF4, 0x70, 0xEF, 0xD5, 0x27,
+ 0x8B, 0xC7, 0x00, 0x9C, 0xFC, 0x85, 0x91, 0x96, 0x91, 0xCB, 0xB1,
+ 0x4B, 0x7A, 0x8C, 0x2A, 0x93, 0xE5, 0xD0, 0x3D, 0x24, 0x7B},
+ // sx
+ {0x63, 0x46, 0xAA, 0x98, 0x72, 0x57, 0xB3, 0xF5, 0xDB, 0x47, 0xD0,
+ 0x6A, 0xF0, 0x88, 0x90, 0xBD, 0x19, 0x58, 0x41, 0x5E, 0x58, 0xC7,
+ 0x64, 0x05, 0xDC, 0x57, 0x8F, 0x59, 0xEB, 0x24, 0xD9, 0x67},
+ // sf
+ {0x25, 0x42, 0x17, 0x95, 0x4E, 0x39, 0xF4, 0x0C, 0x26, 0x8C, 0x5D,
+ 0xDC, 0xC4, 0x1B, 0x16, 0x47, 0xDD, 0x10, 0xB1, 0x7B, 0x11, 0xE8,
+ 0x53, 0x29, 0xBE, 0xA4, 0x35, 0xF3, 0x11, 0xB8, 0x5D, 0x46},
+ // sa
+ {0x4E, 0xBD, 0xED, 0xE8, 0x6F, 0xC4, 0x6B, 0xCC, 0x3E, 0x00, 0x97,
+ 0x35, 0xF9, 0x73, 0xB7, 0x61, 0x3A, 0x24, 0x8B, 0xB8, 0xDC, 0xC5,
+ 0x26, 0xF5, 0x3C, 0xC1, 0x95, 0x31, 0xCD, 0xA6, 0x2A, 0x84},
+ // sb
+ {0x92, 0xA3, 0x68, 0x1B, 0x61, 0x0C, 0xAF, 0x48, 0xF8, 0x2B, 0x38,
+ 0xE5, 0xB3, 0x7A, 0x52, 0x27, 0xBB, 0x9D, 0x18, 0x6E, 0xED, 0x6E,
+ 0x97, 0xF8, 0x61, 0x93, 0xCD, 0x96, 0x2E, 0x0B, 0x26, 0xCF}};
+ const NativeBasicSignature expected_BaseSig = {
+ // B
+ {{0xB315D67E, 0x1924AE56, 0xCF527861, 0xEBB789B6, 0x3F429D2A, 0xB193BF9A,
+ 0x6BD8502F, 0x5E73BE39},
+ {0x0BD51968, 0x0F13472D, 0xC96B5096, 0xA9CD4491, 0x4AB668CF, 0x2123D56C,
+ 0xF30AF180, 0x0DB43C33}},
+ // K
+ {{0x9C3524E3, 0x4E4CA66B, 0x58731363, 0xB57BC920, 0x1317EBFA, 0xBD71A2D6,
+ 0x046B29FE, 0x64B5A803},
+ {0x86A7A14A, 0xDE584912, 0xFEFD476A, 0x8559EF80, 0x34D8E1D2, 0x81F6BF1D,
+ 0xE0C42E4B, 0x477FEC10}},
+ // T
+ {{0x444DB42F, 0xB57CFAA0, 0x3FB8C069, 0x3593EC91, 0xB968BBAA, 0x02D2BFBB,
+ 0xCF2E5D4A, 0xE57236B5},
+ {0x23C435BE, 0x92D96415, 0x6A552F32, 0x5E071AA9, 0xBBC76EDC, 0xC1C5D18A,
+ 0x654CA5AE, 0xB96FEBB0}},
+ // c
+ {0xD03D247B, 0x8C2A93E5, 0xCBB14B7A, 0x85919691, 0xC7009CFC, 0xEFD5278B,
+ 0x82D2F470, 0xA2CDE297},
+ // xs
+ {0xEB24D967, 0xDC578F59, 0x58C76405, 0x1958415E, 0xF08890BD, 0xDB47D06A,
+ 0x7257B3F5, 0x6346AA98},
+ // sf
+ {0x11B85D46, 0xBEA435F3, 0x11E85329, 0xDD10B17B, 0xC41B1647, 0x268C5DDC,
+ 0x4E39F40C, 0x25421795},
+ // sa
+ {0xCDA62A84, 0x3CC19531, 0xDCC526F5, 0x3A248BB8, 0xF973B761, 0x3E009735,
+ 0x6FC46BCC, 0x4EBDEDE8},
+ // sb
+ {0x2E0B26CF, 0x6193CD96, 0xED6E97F8, 0xBB9D186E, 0xB37A5227, 0xF82B38E5,
+ 0x610CAF48, 0x92A3681B}};
+ NativeBasicSignature result = {0};
+ BasicSignatureDeserialize(&result, &deserialized_BaseSig);
+ EXPECT_EQ(expected_BaseSig, result);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// GroupPubKeySerialize Tests
+TEST_F(EpidMemberTest, GroupPubKeySerializeWorks) {
+ NativeGroupPubKey const input = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb580e099, 0x434c62fd, 0x64cee3ce, 0xd06d8f9d, 0x7e27b0cb,
+ 0x3d753d61, 0xe21b17eb, 0xb36fff81}}},
+ {{{0x74f459ee, 0xd8693ea1, 0x82457e7f, 0xee3d6642, 0xe94dae9c,
+ 0xfdb5b79d, 0xe08859a4, 0x3a075680}}}}, // h1
+ {{{{0xbcdd7fe1, 0x29666163, 0xd55ba704, 0xdc99ed42, 0x5474107b,
+ 0xd5dbca1c, 0x63c2518e, 0xd2742e9f}}},
+ {{{0xe78e1084, 0x93a56ecc, 0xde4ceacb, 0xda3f517d, 0xe85b087b,
+ 0x48120aa6, 0xe314ac72, 0x765dc06e}}}}, // h2
+ {{{{{0x0728e896, 0x8dcd3688, 0x6a95cac6, 0x788753f6, 0x401ba5b6,
+ 0x50719451, 0xe20fca1c, 0xbd195a95}}},
+ {{{0xe2f4b3a1, 0x22d9fde0, 0x0f6c56f5, 0x2414cfd1, 0x15d775f8,
+ 0xa6657a68, 0xb86ae7e5, 0xca78115b}}}},
+ {{{{0x57e4f33c, 0x0a3b5896, 0x89c2399c, 0x898846dd, 0x5deef56a,
+ 0xbc077230, 0xe8b3c725, 0x9021a7e0}}},
+ {{{0xee1140a9, 0x837d3e31, 0x8e25c6ad, 0xba6bf0da, 0x1f3deaa2,
+ 0x5d0a88db, 0x1bb6f705, 0x79516936}}}}}};
+ GroupPubKey const expected = {
+ {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
+ };
+ GroupPubKey actual = {0};
+ GroupPubKeySerialize(&actual, &input);
+ EXPECT_EQ(expected, actual);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// GroupPubKeyDeserialize Tests
+TEST_F(EpidMemberTest, GroupPubKeyDeserializeWorks) {
+ GroupPubKey const input = {
+ {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
+ };
+ NativeGroupPubKey const expected = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb580e099, 0x434c62fd, 0x64cee3ce, 0xd06d8f9d, 0x7e27b0cb,
+ 0x3d753d61, 0xe21b17eb, 0xb36fff81}}},
+ {{{0x74f459ee, 0xd8693ea1, 0x82457e7f, 0xee3d6642, 0xe94dae9c,
+ 0xfdb5b79d, 0xe08859a4, 0x3a075680}}}}, // h1
+ {{{{0xbcdd7fe1, 0x29666163, 0xd55ba704, 0xdc99ed42, 0x5474107b,
+ 0xd5dbca1c, 0x63c2518e, 0xd2742e9f}}},
+ {{{0xe78e1084, 0x93a56ecc, 0xde4ceacb, 0xda3f517d, 0xe85b087b,
+ 0x48120aa6, 0xe314ac72, 0x765dc06e}}}}, // h2
+ {{{{{0x0728e896, 0x8dcd3688, 0x6a95cac6, 0x788753f6, 0x401ba5b6,
+ 0x50719451, 0xe20fca1c, 0xbd195a95}}},
+ {{{0xe2f4b3a1, 0x22d9fde0, 0x0f6c56f5, 0x2414cfd1, 0x15d775f8,
+ 0xa6657a68, 0xb86ae7e5, 0xca78115b}}}},
+ {{{{0x57e4f33c, 0x0a3b5896, 0x89c2399c, 0x898846dd, 0x5deef56a,
+ 0xbc077230, 0xe8b3c725, 0x9021a7e0}}},
+ {{{0xee1140a9, 0x837d3e31, 0x8e25c6ad, 0xba6bf0da, 0x1f3deaa2,
+ 0x5d0a88db, 0x1bb6f705, 0x79516936}}}}}};
+ NativeGroupPubKey actual = {0};
+ GroupPubKeyDeserialize(&actual, &input);
+ EXPECT_EQ(expected, actual);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// PrivKeyDeserialize Tests
+TEST_F(EpidMemberTest, PrivKeyDeserializeWorks) {
+ PrivKey const input = {
+ {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
+ };
+ NativePrivKey const expected = {
+ {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0x196254db, 0x570890e8, 0xdaf296ec, 0x87683f4e, 0xeb4caf8a,
+ 0xacbfdd77, 0xf468e15f, 0x46c969ee}}},
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086,
+ 0x105eafd8, 0xa1e0d7df, 0x0a30ae43} // x
+ },
+ {0x636131c7, 0x362d4135, 0xa707879b, 0xa16567fd, 0xe07cc68e, 0x05d64356,
+ 0x6d47090b, 0x4840b56c} // f
+ };
+ NativePrivKey actual = {0};
+ PrivKeyDeserialize(&actual, &input);
+ EXPECT_EQ(expected, actual);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// MembershipCredentialDeserialize Tests
+TEST_F(EpidMemberTest, MembershipCredentialDeserializeWorks) {
+ MembershipCredential const input = {
+ {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
+ };
+ NativeMembershipCredential const expected = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0x196254db, 0x570890e8, 0xdaf296ec, 0x87683f4e, 0xeb4caf8a,
+ 0xacbfdd77, 0xf468e15f, 0x46c969ee}}},
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086, 0x105eafd8,
+ 0xa1e0d7df, 0x0a30ae43} // x
+ };
+ NativeMembershipCredential actual = {0};
+ MembershipCredentialDeserialize(&actual, &input);
+ EXPECT_EQ(expected, actual);
+}
+
+} // namespace
+
+#endif // SHARED
diff --git a/epid/member/tiny/unittests/internal/signbasic-test.cc b/epid/member/tiny/unittests/internal/signbasic-test.cc
new file mode 100644
index 0000000..9c364ac
--- /dev/null
+++ b/epid/member/tiny/unittests/internal/signbasic-test.cc
@@ -0,0 +1,109 @@
+/*############################################################################
+# 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 tiny SignBasic unit tests.
+ */
+
+#ifndef SHARED
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/serialize.h"
+#include "epid/member/tiny/src/signbasic.h"
+#include "epid/verifier/api.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/tiny/unittests/member-testhelper.h"
+
+namespace {
+
+/////////////////////////////////////////////////////////////////////////
+// SignBasic
+
+TEST_F(EpidMemberTest, BasicSignaturesOfSameMessageAreDifferent) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ NativeBasicSignature basic_sig1 = {0};
+ NativeBasicSignature basic_sig2 = {0};
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &basic_sig1));
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &basic_sig2));
+ EXPECT_NE(0, memcmp(&basic_sig1, &basic_sig2, sizeof(NativeBasicSignature)));
+}
+
+TEST_F(EpidMemberTest, SignBasicSucceedsUsingRandomBase) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ NativeBasicSignature native_basic_sig = {0};
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &native_basic_sig));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ BasicSignature basic_sig = {0};
+ BasicSignatureSerialize(&basic_sig, &native_basic_sig);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha512) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ NativeBasicSignature native_basic_sig = {0};
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha512));
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &native_basic_sig));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ BasicSignature basic_sig = {0};
+ BasicSignatureSerialize(&basic_sig, &native_basic_sig);
+ EpidVerifierSetHashAlg(ctx, kSha512);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha256) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ NativeBasicSignature native_basic_sig = {0};
+ THROW_ON_EPIDERR(EpidMemberSetHashAlg(member, kSha256));
+ EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
+ 0, &native_basic_sig));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ BasicSignature basic_sig = {0};
+ BasicSignatureSerialize(&basic_sig, &native_basic_sig);
+ EpidVerifierSetHashAlg(ctx, kSha256);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerifyBasicSig(ctx, &basic_sig, msg.data(), msg.size()));
+}
+
+} // namespace
+#endif // SHARED
diff --git a/epid/member/tiny/unittests/internal/validate-test.cc b/epid/member/tiny/unittests/internal/validate-test.cc
new file mode 100644
index 0000000..b090959
--- /dev/null
+++ b/epid/member/tiny/unittests/internal/validate-test.cc
@@ -0,0 +1,317 @@
+/*############################################################################
+ # 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 native type validation unit tests.
+ *
+ * \warning to run the tests in this file you must build a non-shared mode.
+ */
+
+#ifndef SHARED
+
+#include <cstring>
+#include <vector>
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/member/tiny/unittests/member-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/common/types.h"
+#include "epid/member/tiny/math/pairing.h"
+#include "epid/member/tiny/src/native_types.h"
+#include "epid/member/tiny/src/validate.h"
+}
+
+namespace {
+//////////////////////////////////////////////////////////////////////////
+// GroupPubKeyIsInRange Tests
+TEST_F(EpidMemberTest, GroupPubKeyIsInRangePasses) {
+ NativeGroupPubKey const input = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb580e099, 0x434c62fd, 0x64cee3ce, 0xd06d8f9d, 0x7e27b0cb,
+ 0x3d753d61, 0xe21b17eb, 0xb36fff81}}},
+ {{{0x74f459ee, 0xd8693ea1, 0x82457e7f, 0xee3d6642, 0xe94dae9c,
+ 0xfdb5b79d, 0xe08859a4, 0x3a075680}}}}, // h1
+ {{{{0xbcdd7fe1, 0x29666163, 0xd55ba704, 0xdc99ed42, 0x5474107b,
+ 0xd5dbca1c, 0x63c2518e, 0xd2742e9f}}},
+ {{{0xe78e1084, 0x93a56ecc, 0xde4ceacb, 0xda3f517d, 0xe85b087b,
+ 0x48120aa6, 0xe314ac72, 0x765dc06e}}}}, // h2
+ {{{{{0x0728e896, 0x8dcd3688, 0x6a95cac6, 0x788753f6, 0x401ba5b6,
+ 0x50719451, 0xe20fca1c, 0xbd195a95}}},
+ {{{0xe2f4b3a1, 0x22d9fde0, 0x0f6c56f5, 0x2414cfd1, 0x15d775f8,
+ 0xa6657a68, 0xb86ae7e5, 0xca78115b}}}},
+ {{{{0x57e4f33c, 0x0a3b5896, 0x89c2399c, 0x898846dd, 0x5deef56a,
+ 0xbc077230, 0xe8b3c725, 0x9021a7e0}}},
+ {{{0xee1140a9, 0x837d3e31, 0x8e25c6ad, 0xba6bf0da, 0x1f3deaa2,
+ 0x5d0a88db, 0x1bb6f705, 0x79516936}}}}}};
+ EXPECT_TRUE(GroupPubKeyIsInRange(&input));
+}
+
+TEST_F(EpidMemberTest, GroupPubKeyIsInRangeFails) {
+ NativeGroupPubKey const input = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}}}, //< q
+ {{{0x74f459ee, 0xd8693ea1, 0x82457e7f, 0xee3d6642, 0xe94dae9c,
+ 0xfdb5b79d, 0xe08859a4, 0x3a075680}}}}, // h1
+ {{{{0xbcdd7fe1, 0x29666163, 0xd55ba704, 0xdc99ed42, 0x5474107b,
+ 0xd5dbca1c, 0x63c2518e, 0xd2742e9f}}},
+ {{{0xe78e1084, 0x93a56ecc, 0xde4ceacb, 0xda3f517d, 0xe85b087b,
+ 0x48120aa6, 0xe314ac72, 0x765dc06e}}}}, // h2
+ {{{{{0x0728e896, 0x8dcd3688, 0x6a95cac6, 0x788753f6, 0x401ba5b6,
+ 0x50719451, 0xe20fca1c, 0xbd195a95}}},
+ {{{0xe2f4b3a1, 0x22d9fde0, 0x0f6c56f5, 0x2414cfd1, 0x15d775f8,
+ 0xa6657a68, 0xb86ae7e5, 0xca78115b}}}},
+ {{{{0x57e4f33c, 0x0a3b5896, 0x89c2399c, 0x898846dd, 0x5deef56a,
+ 0xbc077230, 0xe8b3c725, 0x9021a7e0}}},
+ {{{0xee1140a9, 0x837d3e31, 0x8e25c6ad, 0xba6bf0da, 0x1f3deaa2,
+ 0x5d0a88db, 0x1bb6f705, 0x79516936}}}}}};
+ EXPECT_FALSE(GroupPubKeyIsInRange(&input));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// MembershipCredentialIsInRange Tests
+TEST_F(EpidMemberTest, MembershipCredentialIsInRangePasses) {
+ NativeMembershipCredential const input = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0x196254db, 0x570890e8, 0xdaf296ec, 0x87683f4e, 0xeb4caf8a,
+ 0xacbfdd77, 0xf468e15f, 0x46c969ee}}},
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086, 0x105eafd8,
+ 0xa1e0d7df, 0x0a30ae43} // x
+ };
+ EXPECT_TRUE(MembershipCredentialIsInRange(&input));
+}
+
+TEST_F(EpidMemberTest, MembershipCredentialIsInRangeFails) {
+ NativeMembershipCredential const input = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}}}, //< q
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086, 0x105eafd8,
+ 0xa1e0d7df, 0x0a30ae43} // x
+ };
+ EXPECT_FALSE(MembershipCredentialIsInRange(&input));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// MembershipCredentialIsInGroup Tests
+TEST_F(EpidMemberTest, MembershipCredentialIsInGroupPasses) {
+ PairingState pairing_state;
+ PairingInit(&pairing_state);
+ NativeMembershipCredential const input = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0x196254db, 0x570890e8, 0xdaf296ec, 0x87683f4e, 0xeb4caf8a,
+ 0xacbfdd77, 0xf468e15f, 0x46c969ee}}},
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086, 0x105eafd8,
+ 0xa1e0d7df, 0x0a30ae43} // x
+ };
+ FpElem const f = {0x636131c7, 0x362d4135, 0xa707879b, 0xa16567fd,
+ 0xe07cc68e, 0x05d64356, 0x6d47090b, 0x4840b56c}; // f
+ NativeGroupPubKey const pubkey = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb580e099, 0x434c62fd, 0x64cee3ce, 0xd06d8f9d, 0x7e27b0cb,
+ 0x3d753d61, 0xe21b17eb, 0xb36fff81}}},
+ {{{0x74f459ee, 0xd8693ea1, 0x82457e7f, 0xee3d6642, 0xe94dae9c,
+ 0xfdb5b79d, 0xe08859a4, 0x3a075680}}}}, // h1
+ {{{{0xbcdd7fe1, 0x29666163, 0xd55ba704, 0xdc99ed42, 0x5474107b,
+ 0xd5dbca1c, 0x63c2518e, 0xd2742e9f}}},
+ {{{0xe78e1084, 0x93a56ecc, 0xde4ceacb, 0xda3f517d, 0xe85b087b,
+ 0x48120aa6, 0xe314ac72, 0x765dc06e}}}}, // h2
+ {{{{{0x0728e896, 0x8dcd3688, 0x6a95cac6, 0x788753f6, 0x401ba5b6,
+ 0x50719451, 0xe20fca1c, 0xbd195a95}}},
+ {{{0xe2f4b3a1, 0x22d9fde0, 0x0f6c56f5, 0x2414cfd1, 0x15d775f8,
+ 0xa6657a68, 0xb86ae7e5, 0xca78115b}}}},
+ {{{{0x57e4f33c, 0x0a3b5896, 0x89c2399c, 0x898846dd, 0x5deef56a,
+ 0xbc077230, 0xe8b3c725, 0x9021a7e0}}},
+ {{{0xee1140a9, 0x837d3e31, 0x8e25c6ad, 0xba6bf0da, 0x1f3deaa2,
+ 0x5d0a88db, 0x1bb6f705, 0x79516936}}}}}};
+ EXPECT_TRUE(
+ MembershipCredentialIsInGroup(&input, &f, &pubkey, &pairing_state));
+}
+
+TEST_F(EpidMemberTest, MembershipCredentialIsInGroupFails) {
+ PairingState pairing_state;
+ PairingInit(&pairing_state);
+ NativeMembershipCredential const input = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x02}, // group id
+ {{{{0x196254db, 0x570890e8, 0xdaf296ec, 0x87683f4e, 0xeb4caf8a,
+ 0xacbfdd77, 0xf468e15f, 0x46c969ee}}},
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086, 0x105eafd8,
+ 0xa1e0d7df, 0x0a30ae43} // x
+ };
+ FpElem const f = {0x636131c7, 0x362d4135, 0xa707879b, 0xa16567fd,
+ 0xe07cc68e, 0x05d64356, 0x6d47090b, 0x4840b56c}; // f
+ NativeGroupPubKey const pubkey = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb580e099, 0x434c62fd, 0x64cee3ce, 0xd06d8f9d, 0x7e27b0cb,
+ 0x3d753d61, 0xe21b17eb, 0xb36fff81}}},
+ {{{0x74f459ee, 0xd8693ea1, 0x82457e7f, 0xee3d6642, 0xe94dae9c,
+ 0xfdb5b79d, 0xe08859a4, 0x3a075680}}}}, // h1
+ {{{{0xbcdd7fe1, 0x29666163, 0xd55ba704, 0xdc99ed42, 0x5474107b,
+ 0xd5dbca1c, 0x63c2518e, 0xd2742e9f}}},
+ {{{0xe78e1084, 0x93a56ecc, 0xde4ceacb, 0xda3f517d, 0xe85b087b,
+ 0x48120aa6, 0xe314ac72, 0x765dc06e}}}}, // h2
+ {{{{{0x0728e896, 0x8dcd3688, 0x6a95cac6, 0x788753f6, 0x401ba5b6,
+ 0x50719451, 0xe20fca1c, 0xbd195a95}}},
+ {{{0xe2f4b3a1, 0x22d9fde0, 0x0f6c56f5, 0x2414cfd1, 0x15d775f8,
+ 0xa6657a68, 0xb86ae7e5, 0xca78115b}}}},
+ {{{{0x57e4f33c, 0x0a3b5896, 0x89c2399c, 0x898846dd, 0x5deef56a,
+ 0xbc077230, 0xe8b3c725, 0x9021a7e0}}},
+ {{{0xee1140a9, 0x837d3e31, 0x8e25c6ad, 0xba6bf0da, 0x1f3deaa2,
+ 0x5d0a88db, 0x1bb6f705, 0x79516936}}}}}};
+ EXPECT_FALSE(
+ MembershipCredentialIsInGroup(&input, &f, &pubkey, &pairing_state));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// PrivKeyIsInRange Tests
+TEST_F(EpidMemberTest, PrivKeyIsInRangePasses) {
+ NativePrivKey const input = {
+ {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0x196254db, 0x570890e8, 0xdaf296ec, 0x87683f4e, 0xeb4caf8a,
+ 0xacbfdd77, 0xf468e15f, 0x46c969ee}}},
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086,
+ 0x105eafd8, 0xa1e0d7df, 0x0a30ae43} // x
+ },
+ {0x636131c7, 0x362d4135, 0xa707879b, 0xa16567fd, 0xe07cc68e, 0x05d64356,
+ 0x6d47090b, 0x4840b56c} // f
+ };
+ EXPECT_TRUE(PrivKeyIsInRange(&input));
+}
+
+TEST_F(EpidMemberTest, PrivKeyIsInRangeRangeFails) {
+ NativePrivKey const input = {
+ {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xAED33013, 0xD3292DDB, 0x12980A82, 0x0CDC65FB, 0xEE71A49F,
+ 0x46E5F25E, 0xFFFCF0CD, 0xFFFFFFFF}}}, //< q
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086,
+ 0x105eafd8, 0xa1e0d7df, 0x0a30ae43} // x
+ },
+ {0x636131c7, 0x362d4135, 0xa707879b, 0xa16567fd, 0xe07cc68e, 0x05d64356,
+ 0x6d47090b, 0x4840b56c} // f
+ };
+ EXPECT_FALSE(PrivKeyIsInRange(&input));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// PrivKeyIsInGroup Tests
+TEST_F(EpidMemberTest, PrivKeyIsInGroupPasses) {
+ PairingState pairing_state;
+ PairingInit(&pairing_state);
+ NativePrivKey const input = {
+ {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0x196254db, 0x570890e8, 0xdaf296ec, 0x87683f4e, 0xeb4caf8a,
+ 0xacbfdd77, 0xf468e15f, 0x46c969ee}}},
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086,
+ 0x105eafd8, 0xa1e0d7df, 0x0a30ae43} // x
+ },
+ {0x636131c7, 0x362d4135, 0xa707879b, 0xa16567fd, 0xe07cc68e, 0x05d64356,
+ 0x6d47090b, 0x4840b56c} // f
+ };
+ NativeGroupPubKey const pubkey = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb580e099, 0x434c62fd, 0x64cee3ce, 0xd06d8f9d, 0x7e27b0cb,
+ 0x3d753d61, 0xe21b17eb, 0xb36fff81}}},
+ {{{0x74f459ee, 0xd8693ea1, 0x82457e7f, 0xee3d6642, 0xe94dae9c,
+ 0xfdb5b79d, 0xe08859a4, 0x3a075680}}}}, // h1
+ {{{{0xbcdd7fe1, 0x29666163, 0xd55ba704, 0xdc99ed42, 0x5474107b,
+ 0xd5dbca1c, 0x63c2518e, 0xd2742e9f}}},
+ {{{0xe78e1084, 0x93a56ecc, 0xde4ceacb, 0xda3f517d, 0xe85b087b,
+ 0x48120aa6, 0xe314ac72, 0x765dc06e}}}}, // h2
+ {{{{{0x0728e896, 0x8dcd3688, 0x6a95cac6, 0x788753f6, 0x401ba5b6,
+ 0x50719451, 0xe20fca1c, 0xbd195a95}}},
+ {{{0xe2f4b3a1, 0x22d9fde0, 0x0f6c56f5, 0x2414cfd1, 0x15d775f8,
+ 0xa6657a68, 0xb86ae7e5, 0xca78115b}}}},
+ {{{{0x57e4f33c, 0x0a3b5896, 0x89c2399c, 0x898846dd, 0x5deef56a,
+ 0xbc077230, 0xe8b3c725, 0x9021a7e0}}},
+ {{{0xee1140a9, 0x837d3e31, 0x8e25c6ad, 0xba6bf0da, 0x1f3deaa2,
+ 0x5d0a88db, 0x1bb6f705, 0x79516936}}}}}};
+ EXPECT_TRUE(PrivKeyIsInGroup(&input, &pubkey, &pairing_state));
+}
+
+TEST_F(EpidMemberTest, PrivKeyIsInGroupFails) {
+ PairingState pairing_state;
+ PairingInit(&pairing_state);
+ NativePrivKey const input = {
+ {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02}, // group id
+ {{{{0x196254db, 0x570890e8, 0xdaf296ec, 0x87683f4e, 0xeb4caf8a,
+ 0xacbfdd77, 0xf468e15f, 0x46c969ee}}},
+ {{{0x82803777, 0x16249880, 0xffa64ba8, 0xae43de62, 0x0acf364f,
+ 0x9a1b8aad, 0x91e4a81d, 0x1e522316}}}}, // A
+ {0x1372c377, 0x00147c6b, 0x46ddb71b, 0xd09db9e4, 0x5a611086,
+ 0x105eafd8, 0xa1e0d7df, 0x0a30ae43} // x
+ },
+ {0x636131c7, 0x362d4135, 0xa707879b, 0xa16567fd, 0xe07cc68e, 0x05d64356,
+ 0x6d47090b, 0x4840b56c} // f
+ };
+ NativeGroupPubKey const pubkey = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01}, // group id
+ {{{{0xb580e099, 0x434c62fd, 0x64cee3ce, 0xd06d8f9d, 0x7e27b0cb,
+ 0x3d753d61, 0xe21b17eb, 0xb36fff81}}},
+ {{{0x74f459ee, 0xd8693ea1, 0x82457e7f, 0xee3d6642, 0xe94dae9c,
+ 0xfdb5b79d, 0xe08859a4, 0x3a075680}}}}, // h1
+ {{{{0xbcdd7fe1, 0x29666163, 0xd55ba704, 0xdc99ed42, 0x5474107b,
+ 0xd5dbca1c, 0x63c2518e, 0xd2742e9f}}},
+ {{{0xe78e1084, 0x93a56ecc, 0xde4ceacb, 0xda3f517d, 0xe85b087b,
+ 0x48120aa6, 0xe314ac72, 0x765dc06e}}}}, // h2
+ {{{{{0x0728e896, 0x8dcd3688, 0x6a95cac6, 0x788753f6, 0x401ba5b6,
+ 0x50719451, 0xe20fca1c, 0xbd195a95}}},
+ {{{0xe2f4b3a1, 0x22d9fde0, 0x0f6c56f5, 0x2414cfd1, 0x15d775f8,
+ 0xa6657a68, 0xb86ae7e5, 0xca78115b}}}},
+ {{{{0x57e4f33c, 0x0a3b5896, 0x89c2399c, 0x898846dd, 0x5deef56a,
+ 0xbc077230, 0xe8b3c725, 0x9021a7e0}}},
+ {{{0xee1140a9, 0x837d3e31, 0x8e25c6ad, 0xba6bf0da, 0x1f3deaa2,
+ 0x5d0a88db, 0x1bb6f705, 0x79516936}}}}}};
+ EXPECT_FALSE(PrivKeyIsInGroup(&input, &pubkey, &pairing_state));
+}
+
+} // namespace
+
+#endif // SHARED
diff --git a/epid/member/tiny/unittests/join_request-test.cc b/epid/member/tiny/unittests/join_request-test.cc
new file mode 100644
index 0000000..9d45d8d
--- /dev/null
+++ b/epid/member/tiny/unittests/join_request-test.cc
@@ -0,0 +1,369 @@
+/*############################################################################
+ # 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/tiny/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, kSha512));
+ 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, CreateJoinRequestFailsGivenNoF) {
+ 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, kSha512));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidCreateJoinRequest(ctx, &pub_key, &ni, &join_request));
+}
+
+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, kSha512));
+ 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;
+ 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);
+
+ std::unique_ptr<uint8_t[]> member;
+ size_t context_size = 0;
+ sts = EpidMemberGetSize(&params, &context_size);
+ EXPECT_TRUE(kEpidNoErr == sts || kEpidBadArgErr == sts)
+ << "Actual value " << sts;
+
+ if (kEpidNoErr == sts) {
+ member.reset(new uint8_t[context_size]());
+ sts = EpidMemberInit(&params, (MemberCtx*)member.get());
+ EXPECT_TRUE(kEpidNoErr == sts || kEpidBadArgErr == sts)
+ << "Actual value " << sts;
+ }
+
+ if (kEpidNoErr == sts) {
+ sts = EpidCreateJoinRequest((MemberCtx*)member.get(), &pub_key, &ni,
+ &join_request);
+ EXPECT_EQ(kEpidBadArgErr, sts);
+ }
+
+ EpidMemberDeinit((MemberCtx*)member.get());
+}
+
+TEST_F(EpidMemberTest, CreateJoinRequestWorksUsingSha512) {
+ 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, kSha512));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request, kSha512, pub_key, f, ni));
+}
+
+TEST_F(EpidMemberTest, CreateJoinRequestWorksUsingSha256) {
+ 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,
+ 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, kSha512));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request1));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request1, kSha512, pub_key, f, ni));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, &pub_key, &ni, &join_request2));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request2, kSha512, pub_key, f, 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, kSha512));
+ prng.set_seed(0x1234);
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member2, &pub_key, &ni, &join_request2));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request2, kSha512, 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, kSha512));
+ EXPECT_EQ(kEpidNoErr,
+ EpidCreateJoinRequest(member, pub_key, &ni, &join_request));
+ EXPECT_NO_FATAL_FAILURE(
+ ValidateJoinRequest(join_request, kSha512, *pub_key, f, ni));
+}
+} // namespace
diff --git a/epid/member/tiny/unittests/main-testhelper.cc b/epid/member/tiny/unittests/main-testhelper.cc
new file mode 100644
index 0000000..2ea1d21
--- /dev/null
+++ b/epid/member/tiny/unittests/main-testhelper.cc
@@ -0,0 +1,24 @@
+/*############################################################################
+ # 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 tiny member unit tests
+/*! \file */
+
+#include <gtest/gtest.h>
+
+int main(int argc, char* argv[]) {
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/epid/member/tiny/unittests/member-testhelper.cc b/epid/member/tiny/unittests/member-testhelper.cc
new file mode 100644
index 0000000..870b29c
--- /dev/null
+++ b/epid/member/tiny/unittests/member-testhelper.cc
@@ -0,0 +1,468 @@
+/*############################################################################
+ # 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 EpidMemberTest test fixture implementation.
+ */
+
+#include "epid/member/tiny/unittests/member-testhelper.h"
+
+#include <cstdio>
+#include <cstring>
+#include <string>
+
+extern "C" {
+#include "epid/common/types.h"
+#include "epid/member/tiny/src/native_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));
+}
+
+/// Arbitrary test data were generated based on Intel(R) EPID 2.0 parameters
+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
+};
+
+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
+};
+
+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
+ {
+ 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 NativeBasicSignature EpidMemberTest::kBasicSig = {
+ // B
+ {{0xD2E7034F, 0xDE132705, 0x532E403A, 0x9D6C5CAB, 0x6AA4231B, 0x16C48B8A,
+ 0x3784FC01, 0x1A4456B3},
+ {0xD0BB1EEC, 0x417952E2, 0x71755350, 0xE39B1B6F, 0x10ABCD80, 0x89EAF58F,
+ 0xE68604BC, 0x1F308883}},
+ // K
+ {{0x7BA80706, 0x3A0326CB, 0xBFB2C975, 0xF362D12D, 0xBD15EC31, 0x832BB024,
+ 0x583ED765, 0x6F6C3E01},
+ {0xFBEDFF07, 0x4450A702, 0xB80EAC00, 0x6B2E31AE, 0xE49B1639, 0xC7E70FED,
+ 0x2FEC671D, 0x923A7258}},
+ // T
+ {{0x931C950D, 0xEF075B6B, 0x126CB51A, 0x6278696A, 0xB5BEE13B, 0x2D682765,
+ 0xA9C2B37D, 0xCDECCBBA},
+ {0xE8953E8D, 0x151E3984, 0x276EC430, 0x33327946, 0x7F32E500, 0x07C3D873,
+ 0x27E7E4D3, 0xFA0A9ED2}},
+ // c
+ {0x2FDCAC88, 0x432C5EC5, 0x532F10A9, 0x5FE27AF0, 0xEE0657AB, 0x97884AF7,
+ 0x0897633B, 0xE5C33EEF},
+ // sx
+ {0x86639266, 0x80D60A98, 0x80AB6BB6, 0x87066083, 0x9D029C65, 0xD7550AE6,
+ 0x94D81487, 0xD9FDF300},
+ // sf
+ {0xCD23A7BC, 0x2C2F28D5, 0xDCC46E40, 0x951B6719, 0x988B676D, 0xD7DC015A,
+ 0xEBBEA941, 0xAAEFA83A},
+ // sa
+ {0xB706055E, 0xA1280802, 0xE9EB52AF, 0x1D147522, 0x952A12B2, 0x7744D263,
+ 0x76E80259, 0x55422EA1},
+ // sb
+ {0xF8EE5D60, 0xDB85B38E, 0xD57C2B9F, 0x3F0A58C0, 0x3A0AB12C, 0xB9971C02,
+ 0x69E22FF7, 0xBAAF3219}};
+
+const std::vector<uint8_t> EpidMemberTest::kGroupPublicKeyDataIkgf = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/pubkey.inc"
+};
+const std::vector<uint8_t> EpidMemberTest::kMemberPrivateKeyDataIkgf = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/member0/mprivkey.inc"
+};
+
+const std::vector<uint8_t> EpidMemberTest::kGrp01Member0SigTest1Sha256 = {
+#include "epid/common-testhelper/testdata/grp01/member0/sig_test1_sha256.inc"
+};
+const std::vector<uint8_t> EpidMemberTest::kGrp01Member0SigTest1Sha384 = {
+#include "epid/common-testhelper/testdata/grp01/member0/sig_test1_sha384.inc"
+};
+const std::vector<uint8_t> EpidMemberTest::kGrp01Member0SigTest1Sha512 = {
+#include "epid/common-testhelper/testdata/grp01/member0/sig_test1_sha512.inc"
+};
+const std::vector<uint8_t> EpidMemberTest::kTest1Msg = {'t', 'e', 's', 't',
+ '1'};
+std::vector<uint8_t> EpidMemberTest::kSigRlData = {
+#include "epid/common-testhelper/testdata/grp01/sigrl.inc"
+};
+std::vector<uint8_t> EpidMemberTest::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};
+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"
+};
+const PrivKey EpidMemberTest::kGrpXMember0PrivKey = {
+#include "epid/common-testhelper/testdata/grp_x/member0/mprivkey.inc"
+};
+const PrivKey EpidMemberTest::kGrpXSigrevokedMember0PrivKey = {
+#include "epid/common-testhelper/testdata/grp_x/sigrevoked/mprivatekey000.inc"
+};
+const std::vector<uint8_t> EpidMemberTest::kGrpXSigRl = {
+#include "epid/common-testhelper/testdata/grp_x/sigrl.inc"
+};
+const std::vector<uint8_t> EpidMemberTest::kGrpXSigRlSingleEntry = {
+#include "epid/common-testhelper/testdata/grp_x/sigrl_single_entry.inc"
+};
+
+const CompressedPrivKey EpidMemberTest::kGrpXMember9CompressedKey = {
+#include "epid/common-testhelper/testdata/grp_x/cmember9/cmpprivkey.inc"
+};
+const PrivKey EpidMemberTest::kGrpXMember9PrivKey = {
+#include "epid/common-testhelper/testdata/grp_x/cmember9/mprivkey.inc"
+};
+
+const GroupPubKey EpidMemberTest::kGrpYKey = {
+#include "epid/common-testhelper/testdata/grp_y/pubkey.inc"
+};
+
+const CompressedPrivKey EpidMemberTest::kGrpYMember9CompressedKey = {
+#include "epid/common-testhelper/testdata/grp_y/cmember9/cmpprivkey.inc"
+};
+
+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/tiny/unittests/member-testhelper.h b/epid/member/tiny/unittests/member-testhelper.h
new file mode 100644
index 0000000..b9c38c9
--- /dev/null
+++ b/epid/member/tiny/unittests/member-testhelper.h
@@ -0,0 +1,119 @@
+/*############################################################################
+ # 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 EpidMemberTest test fixture.
+ */
+#ifndef EPID_MEMBER_TINY_UNITTESTS_MEMBER_TESTHELPER_H_
+#define EPID_MEMBER_TINY_UNITTESTS_MEMBER_TESTHELPER_H_
+
+#include <stdint.h>
+#include <vector>
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/common-testhelper/member_wrapper-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/api.h"
+}
+
+typedef struct G1ElemStr G1ElemStr;
+typedef struct NativeBasicSignature NativeBasicSignature;
+
+/// 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);
+
+/// Test fixture class for EpidMember
+class EpidMemberTest : public ::testing::Test {
+ public:
+ /// test data
+ static const GroupPubKey kGroupPublicKey;
+ /// test data
+ static const PrivKey kMemberPrivateKey;
+ /// test data
+ static const std::vector<uint8_t> kGroupPublicKeyDataIkgf;
+ /// test data
+ static const std::vector<uint8_t> kMemberPrivateKeyDataIkgf;
+ /// test data
+ static const MemberPrecomp kMemberPrecomp;
+ /// test data
+ static const std::vector<uint8_t> kGrp01Member0SigTest1Sha256;
+ /// test data
+ static const NativeBasicSignature kBasicSig;
+ /// test data
+ static const std::vector<uint8_t> kGrp01Member0SigTest1Sha384;
+ /// test data
+ static const std::vector<uint8_t> kGrp01Member0SigTest1Sha512;
+ /// test data
+ static const std::vector<uint8_t> kTest1Msg;
+ /// signature based revocation list with 50 entries
+ static std::vector<uint8_t> kSigRlData;
+ /// signature based revocation list with 5 entries
+ static std::vector<uint8_t> kSigRl5EntryData;
+ /// a message
+ static const std::vector<uint8_t> kMsg0;
+ /// a message
+ static const std::vector<uint8_t> kMsg1;
+ /// a basename
+ 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
+ static const PrivKey kGrpXMember0PrivKey;
+ /// a member private key in group X revoked in SigRl
+ static const PrivKey kGrpXSigrevokedMember0PrivKey;
+ /// a SigRl of group X
+ static const std::vector<uint8_t> kGrpXSigRl;
+ /// a SigRl with single entry of group X
+ static const std::vector<uint8_t> kGrpXSigRlSingleEntry;
+ /// a compressed private key in group X
+ static const CompressedPrivKey kGrpXMember9CompressedKey;
+ /// a private key in group X
+ static const PrivKey kGrpXMember9PrivKey;
+
+ /// a group key in group Y
+ static const GroupPubKey kGrpYKey;
+ /// a compressed private key in group Y
+ static const CompressedPrivKey kGrpYMember9CompressedKey;
+
+ /// 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
+ virtual void TearDown() {}
+};
+
+#endif // EPID_MEMBER_TINY_UNITTESTS_MEMBER_TESTHELPER_H_
diff --git a/epid/member/tiny/unittests/presig-test.cc b/epid/member/tiny/unittests/presig-test.cc
new file mode 100644
index 0000000..4e1f538
--- /dev/null
+++ b/epid/member/tiny/unittests/presig-test.cc
@@ -0,0 +1,117 @@
+/*############################################################################
+ # 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 ComputePreSig unit tests.
+ */
+#include <algorithm>
+#include <cstring>
+#include <limits>
+#include <vector>
+
+#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "gtest/gtest.h"
+
+extern "C" {
+#include "epid/member/api.h"
+}
+
+#include "epid/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/member/tiny/unittests/member-testhelper.h"
+
+/// Count of elements in array
+#define COUNT_OF(A) (sizeof(A) / sizeof((A)[0]))
+
+namespace {
+
+///////////////////////////////////////////////////////////////////////
+// EpidAddPreSigs
+TEST_F(EpidMemberTest, DISABLED_AddPreSigsFailsGivenNullPointer) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ EXPECT_EQ(kEpidBadArgErr, EpidAddPreSigs(nullptr, 1));
+}
+
+TEST_F(EpidMemberTest, DISABLED_AddPreSigsFailsGivenHugeNumberOfPreSigs) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ // number_presigs = 0x80..01 of size equal to sizeof(size_t)
+ EXPECT_NE(kEpidNoErr, EpidAddPreSigs(member, (SIZE_MAX >> 1) + 2));
+}
+
+TEST_F(EpidMemberTest,
+ DISABLED_AddPreSigsComputesSpecifiedNumberOfPresigsIfInputPresigsNull) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ ASSERT_EQ(kEpidNoErr, EpidAddPreSigs(member, 2));
+ ASSERT_EQ(kEpidNoErr, EpidAddPreSigs(member, 1));
+ // request to generate 0 pre-computed signatures do nothing
+ ASSERT_EQ(kEpidNoErr, EpidAddPreSigs(member, 0));
+ EXPECT_EQ((size_t)3, EpidGetNumPreSigs(member));
+}
+
+TEST_F(EpidMemberTest,
+ DISABLED_AddPreSigsAddsCorrectNumberOfPresigsGivenValidInput) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ const size_t presigs1_added = 2;
+ const size_t presigs2_added = 3;
+
+ // add
+ ASSERT_EQ(kEpidNoErr, EpidAddPreSigs(member, presigs1_added));
+ // extend
+ ASSERT_EQ(kEpidNoErr, EpidAddPreSigs(member, presigs2_added));
+ // add empty pre-computed signatures array does not affect internal pool
+ ASSERT_EQ(kEpidNoErr, EpidAddPreSigs(member, 0));
+ EXPECT_EQ(presigs1_added + presigs2_added, EpidGetNumPreSigs(member));
+}
+
+///////////////////////////////////////////////////////////////////////
+// EpidGetNumPreSigs
+TEST_F(EpidMemberTest, DISABLED_GetNumPreSigsReturnsZeroGivenNullptr) {
+ EXPECT_EQ((size_t)0, EpidGetNumPreSigs(nullptr));
+}
+
+TEST_F(EpidMemberTest, DISABLED_NumPreSigsForNewleyCreatedContextIsZero) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ EXPECT_EQ((size_t)0, EpidGetNumPreSigs(member));
+}
+
+TEST_F(EpidMemberTest, DISABLED_GetNumPreSigsReturnsNumberOfAddedPresigs) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+
+ const size_t presigs_added = 5;
+
+ THROW_ON_EPIDERR(EpidAddPreSigs(member, presigs_added));
+ EXPECT_EQ(presigs_added, EpidGetNumPreSigs(member));
+}
+
+} // namespace
diff --git a/epid/member/tiny/unittests/provision_compressed-test.cc b/epid/member/tiny/unittests/provision_compressed-test.cc
new file mode 100644
index 0000000..7df36ec
--- /dev/null
+++ b/epid/member/tiny/unittests/provision_compressed-test.cc
@@ -0,0 +1,176 @@
+/*############################################################################
+ # 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/tiny/unittests/member-testhelper.h"
+
+extern "C" {
+#include "epid/member/api.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, DISABLED_ProvisionCompressedFailsGivenNullParameters) {
+ 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);
+ MemberCtxObj member(&params);
+ 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));
+}
+
+TEST_F(EpidMemberTest,
+ DISABLED_ProvisionCompressedSucceedsGivenValidParameters) {
+ 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);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionCompressed(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionCompressed(member, &pub_key, &priv_key, nullptr));
+}
+
+TEST_F(EpidMemberTest, DISABLED_ProvisionCompressedFailsForInvalidGroupPubKey) {
+ 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);
+ MemberCtxObj member(&params);
+
+ 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));
+}
+
+TEST_F(EpidMemberTest, DISABLED_ProvisionCompressedFailsForInvalidPrivateKey) {
+ 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);
+ MemberCtxObj member(&params);
+
+ 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));
+}
+
+} // namespace
diff --git a/epid/member/tiny/unittests/provision_credential-test.cc b/epid/member/tiny/unittests/provision_credential-test.cc
new file mode 100644
index 0000000..67167aa
--- /dev/null
+++ b/epid/member/tiny/unittests/provision_credential-test.cc
@@ -0,0 +1,317 @@
+/*############################################################################
+# 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/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/tiny/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) {
+ 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);
+ MemberCtxObj member(&params);
+ 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));
+}
+
+TEST_F(EpidMemberTest, ProvisionCredentialRejectsInvalidCredential) {
+ 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);
+ MemberCtxObj member(&params);
+
+ 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));
+}
+
+TEST_F(EpidMemberTest, ProvisionCredentialRejectsInvalidGroupKey) {
+ 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);
+ MemberCtxObj member(&params);
+
+ 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));
+}
+
+TEST_F(EpidMemberTest, ProvisionCredentialRejectsCredentialNotInGroup) {
+ 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);
+ MemberCtxObj member(&params);
+
+ 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));
+}
+
+TEST_F(EpidMemberTest, CanProvisionUsingMembershipCredentialPrecomp) {
+ 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);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, &precomp));
+}
+
+TEST_F(EpidMemberTest, CanProvisionUsingMembershipCredentialNoPrecomp) {
+ 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);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, &pub_key,
+ &credential, nullptr));
+}
+
+// test that create succeeds with valid IKGF given parameters
+TEST_F(EpidMemberTest, CanProvisionUsingIKGFMembershipCredentialPrecomp) {
+ 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);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, pub_key,
+ &credential, &precomp));
+}
+
+TEST_F(EpidMemberTest, CanProvisionUsingIKGFMembershipCredentialNoPrecomp) {
+ 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);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr,
+ ProvisionCredentialAndStart(member, pub_key, &credential, nullptr));
+}
+
+TEST_F(EpidMemberTest,
+ DISABLED_ProvisionCredentialCanStoreMembershipCredentialNoPrecomp) {
+ Prng prng;
+ MembershipCredential const orig_credential =
+ *(MembershipCredential*)&this->kGrpXMember9PrivKey;
+
+ GroupPubKey pub_key = this->kGrpXKey;
+ FpElemStr f = this->kGrpXMember9PrivKey.f;
+
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &f, &params);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, &pub_key,
+ &orig_credential, nullptr));
+
+ FAIL() << "todo(developer): implement verification that credentials are "
+ "provisioned";
+ // MembershipCredential credential;
+ // uint32_t nv_index = 0x01c10100;
+ // EXPECT_EQ(kEpidNoErr, EpidNvReadMembershipCredential(
+ // member->tpm2_ctx, nv_index, &pub_key,
+ // &credential));
+ // EXPECT_EQ(orig_credential, credential);
+}
+
+} // namespace
diff --git a/epid/member/tiny/unittests/provision_key-test.cc b/epid/member/tiny/unittests/provision_key-test.cc
new file mode 100644
index 0000000..c8a692b
--- /dev/null
+++ b/epid/member/tiny/unittests/provision_key-test.cc
@@ -0,0 +1,243 @@
+/*############################################################################
+ # 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/tiny/unittests/member-testhelper.h"
+
+extern "C" {
+#include "epid/member/api.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) {
+ 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);
+ MemberCtxObj member(&params);
+ 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));
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkSucceedsGivenValidParameters) {
+ 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);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionKey(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidNoErr, EpidProvisionKey(member, &pub_key, &priv_key, nullptr));
+}
+
+// test that create succeeds with valid IKGF given parameters
+TEST_F(EpidMemberTest, ProvisionBulkSucceedsGivenValidParametersUsingIKGFData) {
+ 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);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr,
+ EpidProvisionKey(member, &pub_key, &priv_key, &precomp));
+ EXPECT_EQ(kEpidNoErr, EpidProvisionKey(member, &pub_key, &priv_key, nullptr));
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidGroupPubKey) {
+ 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);
+ MemberCtxObj member(&params);
+
+ 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));
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidF) {
+ 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);
+ MemberCtxObj member(&params);
+
+ 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));
+}
+
+TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidPrivateKey) {
+ 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);
+ MemberCtxObj member(&params);
+
+ 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));
+}
+
+TEST_F(EpidMemberTest, DISABLED_ProvisionBulkCanStoreMembershipCredential) {
+ Prng prng;
+ GroupPubKey pub_key = this->kGroupPublicKey;
+ PrivKey priv_key = this->kMemberPrivateKey;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &prng, &priv_key.f, &params);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr,
+ ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
+
+ FAIL() << "todo(developer): implement verification that credentials are "
+ "provisioned";
+ // uint32_t nv_index = 0x01c10100;
+ // MembershipCredential credential;
+ // MembershipCredential const orig_credential{ priv_key.gid, priv_key.A,
+ // priv_key.x };
+ // EXPECT_EQ(kEpidNoErr, EpidNvReadMembershipCredential(
+ // member->tpm2_ctx, nv_index, &pub_key,
+ // &credential));
+ // EXPECT_EQ(orig_credential, credential);
+}
+
+} // namespace
diff --git a/epid/member/tiny/unittests/sign-test.cc b/epid/member/tiny/unittests/sign-test.cc
new file mode 100644
index 0000000..542a80d
--- /dev/null
+++ b/epid/member/tiny/unittests/sign-test.cc
@@ -0,0 +1,1082 @@
+/*############################################################################
+ # 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 Sign unit tests.
+ */
+#include <vector>
+
+#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/common-testhelper/errors-testhelper.h"
+#include "epid/common-testhelper/prng-testhelper.h"
+#include "epid/common-testhelper/verifier_wrapper-testhelper.h"
+#include "epid/member/tiny/unittests/member-testhelper.h"
+namespace {
+
+/// Count of elements in array
+#define COUNT_OF(A) (sizeof(A) / sizeof((A)[0]))
+
+/////////////////////////////////////////////////////////////////////////
+// Simple error cases
+
+TEST_F(EpidMemberTest, SignFailsGivenNullParameters) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ std::vector<uint8_t> sig(EpidGetSigSize(&srl));
+ THROW_ON_EPIDERR(
+ EpidMemberSetSigRl(member, &srl, sizeof(srl) - sizeof(srl.bk)));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSign(nullptr, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig.data(), sig.size()));
+ EXPECT_EQ(kEpidBadArgErr, EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), nullptr, sig.size()));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSign(member, nullptr, msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig.data(), sig.size()));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, bsn.size(),
+ (EpidSignature*)sig.data(), sig.size()));
+}
+
+TEST_F(EpidMemberTest, SignFailsGivenNonZeroMessageLenWithNullMessage) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ std::vector<uint8_t> sig(EpidGetSigSize(&srl));
+ THROW_ON_EPIDERR(
+ EpidMemberSetSigRl(member, &srl, sizeof(srl) - sizeof(srl.bk)));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSign(member, nullptr, msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig.data(), sig.size()));
+}
+
+TEST_F(EpidMemberTest, SignFailsGivenNonZeroBasenameLenWithNullBasename) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ std::vector<uint8_t> sig(EpidGetSigSize(&srl));
+ THROW_ON_EPIDERR(
+ EpidMemberSetSigRl(member, &srl, sizeof(srl) - sizeof(srl.bk)));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, bsn.size(),
+ (EpidSignature*)sig.data(), sig.size()));
+}
+TEST_F(EpidMemberTest, SignFailsGivenWrongSigLen) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ THROW_ON_EPIDERR(
+ EpidMemberSetSigRl(member, &srl, sizeof(srl) - sizeof(srl.bk)));
+
+ // signature buffer one byte less than needed
+ std::vector<uint8_t> sig_small(EpidGetSigSize(&srl) - 1);
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSign(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig_small.data(), sig_small.size()));
+
+ // signature buffer is one byte - a less than allowed for EpidSignature
+ std::vector<uint8_t> sig_one(1);
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSign(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig_one.data(), sig_one.size()));
+}
+
+TEST_F(EpidMemberTest, SignFailsGivenUnregisteredBasename) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ auto& bsn1 = this->kBsn1;
+ SigRl srl = {{{0}}, {{0}}, {{0}}, {{{{0}, {0}}, {{0}, {0}}}}};
+ srl.gid = this->kGroupPublicKey.gid;
+ std::vector<uint8_t> sig(EpidGetSigSize(&srl));
+ THROW_ON_EPIDERR(
+ EpidMemberSetSigRl(member, &srl, sizeof(srl) - sizeof(srl.bk)));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidBadArgErr,
+ EpidSign(member, msg.data(), msg.size(), bsn1.data(), bsn1.size(),
+ (EpidSignature*)sig.data(), sig.size()));
+}
+TEST_F(EpidMemberTest, SignsFailsIfNotProvisioned) {
+ Prng my_prng;
+ MemberCtxObj member(&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(kEpidOutOfSequenceError,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+}
+/////////////////////////////////////////////////////////////////////////
+// Anonymity
+
+TEST_F(EpidMemberTest, SignaturesOfSameMessageAreDifferent) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ std::vector<uint8_t> sig1(EpidGetSigSize(nullptr));
+ std::vector<uint8_t> sig2(EpidGetSigSize(nullptr));
+ // without signature based revocation list
+ EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), msg.size(), nullptr, 0,
+ (EpidSignature*)sig1.data(), sig1.size()));
+ EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), msg.size(), nullptr, 0,
+ (EpidSignature*)sig2.data(), sig2.size()));
+ EXPECT_TRUE(sig1.size() == sig2.size() &&
+ 0 != memcmp(sig1.data(), sig2.data(), sig1.size()));
+ // with signature based revocation list
+ uint8_t sig_rl_data_n2_one[] = {
+ // gid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ // version
+ 0x00, 0x00, 0x00, 0x00,
+ // n2
+ 0x0, 0x00, 0x00, 0x01,
+ // one bk
+ 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};
+ SigRl* srl1 = reinterpret_cast<SigRl*>(sig_rl_data_n2_one);
+ size_t srl1_size = sizeof(sig_rl_data_n2_one);
+ std::vector<uint8_t> sig3(EpidGetSigSize(srl1));
+ std::vector<uint8_t> sig4(EpidGetSigSize(srl1));
+ THROW_ON_EPIDERR(EpidMemberSetSigRl(member, srl1, srl1_size));
+ EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), msg.size(), nullptr, 0,
+ (EpidSignature*)sig3.data(), sig3.size()));
+ EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), msg.size(), nullptr, 0,
+ (EpidSignature*)sig4.data(), sig4.size()));
+ EXPECT_TRUE(sig3.size() == sig4.size() &&
+ 0 != memcmp(sig3.data(), sig4.data(), sig3.size()));
+}
+TEST_F(EpidMemberTest, SignaturesOfSameMessageWithSameBasenameAreDifferent) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ std::vector<uint8_t> sig1(EpidGetSigSize(nullptr));
+ std::vector<uint8_t> sig2(EpidGetSigSize(nullptr));
+ // without signature based revocation list
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig1.data(), sig1.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig2.data(), sig2.size()));
+ EXPECT_TRUE(sig1.size() == sig2.size() &&
+ 0 != memcmp(sig1.data(), sig2.data(), sig1.size()));
+
+ // with signature based revocation list
+ uint8_t sig_rl_data_n2_one[] = {
+ // gid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ // version
+ 0x00, 0x00, 0x00, 0x00,
+ // n2
+ 0x0, 0x00, 0x00, 0x01,
+ // one bk
+ 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};
+ SigRl* srl1 = reinterpret_cast<SigRl*>(sig_rl_data_n2_one);
+ size_t srl1_size = sizeof(sig_rl_data_n2_one);
+ std::vector<uint8_t> sig3(EpidGetSigSize(srl1));
+ std::vector<uint8_t> sig4(EpidGetSigSize(srl1));
+ THROW_ON_EPIDERR(EpidMemberSetSigRl(member, srl1, srl1_size));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig3.data(), sig3.size()));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
+ (EpidSignature*)sig4.data(), sig4.size()));
+ EXPECT_TRUE(sig3.size() == sig4.size() &&
+ 0 != memcmp(sig3.data(), sig4.data(), sig3.size()));
+}
+
+/////////////////////////////////////////////////////////////////////////
+// Variable basename
+
+TEST_F(EpidMemberTest, SignsMessageUsingRandomBaseNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ 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);
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+TEST_F(EpidMemberTest, SignsMessageUsingRandomBaseWithSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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(), nullptr, 0, sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageUsingBasenameNoSigRl) {
+ Prng my_prng;
+ 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);
+ EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), sig, sig_len));
+ // verify basic signature
+ 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()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageUsingBasenameWithSigRl) {
+ Prng my_prng;
+ 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()));
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetBasename(ctx, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsUsingRandomBaseWithRegisteredBasenamesNoSigRl) {
+ Prng my_prng;
+ 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);
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+TEST_F(EpidMemberTest, SignsUsingRandomBaseWithRegisteredBasenamesWithSigRl) {
+ Prng my_prng;
+ 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()));
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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(), nullptr, 0, sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsUsingRandomBaseWithoutRegisteredBasenamesNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ 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);
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+TEST_F(EpidMemberTest,
+ SignsUsingRandomBaseWithoutRegisteredBasenamesWithSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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(), nullptr, 0, sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ 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
+
+TEST_F(EpidMemberTest, SignsMessageGivenNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+
+ size_t sig_len = EpidGetSigSize(nullptr);
+ std::vector<uint8_t> newsig(sig_len);
+ EpidSignature* sig = (EpidSignature*)newsig.data();
+
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+TEST_F(EpidMemberTest, SignsMessageGivenNoSigRlUsingIKGFData) {
+ GroupPubKey grp_public_key = *reinterpret_cast<const GroupPubKey*>(
+ this->kGroupPublicKeyDataIkgf.data());
+ PrivKey mbr_private_key =
+ *reinterpret_cast<const PrivKey*>(this->kMemberPrivateKeyDataIkgf.data());
+ Prng my_prng;
+ auto& msg = this->kMsg0;
+
+ size_t sig_len = EpidGetSigSize(nullptr);
+ std::vector<uint8_t> newsig(sig_len);
+ // using ikgf keys
+ MemberCtxObj member(grp_public_key, mbr_private_key, &Prng::Generate,
+ &my_prng);
+ EpidSignature* sig = (EpidSignature*)newsig.data();
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(grp_public_key);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageGivenSigRlWithNoEntries) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+
+ uint8_t sig_rl_data_n2_zero[] = {
+ // gid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ // version
+ 0x00, 0x00, 0x00, 0x00,
+ // n2
+ 0x0, 0x00, 0x00, 0x00,
+ // not bk's
+ };
+ SigRl const* srl = reinterpret_cast<SigRl const*>(sig_rl_data_n2_zero);
+ size_t srl_size = sizeof(sig_rl_data_n2_zero);
+ 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(), nullptr, 0, sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageGivenSigRlWithNoEntriesUsingIkgfData) {
+ GroupPubKey grp_public_key = *reinterpret_cast<const GroupPubKey*>(
+ this->kGroupPublicKeyDataIkgf.data());
+ PrivKey mbr_private_key =
+ *reinterpret_cast<const PrivKey*>(this->kMemberPrivateKeyDataIkgf.data());
+ Prng my_prng;
+ auto& msg = this->kMsg0;
+ // using ikgf keys
+ MemberCtxObj member_ikgf(grp_public_key, mbr_private_key, &Prng::Generate,
+ &my_prng);
+ uint8_t sig_rl_data_n2_one_gid0[] = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/sigrl_empty.inc"
+ };
+ SigRl* srl_ikgf = reinterpret_cast<SigRl*>(sig_rl_data_n2_one_gid0);
+ size_t srl_size = sizeof(sig_rl_data_n2_one_gid0);
+ std::vector<uint8_t> sig_data_ikgf(EpidGetSigSize(srl_ikgf));
+ EpidSignature* sig_ikgf =
+ reinterpret_cast<EpidSignature*>(sig_data_ikgf.data());
+ size_t sig_len = sig_data_ikgf.size() * sizeof(uint8_t);
+ THROW_ON_EPIDERR(EpidMemberSetSigRl(member_ikgf, srl_ikgf, srl_size));
+ EXPECT_EQ(kEpidNoErr, EpidSign(member_ikgf, msg.data(), msg.size(), nullptr,
+ 0, sig_ikgf, sig_len));
+ VerifierCtxObj ctx_ikgf(grp_public_key);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx_ikgf, srl_ikgf, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx_ikgf, sig_ikgf, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageGivenSigRlWithEntries) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ uint8_t sig_rl_data_n2_one[] = {
+ // gid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ // version
+ 0x00, 0x00, 0x00, 0x00,
+ // n2
+ 0x0, 0x00, 0x00, 0x02,
+ // one bk
+ 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};
+ SigRl* srl = reinterpret_cast<SigRl*>(sig_rl_data_n2_one);
+ size_t srl_size = sizeof(sig_rl_data_n2_one);
+ 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(), nullptr, 0, sig, sig_len));
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageGivenSigRlWithEntriesUsingIKGFData) {
+ GroupPubKey grp_public_key = *reinterpret_cast<const GroupPubKey*>(
+ this->kGroupPublicKeyDataIkgf.data());
+ PrivKey mbr_private_key =
+ *reinterpret_cast<const PrivKey*>(this->kMemberPrivateKeyDataIkgf.data());
+ Prng my_prng;
+ auto& msg = this->kMsg0;
+ // using ikgf keys
+ MemberCtxObj member_ikgf(grp_public_key, mbr_private_key, &Prng::Generate,
+ &my_prng);
+ uint8_t sig_rl_data_n2_one_gid0[] = {
+ // gid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ // version
+ 0x00, 0x00, 0x00, 0x00,
+ // n2
+ 0x0, 0x00, 0x00, 0x02,
+ // one bk
+ 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};
+ SigRl* srl_ikgf = reinterpret_cast<SigRl*>(sig_rl_data_n2_one_gid0);
+ size_t srl_size = sizeof(sig_rl_data_n2_one_gid0);
+ std::vector<uint8_t> sig_data_ikgf(EpidGetSigSize(srl_ikgf));
+ EpidSignature* sig_ikgf =
+ reinterpret_cast<EpidSignature*>(sig_data_ikgf.data());
+ size_t sig_len = sig_data_ikgf.size() * sizeof(uint8_t);
+ THROW_ON_EPIDERR(EpidMemberSetSigRl(member_ikgf, srl_ikgf, srl_size));
+ EXPECT_EQ(kEpidNoErr, EpidSign(member_ikgf, msg.data(), msg.size(), nullptr,
+ 0, sig_ikgf, sig_len));
+ VerifierCtxObj ctx_ikgf(grp_public_key);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx_ikgf, srl_ikgf, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx_ikgf, sig_ikgf, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignMessageReportsIfMemberRevoked) {
+ // note: a complete sig + nr proof should still be returned!!
+ auto& pub_key = this->kGrpXKey;
+ auto& priv_key = this->kGrpXMember0PrivKey;
+ auto& msg = this->kMsg0;
+ Prng my_prng;
+ MemberCtxObj member(pub_key, priv_key, &Prng::Generate, &my_prng);
+ const std::vector<uint8_t> kGrpXSigRlMember0Sha512Rndbase0Msg0MiddleEntry = {
+#include "epid/common-testhelper/testdata/grp_x/sigrl_member0_sig_sha512_rndbase_msg0_revoked_middle_entry.inc"
+ };
+ auto srl = reinterpret_cast<SigRl const*>(
+ kGrpXSigRlMember0Sha512Rndbase0Msg0MiddleEntry.data());
+ size_t srl_size = kGrpXSigRlMember0Sha512Rndbase0Msg0MiddleEntry.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()));
+}
+
+TEST_F(EpidMemberTest, SignMessageReportsIfMemberRevokedUsingIKGFData) {
+ // note: a complete sig + nr proof should still be returned!!
+ GroupPubKey grp_public_key = *reinterpret_cast<const GroupPubKey*>(
+ this->kGroupPublicKeyDataIkgf.data());
+ const PrivKey member_private_key_revoked_by_sig = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/sigrevokedmember0/mprivkey.inc"
+ };
+ Prng my_prng;
+ MemberCtxObj member(grp_public_key, member_private_key_revoked_by_sig,
+ &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ const std::vector<uint8_t> sig_Rl = {
+#include "epid/common-testhelper/testdata/ikgf/groupa/sigrl.inc"
+ };
+ auto srl = reinterpret_cast<SigRl const*>(sig_Rl.data());
+ size_t srl_size = sig_Rl.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(grp_public_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, 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);
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, DISABLED_SignsMessageUsingSha384HashAlg) {
+ Prng my_prng;
+ 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);
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha384));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageUsingSha512HashAlg) {
+ Prng my_prng;
+ 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);
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha512));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, DISABLED_SignsMessageUsingSha512256HashAlg) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ 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);
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetHashAlg(ctx, kSha512_256));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+/////////////////////////////////////////////////////////////////////////
+// Variable precomputed signatures
+
+TEST_F(EpidMemberTest, DISABLED_SignConsumesPrecomputedSignaturesNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ THROW_ON_EPIDERR(EpidAddPreSigs(member, 3));
+ 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));
+ EXPECT_EQ((size_t)2, EpidGetNumPreSigs(member));
+}
+
+TEST_F(EpidMemberTest, DISABLED_SignConsumesPrecomputedSignaturesWithSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ THROW_ON_EPIDERR(EpidAddPreSigs(member, 3));
+ auto& msg = this->kMsg0;
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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(), nullptr, 0, sig, sig_len));
+ EXPECT_EQ((size_t)2, EpidGetNumPreSigs(member));
+}
+
+TEST_F(EpidMemberTest, DISABLED_SignsMessageWithPrecomputedSignaturesNoSigRl) {
+ 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;
+ 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 basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest,
+ DISABLED_SignsMessageWithPrecomputedSignaturesWithSigRl) {
+ 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;
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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(), nullptr, 0, sig, sig_len));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageWithoutPrecomputedSignaturesNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ 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);
+ // test sign without precomputed signatures
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+TEST_F(EpidMemberTest, SignsMessageWithoutPrecomputedSignaturesWithSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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));
+ // test sign without precomputed signatures
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()));
+}
+
+/////////////////////////////////////////////////////////////////////////
+// Variable messages
+
+TEST_F(EpidMemberTest, SignsEmptyMessageNoSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ auto& bsn = this->kBsn0;
+ 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(), 0, 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(), 0));
+}
+
+TEST_F(EpidMemberTest, SignsEmptyMessageWithSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ auto& msg = this->kMsg0;
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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(), 0, nullptr, 0, sig, sig_len));
+ // verify basic signature
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ EXPECT_EQ(kEpidSigValid, EpidVerify(ctx, sig, sig_len, msg.data(), 0));
+}
+
+TEST_F(EpidMemberTest, SignsShortMessageNoSigRl) {
+ // check: 1, 13, 128, 256, 512, 1021, 1024 bytes
+ // 13 and 1021 are primes
+ 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);
+ size_t lengths[] = {1, 13, 128, 256,
+ 512, 1021, 1024}; // have desired lengths to loop over
+ std::vector<uint8_t> msg(
+ lengths[COUNT_OF(lengths) - 1]); // allocate message for max size
+ for (size_t n = 0; n < msg.size(); n++) {
+ msg[n] = (uint8_t)n;
+ }
+ for (auto length : lengths) {
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), length, nullptr, 0, sig, sig_len))
+ << "EpidSign for message_len: " << length << " failed";
+ EXPECT_EQ(kEpidSigValid, EpidVerify(ctx, sig, sig_len, msg.data(), length))
+ << "EpidVerify for message_len: " << length << " failed";
+ }
+}
+
+TEST_F(EpidMemberTest, SignsShortMessageWithSigRl) {
+ // check: 1, 13, 128, 256, 512, 1021, 1024 bytes
+ // 13 and 1021 are primes
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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);
+ size_t message_len = 0;
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ size_t lengths[] = {1, 13, 128, 256,
+ 512, 1021, 1024}; // have desired lengths to loop over
+ std::vector<uint8_t> msg(
+ lengths[COUNT_OF(lengths) - 1]); // allocate message for max size
+ for (size_t n = 0; n < msg.size(); n++) {
+ msg.at(n) = (uint8_t)n;
+ }
+ THROW_ON_EPIDERR(EpidMemberSetSigRl(member, srl, srl_size));
+ for (auto length : lengths) {
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), length, nullptr, 0, sig, sig_len))
+ << "EpidSign for message_len: " << message_len << " failed";
+ EXPECT_EQ(kEpidSigValid, EpidVerify(ctx, sig, sig_len, msg.data(), length))
+ << "EpidVerify for message_len: " << message_len << " failed";
+ }
+}
+
+TEST_F(EpidMemberTest, SignsLongMessageNoSigRl) {
+ 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(1000000); // allocate message for max size
+ for (size_t n = 0; n < msg.size(); n++) {
+ msg.at(n) = (uint8_t)n;
+ }
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len))
+ << "EpidSign for message_len: " << 1000000 << " failed";
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()))
+ << "EpidVerify for message_len: " << 1000000 << " failed";
+}
+
+TEST_F(EpidMemberTest, SignsLongMessageWithSigRl) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ SigRl const* srl =
+ reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
+ size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
+ 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);
+ VerifierCtxObj ctx(this->kGroupPublicKey);
+ THROW_ON_EPIDERR(EpidVerifierSetSigRl(ctx, srl, srl_size));
+ std::vector<uint8_t> msg(1000000); // allocate message for max size
+ for (size_t n = 0; n < msg.size(); n++) {
+ msg.at(n) = (uint8_t)n;
+ }
+ THROW_ON_EPIDERR(EpidMemberSetSigRl(member, srl, srl_size));
+ EXPECT_EQ(kEpidNoErr,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len))
+ << "EpidSign for message_len: " << 1000000 << " failed";
+ EXPECT_EQ(kEpidSigValid,
+ EpidVerify(ctx, sig, sig_len, msg.data(), msg.size()))
+ << "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/tiny/unittests/utest.parts b/epid/member/tiny/unittests/utest.parts
new file mode 100644
index 0000000..aee3023
--- /dev/null
+++ b/epid/member/tiny/unittests/utest.parts
@@ -0,0 +1,64 @@
+# pylint:disable=I0011,W0401,W0614,C0103,E0602
+############################################################################
+# 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.
+############################################################################
+"""Build configuration for unit test of minimal library.
+"""
+Import('*')
+env.PartName('utest')
+
+env.DependsOn([Component(env.subst('${PART_PARENT_NAME}'),
+ requires=REQ.EXISTS|REQ.DEFAULT),
+ Component('gtest'),
+ Component('common-testhelper'),
+ Component('verifier')])
+
+utest_files = Pattern(src_dir='.',
+ includes=['*-test.cc',
+ '*-testhelper.cc'],
+ recursive=True).files()
+
+env.Append(CPPPATH='#')
+
+env['UNIT_TEST_TARGET_NAME'] = "${PART_PARENT_NAME}-${UNIT_TEST_TARGET}"
+
+shlib = []
+
+if 'shared' in env['MODE']:
+ if env['TARGET_OS'] == 'win32':
+ dependent_shlib = env.subst("${{DEPENDS.{0}.SDKBIN}}"
+ .format(env.subst("${PART_PARENT_NAME}")))
+ shlib = env.CCopy("${INSTALL_TEST_BIN}", dependent_shlib)
+ else:
+ dependent_shlib = env.subst("${{DEPENDS.{0}.SDKLIB}}"
+ .format(env.subst("${PART_PARENT_NAME}")))
+ shlib = env.CCopy("${INSTALL_LIB}", dependent_shlib)
+
+
+utest = env.UnitTest('${PART_SHORT_NAME}',
+ utest_files,
+ command_args=[
+ '--gtest_filter=**',
+ '--gtest_color=yes',
+ '--gtest_print_time=1',
+ '--gtest_output=xml',
+ #'--gtest_break_on_failure',
+ #'--gtest_catch_exceptions=0',
+ ],
+ data_src=[],
+ make_pdb=(env.isConfigBasedOn('debug')),
+ INSTALL_BIN='${INSTALL_TEST_BIN}'
+ )
+Depends(utest, shlib)
diff --git a/epid/member/tinymember.parts b/epid/member/tinymember.parts
new file mode 100644
index 0000000..9f79f67
--- /dev/null
+++ b/epid/member/tinymember.parts
@@ -0,0 +1,98 @@
+# pylint:disable=I0011,W0401,W0614,C0103,E0602
+############################################################################
+# 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.
+############################################################################
+"""Build configuration for tiny member library.
+"""
+Import('*')
+env.PartName('member')
+
+default_build_mode = 'static'
+
+include_files = Pattern(src_dir='.', includes=['*.h'], recursive=False).files()
+
+src_files = Pattern(
+ src_dir='tiny/src', includes=['*.c'], recursive=False).files()
+
+install_files = Pattern(
+ src_dir='tiny',
+ includes=[
+ '*.h', '*.c', '*-test.cc', '*-testhelper.cc', '*-testhelper.h',
+ '*.parts', 'Makefile'
+ ],
+ excludes=['*/platform_specific*/'],
+ recursive=True)
+
+if 'install_package' in env['MODE']:
+ env.InstallTopLevel(install_files, sub_dir='epid/member/tiny')
+
+else:
+ env.Part(parts_file='tiny/stdlib/tiny_stdlib.parts')
+ env.Part(parts_file='tiny/math/math.parts')
+ env.DependsOn([
+ Component('tinycommon', requires=REQ.HEADERS),
+ Component('member.tiny_stdlib'), Component('member.math')
+ ])
+
+ env.Append(CPPPATH='#')
+
+ if 'use-sigrl-by-reference' in env['MODE']:
+ env.Append(CPPDEFINES=['USE_SIGRL_BY_REFERENCE'])
+ else:
+ max_sigrl_entries = ARGUMENTS.get('MAX_SIGRL_ENTRIES', 0)
+ n2_max = int(max_sigrl_entries)
+ if n2_max:
+ env.Append(CPPDEFINES=['MAX_SIGRL_ENTRIES={0}'.format(n2_max)])
+
+ if 'static' in env['MODE'] and 'shared' in env['MODE']:
+ PrintError("both shared and static build mode specified for '{}'. "
+ .format(env.subst('$PART_SHORT_NAME')))
+ if 'static' not in env['MODE'] and 'shared' not in env['MODE']:
+ PrintMessage(
+ "build mode not specified for '{}'. Defaulting to '{}'"
+ .format(env.subst('$PART_SHORT_NAME'), default_build_mode))
+ env['MODE'].append(default_build_mode)
+
+ if 'shared' in env['MODE']:
+ env.Append(CPPDEFINES=['SHARED'])
+ env.ExportCPPDEFINES(['SHARED'])
+ outputs = env.SharedLibrary('${PART_SHORT_NAME}', src_files)
+ elif 'static' in env['MODE']:
+ outputs = env.Library('${PART_SHORT_NAME}', src_files)
+ else:
+ print env.subst('$PART_SHORT_NAME')
+ PrintError("build mode not specified for '{}'. {}".format(
+ env.subst('$PART_SHORT_NAME'),
+ "Specify either 'shared' or 'static'."))
+
+ sdk_outs = env.Sdk(outputs)
+ env.SdkInclude(include_files, sub_dir='epid/${PART_SHORT_NAME}')
+
+ if 'shared' in env['MODE']:
+ env.InstallTarget(outputs)
+
+ if 'install_lib' in env['MODE']:
+ env.InstallInclude(include_files, sub_dir='epid/${PART_SHORT_NAME}')
+ if 'static' in env['MODE']:
+ env.InstallLib(outputs)
+
+ is_utest_build = False
+ for i in BUILD_TARGETS:
+ if "utest::" in str(i):
+ is_utest_build = True
+ if is_utest_build:
+ env.Part(
+ parts_file='tiny/unittests/utest.parts',
+ CONFIG=DefaultEnvironment().subst('$CONFIG'))
diff --git a/epid/member/tpm2/unittests/createprimary-tss-test.cc b/epid/member/tpm2/unittests/createprimary-test.cc
index 5a69eda..c1e4f41 100644
--- a/epid/member/tpm2/unittests/createprimary-tss-test.cc
+++ b/epid/member/tpm2/unittests/createprimary-test.cc
@@ -21,49 +21,28 @@
#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/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) {
+TEST_F(EpidTpm2Test, CreatePrimaryFailsGivenNullParameters) {
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) {
+TEST_F(EpidTpm2Test, CreatePrimaryWorksGivenValidParameter) {
+ Prng prng;
Epid2ParamsObj epid2params;
- Tpm2CtxObj tss(nullptr, nullptr, nullptr, epid2params);
+ Tpm2CtxObj tss(Prng::Generate, &prng, 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/unittests/context-test.cc b/epid/member/unittests/context-test.cc
index fcdb39b..14540b3 100644
--- a/epid/member/unittests/context-test.cc
+++ b/epid/member/unittests/context-test.cc
@@ -49,6 +49,104 @@ bool operator==(MembershipCredential const& lhs,
MembershipCredential const& rhs);
namespace {
//////////////////////////////////////////////////////////////////////////
+// EpidMemberDeinit Tests
+TEST_F(EpidMemberTest, DeinitWorksGivenNullMemberCtx) {
+ EpidMemberDeinit(nullptr);
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberGetSize Tests
+TEST_F(EpidMemberTest, GetSizeFailsGivenNullParams) {
+ size_t ctx_size = 0;
+ MemberParams params = {0};
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberGetSize(&params, nullptr));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberGetSize(nullptr, &ctx_size));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberGetSize(nullptr, nullptr));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberGetSize Tests
+TEST_F(EpidMemberTest, GetSizeWorksGivenValidParams) {
+ size_t ctx_size = 0;
+ Prng my_prng;
+ MemberParams params = {0};
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+}
+
+//////////////////////////////////////////////////////////////////////////
+// EpidMemberInit Tests
+TEST_F(EpidMemberTest, InitFailsGivenNullParameters) {
+ size_t ctx_size = 0;
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ std::vector<uint8_t> ctx_buf;
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+ ctx_buf.resize(ctx_size);
+ ctx = (MemberCtx*)&ctx_buf[0];
+
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberInit(nullptr, nullptr));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberInit(&params, nullptr));
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberInit(nullptr, ctx));
+}
+
+TEST_F(EpidMemberTest, InitFailsGivenInvalidParameters) {
+ 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,
+ };
+ size_t ctx_size = 0;
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ std::vector<uint8_t> ctx_buf;
+ SetMemberParams(&Prng::Generate, &my_prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+ ctx_buf.resize(ctx_size);
+ ctx = (MemberCtx*)&ctx_buf[0];
+
+ EXPECT_EQ(kEpidBadArgErr, EpidMemberInit(&params, ctx));
+}
+
+TEST_F(EpidMemberTest, InitSucceedsGivenValidParameters) {
+ FpElemStr f = {
+ 0x00, 0x00, 0x00, 0x00, 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,
+ };
+ size_t ctx_size = 0;
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ std::vector<uint8_t> ctx_buf;
+ SetMemberParams(&Prng::Generate, &my_prng, &f, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+ ctx_buf.resize(ctx_size);
+ ctx = (MemberCtx*)&ctx_buf[0];
+
+ EXPECT_EQ(kEpidNoErr, EpidMemberInit(&params, ctx));
+ EpidMemberDeinit(ctx);
+}
+
+TEST_F(EpidMemberTest, InitSucceedsGivenValidParametersWithNoF) {
+ size_t ctx_size = 0;
+ MemberCtx* ctx = nullptr;
+ Prng my_prng;
+ MemberParams params = {0};
+ std::vector<uint8_t> ctx_buf;
+ SetMemberParams(&Prng::Generate, &my_prng, nullptr, &params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberGetSize(&params, &ctx_size));
+ ctx_buf.resize(ctx_size);
+ ctx = (MemberCtx*)&ctx_buf[0];
+
+ EXPECT_EQ(kEpidNoErr, EpidMemberInit(&params, ctx));
+ EpidMemberDeinit(ctx);
+}
+
+//////////////////////////////////////////////////////////////////////////
// EpidMemberDelete Tests
TEST_F(EpidMemberTest, DeleteWorksGivenNullMemberCtx) {
EpidMemberDelete(nullptr);
@@ -111,23 +209,21 @@ TEST_F(EpidMemberTest, StartupFailsGivenNullParameters) {
}
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));
+ MemberCtxObj member(&params);
EXPECT_EQ(kEpidNoErr, EpidProvisionKey(member, &pub_key, &priv_key, nullptr));
- MembershipCredential credential_expected = member->credential;
+ MembershipCredential credential_expected = ((MemberCtx*)member)->credential;
// reset member credential to test if startup reads them from NV memory
// correctly
- member->pub_key = {0};
- member->credential = {0};
+ ((MemberCtx*)member)->pub_key = {0};
+ ((MemberCtx*)member)->credential = {0};
EXPECT_EQ(kEpidNoErr, EpidMemberStartup(member));
- EXPECT_EQ(pub_key, member->pub_key);
- EXPECT_EQ(credential_expected, member->credential);
- EpidMemberDelete(&member);
+ EXPECT_EQ(pub_key, ((MemberCtx*)member)->pub_key);
+ EXPECT_EQ(credential_expected, ((MemberCtx*)member)->credential);
}
//////////////////////////////////////////////////////////////////////////
@@ -226,7 +322,7 @@ TEST_F(EpidMemberTest, SetSigRlFailsGivenBadGroupId) {
EXPECT_EQ(kEpidBadArgErr,
EpidMemberSetSigRl(member_ctx, &srl, sizeof(srl) - sizeof(srl.bk)));
}
-TEST_F(EpidMemberTest, SetPrivRlFailsGivenEmptySigRlFromDifferentGroup) {
+TEST_F(EpidMemberTest, SetSigRlFailsGivenEmptySigRlFromDifferentGroup) {
Prng my_prng;
MemberCtxObj member_ctx(this->kGroupPublicKey, this->kMemberPrivateKey,
&Prng::Generate, &my_prng);
@@ -305,17 +401,35 @@ TEST_F(EpidMemberTest, SetSigRlWorksGivenSigRlWithOneEntry) {
size_t sig_rl_size = this->kGrpXSigRlSingleEntry.size();
EXPECT_EQ(kEpidNoErr, EpidMemberSetSigRl(member_ctx, sig_rl, sig_rl_size));
}
+TEST_F(EpidMemberTest, SetSigRlFailsIfNotProvisioned) {
+ Prng my_prng;
+ MemberCtxObj member_ctx(&Prng::Generate, &my_prng);
+ uint8_t sig_rl_data[] = {
+ // gid
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01,
+ // version
+ 0x00, 0x00, 0x00, 0x00,
+ // n2
+ 0x0, 0x00, 0x00, 0x00,
+ // not bk's
+ };
+ SigRl* sig_rl = reinterpret_cast<SigRl*>(sig_rl_data);
+ size_t sig_rl_size = sizeof(sig_rl_data);
+ EXPECT_EQ(kEpidOutOfSequenceError,
+ EpidMemberSetSigRl(member_ctx, sig_rl, sig_rl_size));
+}
//////////////////////////////////////////////////////////////////////////
-// EpidRegisterBaseName
+// EpidRegisterBasename
TEST_F(EpidMemberTest, RegisterBaseNameFailsGivenNullPtr) {
Prng my_prng;
MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
std::vector<uint8_t> basename = {'_', 'b', 'a', 's', 'e', 'n', 'a', 'm', 'e'};
EXPECT_EQ(kEpidBadArgErr,
- EpidRegisterBaseName(member, nullptr, basename.size()));
+ EpidRegisterBasename(member, nullptr, basename.size()));
EXPECT_EQ(kEpidBadArgErr,
- EpidRegisterBaseName(nullptr, basename.data(), basename.size()));
+ EpidRegisterBasename(nullptr, basename.data(), basename.size()));
}
TEST_F(EpidMemberTest, RegisterBaseNameFailsGivenDuplicateBaseName) {
Prng my_prng;
@@ -323,9 +437,9 @@ TEST_F(EpidMemberTest, RegisterBaseNameFailsGivenDuplicateBaseName) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
std::vector<uint8_t> basename = {'d', 'b', 'a', 's', 'e', 'n', 'a', 'm', 'e'};
EXPECT_EQ(kEpidNoErr,
- EpidRegisterBaseName(member, basename.data(), basename.size()));
+ EpidRegisterBasename(member, basename.data(), basename.size()));
EXPECT_EQ(kEpidDuplicateErr,
- EpidRegisterBaseName(member, basename.data(), basename.size()));
+ EpidRegisterBasename(member, basename.data(), basename.size()));
}
TEST_F(EpidMemberTest, RegisterBaseNameFailsGivenInvalidBaseName) {
Prng my_prng;
@@ -334,8 +448,8 @@ TEST_F(EpidMemberTest, RegisterBaseNameFailsGivenInvalidBaseName) {
std::vector<uint8_t> basename = {};
std::vector<uint8_t> basename2 = {'b', 's', 'n'};
EXPECT_EQ(kEpidBadArgErr,
- EpidRegisterBaseName(member, basename.data(), basename.size()));
- EXPECT_EQ(kEpidBadArgErr, EpidRegisterBaseName(member, basename2.data(), 0));
+ EpidRegisterBasename(member, basename.data(), basename.size()));
+ EXPECT_EQ(kEpidBadArgErr, EpidRegisterBasename(member, basename2.data(), 0));
}
TEST_F(EpidMemberTest, RegisterBaseNameSucceedsGivenUniqueBaseName) {
Prng my_prng;
@@ -343,7 +457,7 @@ TEST_F(EpidMemberTest, RegisterBaseNameSucceedsGivenUniqueBaseName) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
std::vector<uint8_t> basename = {'b', 's', 'n', '0', '1'};
EXPECT_EQ(kEpidNoErr,
- EpidRegisterBaseName(member, basename.data(), basename.size()));
+ EpidRegisterBasename(member, basename.data(), basename.size()));
}
TEST_F(EpidMemberTest, RegisterBaseNameSucceedsGivenMultipleUniqueBaseNames) {
Prng my_prng;
@@ -353,28 +467,73 @@ TEST_F(EpidMemberTest, RegisterBaseNameSucceedsGivenMultipleUniqueBaseNames) {
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()));
+ EpidRegisterBasename(member, basename1.data(), basename1.size()));
EXPECT_EQ(kEpidNoErr,
- EpidRegisterBaseName(member, basename2.data(), basename2.size()));
+ EpidRegisterBasename(member, basename2.data(), basename2.size()));
EXPECT_EQ(kEpidNoErr,
- EpidRegisterBaseName(member, basename3.data(), basename3.size()));
+ EpidRegisterBasename(member, basename3.data(), basename3.size()));
// Verify that basenames registered succesfully
EXPECT_EQ(kEpidDuplicateErr,
- EpidRegisterBaseName(member, basename1.data(), basename1.size()));
+ EpidRegisterBasename(member, basename1.data(), basename1.size()));
EXPECT_EQ(kEpidDuplicateErr,
- EpidRegisterBaseName(member, basename2.data(), basename2.size()));
+ EpidRegisterBasename(member, basename2.data(), basename2.size()));
EXPECT_EQ(kEpidDuplicateErr,
- EpidRegisterBaseName(member, basename3.data(), basename3.size()));
+ 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(),
+ EXPECT_EQ(kEpidNoErr, EpidRegisterBasename(member, this->kData_0_255.data(),
this->kData_0_255.size()));
}
//////////////////////////////////////////////////////////////////////////
+// EpidClearRegisteredBasenames
+TEST_F(EpidMemberTest, EpidClearRegisteredBasenamesFailsGivenNullPtr) {
+ EXPECT_EQ(kEpidBadArgErr, EpidClearRegisteredBasenames(nullptr));
+}
+TEST_F(EpidMemberTest, EpidClearRegisteredBasenamesClearsBasenames) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ THROW_ON_EPIDERR(
+ EpidRegisterBasename(member, this->kBsn0.data(), this->kBsn0.size()));
+ EXPECT_EQ(kEpidNoErr, EpidClearRegisteredBasenames(member));
+ // check, that after clearing EpidRegisterBasename works correctly
+ THROW_ON_EPIDERR(
+ EpidRegisterBasename(member, this->kBsn0.data(), this->kBsn0.size()));
+}
+TEST_F(EpidMemberTest, EpidClearRegisteredBasenamesClearsAllBasenames) {
+ Prng my_prng;
+ MemberCtxObj member(this->kGroupPublicKey, this->kMemberPrivateKey,
+ this->kMemberPrecomp, &Prng::Generate, &my_prng);
+ for (int i = 0; i < 3; ++i) {
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, &i, sizeof(i)));
+ }
+ EXPECT_EQ(kEpidNoErr, EpidClearRegisteredBasenames(member));
+ for (int i = 0; i < 3; ++i) {
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, &i, sizeof(i)));
+ }
+}
+TEST_F(EpidMemberTest,
+ EpidClearRegisteredBasenamesCausesSignWithBasenameAfterItToFail) {
+ Prng my_prng;
+ 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);
+ THROW_ON_EPIDERR(EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), sig, sig_len));
+ THROW_ON_EPIDERR(EpidClearRegisteredBasenames(member));
+ ASSERT_EQ(kEpidBadArgErr, EpidSign(member, msg.data(), msg.size(), bsn.data(),
+ bsn.size(), sig, sig_len));
+}
+//////////////////////////////////////////////////////////////////////////
// EpidMemberWritePrecomp
TEST_F(EpidMemberTest, MemberWritePrecompFailsGivenNullPointer) {
MemberPrecomp precomp;
@@ -414,17 +573,16 @@ TEST_F(EpidMemberTest, DefaultHashAlgIsSha512) {
MemberCtx* ctx = member;
EXPECT_EQ(kSha512, ctx->hash_alg);
}
-
+#ifdef TPM_TSS
//////////////////////////////////////////////////////////////////////////
// MemberCanLoadMembershipCredentialFromTpm
-TEST_F(EpidMemberTest, DISABLED_MemberCanLoadMembershipCredentialFromTpm) {
+TEST_F(EpidMemberTest,
+ MemberCanLoadPreviouslyProvisionedMembershipCredentialFromTpm) {
// 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;
@@ -432,22 +590,31 @@ TEST_F(EpidMemberTest, DISABLED_MemberCanLoadMembershipCredentialFromTpm) {
this->kGrpXMember9PrivKey.A,
this->kGrpXMember9PrivKey.x};
MembershipCredential credential;
- // write credentials
- THROW_ON_EPIDERR(EpidNvWriteMembershipCredential(
- tpm, &pub_key_expected, &credential_expected, nv_index));
+ // Tpm2CtxObj calls Tpm2CreateContext() and sets
+ // is_context_already_created=true. To call this function in
+ // EpidMemberInit() successfully Tpm2DeleteContext() must be called.
+ // Putting creation of Tpm2CtxObj object in a block solves it
+ {
+ // write credentials
+ Tpm2CtxObj tpm(&Prng::Generate, &prng, nullptr, epid2params);
+ 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);
+ // read credentials to confirm that credential has been really inserted
+ 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);
+ MemberCtxObj member(&params);
+ EXPECT_EQ(kEpidNoErr, EpidMemberStartup(member));
+ EXPECT_EQ(pub_key_expected, ((MemberCtx*)member)->pub_key);
+ EXPECT_EQ(credential_expected, ((MemberCtx*)member)->credential);
+
+ Tpm2NvUndefineSpace(((MemberCtx*)member)->tpm2_ctx, nv_index);
}
+#endif
} // namespace
diff --git a/epid/member/unittests/join_request-test.cc b/epid/member/unittests/join_request-test.cc
index 60b5dbc..d61347a 100644
--- a/epid/member/unittests/join_request-test.cc
+++ b/epid/member/unittests/join_request-test.cc
@@ -168,7 +168,6 @@ TEST_F(EpidMemberTest, CreateJoinRequestFailsGivenInvalidGroupKey) {
TEST_F(EpidMemberTest, CreateJoinRequestFailsGivenInvalidFValue) {
Prng prng;
- MemberCtx* member;
MemberParams params = {0};
GroupPubKey pub_key = kPubKey;
FpElemStr f = {
@@ -184,14 +183,27 @@ TEST_F(EpidMemberTest, CreateJoinRequestFailsGivenInvalidFValue) {
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);
+
+ std::unique_ptr<uint8_t[]> member;
+ size_t context_size = 0;
+ sts = EpidMemberGetSize(&params, &context_size);
+ EXPECT_TRUE(kEpidNoErr == sts || kEpidBadArgErr == sts)
+ << "Actual value " << sts;
+
+ if (kEpidNoErr == sts) {
+ member.reset(new uint8_t[context_size]());
+ sts = EpidMemberInit(&params, (MemberCtx*)member.get());
+ EXPECT_TRUE(kEpidNoErr == sts || kEpidBadArgErr == sts)
+ << "Actual value " << sts;
+ }
+
if (kEpidNoErr == sts) {
- sts = EpidCreateJoinRequest(member, &pub_key, &ni, &join_request);
- EpidMemberDelete(&member);
+ sts = EpidCreateJoinRequest((MemberCtx*)member.get(), &pub_key, &ni,
+ &join_request);
+ EXPECT_EQ(kEpidBadArgErr, sts);
}
- EXPECT_EQ(kEpidBadArgErr, sts);
+
+ EpidMemberDeinit((MemberCtx*)member.get());
}
TEST_F(EpidMemberTest, CreateJoinRequestWorksGivenValidParameters) {
diff --git a/epid/member/unittests/member-testhelper.cc b/epid/member/unittests/member-testhelper.cc
index 9189f65..3503f1f 100644
--- a/epid/member/unittests/member-testhelper.cc
+++ b/epid/member/unittests/member-testhelper.cc
@@ -51,270 +51,6 @@ 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) {
- 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) {
- 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_); }
-
-MemberCtx* MemberCtxObj::ctx() const { return ctx_; }
-
-MemberCtxObj::operator MemberCtx*() const { return ctx_; }
-
-MemberCtxObj::operator const MemberCtx*() const { return ctx_; }
-
/// Arbitrary test data were generated based on Intel(R) EPID 2.0 parameters
const GroupPubKey EpidMemberTest::kGroupPublicKey = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/epid/member/unittests/member-testhelper.h b/epid/member/unittests/member-testhelper.h
index ea15488..226fc07 100644
--- a/epid/member/unittests/member-testhelper.h
+++ b/epid/member/unittests/member-testhelper.h
@@ -25,6 +25,7 @@
#include <vector>
#include "epid/common-testhelper/epid_gtest-testhelper.h"
+#include "epid/common-testhelper/member_wrapper-testhelper.h"
#include "gtest/gtest.h"
extern "C" {
@@ -42,58 +43,6 @@ bool operator==(MembershipCredential const& lhs,
/// 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;
- MemberCtxObj& operator=(const MemberCtxObj&) = delete;
-
- /// Destroy the MemberCtx
- ~MemberCtxObj();
- /// get a pointer to the stored MemberCtx
- MemberCtx* ctx() const;
- /// cast operator to get the pointer to the stored MemberCtx
- operator MemberCtx*() const;
- /// const cast operator to get the pointer to the stored MemberCtx
- operator const MemberCtx*() const;
-
- private:
- /// The stored MemberCtx
- MemberCtx* ctx_;
-};
-
/// Test fixture class for EpidMember
class EpidMemberTest : public ::testing::Test {
public:
diff --git a/epid/member/unittests/nr_prove-test.cc b/epid/member/unittests/nr_prove-test.cc
index 271ced9..339b26b 100644
--- a/epid/member/unittests/nr_prove-test.cc
+++ b/epid/member/unittests/nr_prove-test.cc
@@ -210,7 +210,7 @@ TEST_F(EpidMemberTest, GeneratesNrProofForMsgContainingAllPossibleBytes) {
NrProof proof;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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));
diff --git a/epid/member/unittests/provision_compressed-test.cc b/epid/member/unittests/provision_compressed-test.cc
index 6d321eb..001129e 100644
--- a/epid/member/unittests/provision_compressed-test.cc
+++ b/epid/member/unittests/provision_compressed-test.cc
@@ -50,7 +50,6 @@ EpidStatus ProvisionCompressedAndStart(
}
TEST_F(EpidMemberTest, ProvisionCompressedFailsGivenNullParameters) {
- MemberCtx* member = nullptr;
Prng prng;
GroupPubKey pub_key = this->kGrpXKey;
CompressedPrivKey priv_key = this->kGrpXMember9CompressedKey;
@@ -60,7 +59,8 @@ TEST_F(EpidMemberTest, ProvisionCompressedFailsGivenNullParameters) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
+
EXPECT_EQ(kEpidBadArgErr,
EpidProvisionCompressed(nullptr, &pub_key, &priv_key, &precomp));
EXPECT_EQ(kEpidBadArgErr,
@@ -73,11 +73,9 @@ TEST_F(EpidMemberTest, ProvisionCompressedFailsGivenNullParameters) {
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;
@@ -87,16 +85,15 @@ TEST_F(EpidMemberTest, ProvisionCompressedSucceedsGivenValidParameters) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
+
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;
@@ -106,7 +103,7 @@ TEST_F(EpidMemberTest, ProvisionCompressedFailsForInvalidGroupPubKey) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
pub_key = this->kGrpXKey;
pub_key.h1.x.data.data[0]++;
@@ -149,12 +146,9 @@ TEST_F(EpidMemberTest, ProvisionCompressedFailsForInvalidGroupPubKey) {
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;
@@ -164,7 +158,7 @@ TEST_F(EpidMemberTest, ProvisionCompressedFailsForInvalidPrivateKey) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
priv_key = this->kGrpXMember9CompressedKey;
priv_key.ax.data.data[0]++;
@@ -179,8 +173,6 @@ TEST_F(EpidMemberTest, ProvisionCompressedFailsForInvalidPrivateKey) {
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
index b4faeac..c8ec7ad 100644
--- a/epid/member/unittests/provision_credential-test.cc
+++ b/epid/member/unittests/provision_credential-test.cc
@@ -15,9 +15,9 @@
############################################################################*/
/*!
-* \file
-* \brief Provision credential unit tests.
-*/
+ * \file
+ * \brief Provision credential unit tests.
+ */
#include <cstring>
#include <vector>
@@ -51,7 +51,6 @@ EpidStatus ProvisionCredentialAndStart(MemberCtx* ctx,
}
TEST_F(EpidMemberTest, ProvisionCredentialFailsGivenNullParameters) {
- MemberCtx* member = nullptr;
Prng prng;
GroupPubKey pub_key = this->kGrpXKey;
FpElemStr f = this->kGrpXMember9PrivKey.f;
@@ -65,7 +64,7 @@ TEST_F(EpidMemberTest, ProvisionCredentialFailsGivenNullParameters) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
EXPECT_EQ(kEpidBadArgErr,
EpidProvisionCredential(nullptr, &pub_key, &credential, &precomp));
EXPECT_EQ(kEpidBadArgErr,
@@ -78,11 +77,9 @@ TEST_F(EpidMemberTest, ProvisionCredentialFailsGivenNullParameters) {
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;
@@ -97,7 +94,7 @@ TEST_F(EpidMemberTest, ProvisionCredentialRejectsInvalidCredential) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
credential = base_credential;
credential.A.x.data.data[0]++;
@@ -119,12 +116,9 @@ TEST_F(EpidMemberTest, ProvisionCredentialRejectsInvalidCredential) {
&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;
@@ -138,7 +132,7 @@ TEST_F(EpidMemberTest, ProvisionCredentialRejectsInvalidGroupKey) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
pub_key = this->kGroupPublicKey;
pub_key.h1.x.data.data[0]++;
@@ -195,12 +189,9 @@ TEST_F(EpidMemberTest, ProvisionCredentialRejectsInvalidGroupKey) {
&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;
@@ -215,7 +206,7 @@ TEST_F(EpidMemberTest, ProvisionCredentialRejectsCredentialNotInGroup) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
credential = base_credential;
credential.gid.data[0] = ~credential.gid.data[0];
@@ -223,12 +214,9 @@ TEST_F(EpidMemberTest, ProvisionCredentialRejectsCredentialNotInGroup) {
&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;
@@ -242,14 +230,12 @@ TEST_F(EpidMemberTest, CanProvisionUsingMembershipCredentialPrecomp) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
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;
@@ -259,15 +245,13 @@ TEST_F(EpidMemberTest, CanProvisionUsingMembershipCredentialNoPrecomp) {
credential.x = this->kGrpXMember9PrivKey.x;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
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());
@@ -284,14 +268,12 @@ TEST_F(EpidMemberTest, CanProvisionUsingIKGFMembershipCredentialPrecomp) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
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());
@@ -304,17 +286,16 @@ TEST_F(EpidMemberTest, CanProvisionUsingIKGFMembershipCredentialNoPrecomp) {
credential.x = priv_key->x;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
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;
@@ -324,14 +305,14 @@ TEST_F(EpidMemberTest,
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
EXPECT_EQ(kEpidNoErr, ProvisionCredentialAndStart(member, &pub_key,
&orig_credential, nullptr));
- EXPECT_EQ(kEpidNoErr, EpidNvReadMembershipCredential(
- member->tpm2_ctx, nv_index, &pub_key, &credential));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNvReadMembershipCredential(((MemberCtx*)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
index cc3271e..113de5f 100644
--- a/epid/member/unittests/provision_key-test.cc
+++ b/epid/member/unittests/provision_key-test.cc
@@ -50,14 +50,13 @@ EpidStatus ProvisionBulkAndStart(MemberCtx* ctx, GroupPubKey const* pub_key,
}
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));
+ MemberCtxObj member(&params);
EXPECT_EQ(kEpidBadArgErr,
EpidProvisionKey(nullptr, &pub_key, &priv_key, &precomp));
EXPECT_EQ(kEpidBadArgErr,
@@ -70,27 +69,23 @@ TEST_F(EpidMemberTest, ProvisionBulkFailsGivenNullParameters) {
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));
+ MemberCtxObj member(&params);
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"
@@ -104,15 +99,13 @@ TEST_F(EpidMemberTest, ProvisionBulkSucceedsGivenValidParametersUsingIKGFData) {
};
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
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;
@@ -121,7 +114,7 @@ TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidGroupPubKey) {
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
pub_key = this->kGroupPublicKey;
pub_key.h1.x.data.data[0]++;
@@ -178,12 +171,9 @@ TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidGroupPubKey) {
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,
@@ -195,7 +185,7 @@ TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidF) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
priv_key = this->kMemberPrivateKey;
priv_key.f = f;
@@ -203,12 +193,9 @@ TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidF) {
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;
@@ -216,7 +203,7 @@ TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidPrivateKey) {
MemberPrecomp precomp = this->kMemberPrecomp;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, nullptr, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
priv_key = this->kMemberPrivateKey;
priv_key.A.x.data.data[0]++;
@@ -231,14 +218,12 @@ TEST_F(EpidMemberTest, ProvisionBulkFailsForInvalidPrivateKey) {
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,
@@ -246,14 +231,14 @@ TEST_F(EpidMemberTest, ProvisionBulkCanStoreMembershipCredential) {
MembershipCredential credential;
MemberParams params = {0};
SetMemberParams(&Prng::Generate, &prng, &priv_key.f, &params);
- EXPECT_EQ(kEpidNoErr, EpidMemberCreate(&params, &member));
+ MemberCtxObj member(&params);
EXPECT_EQ(kEpidNoErr,
ProvisionBulkAndStart(member, &pub_key, &priv_key, nullptr));
- EXPECT_EQ(kEpidNoErr, EpidNvReadMembershipCredential(
- member->tpm2_ctx, nv_index, &pub_key, &credential));
+ EXPECT_EQ(kEpidNoErr,
+ EpidNvReadMembershipCredential(((MemberCtx*)member)->tpm2_ctx,
+ nv_index, &pub_key, &credential));
EXPECT_EQ(orig_credential, credential);
- EpidMemberDelete(&member);
}
} // namespace
diff --git a/epid/member/unittests/sign-test.cc b/epid/member/unittests/sign-test.cc
index 64994e2..54f2faf 100644
--- a/epid/member/unittests/sign-test.cc
+++ b/epid/member/unittests/sign-test.cc
@@ -101,11 +101,21 @@ TEST_F(EpidMemberTest, SignFailsGivenUnregisteredBasename) {
std::vector<uint8_t> sig(EpidGetSigSize(&srl));
THROW_ON_EPIDERR(
EpidMemberSetSigRl(member, &srl, sizeof(srl) - sizeof(srl.bk)));
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
EXPECT_EQ(kEpidBadArgErr,
EpidSign(member, msg.data(), msg.size(), bsn1.data(), bsn1.size(),
(EpidSignature*)sig.data(), sig.size()));
}
+TEST_F(EpidMemberTest, SignsFailsIfNotProvisioned) {
+ Prng my_prng;
+ MemberCtxObj member(&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(kEpidOutOfSequenceError,
+ EpidSign(member, msg.data(), msg.size(), nullptr, 0, sig, sig_len));
+}
/////////////////////////////////////////////////////////////////////////
// Anonymity
@@ -166,7 +176,7 @@ TEST_F(EpidMemberTest, SignaturesOfSameMessageWithSameBasenameAreDifferent) {
std::vector<uint8_t> sig1(EpidGetSigSize(nullptr));
std::vector<uint8_t> sig2(EpidGetSigSize(nullptr));
// without signature based revocation list
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
EXPECT_EQ(kEpidNoErr,
EpidSign(member, msg.data(), msg.size(), bsn.data(), bsn.size(),
(EpidSignature*)sig1.data(), sig1.size()));
@@ -255,7 +265,7 @@ TEST_F(EpidMemberTest, SignsMessageUsingBasenameNoSigRl) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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);
@@ -274,7 +284,7 @@ TEST_F(EpidMemberTest, SignsMessageUsingBasenameWithSigRl) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
SigRl const* srl =
reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
@@ -297,7 +307,7 @@ TEST_F(EpidMemberTest, SignsUsingRandomBaseWithRegisteredBasenamesNoSigRl) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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);
@@ -313,7 +323,7 @@ TEST_F(EpidMemberTest, SignsUsingRandomBaseWithRegisteredBasenamesWithSigRl) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
SigRl const* srl =
reinterpret_cast<SigRl const*>(this->kSigRl5EntryData.data());
size_t srl_size = this->kSigRl5EntryData.size() * sizeof(uint8_t);
@@ -374,7 +384,7 @@ TEST_F(EpidMemberTest, SignsMessageUsingHugeBasenameNoSigRl) {
for (size_t i = 0; i < bsn.size(); ++i) {
bsn[i] = c++;
}
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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);
@@ -396,7 +406,7 @@ TEST_F(EpidMemberTest, SignsMessageUsingHugeBasenameWithSigRl) {
for (size_t i = 0; i < bsn.size(); ++i) {
bsn[i] = c++;
}
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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));
@@ -419,7 +429,7 @@ TEST_F(EpidMemberTest, SignsMsgUsingBsnContainingAllPossibleBytesNoSigRl) {
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()));
+ 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);
@@ -1001,7 +1011,7 @@ TEST_F(EpidMemberTest, SignsEmptyMessageNoSigRl) {
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()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
EXPECT_EQ(kEpidNoErr, EpidSign(member, msg.data(), 0, bsn.data(), bsn.size(),
sig, sig_len));
VerifierCtxObj ctx(this->kGroupPublicKey);
diff --git a/epid/member/unittests/signbasic-test.cc b/epid/member/unittests/signbasic-test.cc
index 1a92f7b..1f51508 100644
--- a/epid/member/unittests/signbasic-test.cc
+++ b/epid/member/unittests/signbasic-test.cc
@@ -79,7 +79,7 @@ TEST_F(EpidMemberTest, SignBasicDoesNotComputeRandomBasenameGivenBasename) {
BigNumStr rnd_bsn = {0};
BigNumStr zero = {0};
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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));
@@ -108,7 +108,7 @@ TEST_F(EpidMemberTest, SignBasicFailsForUnregisteredBasename) {
auto& msg = this->kMsg0;
auto& bsn0 = this->kBsn0;
auto& bsn1 = this->kBsn1;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn0.data(), bsn0.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn0.data(), bsn0.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidBadArgErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn1.data(),
@@ -139,7 +139,7 @@ TEST_F(EpidMemberTest,
auto& bsn = this->kBsn0;
BasicSignature basic_sig1;
BasicSignature basic_sig2;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
EXPECT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
bsn.size(), &basic_sig1, nullptr));
@@ -193,7 +193,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingBasename) {
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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));
@@ -214,7 +214,7 @@ TEST_F(EpidMemberTest,
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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));
@@ -237,7 +237,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingBasenameUsingIKGFData) {
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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));
@@ -254,7 +254,7 @@ TEST_F(EpidMemberTest,
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
BigNumStr rnd_bsn = {0};
EXPECT_EQ(kEpidNoErr, EpidSignBasic(member, msg.data(), msg.size(), nullptr,
@@ -286,7 +286,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingBsnContainingAllPossibleBytes) {
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()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
@@ -308,7 +308,7 @@ TEST_F(EpidMemberTest,
auto& msg = this->kMsg0;
auto& bsn = this->kData_0_255;
// 0 - 123
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), 124));
+ 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));
@@ -319,7 +319,7 @@ TEST_F(EpidMemberTest,
EpidVerifyBasicSig(ctx1, &basic_sig, msg.data(), msg.size()));
// 124 - 247
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data() + 124, 124));
+ 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));
@@ -331,7 +331,7 @@ TEST_F(EpidMemberTest,
// 248 - 255
THROW_ON_EPIDERR(
- EpidRegisterBaseName(member, bsn.data() + 124 * 2, 256 - 124 * 2));
+ 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));
@@ -350,7 +350,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha256HashAlg) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
@@ -370,7 +370,7 @@ TEST_F(EpidMemberTest,
&Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
@@ -387,7 +387,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha384HashAlg) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
@@ -404,7 +404,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha512HashAlg) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
@@ -422,7 +422,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsUsingSha512256HashAlg) {
&my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
@@ -442,7 +442,7 @@ TEST_F(EpidMemberTest, SignBasicConsumesPrecomputedSignatures) {
auto& msg = this->kMsg0;
BasicSignature basic_sig;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
// use 1 precomputed signature
ASSERT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
@@ -494,7 +494,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsWithoutPrecomputedSignatures) {
auto& msg = this->kMsg0;
BasicSignature basic_sig;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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));
@@ -516,7 +516,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsGivenEmptyMessage) {
this->kMemberPrecomp, &Prng::Generate, &my_prng);
auto& msg = this->kMsg0;
auto& bsn = this->kBsn0;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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, nullptr));
@@ -575,7 +575,7 @@ TEST_F(EpidMemberTest, SignBasicSucceedsWithMsgContainingAllPossibleBytes) {
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()));
+ THROW_ON_EPIDERR(EpidRegisterBasename(member, bsn.data(), bsn.size()));
BasicSignature basic_sig;
EXPECT_EQ(kEpidNoErr,
EpidSignBasic(member, msg.data(), msg.size(), bsn.data(),
@@ -596,7 +596,7 @@ TEST_F(EpidMemberTest,
auto& msg = this->kData_0_255;
auto& bsn = this->kBsn0;
BasicSignature basic_sig;
- THROW_ON_EPIDERR(EpidRegisterBaseName(member, bsn.data(), bsn.size()));
+ 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));
diff --git a/epid/verifier/Makefile b/epid/verifier/Makefile
index 209362c..ee3386b 100644
--- a/epid/verifier/Makefile
+++ b/epid/verifier/Makefile
@@ -37,6 +37,10 @@ LDFLAGS += -L$(GTEST_INCLUDE_DIR)/gtest -L$(LIB_COMMON_TESTHELPER_DIR) \
-L$(LIB_IPPCP_DIR) -lgtest -lcommon-testhelper -lverifier -lcommon \
-lippcp
+ifneq ($(TSS_PATH),)
+ CFLAGS += -DTPM_TSS
+endif
+
#target part
$(VERIFIER_OBJ): %.o: %.c
$(CC) $(CFLAGS) -I$(IPP_INCLUDE_DIR) -I$(IPP_SRC_INCLUDE_DIR) \
diff --git a/example/Makefile b/example/Makefile
index a892059..5ee6f06 100644
--- a/example/Makefile
+++ b/example/Makefile
@@ -17,7 +17,7 @@ VERIFYSIG_EXE = ./verifysig/src/verifysig$(EXE_EXTENSION)
LIB_UTIL_DIR = ./util/src
-LIB_DROPT_DIR = ../ext/dropt/src
+LIB_ARGTABLE_DIR = ../ext/argtable3
LIB_IPPCP_DIR = ../ext/ipp/sources/ippcp/src
LIB_MEMBER_DIR = ../epid/member
LIB_VERIFIER_DIR = ../epid/verifier
@@ -25,18 +25,26 @@ LIB_COMMON_DIR = ../epid/common
#set linker flags
LDFLAGS += -L$(LIB_UTIL_DIR) \
- -L$(LIB_DROPT_DIR) \
+ -L$(LIB_ARGTABLE_DIR) \
-L$(LIB_IPPCP_DIR) \
-L$(LIB_COMMON_DIR) \
-lcommon \
- -lippcp -lutil -ldropt
+ -lippcp -lutil -largtable3
+
+ifneq ($(TSS_PATH),)
+ LDFLAGS += -L$(TSS_PATH) -ltss -lcrypto
+endif
+
+ifneq ($(TINY),)
+ LDFLAGS += -L$(LIB_MEMBER_DIR) -lmath -ltiny_stdlib
+endif
$(VERIFYSIG_EXE): $(VERIFYSIG_OBJ)
$(CC) -o $@ $^ -L$(LIB_VERIFIER_DIR) -lverifier $(LDFLAGS)
$(VERIFYSIG_OBJ): %.o: %.c
$(CC) -o $@ $(CFLAGS) -I$(LIB_UTIL_DIR)/../.. \
- -I$(LIB_DROPT_DIR)/../include \
+ -I$(LIB_ARGTABLE_DIR) \
-I$(LIB_VERIFIER_DIR)/../.. \
-I$(VERIFYSIG_INCLUDE_DIR) \
-I$(IPP_API_INCLUDE_DIR) -c $^
@@ -47,7 +55,7 @@ $(SIGNMSG_EXE): $(SIGNMSG_OBJ)
$(SIGNMSG_OBJ): %.o: %.c
$(CC) -o $@ $(CFLAGS) -I$(LIB_UTIL_DIR)/../.. \
- -I$(LIB_DROPT_DIR)/../include \
+ -I$(LIB_ARGTABLE_DIR) \
-I$(LIB_MEMBER_DIR)/../.. \
-I$(SIGNMSG_INCLUDE_DIR) \
-I$(IPP_API_INCLUDE_DIR) -c $^
diff --git a/example/signmsg/signmsg.parts b/example/signmsg/signmsg.parts
index 1246cb9..2f07baa 100644
--- a/example/signmsg/signmsg.parts
+++ b/example/signmsg/signmsg.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.
@@ -34,8 +34,9 @@ if 'install_package' in env['MODE']:
else:
env.DependsOn([
Component('member'),
+ Component('common'),
Component('util'),
- Component('dropt')
+ Component('argtable3')
])
env.Append(CPPPATH='#/example/signmsg')
diff --git a/example/signmsg/src/main.c b/example/signmsg/src/main.c
index 5954545..193929a 100644
--- a/example/signmsg/src/main.c
+++ b/example/signmsg/src/main.c
@@ -19,7 +19,7 @@
* \brief Signmsg example implementation.
*/
-#include <dropt.h>
+#include <argtable3.h>
#include <stdlib.h>
#include <string.h>
@@ -35,6 +35,8 @@
#define SIG_DEFAULT "sig.dat"
#define CACERT_DEFAULT "cacert.bin"
#define HASHALG_DEFAULT "SHA-512"
+#define ARGPARSE_ERROR_MAX 20
+#define ARGTABLE_SIZE 14
bool IsCaCertAuthorizedByRootCa(void const* data, size_t size) {
// Implementation of this function is out of scope of the sample.
@@ -45,26 +47,6 @@ bool IsCaCertAuthorizedByRootCa(void const* data, size_t size) {
return true;
}
-/// parses string to a hashalg type
-static dropt_error HandleHashalg(dropt_context* context,
- const char* option_argument,
- void* handler_data) {
- dropt_error err = dropt_error_none;
- HashAlg* hashalg = handler_data;
- (void)context;
- if (option_argument == NULL) {
- *hashalg = kSha512;
- } else if (option_argument[0] == '\0') {
- err = dropt_error_insufficient_arguments;
- } else if (StringToHashAlg(option_argument, hashalg)) {
- err = dropt_error_none;
- } else {
- /* Reject the value as being inappropriate for this handler. */
- err = dropt_error_mismatch;
- }
- return err;
-}
-
/// Main entrypoint
int main(int argc, char* argv[]) {
// intermediate return value for C style functions
@@ -75,41 +57,18 @@ int main(int argc, char* argv[]) {
// User Settings
- // Signature file name parameter
- static char* sig_file = NULL;
-
// Message string parameter
static char* msg_str = NULL;
size_t msg_size = 0;
- static char* msg_file = NULL;
char* msg_buf = NULL; // message loaded from msg_file
// Basename string parameter
static char* basename_str = NULL;
size_t basename_size = 0;
- static char* basename_file = NULL;
char* basename_buf = NULL; // basename loaded from basename_file
- // SigRl file name parameter
- static char* sigrl_file = NULL;
-
- // Group public key file name parameter
- static char* pubkey_file = NULL;
-
- // Member private key file name parameter
- static char* mprivkey_file = NULL;
-
- // Member pre-computed settings input file name parameter
- static char* mprecmpi_file = NULL;
-
- // CA certificate file name parameter
- static char* cacert_file = NULL;
-
- // help flag parameter
- static bool show_help = false;
-
// Verbose flag parameter
- static bool verbose = false;
+ static bool verbose_flag = false;
// Buffers and computed values
@@ -137,155 +96,163 @@ int main(int argc, char* argv[]) {
MemberPrecomp* member_precmp_ptr = NULL;
// Hash algorithm
- static HashAlg hashalg = kSha512;
-
- dropt_option options[] = {
- {'\0', "sig", "write signature to FILE (default: " SIG_DEFAULT ")",
- "FILE", dropt_handle_string, &sig_file},
- {'\0', "msg", "MESSAGE to sign", "MESSAGE", dropt_handle_string,
- &msg_str},
- {'\0', "msgfile", "FILE containing message to sign", "FILE",
- dropt_handle_string, &msg_file},
- {'\0', "bsn", "BASENAME to sign with (default: random)", "BASENAME",
- dropt_handle_string, &basename_str},
- {'\0', "bsnfile", "FILE containing basename to sign with", "FILE",
- dropt_handle_string, &basename_file},
-
- {'\0', "sigrl", "load signature based revocation list from FILE", "FILE",
- dropt_handle_string, &sigrl_file},
- {'\0', "gpubkey",
- "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")",
- "FILE", dropt_handle_string, &pubkey_file},
- {'\0', "mprivkey",
- "load member private key from FILE "
- "(default:" MPRIVKEYFILE_DEFAULT ")",
- "FILE", dropt_handle_string, &mprivkey_file},
- {'\0', "mprecmpi", "load pre-computed member data from FILE", "FILE",
- dropt_handle_string, &mprecmpi_file},
- {'\0', "capubkey",
- "load IoT Issuing CA public key from FILE (default: " CACERT_DEFAULT ")",
- "FILE", dropt_handle_string, &cacert_file},
-
- {'\0', "hashalg",
- "use specified hash algorithm (default: " HASHALG_DEFAULT ")",
- "{SHA-256 | SHA-384 | SHA-512 | SHA-512/256}", HandleHashalg, &hashalg},
- {'h', "help", "display this help and exit", NULL, dropt_handle_bool,
- &show_help, dropt_attr_halt},
- {'v', "verbose", "print status messages to stdout", NULL,
- dropt_handle_bool, &verbose},
-
- {0} /* Required sentinel value. */
- };
-
- dropt_context* dropt_ctx = NULL;
+ static HashAlg hashalg = kInvalidHashAlg;
+
+ // Argument variables
+ struct arg_file* sig_file =
+ arg_file0(NULL, "sig", "FILE",
+ "write signature to FILE (default: " SIG_DEFAULT ")");
+ struct arg_str* msg = arg_str0(NULL, "msg", "MESSAGE", "MESSAGE to sign");
+ struct arg_file* msg_file =
+ arg_file0(NULL, "msgfile", "FILE", "FILE containing message to sign");
+ struct arg_str* basename = arg_str0(
+ NULL, "bsn", "BASENAME", "BASENAME to sign with (default: random)");
+ struct arg_file* basename_file = arg_file0(
+ NULL, "bsnfile", "FILE", "FILE containing basename to sign with");
+ struct arg_file* sigrl_file = arg_file0(
+ NULL, "sigrl", "FILE", "load signature based revocation list from FILE");
+ struct arg_file* pubkey_file = arg_file0(
+ NULL, "gpubkey", "FILE",
+ "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")");
+ struct arg_file* mprivkey_file = arg_file0(
+ NULL, "mprivkey", "FILE",
+ "load member private key from FILE (default: " MPRIVKEYFILE_DEFAULT ")");
+ struct arg_file* mprecmpi_file = arg_file0(
+ NULL, "mprecmpi", "FILE", "load pre-computed member data from FILE");
+ struct arg_file* cacert_file = arg_file0(
+ NULL, "capubkey", "FILE",
+ "load IoT Issuing CA public key from FILE (default: " CACERT_DEFAULT ")");
+ struct arg_str* hashalg_str =
+ arg_str0(NULL, "hashalg", "{SHA-256 | SHA-384 | SHA-512 | SHA-512/256}",
+ "use specified hash algorithm (default: " HASHALG_DEFAULT ")");
+ struct arg_lit* help = arg_lit0(NULL, "help", "display this help and exit");
+ struct arg_lit* verbose =
+ arg_lit0("v", "verbose", "print status messages to stdout");
+ struct arg_end* end = arg_end(ARGPARSE_ERROR_MAX);
+ void* argtable[ARGTABLE_SIZE];
+ int nerrors;
+
+ /* initialize the argtable array with ptrs to the arg_xxx structures
+ * constructed above */
+ argtable[0] = sig_file;
+ argtable[1] = msg;
+ argtable[2] = msg_file;
+ argtable[3] = basename;
+ argtable[4] = basename_file;
+ argtable[5] = sigrl_file;
+ argtable[6] = pubkey_file;
+ argtable[7] = mprivkey_file;
+ argtable[8] = mprecmpi_file;
+ argtable[9] = cacert_file;
+ argtable[10] = hashalg_str;
+ argtable[11] = help;
+ argtable[12] = verbose;
+ argtable[13] = end;
+
// set program name for logging
set_prog_name(PROGRAM_NAME);
do {
- dropt_ctx = dropt_new_context(options);
- if (!dropt_ctx) {
+ /* verify the argtable[] entries were allocated sucessfully */
+ if (arg_nullcheck(argtable) != 0) {
+ /* NULL entries were detected, some allocations must have failed */
+ printf("%s: insufficient memory\n", PROGRAM_NAME);
ret_value = EXIT_FAILURE;
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.
- */
- 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));
- if (dropt_error_invalid_option == dropt_get_error(dropt_ctx)) {
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- }
+ }
+
+ /* set any command line default values prior to parsing */
+ sig_file->filename[0] = SIG_DEFAULT;
+ pubkey_file->filename[0] = PUBKEYFILE_DEFAULT;
+ mprivkey_file->filename[0] = MPRIVKEYFILE_DEFAULT;
+ cacert_file->filename[0] = CACERT_DEFAULT;
+ hashalg_str->sval[0] = HASHALG_DEFAULT;
+
+ /* Parse the command line as defined by argtable[] */
+ nerrors = arg_parse(argc, argv, argtable);
+
+ if (help->count > 0) {
+ log_fmt(
+ "Usage: %s [OPTION]...\n"
+ "Create Intel(R) EPID signature of message\n"
+ "\n"
+ "Options:\n",
+ PROGRAM_NAME);
+ arg_print_glossary(stdout, argtable, " %-25s %s\n");
+ ret_value = EXIT_SUCCESS;
+ break;
+ }
+ if (verbose->count > 0) {
+ verbose_flag = ToggleVerbosity();
+ }
+ /* If the parser returned any errors then display them and exit */
+ if (nerrors > 0) {
+ /* Display the error details contained in the arg_end struct.*/
+ arg_print_errors(stderr, end, PROGRAM_NAME);
+ fprintf(stderr, "Try '%s --help' for more information.\n", PROGRAM_NAME);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
+
+ if (msg->count > 0 && msg_file->count > 0) {
+ log_error("options --msg and --msgfile cannot be used together");
+ ret_value = EXIT_FAILURE;
+ break;
+ } else if (msg->count > 0) {
+ msg_str = (char*)msg->sval[0];
+ msg_size = strlen(msg_str);
+ } else if (msg_file->count > 0) {
+ msg_buf = NewBufferFromFile(msg_file->filename[0], &msg_size);
+ if (!msg_buf) {
ret_value = EXIT_FAILURE;
break;
- } else if (show_help) {
- log_fmt(
- "Usage: %s [OPTION]...\n"
- "Create Intel(R) EPID signature of message\n"
- "\n"
- "Options:\n",
- PROGRAM_NAME);
- dropt_print_help(stdout, dropt_ctx, NULL);
- ret_value = EXIT_SUCCESS;
- break;
- } else if (*rest) {
- // we have unparsed (positional) arguments
- log_error("invalid argument: %s", *rest);
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
+ }
+ msg_str = msg_buf;
+ } else {
+ msg_size = 0;
+ }
+
+ if (basename->count > 0 && basename_file->count > 0) {
+ log_error("options --bsn and --bsnfile cannot be used together");
+ ret_value = EXIT_FAILURE;
+ break;
+ } else if (basename->count > 0) {
+ basename_str = (char*)basename->sval[0];
+ basename_size = strlen(basename_str);
+ } else if (basename_file->count > 0) {
+ basename_buf =
+ NewBufferFromFile(basename_file->filename[0], &basename_size);
+ if (!basename_buf) {
+ log_error("Failed in reading basename from %s", basename_file);
ret_value = EXIT_FAILURE;
break;
- } else {
- if (verbose) {
- verbose = ToggleVerbosity();
- }
- if (!sig_file) {
- sig_file = SIG_DEFAULT;
- }
- if (!pubkey_file) {
- pubkey_file = PUBKEYFILE_DEFAULT;
- }
- if (!mprivkey_file) {
- mprivkey_file = MPRIVKEYFILE_DEFAULT;
- }
- if (!cacert_file) {
- cacert_file = CACERT_DEFAULT;
- }
+ }
+ basename_str = basename_buf;
+ } else {
+ basename_size = 0;
+ }
- if (msg_str && msg_file) {
- log_error("options --msg and --msgfile cannot be used together");
- ret_value = EXIT_FAILURE;
- break;
- } else if (msg_str) {
- msg_size = strlen(msg_str);
- } else if (msg_file) {
- msg_buf = NewBufferFromFile(msg_file, &msg_size);
- if (!msg_buf) {
- ret_value = EXIT_FAILURE;
- break;
- }
- msg_str = msg_buf;
- } else {
- msg_size = 0;
- }
+ if (!StringToHashAlg(hashalg_str->sval[0], &hashalg)) {
+ log_error("invalid hashalg: %s", hashalg_str->sval[0]);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
- if (basename_str && basename_file) {
- log_error("options --bsn and --bsnfile cannot be used together");
- ret_value = EXIT_FAILURE;
- break;
- } else if (basename_str) {
- basename_size = strlen(basename_str);
- } else if (basename_file) {
- basename_buf = NewBufferFromFile(basename_file, &basename_size);
- if (!basename_buf) {
- log_error("Failed in reading basename from %s", basename_file);
- ret_value = EXIT_FAILURE;
- break;
- }
- basename_str = basename_buf;
- } else {
- basename_size = 0;
- }
- if (verbose) {
- log_msg("\nOption values:");
- log_msg(" sig_file : %s", sig_file);
- log_msg(" msg_str : %s", msg_str);
- log_msg(" basename_str : %s", basename_str);
- log_msg(" pubkey_file : %s", pubkey_file);
- log_msg(" mprivkey_file : %s", mprivkey_file);
- log_msg(" mprecmpi_file : %s", mprecmpi_file);
- log_msg(" hashalg : %s", HashAlgToString(hashalg));
- log_msg(" cacert_file : %s", cacert_file);
- log_msg("");
- }
- }
+ if (verbose_flag) {
+ log_msg("\nOption values:");
+ log_msg(" sig_file : %s", sig_file->filename[0]);
+ log_msg(" msg_str : %s", msg_str);
+ log_msg(" basename_str : %s", basename_str);
+ log_msg(" pubkey_file : %s", pubkey_file->filename[0]);
+ log_msg(" mprivkey_file : %s", mprivkey_file->filename[0]);
+ log_msg(" mprecmpi_file : %s", mprecmpi_file->filename[0]);
+ log_msg(" hashalg : %s", HashAlgToString(hashalg));
+ log_msg(" cacert_file : %s", cacert_file->filename[0]);
+ log_msg("");
}
// convert command line args to usable formats
// CA certificate
- if (0 != ReadLoud(cacert_file, &cacert, sizeof(cacert))) {
+ if (0 != ReadLoud(cacert_file->filename[0], &cacert, sizeof(cacert))) {
ret_value = EXIT_FAILURE;
break;
}
@@ -299,36 +266,40 @@ int main(int argc, char* argv[]) {
break;
}
// SigRl
- if (sigrl_file) {
- if (FileExists(sigrl_file)) {
- signed_sig_rl = NewBufferFromFile(sigrl_file, &signed_sig_rl_size);
+ if (sigrl_file->count > 0) {
+ if (FileExists(sigrl_file->filename[0])) {
+ signed_sig_rl =
+ NewBufferFromFile(sigrl_file->filename[0], &signed_sig_rl_size);
if (!signed_sig_rl) {
ret_value = EXIT_FAILURE;
break;
}
- if (0 != ReadLoud(sigrl_file, signed_sig_rl, signed_sig_rl_size)) {
+ if (0 != ReadLoud(sigrl_file->filename[0], signed_sig_rl,
+ signed_sig_rl_size)) {
ret_value = EXIT_FAILURE;
break;
}
} else {
- log_error("SigRL file %s does not exist", sigrl_file);
+ log_error("SigRL file %s does not exist", sigrl_file->filename[0]);
ret_value = EXIT_FAILURE;
break;
}
}
// Group public key file
- signed_pubkey = NewBufferFromFile(pubkey_file, &signed_pubkey_size);
+ signed_pubkey =
+ NewBufferFromFile(pubkey_file->filename[0], &signed_pubkey_size);
if (!signed_pubkey) {
ret_value = EXIT_FAILURE;
break;
}
- if (0 != ReadLoud(pubkey_file, signed_pubkey, signed_pubkey_size)) {
+ if (0 !=
+ ReadLoud(pubkey_file->filename[0], signed_pubkey, signed_pubkey_size)) {
ret_value = EXIT_FAILURE;
break;
}
// Member private key
- mprivkey = NewBufferFromFile(mprivkey_file, &mprivkey_size);
+ mprivkey = NewBufferFromFile(mprivkey_file->filename[0], &mprivkey_size);
if (!mprivkey) {
ret_value = EXIT_FAILURE;
break;
@@ -340,19 +311,20 @@ int main(int argc, char* argv[]) {
ret_value = EXIT_FAILURE;
break;
}
- if (0 != ReadLoud(mprivkey_file, mprivkey, mprivkey_size)) {
+ if (0 != ReadLoud(mprivkey_file->filename[0], mprivkey, mprivkey_size)) {
ret_value = EXIT_FAILURE;
break;
}
// Load Member pre-computed settings
- if (mprecmpi_file) {
- if (sizeof(MemberPrecomp) != GetFileSize(mprecmpi_file)) {
+ if (mprecmpi_file->count > 0) {
+ if (sizeof(MemberPrecomp) != GetFileSize(mprecmpi_file->filename[0])) {
log_error("incorrect input precomp size");
ret_value = EXIT_FAILURE;
break;
}
- if (0 != ReadLoud(mprecmpi_file, &member_precmp, sizeof(MemberPrecomp))) {
+ if (0 != ReadLoud(mprecmpi_file->filename[0], &member_precmp,
+ sizeof(MemberPrecomp))) {
ret_value = EXIT_FAILURE;
break;
}
@@ -360,7 +332,7 @@ int main(int argc, char* argv[]) {
}
// Report Settings
- if (verbose) {
+ if (verbose_flag) {
log_msg("==============================================");
log_msg("Signing Message:");
log_msg("");
@@ -413,7 +385,7 @@ int main(int argc, char* argv[]) {
if (sig && sig_size != 0) {
// Store signature
- if (0 != WriteLoud(sig, sig_size, sig_file)) {
+ if (0 != WriteLoud(sig, sig_size, sig_file->filename[0])) {
ret_value = EXIT_FAILURE;
break;
}
@@ -431,7 +403,7 @@ int main(int argc, char* argv[]) {
if (signed_pubkey) free(signed_pubkey);
if (mprivkey) free(mprivkey);
- dropt_free_context(dropt_ctx);
+ arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
return ret_value;
}
diff --git a/example/signmsg/src/signmsg.c b/example/signmsg/src/signmsg.c
index 5a70dbc..8dd37bc 100644
--- a/example/signmsg/src/signmsg.c
+++ b/example/signmsg/src/signmsg.c
@@ -50,6 +50,7 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
MembershipCredential member_credential = {0};
size_t sig_rl_size = 0;
MemberParams params = {0};
+ size_t member_size = 0;
if (!sig) {
sts = kEpidBadArgErr;
@@ -86,7 +87,16 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
SetMemberParams(&PrngGen, prng, NULL, &params);
// create member
- sts = EpidMemberCreate(&params, &member);
+ sts = EpidMemberGetSize(&params, &member_size);
+ if (kEpidNoErr != sts) {
+ break;
+ }
+ member = (MemberCtx*)calloc(1, member_size);
+ if (!member) {
+ sts = kEpidNoMemErr;
+ break;
+ }
+ sts = EpidMemberInit(&params, member);
if (kEpidNoErr != sts) {
break;
}
@@ -117,7 +127,7 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
// register any provided basename as allowed
if (0 != basename_len) {
- sts = EpidRegisterBaseName(member, basename, basename_len);
+ sts = EpidRegisterBasename(member, basename, basename_len);
if (kEpidNoErr != sts) {
break;
}
@@ -177,7 +187,8 @@ EpidStatus SignMsg(void const* msg, size_t msg_len, void const* basename,
} while (0);
PrngDelete(&prng);
- EpidMemberDelete(&member);
+ EpidMemberDeinit(member);
+ if (member) free(member);
if (sig_rl) free(sig_rl);
diff --git a/example/util/util.parts b/example/util/util.parts
index 585847a..289475b 100644
--- a/example/util/util.parts
+++ b/example/util/util.parts
@@ -43,7 +43,8 @@ if 'install_package' in env['MODE']:
env.InstallTopLevel(makefile, sub_dir='example/${PART_SHORT_NAME}')
else:
env.DependsOn(
- [Component('common', requires=REQ.HEADERS), Component('member')])
+ [Component('common', requires=REQ.HEADERS),
+ Component('member', requires=REQ.HEADERS)])
env.Append(CPPPATH='#/example')
diff --git a/example/verifysig/src/main.c b/example/verifysig/src/main.c
index 07a728c..c154db2 100644
--- a/example/verifysig/src/main.c
+++ b/example/verifysig/src/main.c
@@ -19,7 +19,7 @@
* \brief Verifysig example implementation.
*/
-#include <dropt.h>
+#include <argtable3.h>
#include <stdlib.h>
#include <string.h>
@@ -42,9 +42,10 @@
#define SIG_DEFAULT "sig.dat"
#define CACERT_DEFAULT "cacert.bin"
#define HASHALG_DEFAULT "SHA-512"
-#define UNPARSED_HASHALG (kInvalidHashAlg)
#define VPRECMPI_DEFAULT NULL
#define VPRECMPO_DEFAULT NULL
+#define ARGPARSE_ERROR_MAX 20
+#define ARGTABLE_SIZE 17
bool IsCaCertAuthorizedByRootCa(void const* data, size_t size) {
// Implementation of this function is out of scope of the sample.
@@ -55,26 +56,6 @@ bool IsCaCertAuthorizedByRootCa(void const* data, size_t size) {
return true;
}
-/// parses string to a hashalg type
-static dropt_error HandleHashalg(dropt_context* context,
- const char* option_argument,
- void* handler_data) {
- dropt_error err = dropt_error_none;
- HashAlg* hashalg = handler_data;
- (void)context;
- if (option_argument == NULL) {
- *hashalg = UNPARSED_HASHALG;
- } else if (option_argument[0] == '\0') {
- err = dropt_error_insufficient_arguments;
- } else if (StringToHashAlg(option_argument, hashalg)) {
- err = dropt_error_none;
- } else {
- /* Reject the value as being inappropriate for this handler. */
- err = dropt_error_mismatch;
- }
- return err;
-}
-
/// Main entrypoint
int main(int argc, char* argv[]) {
// intermediate return value for C style functions
@@ -84,50 +65,18 @@ int main(int argc, char* argv[]) {
// User Settings
- // Signature file name parameter
- static char* sig_file = SIG_DEFAULT;
-
// Message string parameter
static char* msg_str = NULL;
size_t msg_size = 0;
- static char* msg_file = NULL;
char* msg_buf = NULL; // message loaded from msg_file
// Basename string parameter
static char* basename_str = NULL;
size_t basename_size = 0;
- static char* basename_file = NULL;
char* basename_buf = NULL; // basename loaded from basename_file
- // PrivRl file name parameter
- static char* privrl_file = NULL;
-
- // SigRl file name parameter
- static char* sigrl_file = NULL;
-
- // GrpRl file name parameter
- static char* grprl_file = NULL;
-
- // VerRl file name parameter
- static char* verrl_file = NULL;
-
- // Group public key file name parameter
- static char* pubkey_file = NULL;
-
- // Verifier pre-computed settings input file name parameter
- static char* vprecmpi_file = NULL;
-
- // Verifier pre-computed settings output file name parameter
- static char* vprecmpo_file = NULL;
-
- // CA certificate file name parameter
- static char* cacert_file_name = NULL;
-
// Verbose flag parameter
- static bool verbose = false;
-
- // help flag parameter
- static bool show_help = false;
+ static bool verbose_flag = false;
// Buffers and computed values
@@ -162,52 +111,69 @@ int main(int argc, char* argv[]) {
// CA certificate
EpidCaCertificate cacert = {0};
// Hash algorithm
- static HashAlg hashalg = UNPARSED_HASHALG;
-
- dropt_option options[] = {
- {'\0', "sig", "load signature from FILE (default: " SIG_DEFAULT ")",
- "FILE", dropt_handle_string, &sig_file},
- {'\0', "msg", "MESSAGE that was signed (default: empty)", "MESSAGE",
- dropt_handle_string, &msg_str},
- {'\0', "msgfile", "FILE containing message that was signed", "FILE",
- dropt_handle_string, &msg_file},
- {'\0', "bsn", "BASENAME used in signature (default: random)", "BASENAME",
- dropt_handle_string, &basename_str},
- {'\0', "bsnfile", "FILE containing basename used in signature", "FILE",
- dropt_handle_string, &basename_file},
- {'\0', "privrl", "load private key revocation list from FILE", "FILE",
- dropt_handle_string, &privrl_file},
- {'\0', "sigrl", "load signature based revocation list from FILE", "FILE",
- dropt_handle_string, &sigrl_file},
- {'\0', "grprl",
- "load group revocation list from FILE\n (default: " GRPRL_DEFAULT ")",
- "FILE", dropt_handle_string, &grprl_file},
- {'\0', "verifierrl", "load verifier revocation list from FILE", "FILE",
- dropt_handle_string, &verrl_file},
- {'\0', "gpubkey",
- "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")",
- "FILE", dropt_handle_string, &pubkey_file},
- {'\0', "vprecmpi", "load pre-computed verifier data from FILE", "FILE",
- dropt_handle_string, &vprecmpi_file},
- {'\0', "vprecmpo", "write pre-computed verifier data to FILE", "FILE",
- dropt_handle_string, &vprecmpo_file},
- {'\0', "capubkey",
- "load IoT Issuing CA public key from FILE\n (default: " CACERT_DEFAULT
- ")",
- "FILE", dropt_handle_string, &cacert_file_name},
- {'\0', "hashalg",
- "use specified hash algorithm for 2.0 groups "
- "(default: " HASHALG_DEFAULT ")",
- "{SHA-256 | SHA-384 | SHA-512 | SHA512/256}", HandleHashalg, &hashalg},
- {'h', "help", "display this help and exit", NULL, dropt_handle_bool,
- &show_help, dropt_attr_halt},
- {'v', "verbose", "print status messages to stdout", NULL,
- dropt_handle_bool, &verbose},
-
- {0} /* Required sentinel value. */
- };
-
- dropt_context* dropt_ctx = NULL;
+ static HashAlg hashalg = kInvalidHashAlg;
+
+ // Argument variables
+ struct arg_file* sig_file =
+ arg_file0(NULL, "sig", "FILE",
+ "load signature from FILE (default: " SIG_DEFAULT ")");
+ struct arg_str* msg = arg_str0(NULL, "msg", "MESSAGE",
+ "MESSAGE that was signed (default: empty)");
+ struct arg_file* msg_file = arg_file0(
+ NULL, "msgfile", "FILE", "FILE containing message that was signed");
+ struct arg_str* basename = arg_str0(
+ NULL, "bsn", "BASENAME", "BASENAME used in signature (default: random)");
+ struct arg_file* basename_file = arg_file0(
+ NULL, "bsnfile", "FILE", "FILE containing basename used in signature");
+ struct arg_file* privrl_file = arg_file0(
+ NULL, "privrl", "FILE", "load private key revocation list from FILE");
+ struct arg_file* sigrl_file = arg_file0(
+ NULL, "sigrl", "FILE", "load signature based revocation list from FILE");
+ struct arg_file* grprl_file = arg_file0(
+ NULL, "grprl", "FILE",
+ "load group revocation list from FILE (default: " GRPRL_DEFAULT ")");
+ struct arg_file* verrl_file = arg_file0(
+ NULL, "verifierrl", "FILE", "load verifier revocation list from FILE");
+ struct arg_file* pubkey_file = arg_file0(
+ NULL, "gpubkey", "FILE",
+ "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")");
+ struct arg_file* vprecmpi_file = arg_file0(
+ NULL, "vprecmpi", "FILE", "load pre-computed verifier data from FILE");
+ struct arg_file* vprecmpo_file = arg_file0(
+ NULL, "vprecmpo", "FILE", "write pre-computed verifier data to FILE");
+ struct arg_file* cacert_file = arg_file0(
+ NULL, "capubkey", "FILE",
+ "load IoT Issuing CA public key from FILE (default: " CACERT_DEFAULT ")");
+ struct arg_str* hashalg_str = arg_str0(
+ NULL, "hashalg", "{SHA-256 | SHA-384 | SHA-512 | SHA-512/256}",
+ "use specified hash algorithm for 2.0 groups (default: " HASHALG_DEFAULT
+ ")");
+ struct arg_lit* help = arg_lit0(NULL, "help", "display this help and exit");
+ struct arg_lit* verbose =
+ arg_lit0("v", "verbose", "print status messages to stdout");
+ struct arg_end* end = arg_end(ARGPARSE_ERROR_MAX);
+ void* argtable[ARGTABLE_SIZE];
+ int nerrors;
+
+ /* initialize the argtable array with ptrs to the arg_xxx structures
+ * constructed above */
+ argtable[0] = sig_file;
+ argtable[1] = msg;
+ argtable[2] = msg_file;
+ argtable[3] = basename;
+ argtable[4] = basename_file;
+ argtable[5] = privrl_file;
+ argtable[6] = sigrl_file;
+ argtable[7] = grprl_file;
+ argtable[8] = verrl_file;
+ argtable[9] = pubkey_file;
+ argtable[10] = vprecmpi_file;
+ argtable[11] = vprecmpo_file;
+ argtable[12] = cacert_file;
+ argtable[13] = hashalg_str;
+ argtable[14] = help;
+ argtable[15] = verbose;
+ argtable[16] = end;
// set program name for logging
set_prog_name(PROGRAM_NAME);
@@ -215,117 +181,119 @@ int main(int argc, char* argv[]) {
EpidVersion epid_version = kNumEpidVersions;
// Read command line args
- dropt_ctx = dropt_new_context(options);
- if (!dropt_ctx) {
+ /* verify the argtable[] entries were allocated sucessfully */
+ if (arg_nullcheck(argtable) != 0) {
+ /* NULL entries were detected, some allocations must have failed */
+ printf("%s: insufficient memory\n", PROGRAM_NAME);
ret_value = EXIT_FAILURE;
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.
- */
- 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));
- if (dropt_error_invalid_option == dropt_get_error(dropt_ctx)) {
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- }
+ }
+
+ /* set any command line default values prior to parsing */
+ sig_file->filename[0] = SIG_DEFAULT;
+ grprl_file->filename[0] = GRPRL_DEFAULT;
+ pubkey_file->filename[0] = PUBKEYFILE_DEFAULT;
+ cacert_file->filename[0] = CACERT_DEFAULT;
+ hashalg_str->sval[0] = HASHALG_DEFAULT;
+
+ /* Parse the command line as defined by argtable[] */
+ nerrors = arg_parse(argc, argv, argtable);
+
+ if (help->count > 0) {
+ log_fmt(
+ "Usage: %s [OPTION]...\n"
+ "Verify signature was created by group member in good standing\n"
+ "\n"
+ "Options:\n",
+ PROGRAM_NAME);
+ arg_print_glossary(stdout, argtable, " %-25s %s\n");
+ ret_value = EXIT_SUCCESS;
+ break;
+ }
+ if (verbose->count > 0) {
+ verbose_flag = ToggleVerbosity();
+ }
+ /* If the parser returned any errors then display them and exit */
+ if (nerrors > 0) {
+ /* Display the error details contained in the arg_end struct.*/
+ arg_print_errors(stderr, end, PROGRAM_NAME);
+ fprintf(stderr, "Try '%s --help' for more information.\n", PROGRAM_NAME);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
+
+ if (msg->count > 0 && msg_file->count > 0) {
+ log_error("options --msg and --msgfile cannot be used together");
+ ret_value = EXIT_FAILURE;
+ break;
+ } else if (msg->count > 0) {
+ msg_str = (char*)msg->sval[0];
+ msg_size = strlen(msg_str);
+ } else if (msg_file->count > 0) {
+ msg_buf = NewBufferFromFile(msg_file->filename[0], &msg_size);
+ if (!msg_buf) {
ret_value = EXIT_FAILURE;
break;
- } else if (show_help) {
- log_fmt(
- "Usage: %s [OPTION]...\n"
- "Verify signature was created by group member in good standing\n"
- "\n"
- "Options:\n",
- PROGRAM_NAME);
- dropt_print_help(stdout, dropt_ctx, NULL);
- ret_value = EXIT_SUCCESS;
- break;
- } else if (*rest) {
- // we have unparsed (positional) arguments
- log_error("invalid argument: %s", *rest);
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
+ }
+ msg_str = msg_buf;
+ } else {
+ msg_size = 0;
+ }
+
+ if (basename->count > 0 && basename_file->count > 0) {
+ log_error("options --bsn and --bsnfile cannot be used together");
+ ret_value = EXIT_FAILURE;
+ break;
+ } else if (basename->count > 0) {
+ basename_str = (char*)basename->sval[0];
+ basename_size = strlen(basename_str);
+ } else if (basename_file->count > 0) {
+ basename_buf =
+ NewBufferFromFile(basename_file->filename[0], &basename_size);
+ if (!basename_buf) {
+ log_error("Failed in reading basename from %s", basename_file);
ret_value = EXIT_FAILURE;
break;
- } else {
- if (verbose) {
- verbose = ToggleVerbosity();
- }
- if (!sig_file) sig_file = SIG_DEFAULT;
- if (!grprl_file) grprl_file = GRPRL_DEFAULT;
- if (!pubkey_file) pubkey_file = PUBKEYFILE_DEFAULT;
- if (!cacert_file_name) cacert_file_name = CACERT_DEFAULT;
-
- if (msg_str && msg_file) {
- log_error("options --msg and --msgfile cannot be used together");
- ret_value = EXIT_FAILURE;
- break;
- } else if (msg_str) {
- msg_size = strlen(msg_str);
- } else if (msg_file) {
- msg_buf = NewBufferFromFile(msg_file, &msg_size);
- if (!msg_buf) {
- ret_value = EXIT_FAILURE;
- break;
- }
- msg_str = msg_buf;
- } else {
- msg_size = 0;
- }
+ }
+ basename_str = basename_buf;
+ } else {
+ basename_size = 0;
+ }
- if (basename_str && basename_file) {
- log_error("options --bsn and --bsnfile cannot be used together");
- ret_value = EXIT_FAILURE;
- break;
- } else if (basename_str) {
- basename_size = strlen(basename_str);
- } else if (basename_file) {
- basename_buf = NewBufferFromFile(basename_file, &basename_size);
- if (!basename_buf) {
- log_error("Failed in reading basename from %s", basename_file);
- ret_value = EXIT_FAILURE;
- break;
- }
- basename_str = basename_buf;
- } else {
- basename_size = 0;
- }
+ if (!StringToHashAlg(hashalg_str->sval[0], &hashalg)) {
+ log_error("invalid hashalg: %s", hashalg_str->sval[0]);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
- if (verbose) {
- log_msg("\nOption values:");
- log_msg(" sig_file : %s", sig_file);
- log_msg(" msg_str : %s", msg_str);
- log_msg(" basename_str : %s", basename_str);
- log_msg(" privrl_file : %s", privrl_file);
- log_msg(" sigrl_file : %s", sigrl_file);
- log_msg(" grprl_file : %s", grprl_file);
- 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(" cacert_file_name : %s", cacert_file_name);
- log_msg("");
- }
- }
+ if (verbose_flag) {
+ log_msg("\nOption values:");
+ log_msg(" sig_file : %s", sig_file->filename[0]);
+ log_msg(" msg_str : %s", msg_str);
+ log_msg(" basename_str : %s", basename_str);
+ log_msg(" privrl_file : %s", privrl_file->filename[0]);
+ log_msg(" sigrl_file : %s", sigrl_file->filename[0]);
+ log_msg(" grprl_file : %s", grprl_file->filename[0]);
+ log_msg(" verrl_file : %s", verrl_file->filename[0]);
+ log_msg(" vprecmpi_file : %s", vprecmpi_file->filename[0]);
+ log_msg(" vprecmpo_file : %s", vprecmpo_file->filename[0]);
+ log_msg(" hashalg : %s", HashAlgToString(hashalg));
+ log_msg(" cacert_file : %s", cacert_file->filename[0]);
+ log_msg("");
}
// convert command line args to usable formats
// Signature
- sig = NewBufferFromFile(sig_file, &sig_size);
+ sig = NewBufferFromFile(sig_file->filename[0], &sig_size);
if (!sig) {
ret_value = EXIT_FAILURE;
break;
}
// PrivRl
- if (privrl_file) {
- signed_priv_rl = NewBufferFromFile(privrl_file, &signed_priv_rl_size);
+ if (privrl_file->count > 0) {
+ signed_priv_rl =
+ NewBufferFromFile(privrl_file->filename[0], &signed_priv_rl_size);
if (!signed_priv_rl) {
ret_value = EXIT_FAILURE;
break;
@@ -333,8 +301,9 @@ int main(int argc, char* argv[]) {
}
// SigRl
- if (sigrl_file) {
- signed_sig_rl = NewBufferFromFile(sigrl_file, &signed_sig_rl_size);
+ if (sigrl_file->count > 0) {
+ signed_sig_rl =
+ NewBufferFromFile(sigrl_file->filename[0], &signed_sig_rl_size);
if (!signed_sig_rl) {
ret_value = EXIT_FAILURE;
break;
@@ -342,14 +311,16 @@ int main(int argc, char* argv[]) {
}
// GrpRl
- signed_grp_rl = NewBufferFromFile(grprl_file, &signed_grp_rl_size);
+ signed_grp_rl =
+ NewBufferFromFile(grprl_file->filename[0], &signed_grp_rl_size);
if (!signed_grp_rl) {
ret_value = EXIT_FAILURE;
break;
}
// VerRl
- if (verrl_file) {
- ver_rl = (VerifierRl*)NewBufferFromFile(verrl_file, &ver_rl_size);
+ if (verrl_file->count > 0) {
+ ver_rl =
+ (VerifierRl*)NewBufferFromFile(verrl_file->filename[0], &ver_rl_size);
if (!ver_rl) {
ret_value = EXIT_FAILURE;
break;
@@ -357,14 +328,15 @@ int main(int argc, char* argv[]) {
}
// Group public key
- signed_pubkey = NewBufferFromFile(pubkey_file, &signed_pubkey_size);
+ signed_pubkey =
+ NewBufferFromFile(pubkey_file->filename[0], &signed_pubkey_size);
if (!signed_pubkey) {
ret_value = EXIT_FAILURE;
break;
}
// CA certificate
- if (0 != ReadLoud(cacert_file_name, &cacert, sizeof(cacert))) {
+ if (0 != ReadLoud(cacert_file->filename[0], &cacert, sizeof(cacert))) {
ret_value = EXIT_FAILURE;
break;
}
@@ -390,33 +362,30 @@ int main(int argc, char* argv[]) {
// Configure hashalg based on group
if (kEpid1x == epid_version) {
- if (!(kSha256 == hashalg || UNPARSED_HASHALG == hashalg)) {
+ if (kSha256 != hashalg && hashalg_str->count > 0) {
log_error(
"unsupported hash algorithm: %s only supported for 2.0 groups",
HashAlgToString(hashalg));
ret_value = EXIT_FAILURE;
break;
}
- } else {
- if (UNPARSED_HASHALG == hashalg) {
- hashalg = kSha512;
- }
}
// Load Verifier pre-computed settings
- if (vprecmpi_file) {
- vprecmpi_file_size = GetFileSize_S(vprecmpi_file, SIZE_MAX);
+ if (vprecmpi_file->count > 0) {
+ vprecmpi_file_size = GetFileSize_S(vprecmpi_file->filename[0], SIZE_MAX);
verifier_precmp = AllocBuffer(vprecmpi_file_size);
- if (0 != ReadLoud(vprecmpi_file, verifier_precmp, vprecmpi_file_size)) {
+ if (0 != ReadLoud(vprecmpi_file->filename[0], verifier_precmp,
+ vprecmpi_file_size)) {
ret_value = EXIT_FAILURE;
break;
}
}
// Report Settings
- if (verbose) {
+ if (verbose_flag) {
log_msg("==============================================");
log_msg("Verifying Message:");
log_msg("");
@@ -455,7 +424,7 @@ int main(int argc, char* argv[]) {
PrintBuffer(signed_pubkey, sizeof(signed_pubkey_size));
log_msg("");
log_msg(" [in] Hash Algorithm: %s", HashAlgToString(hashalg));
- if (vprecmpi_file) {
+ if (vprecmpi_file->count > 0) {
log_msg("");
log_msg(" [in] Verifier PreComp: ");
PrintBuffer(verifier_precmp, vprecmpi_file_size);
@@ -517,8 +486,9 @@ int main(int argc, char* argv[]) {
}
// Store Verifier pre-computed settings
- if (vprecmpo_file) {
- if (0 != WriteLoud(verifier_precmp, vprecmpi_file_size, vprecmpo_file)) {
+ if (vprecmpo_file->count > 0) {
+ if (0 != WriteLoud(verifier_precmp, vprecmpi_file_size,
+ vprecmpo_file->filename[0])) {
ret_value = EXIT_FAILURE;
break;
}
@@ -539,7 +509,7 @@ int main(int argc, char* argv[]) {
if (signed_pubkey) free(signed_pubkey);
if (verifier_precmp) free(verifier_precmp);
- dropt_free_context(dropt_ctx);
+ arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
return ret_value;
}
diff --git a/example/verifysig/verifysig.parts b/example/verifysig/verifysig.parts
index 68b62df..2890ed2 100644
--- a/example/verifysig/verifysig.parts
+++ b/example/verifysig/verifysig.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.
@@ -36,7 +36,7 @@ else:
env.DependsOn([
Component('verifier'),
Component('util'),
- Component('dropt')
+ Component('argtable3')
])
env.Append(CPPPATH='#/example/verifysig')
diff --git a/ext/argtable3/LICENSE b/ext/argtable3/LICENSE
new file mode 100644
index 0000000..1a28ef9
--- /dev/null
+++ b/ext/argtable3/LICENSE
@@ -0,0 +1,26 @@
+Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+<sheitmann@users.sourceforge.net>
+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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+
diff --git a/ext/argtable3/Makefile b/ext/argtable3/Makefile
new file mode 100644
index 0000000..db76127
--- /dev/null
+++ b/ext/argtable3/Makefile
@@ -0,0 +1,22 @@
+#!/usr/bin/make -f
+
+ARGTABLE_SRC = $(wildcard *.c)
+ARGTABLE_OBJ = $(ARGTABLE_SRC:.c=.o)
+
+ARGTABLE_LIB = libargtable3.a
+
+$(ARGTABLE_OBJ): %.o: %.c
+ $(CC) -o $@ -c $(CFLAGS) $<
+
+$(ARGTABLE_LIB): $(ARGTABLE_OBJ)
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+build: all
+
+all: $(ARGTABLE_LIB)
+
+install:
+
+clean:
+ rm -f $(ARGTABLE_OBJ) $(ARGTABLE_LIB)
diff --git a/ext/argtable3/argtable3.c b/ext/argtable3/argtable3.c
new file mode 100644
index 0000000..a551005
--- /dev/null
+++ b/ext/argtable3/argtable3.c
@@ -0,0 +1,5062 @@
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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 HAS BEEN ALTERED from original version to:
+ // * fix warnings
+ // * fix issues found by static code analisys:
+ // - Null pointer dereference in trex_compile
+
+#include "argtable3.h"
+
+// On Windows isspace crashes app in case of using Unicode character set and string to be above ASCII
+// so you have to use _istspace instead of space
+#ifdef UNICODE
+#include <tchar.h>
+ #define ISSPACE _istspace
+#else
+ #define ISSPACE isspace
+#endif
+
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 2013 Tom G. Huang
+ * <tomghuang@gmail.com>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#ifndef ARG_UTILS_H
+#define ARG_UTILS_H
+
+#define ARG_ENABLE_TRACE 0
+#define ARG_ENABLE_LOG 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum
+{
+ EMINCOUNT = 1,
+ EMAXCOUNT,
+ EBADINT,
+ // The same name define EOVERFLOW in errno.h on windows platform
+#ifdef __STDC_WANT_SECURE_LIB__
+ EOVERFLOW_,
+#else
+ EOVERFLOW,
+#endif
+ EBADDOUBLE,
+ EBADDATE,
+ EREGNOMATCH
+};
+
+
+#if defined(_MSC_VER)
+#define ARG_TRACE(x) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable:4127)) \
+ do { if (ARG_ENABLE_TRACE) dbg_printf x; } while (0) \
+ __pragma(warning(pop))
+
+#define ARG_LOG(x) \
+ __pragma(warning(push)) \
+ __pragma(warning(disable:4127)) \
+ do { if (ARG_ENABLE_LOG) dbg_printf x; } while (0) \
+ __pragma(warning(pop))
+#else
+#define ARG_TRACE(x) \
+ do { if (ARG_ENABLE_TRACE) dbg_printf x; } while (0)
+
+#define ARG_LOG(x) \
+ do { if (ARG_ENABLE_LOG) dbg_printf x; } while (0)
+#endif
+
+extern void dbg_printf(const char *fmt, ...);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdarg.h>
+#include <stdio.h>
+
+
+void dbg_printf(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+
+/* $Id: getopt.h,v 1.1 2009/10/16 19:50:28 rodney Exp rodney $ */
+/* $OpenBSD: getopt.h,v 1.1 2002/12/03 20:24:29 millert Exp $ */
+/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#ifndef _GETOPT_H_
+#define _GETOPT_H_
+
+#if 0
+#include <sys/cdefs.h>
+#endif
+
+/*
+ * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
+ */
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+struct option {
+ /* name of long option */
+ const char *name;
+ /*
+ * one of no_argument, required_argument, and optional_argument:
+ * whether option takes an argument
+ */
+ int has_arg;
+ /* if not NULL, set *flag to val when option found */
+ int *flag;
+ /* if flag not NULL, value to set *flag to; else return value */
+ int val;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int getopt_long(int, char * const *, const char *,
+ const struct option *, int *);
+int getopt_long_only(int, char * const *, const char *,
+ const struct option *, int *);
+#ifndef _GETOPT_DEFINED
+#define _GETOPT_DEFINED
+int getopt(int, char * const *, const char *);
+int getsubopt(char **, char * const *, char **);
+
+extern char *optarg; /* getopt(3) external variables */
+extern int opterr;
+extern int optind;
+extern int optopt;
+extern int optreset;
+extern char *suboptarg; /* getsubopt(3) external variable */
+#endif /* _GETOPT_DEFINED */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !_GETOPT_H_ */
+/* $Id: getopt_long.c,v 1.1 2009/10/16 19:50:28 rodney Exp rodney $ */
+/* $OpenBSD: getopt_long.c,v 1.23 2007/10/31 12:34:57 chl Exp $ */
+/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
+
+/*
+ * Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Sponsored in part by the Defense Advanced Research Projects
+ * Agency (DARPA) and Air Force Research Laboratory, Air Force
+ * Materiel Command, USAF, under agreement number F39502-99-1-0512.
+ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#if 0
+#include <err.h>
+#endif
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define REPLACE_GETOPT /* use this getopt as the system getopt(3) */
+
+#ifdef REPLACE_GETOPT
+int opterr = 1; /* if error message should be printed */
+int optind = 1; /* index into parent argv vector */
+int optopt = '?'; /* character checked for validity */
+int optreset; /* reset getopt */
+char *optarg; /* argument associated with option */
+#endif
+
+#define PRINT_ERROR ((opterr) && (*options != ':'))
+
+#define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */
+#define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */
+#define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */
+
+/* return values */
+#define BADCH (int)'?'
+#define BADARG ((*options == ':') ? (int)':' : (int)'?')
+#define INORDER (int)1
+
+#define EMSG ""
+
+static int getopt_internal(int, char * const *, const char *,
+ const struct option *, int *, int);
+static int parse_long_options(char * const *, const char *,
+ const struct option *, int *, int);
+static int gcd(int, int);
+static void permute_args(int, int, int, char * const *);
+
+static char *place = EMSG; /* option letter processing */
+
+/* XXX: set optreset to 1 rather than these two */
+static int nonopt_start = -1; /* first non option argument (for permute) */
+static int nonopt_end = -1; /* first option after non options (for permute) */
+
+/* Error messages */
+static const char recargchar[] = "option requires an argument -- %c";
+static const char recargstring[] = "option requires an argument -- %s";
+static const char ambig[] = "ambiguous option -- %.*s";
+static const char noarg[] = "option doesn't take an argument -- %.*s";
+static const char illoptchar[] = "unknown option -- %c";
+static const char illoptstring[] = "unknown option -- %s";
+
+
+
+#ifdef _WIN32
+
+/* Windows needs warnx(). We change the definition though:
+ * 1. (another) global is defined, opterrmsg, which holds the error message
+ * 2. errors are always printed out on stderr w/o the program name
+ * Note that opterrmsg always gets set no matter what opterr is set to. The
+ * error message will not be printed if opterr is 0 as usual.
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#define MAX_OPTER_MSG_SIZE 128
+
+extern char opterrmsg[MAX_OPTER_MSG_SIZE];
+char opterrmsg[MAX_OPTER_MSG_SIZE]; /* buffer for the last error message */
+
+static void warnx(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ /*
+ Make sure opterrmsg is always zero-terminated despite the _vsnprintf()
+ implementation specifics and manually suppress the warning.
+ */
+ memset(opterrmsg, 0, sizeof opterrmsg);
+ if (fmt != NULL)
+#ifdef __STDC_WANT_SECURE_LIB__
+ _vsnprintf_s(opterrmsg, MAX_OPTER_MSG_SIZE, sizeof(opterrmsg) - 1, fmt, ap);
+#else
+ _vsnprintf(opterrmsg, sizeof(opterrmsg) - 1, fmt, ap);
+#endif
+ va_end(ap);
+
+#ifndef __ICL
+#pragma warning(suppress: 6053)
+#endif
+ fprintf(stderr, "%s\n", opterrmsg);
+}
+
+#else
+#include <err.h>
+#endif /*_WIN32*/
+
+
+/*
+ * Compute the greatest common divisor of a and b.
+ */
+static int
+gcd(int a, int b)
+{
+ int c;
+
+ c = a % b;
+ while (c != 0) {
+ a = b;
+ b = c;
+ c = a % b;
+ }
+
+ return (b);
+}
+
+/*
+ * Exchange the block from nonopt_start to nonopt_end with the block
+ * from nonopt_end to opt_end (keeping the same order of arguments
+ * in each block).
+ */
+static void
+permute_args(int panonopt_start, int panonopt_end, int opt_end,
+ char * const *nargv)
+{
+ int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
+ char *swap;
+
+ /*
+ * compute lengths of blocks and number and size of cycles
+ */
+ nnonopts = panonopt_end - panonopt_start;
+ nopts = opt_end - panonopt_end;
+ ncycle = gcd(nnonopts, nopts);
+ cyclelen = (opt_end - panonopt_start) / ncycle;
+
+ for (i = 0; i < ncycle; i++) {
+ cstart = panonopt_end+i;
+ pos = cstart;
+ for (j = 0; j < cyclelen; j++) {
+ if (pos >= panonopt_end)
+ pos -= nnonopts;
+ else
+ pos += nopts;
+ swap = nargv[pos];
+ /* LINTED const cast */
+ ((char **) nargv)[pos] = nargv[cstart];
+ /* LINTED const cast */
+ ((char **)nargv)[cstart] = swap;
+ }
+ }
+}
+
+/*
+ * parse_long_options --
+ * Parse long options in argc/argv argument vector.
+ * Returns -1 if short_too is set and the option does not match long_options.
+ */
+static int
+parse_long_options(char * const *nargv, const char *options,
+ const struct option *long_options, int *idx, int short_too)
+{
+ char *current_argv, *has_equal;
+ size_t current_argv_len;
+ int i, match;
+
+ current_argv = place;
+ match = -1;
+
+ optind++;
+
+ if ((has_equal = strchr(current_argv, '=')) != NULL) {
+ /* argument found (--option=arg) */
+ current_argv_len = has_equal - current_argv;
+ has_equal++;
+ } else
+ current_argv_len = strlen(current_argv);
+
+ for (i = 0; long_options[i].name; i++) {
+ /* find matching long option */
+ if (strncmp(current_argv, long_options[i].name,
+ current_argv_len))
+ continue;
+
+ if (strlen(long_options[i].name) == current_argv_len) {
+ /* exact match */
+ match = i;
+ break;
+ }
+ /*
+ * If this is a known short option, don't allow
+ * a partial match of a single character.
+ */
+ if (short_too && current_argv_len == 1)
+ continue;
+
+ if (match == -1) /* partial match */
+ match = i;
+ else {
+ /* ambiguous abbreviation */
+ if (PRINT_ERROR)
+ warnx(ambig, (int)current_argv_len,
+ current_argv);
+ optopt = 0;
+ return (BADCH);
+ }
+ }
+ if (match != -1) { /* option found */
+ if (long_options[match].has_arg == no_argument
+ && has_equal) {
+ if (PRINT_ERROR)
+ warnx(noarg, (int)current_argv_len,
+ current_argv);
+ /*
+ * XXX: GNU sets optopt to val regardless of flag
+ */
+ if (long_options[match].flag == NULL)
+ optopt = long_options[match].val;
+ else
+ optopt = 0;
+ return (BADARG);
+ }
+ if (long_options[match].has_arg == required_argument ||
+ long_options[match].has_arg == optional_argument) {
+ if (has_equal)
+ optarg = has_equal;
+ else if (long_options[match].has_arg ==
+ required_argument) {
+ /*
+ * optional argument doesn't use next nargv
+ */
+ optarg = nargv[optind++];
+ }
+ }
+ if ((long_options[match].has_arg == required_argument)
+ && (optarg == NULL)) {
+ /*
+ * Missing argument; leading ':' indicates no error
+ * should be generated.
+ */
+ if (PRINT_ERROR)
+ warnx(recargstring,
+ current_argv);
+ /*
+ * XXX: GNU sets optopt to val regardless of flag
+ */
+ if (long_options[match].flag == NULL)
+ optopt = long_options[match].val;
+ else
+ optopt = 0;
+ --optind;
+ return (BADARG);
+ }
+ } else { /* unknown option */
+ if (short_too) {
+ --optind;
+ return (-1);
+ }
+ if (PRINT_ERROR)
+ warnx(illoptstring, current_argv);
+ optopt = 0;
+ return (BADCH);
+ }
+ if (idx)
+ *idx = match;
+ if (long_options[match].flag) {
+ *long_options[match].flag = long_options[match].val;
+ return (0);
+ } else
+ return (long_options[match].val);
+}
+
+/*
+ * getopt_internal --
+ * Parse argc/argv argument vector. Called by user level routines.
+ */
+static int
+getopt_internal(int nargc, char * const *nargv, const char *options,
+ const struct option *long_options, int *idx, int flags)
+{
+ char *oli; /* option letter list index */
+ int optchar, short_too;
+ static int posixly_correct = -1;
+#ifdef __STDC_WANT_SECURE_LIB__
+ char* buffer = NULL;
+ size_t buffer_size = 0;
+ errno_t err = 0;
+#endif
+
+ if (options == NULL)
+ return (-1);
+
+ /*
+ * Disable GNU extensions if POSIXLY_CORRECT is set or options
+ * string begins with a '+'.
+ */
+
+#ifdef __STDC_WANT_SECURE_LIB__
+ if (posixly_correct == -1) {
+ err = _dupenv_s(&buffer, &buffer_size, "POSIXLY_CORRECT") == 0;
+ posixly_correct = buffer != NULL;
+ if(buffer != NULL && err == 0) {
+ free(buffer);
+ }
+ }
+#else
+ if (posixly_correct == -1)
+ posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
+#endif
+ if (posixly_correct || *options == '+')
+ flags &= ~FLAG_PERMUTE;
+ else if (*options == '-')
+ flags |= FLAG_ALLARGS;
+ if (*options == '+' || *options == '-')
+ options++;
+
+ /*
+ * XXX Some GNU programs (like cvs) set optind to 0 instead of
+ * XXX using optreset. Work around this braindamage.
+ */
+ if (optind == 0)
+ optind = optreset = 1;
+
+ optarg = NULL;
+ if (optreset)
+ nonopt_start = nonopt_end = -1;
+start:
+ if (optreset || !*place) { /* update scanning pointer */
+ optreset = 0;
+ if (optind >= nargc) { /* end of argument vector */
+ place = EMSG;
+ if (nonopt_end != -1) {
+ /* do permutation, if we have to */
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ optind -= nonopt_end - nonopt_start;
+ }
+ else if (nonopt_start != -1) {
+ /*
+ * If we skipped non-options, set optind
+ * to the first of them.
+ */
+ optind = nonopt_start;
+ }
+ nonopt_start = nonopt_end = -1;
+ return (-1);
+ }
+ if (*(place = nargv[optind]) != '-' ||
+ (place[1] == '\0' && strchr(options, '-') == NULL)) {
+ place = EMSG; /* found non-option */
+ if (flags & FLAG_ALLARGS) {
+ /*
+ * GNU extension:
+ * return non-option as argument to option 1
+ */
+ optarg = nargv[optind++];
+ return (INORDER);
+ }
+ if (!(flags & FLAG_PERMUTE)) {
+ /*
+ * If no permutation wanted, stop parsing
+ * at first non-option.
+ */
+ return (-1);
+ }
+ /* do permutation */
+ if (nonopt_start == -1)
+ nonopt_start = optind;
+ else if (nonopt_end != -1) {
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ nonopt_start = optind -
+ (nonopt_end - nonopt_start);
+ nonopt_end = -1;
+ }
+ optind++;
+ /* process next argument */
+ goto start;
+ }
+ if (nonopt_start != -1 && nonopt_end == -1)
+ nonopt_end = optind;
+
+ /*
+ * If we have "-" do nothing, if "--" we are done.
+ */
+ if (place[1] != '\0' && *++place == '-' && place[1] == '\0') {
+ optind++;
+ place = EMSG;
+ /*
+ * We found an option (--), so if we skipped
+ * non-options, we have to permute.
+ */
+ if (nonopt_end != -1) {
+ permute_args(nonopt_start, nonopt_end,
+ optind, nargv);
+ optind -= nonopt_end - nonopt_start;
+ }
+ nonopt_start = nonopt_end = -1;
+ return (-1);
+ }
+ }
+
+ /*
+ * Check long options if:
+ * 1) we were passed some
+ * 2) the arg is not just "-"
+ * 3) either the arg starts with -- we are getopt_long_only()
+ */
+ if (long_options != NULL && place != nargv[optind] &&
+ (*place == '-' || (flags & FLAG_LONGONLY))) {
+ short_too = 0;
+ if (*place == '-')
+ place++; /* --foo long option */
+ else if (*place != ':' && strchr(options, *place) != NULL)
+ short_too = 1; /* could be short option too */
+
+ optchar = parse_long_options(nargv, options, long_options,
+ idx, short_too);
+ if (optchar != -1) {
+ place = EMSG;
+ return (optchar);
+ }
+ }
+
+ if ((optchar = (int)*place++) == (int)':' ||
+ (optchar == (int)'-' && *place != '\0') ||
+ (oli = strchr(options, optchar)) == NULL) {
+ /*
+ * If the user specified "-" and '-' isn't listed in
+ * options, return -1 (non-option) as per POSIX.
+ * Otherwise, it is an unknown option character (or ':').
+ */
+ if (optchar == (int)'-' && *place == '\0')
+ return (-1);
+ if (!*place)
+ ++optind;
+ if (PRINT_ERROR)
+ warnx(illoptchar, optchar);
+ optopt = optchar;
+ return (BADCH);
+ }
+ if (long_options != NULL && optchar == 'W' && oli[1] == ';') {
+ /* -W long-option */
+ if (*place) /* no space */
+ /* NOTHING */;
+ else if (++optind >= nargc) { /* no arg */
+ place = EMSG;
+ if (PRINT_ERROR)
+ warnx(recargchar, optchar);
+ optopt = optchar;
+ return (BADARG);
+ } else /* white space */
+ place = nargv[optind];
+ optchar = parse_long_options(nargv, options, long_options,
+ idx, 0);
+ place = EMSG;
+ return (optchar);
+ }
+ if (*++oli != ':') { /* doesn't take argument */
+ if (!*place)
+ ++optind;
+ } else { /* takes (optional) argument */
+ optarg = NULL;
+ if (*place) /* no white space */
+ optarg = place;
+ else if (oli[1] != ':') { /* arg not optional */
+ if (++optind >= nargc) { /* no arg */
+ place = EMSG;
+ if (PRINT_ERROR)
+ warnx(recargchar, optchar);
+ optopt = optchar;
+ return (BADARG);
+ } else
+ optarg = nargv[optind];
+ }
+ place = EMSG;
+ ++optind;
+ }
+ /* dump back option letter */
+ return (optchar);
+}
+
+#ifdef REPLACE_GETOPT
+/*
+ * getopt --
+ * Parse argc/argv argument vector.
+ *
+ * [eventually this will replace the BSD getopt]
+ */
+int
+getopt(int nargc, char * const *nargv, const char *options)
+{
+
+ /*
+ * We don't pass FLAG_PERMUTE to getopt_internal() since
+ * the BSD getopt(3) (unlike GNU) has never done this.
+ *
+ * Furthermore, since many privileged programs call getopt()
+ * before dropping privileges it makes sense to keep things
+ * as simple (and bug-free) as possible.
+ */
+ return (getopt_internal(nargc, nargv, options, NULL, NULL, 0));
+}
+#endif /* REPLACE_GETOPT */
+
+/*
+ * getopt_long --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt_long(int nargc, char * const *nargv, const char *options,
+ const struct option *long_options, int *idx)
+{
+
+ return (getopt_internal(nargc, nargv, options, long_options, idx,
+ FLAG_PERMUTE));
+}
+
+/*
+ * getopt_long_only --
+ * Parse argc/argv argument vector.
+ */
+int
+getopt_long_only(int nargc, char * const *nargv, const char *options,
+ const struct option *long_options, int *idx)
+{
+
+ return (getopt_internal(nargc, nargv, options, long_options, idx,
+ FLAG_PERMUTE|FLAG_LONGONLY));
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "argtable3.h"
+
+
+char * arg_strptime(const char *buf, const char *fmt, struct tm *tm);
+
+
+static void arg_date_resetfn(struct arg_date *parent)
+{
+ ARG_TRACE(("%s:resetfn(%p)\n", __FILE__, parent));
+ parent->count = 0;
+}
+
+
+static int arg_date_scanfn(struct arg_date *parent, const char *argval)
+{
+ int errorcode = 0;
+
+ if (parent->count == parent->hdr.maxcount)
+ {
+ errorcode = EMAXCOUNT;
+ }
+ else if (!argval)
+ {
+ /* no argument value was given, leave parent->tmval[] unaltered but still count it */
+ parent->count++;
+ }
+ else
+ {
+ const char *pend;
+ struct tm tm = parent->tmval[parent->count];
+
+ /* parse the given argument value, store result in parent->tmval[] */
+ pend = arg_strptime(argval, parent->format, &tm);
+ if (pend && pend[0] == '\0')
+ parent->tmval[parent->count++] = tm;
+ else
+ errorcode = EBADDATE;
+ }
+
+ ARG_TRACE(("%s:scanfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static int arg_date_checkfn(struct arg_date *parent)
+{
+ int errorcode = (parent->count < parent->hdr.mincount) ? EMINCOUNT : 0;
+
+ ARG_TRACE(("%s:checkfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static void arg_date_errorfn(
+ struct arg_date *parent,
+ FILE *fp,
+ int errorcode,
+ const char *argval,
+ const char *progname)
+{
+ const char *shortopts = parent->hdr.shortopts;
+ const char *longopts = parent->hdr.longopts;
+ const char *datatype = parent->hdr.datatype;
+
+ /* make argval NULL safe */
+ argval = argval ? argval : "";
+
+ fprintf(fp, "%s: ", progname);
+ switch(errorcode)
+ {
+ case EMINCOUNT:
+ fputs("missing option ", fp);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+
+ case EMAXCOUNT:
+ fputs("excess option ", fp);
+ arg_print_option(fp, shortopts, longopts, argval, "\n");
+ break;
+
+ case EBADDATE:
+ {
+ struct tm tm;
+ char buff[200];
+
+ fprintf(fp, "illegal timestamp format \"%s\"\n", argval);
+ memset(&tm, 0, sizeof(tm));
+ arg_strptime("1999-12-31 23:59:59", "%F %H:%M:%S", &tm);
+ strftime(buff, sizeof(buff), parent->format, &tm);
+ printf("correct format is \"%s\"\n", buff);
+ break;
+ }
+ }
+}
+
+
+struct arg_date * arg_date0(
+ const char * shortopts,
+ const char * longopts,
+ const char * format,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_daten(shortopts, longopts, format, datatype, 0, 1, glossary);
+}
+
+
+struct arg_date * arg_date1(
+ const char * shortopts,
+ const char * longopts,
+ const char * format,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_daten(shortopts, longopts, format, datatype, 1, 1, glossary);
+}
+
+
+struct arg_date * arg_daten(
+ const char * shortopts,
+ const char * longopts,
+ const char * format,
+ const char *datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary)
+{
+ size_t nbytes;
+ struct arg_date *result;
+
+ /* foolproof things by ensuring maxcount is not less than mincount */
+ maxcount = (maxcount < mincount) ? mincount : maxcount;
+
+ /* default time format is the national date format for the locale */
+ if (!format)
+ format = "%x";
+
+ nbytes = sizeof(struct arg_date) /* storage for struct arg_date */
+ + maxcount * sizeof(struct tm); /* storage for tmval[maxcount] array */
+
+ /* allocate storage for the arg_date struct + tmval[] array. */
+ /* we use calloc because we want the tmval[] array zero filled. */
+ result = (struct arg_date *)calloc(1, nbytes);
+ if (result)
+ {
+ /* init the arg_hdr struct */
+ result->hdr.flag = ARG_HASVALUE;
+ result->hdr.shortopts = shortopts;
+ result->hdr.longopts = longopts;
+ result->hdr.datatype = datatype ? datatype : format;
+ result->hdr.glossary = glossary;
+ result->hdr.mincount = mincount;
+ result->hdr.maxcount = maxcount;
+ result->hdr.parent = result;
+ result->hdr.resetfn = (arg_resetfn *)arg_date_resetfn;
+ result->hdr.scanfn = (arg_scanfn *)arg_date_scanfn;
+ result->hdr.checkfn = (arg_checkfn *)arg_date_checkfn;
+ result->hdr.errorfn = (arg_errorfn *)arg_date_errorfn;
+
+ /* store the tmval[maxcount] array immediately after the arg_date struct */
+ result->tmval = (struct tm *)(result + 1);
+
+ /* init the remaining arg_date member variables */
+ result->count = 0;
+ result->format = format;
+ }
+
+ ARG_TRACE(("arg_daten() returns %p\n", result));
+ return result;
+}
+
+
+/*-
+ * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code was contributed to The NetBSD Foundation by Klaus Klein.
+ * Heavily optimised by David Laight
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#include <ctype.h>
+#include <string.h>
+#include <time.h>
+
+/*
+ * We do not implement alternate representations. However, we always
+ * check whether a given modifier is allowed for a certain conversion.
+ */
+#define ALT_E 0x01
+#define ALT_O 0x02
+#define LEGAL_ALT(x) { if (alt_format & ~(x)) return (0); }
+#define TM_YEAR_BASE (1900)
+
+static int conv_num(const char * *, int *, int, int);
+
+static const char *day[7] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
+ "Friday", "Saturday"
+};
+
+static const char *abday[7] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+};
+
+static const char *mon[12] = {
+ "January", "February", "March", "April", "May", "June", "July",
+ "August", "September", "October", "November", "December"
+};
+
+static const char *abmon[12] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
+
+static const char *am_pm[2] = {
+ "AM", "PM"
+};
+
+
+static int arg_strcasecmp(const char *s1, const char *s2)
+{
+ const unsigned char *us1 = (const unsigned char *)s1;
+ const unsigned char *us2 = (const unsigned char *)s2;
+ while (tolower(*us1) == tolower(*us2++))
+ if (*us1++ == '\0')
+ return 0;
+
+ return tolower(*us1) - tolower(*--us2);
+}
+
+
+static int arg_strncasecmp(const char *s1, const char *s2, size_t n)
+{
+ if (n != 0)
+ {
+ const unsigned char *us1 = (const unsigned char *)s1;
+ const unsigned char *us2 = (const unsigned char *)s2;
+ do
+ {
+ if (tolower(*us1) != tolower(*us2++))
+ return tolower(*us1) - tolower(*--us2);
+
+ if (*us1++ == '\0')
+ break;
+ } while (--n != 0);
+ }
+
+ return 0;
+}
+
+
+char * arg_strptime(const char *buf, const char *fmt, struct tm *tm)
+{
+ char c;
+ const char *bp;
+ size_t len = 0;
+ int alt_format, i, split_year = 0;
+
+ bp = buf;
+
+ while ((c = *fmt) != '\0') {
+ /* Clear `alternate' modifier prior to new conversion. */
+ alt_format = 0;
+
+ /* Eat up white-space. */
+ if (ISSPACE(c)) {
+ while (ISSPACE(*bp))
+ bp++;
+
+ fmt++;
+ continue;
+ }
+
+ if ((c = *fmt++) != '%')
+ goto literal;
+
+
+again:
+ switch (c = *fmt++)
+ {
+ case '%': /* "%%" is converted to "%". */
+literal:
+ if (c != *bp++)
+ return (0);
+ break;
+
+ /*
+ * "Alternative" modifiers. Just set the appropriate flag
+ * and start over again.
+ */
+ case 'E': /* "%E?" alternative conversion modifier. */
+ LEGAL_ALT(0);
+ alt_format |= ALT_E;
+ goto again;
+
+ case 'O': /* "%O?" alternative conversion modifier. */
+ LEGAL_ALT(0);
+ alt_format |= ALT_O;
+ goto again;
+
+ /*
+ * "Complex" conversion rules, implemented through recursion.
+ */
+ case 'c': /* Date and time, using the locale's format. */
+ LEGAL_ALT(ALT_E);
+ bp = arg_strptime(bp, "%x %X", tm);
+ if (!bp)
+ return (0);
+ break;
+
+ case 'D': /* The date as "%m/%d/%y". */
+ LEGAL_ALT(0);
+ bp = arg_strptime(bp, "%m/%d/%y", tm);
+ if (!bp)
+ return (0);
+ break;
+
+ case 'R': /* The time as "%H:%M". */
+ LEGAL_ALT(0);
+ bp = arg_strptime(bp, "%H:%M", tm);
+ if (!bp)
+ return (0);
+ break;
+
+ case 'r': /* The time in 12-hour clock representation. */
+ LEGAL_ALT(0);
+ bp = arg_strptime(bp, "%I:%M:%S %p", tm);
+ if (!bp)
+ return (0);
+ break;
+
+ case 'T': /* The time as "%H:%M:%S". */
+ LEGAL_ALT(0);
+ bp = arg_strptime(bp, "%H:%M:%S", tm);
+ if (!bp)
+ return (0);
+ break;
+
+ case 'X': /* The time, using the locale's format. */
+ LEGAL_ALT(ALT_E);
+ bp = arg_strptime(bp, "%H:%M:%S", tm);
+ if (!bp)
+ return (0);
+ break;
+
+ case 'x': /* The date, using the locale's format. */
+ LEGAL_ALT(ALT_E);
+ bp = arg_strptime(bp, "%m/%d/%y", tm);
+ if (!bp)
+ return (0);
+ break;
+
+ /*
+ * "Elementary" conversion rules.
+ */
+ case 'A': /* The day of week, using the locale's form. */
+ case 'a':
+ LEGAL_ALT(0);
+ for (i = 0; i < 7; i++) {
+ /* Full name. */
+ len = strlen(day[i]);
+ if (arg_strncasecmp(day[i], bp, len) == 0)
+ break;
+
+ /* Abbreviated name. */
+ len = strlen(abday[i]);
+ if (arg_strncasecmp(abday[i], bp, len) == 0)
+ break;
+ }
+
+ /* Nothing matched. */
+ if (i == 7)
+ return (0);
+
+ tm->tm_wday = i;
+ bp += len;
+ break;
+
+ case 'B': /* The month, using the locale's form. */
+ case 'b':
+ case 'h':
+ LEGAL_ALT(0);
+ for (i = 0; i < 12; i++) {
+ /* Full name. */
+ len = strlen(mon[i]);
+ if (arg_strncasecmp(mon[i], bp, len) == 0)
+ break;
+
+ /* Abbreviated name. */
+ len = strlen(abmon[i]);
+ if (arg_strncasecmp(abmon[i], bp, len) == 0)
+ break;
+ }
+
+ /* Nothing matched. */
+ if (i == 12)
+ return (0);
+
+ tm->tm_mon = i;
+ bp += len;
+ break;
+
+ case 'C': /* The century number. */
+ LEGAL_ALT(ALT_E);
+ if (!(conv_num(&bp, &i, 0, 99)))
+ return (0);
+
+ if (split_year) {
+ tm->tm_year = (tm->tm_year % 100) + (i * 100);
+ } else {
+ tm->tm_year = i * 100;
+ split_year = 1;
+ }
+ break;
+
+ case 'd': /* The day of month. */
+ case 'e':
+ LEGAL_ALT(ALT_O);
+ if (!(conv_num(&bp, &tm->tm_mday, 1, 31)))
+ return (0);
+ break;
+
+ case 'k': /* The hour (24-hour clock representation). */
+ LEGAL_ALT(0);
+ /* FALLTHROUGH */
+ case 'H':
+ LEGAL_ALT(ALT_O);
+ if (!(conv_num(&bp, &tm->tm_hour, 0, 23)))
+ return (0);
+ break;
+
+ case 'l': /* The hour (12-hour clock representation). */
+ LEGAL_ALT(0);
+ /* FALLTHROUGH */
+ case 'I':
+ LEGAL_ALT(ALT_O);
+ if (!(conv_num(&bp, &tm->tm_hour, 1, 12)))
+ return (0);
+ if (tm->tm_hour == 12)
+ tm->tm_hour = 0;
+ break;
+
+ case 'j': /* The day of year. */
+ LEGAL_ALT(0);
+ if (!(conv_num(&bp, &i, 1, 366)))
+ return (0);
+ tm->tm_yday = i - 1;
+ break;
+
+ case 'M': /* The minute. */
+ LEGAL_ALT(ALT_O);
+ if (!(conv_num(&bp, &tm->tm_min, 0, 59)))
+ return (0);
+ break;
+
+ case 'm': /* The month. */
+ LEGAL_ALT(ALT_O);
+ if (!(conv_num(&bp, &i, 1, 12)))
+ return (0);
+ tm->tm_mon = i - 1;
+ break;
+
+ case 'p': /* The locale's equivalent of AM/PM. */
+ LEGAL_ALT(0);
+ /* AM? */
+ if (arg_strcasecmp(am_pm[0], bp) == 0) {
+ if (tm->tm_hour > 11)
+ return (0);
+
+ bp += strlen(am_pm[0]);
+ break;
+ }
+ /* PM? */
+ else if (arg_strcasecmp(am_pm[1], bp) == 0) {
+ if (tm->tm_hour > 11)
+ return (0);
+
+ tm->tm_hour += 12;
+ bp += strlen(am_pm[1]);
+ break;
+ }
+
+ /* Nothing matched. */
+ return (0);
+
+ case 'S': /* The seconds. */
+ LEGAL_ALT(ALT_O);
+ if (!(conv_num(&bp, &tm->tm_sec, 0, 61)))
+ return (0);
+ break;
+
+ case 'U': /* The week of year, beginning on sunday. */
+ case 'W': /* The week of year, beginning on monday. */
+ LEGAL_ALT(ALT_O);
+ /*
+ * XXX This is bogus, as we can not assume any valid
+ * information present in the tm structure at this
+ * point to calculate a real value, so just check the
+ * range for now.
+ */
+ if (!(conv_num(&bp, &i, 0, 53)))
+ return (0);
+ break;
+
+ case 'w': /* The day of week, beginning on sunday. */
+ LEGAL_ALT(ALT_O);
+ if (!(conv_num(&bp, &tm->tm_wday, 0, 6)))
+ return (0);
+ break;
+
+ case 'Y': /* The year. */
+ LEGAL_ALT(ALT_E);
+ if (!(conv_num(&bp, &i, 0, 9999)))
+ return (0);
+
+ tm->tm_year = i - TM_YEAR_BASE;
+ break;
+
+ case 'y': /* The year within 100 years of the epoch. */
+ LEGAL_ALT(ALT_E | ALT_O);
+ if (!(conv_num(&bp, &i, 0, 99)))
+ return (0);
+
+ if (split_year) {
+ tm->tm_year = ((tm->tm_year / 100) * 100) + i;
+ break;
+ }
+ split_year = 1;
+ if (i <= 68)
+ tm->tm_year = i + 2000 - TM_YEAR_BASE;
+ else
+ tm->tm_year = i + 1900 - TM_YEAR_BASE;
+ break;
+
+ /*
+ * Miscellaneous conversions.
+ */
+ case 'n': /* Any kind of white-space. */
+ case 't':
+ LEGAL_ALT(0);
+ while (ISSPACE(*bp))
+ bp++;
+ break;
+
+
+ default: /* Unknown/unsupported conversion. */
+ return (0);
+ }
+
+
+ }
+
+ /* LINTED functional specification */
+ return ((char *)bp);
+}
+
+
+static int conv_num(const char * *buf, int *dest, int llim, int ulim)
+{
+ int result = 0;
+
+ /* The limit also determines the number of valid digits. */
+ int rulim = ulim;
+
+ if (**buf < '0' || **buf > '9')
+ return (0);
+
+ do {
+ result *= 10;
+ result += *(*buf)++ - '0';
+ rulim /= 10;
+ } while ((result * 10 <= ulim) && rulim && **buf >= '0' && **buf <= '9');
+
+ if (result < llim || result > ulim)
+ return (0);
+
+ *dest = result;
+ return (1);
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+
+#include "argtable3.h"
+
+
+static void arg_dbl_resetfn(struct arg_dbl *parent)
+{
+ ARG_TRACE(("%s:resetfn(%p)\n", __FILE__, parent));
+ parent->count = 0;
+}
+
+
+static int arg_dbl_scanfn(struct arg_dbl *parent, const char *argval)
+{
+ int errorcode = 0;
+
+ if (parent->count == parent->hdr.maxcount)
+ {
+ /* maximum number of arguments exceeded */
+ errorcode = EMAXCOUNT;
+ }
+ else if (!argval)
+ {
+ /* a valid argument with no argument value was given. */
+ /* This happens when an optional argument value was invoked. */
+ /* leave parent argument value unaltered but still count the argument. */
+ parent->count++;
+ }
+ else
+ {
+ double val;
+ char *end;
+
+ /* extract double from argval into val */
+ val = strtod(argval, &end);
+
+ /* if success then store result in parent->dval[] array otherwise return error*/
+ if (*end == 0)
+ parent->dval[parent->count++] = val;
+ else
+ errorcode = EBADDOUBLE;
+ }
+
+ ARG_TRACE(("%s:scanfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static int arg_dbl_checkfn(struct arg_dbl *parent)
+{
+ int errorcode = (parent->count < parent->hdr.mincount) ? EMINCOUNT : 0;
+
+ ARG_TRACE(("%s:checkfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static void arg_dbl_errorfn(
+ struct arg_dbl *parent,
+ FILE *fp,
+ int errorcode,
+ const char *argval,
+ const char *progname)
+{
+ const char *shortopts = parent->hdr.shortopts;
+ const char *longopts = parent->hdr.longopts;
+ const char *datatype = parent->hdr.datatype;
+
+ /* make argval NULL safe */
+ argval = argval ? argval : "";
+
+ fprintf(fp, "%s: ", progname);
+ switch(errorcode)
+ {
+ case EMINCOUNT:
+ fputs("missing option ", fp);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+
+ case EMAXCOUNT:
+ fputs("excess option ", fp);
+ arg_print_option(fp, shortopts, longopts, argval, "\n");
+ break;
+
+ case EBADDOUBLE:
+ fprintf(fp, "invalid argument \"%s\" to option ", argval);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+ }
+}
+
+
+struct arg_dbl * arg_dbl0(
+ const char * shortopts,
+ const char * longopts,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_dbln(shortopts, longopts, datatype, 0, 1, glossary);
+}
+
+
+struct arg_dbl * arg_dbl1(
+ const char * shortopts,
+ const char * longopts,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_dbln(shortopts, longopts, datatype, 1, 1, glossary);
+}
+
+
+struct arg_dbl * arg_dbln(
+ const char * shortopts,
+ const char * longopts,
+ const char *datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary)
+{
+ size_t nbytes;
+ struct arg_dbl *result;
+
+ /* foolproof things by ensuring maxcount is not less than mincount */
+ maxcount = (maxcount < mincount) ? mincount : maxcount;
+
+ nbytes = sizeof(struct arg_dbl) /* storage for struct arg_dbl */
+ + (maxcount + 1) * sizeof(double); /* storage for dval[maxcount] array plus one extra for padding to memory boundary */
+
+ result = (struct arg_dbl *)malloc(nbytes);
+ if (result)
+ {
+ size_t addr;
+ size_t rem;
+
+ /* init the arg_hdr struct */
+ result->hdr.flag = ARG_HASVALUE;
+ result->hdr.shortopts = shortopts;
+ result->hdr.longopts = longopts;
+ result->hdr.datatype = datatype ? datatype : "<double>";
+ result->hdr.glossary = glossary;
+ result->hdr.mincount = mincount;
+ result->hdr.maxcount = maxcount;
+ result->hdr.parent = result;
+ result->hdr.resetfn = (arg_resetfn *)arg_dbl_resetfn;
+ result->hdr.scanfn = (arg_scanfn *)arg_dbl_scanfn;
+ result->hdr.checkfn = (arg_checkfn *)arg_dbl_checkfn;
+ result->hdr.errorfn = (arg_errorfn *)arg_dbl_errorfn;
+
+ /* Store the dval[maxcount] array on the first double boundary that
+ * immediately follows the arg_dbl struct. We do the memory alignment
+ * purely for SPARC and Motorola systems. They require floats and
+ * doubles to be aligned on natural boundaries.
+ */
+ addr = (size_t)(result + 1);
+ rem = addr % sizeof(double);
+ result->dval = (double *)(addr + sizeof(double) - rem);
+ ARG_TRACE(("addr=%p, dval=%p, sizeof(double)=%d rem=%d\n", addr, result->dval, (int)sizeof(double), (int)rem));
+
+ result->count = 0;
+ }
+
+ ARG_TRACE(("arg_dbln() returns %p\n", result));
+ return result;
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+
+#include "argtable3.h"
+
+
+static void arg_end_resetfn(struct arg_end *parent)
+{
+ ARG_TRACE(("%s:resetfn(%p)\n", __FILE__, parent));
+ parent->count = 0;
+}
+
+static void arg_end_errorfn(
+ void *parent,
+ FILE *fp,
+ int error,
+ const char *argval,
+ const char *progname)
+{
+ /* suppress unreferenced formal parameter warning */
+ (void)parent;
+
+ progname = progname ? progname : "";
+ argval = argval ? argval : "";
+
+ fprintf(fp, "%s: ", progname);
+ switch(error)
+ {
+ case ARG_ELIMIT:
+ fputs("too many errors to display", fp);
+ break;
+ case ARG_EMALLOC:
+ fputs("insufficent memory", fp);
+ break;
+ case ARG_ENOMATCH:
+ fprintf(fp, "unexpected argument \"%s\"", argval);
+ break;
+ case ARG_EMISSARG:
+ fprintf(fp, "option \"%s\" requires an argument", argval);
+ break;
+ case ARG_ELONGOPT:
+ fprintf(fp, "invalid option \"%s\"", argval);
+ break;
+ default:
+ fprintf(fp, "invalid option \"-%c\"", error);
+ break;
+ }
+
+ fputc('\n', fp);
+}
+
+
+struct arg_end * arg_end(int maxcount)
+{
+ size_t nbytes;
+ struct arg_end *result;
+
+ nbytes = sizeof(struct arg_end)
+ + maxcount * sizeof(int) /* storage for int error[maxcount] array*/
+ + maxcount * sizeof(void *) /* storage for void* parent[maxcount] array */
+ + maxcount * sizeof(char *); /* storage for char* argval[maxcount] array */
+
+ result = (struct arg_end *)malloc(nbytes);
+ if (result)
+ {
+ /* init the arg_hdr struct */
+ result->hdr.flag = ARG_TERMINATOR;
+ result->hdr.shortopts = NULL;
+ result->hdr.longopts = NULL;
+ result->hdr.datatype = NULL;
+ result->hdr.glossary = NULL;
+ result->hdr.mincount = 1;
+ result->hdr.maxcount = maxcount;
+ result->hdr.parent = result;
+ result->hdr.resetfn = (arg_resetfn *)arg_end_resetfn;
+ result->hdr.scanfn = NULL;
+ result->hdr.checkfn = NULL;
+ result->hdr.errorfn = (arg_errorfn *)arg_end_errorfn;
+
+ /* store error[maxcount] array immediately after struct arg_end */
+ result->error = (int *)(result + 1);
+
+ /* store parent[maxcount] array immediately after error[] array */
+ result->parent = (void * *)(result->error + maxcount );
+
+ /* store argval[maxcount] array immediately after parent[] array */
+ result->argval = (const char * *)(result->parent + maxcount );
+ }
+
+ ARG_TRACE(("arg_end(%d) returns %p\n", maxcount, result));
+ return result;
+}
+
+
+void arg_print_errors(FILE * fp, struct arg_end * end, const char * progname)
+{
+ int i;
+ ARG_TRACE(("arg_errors()\n"));
+ for (i = 0; i < end->count; i++)
+ {
+ struct arg_hdr *errorparent = (struct arg_hdr *)(end->parent[i]);
+ if (errorparent->errorfn)
+ errorparent->errorfn(end->parent[i],
+ fp,
+ end->error[i],
+ end->argval[i],
+ progname);
+ }
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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 HAS BEEN ALTERED from original version to:
+// * fix issues found by static code analisys:
+// - Possible null pointer dereference at arg_basename
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "argtable3.h"
+
+#ifdef WIN32
+# define FILESEPARATOR1 '\\'
+# define FILESEPARATOR2 '/'
+#else
+# define FILESEPARATOR1 '/'
+# define FILESEPARATOR2 '/'
+#endif
+
+
+static void arg_file_resetfn(struct arg_file *parent)
+{
+ ARG_TRACE(("%s:resetfn(%p)\n", __FILE__, parent));
+ parent->count = 0;
+}
+
+
+/* Returns ptr to the base filename within *filename */
+static const char * arg_basename(const char *filename)
+{
+ const char *result = NULL, *result1, *result2;
+
+ /* Find the last occurrence of eother file separator character. */
+ /* Two alternative file separator chars are supported as legal */
+ /* file separators but not both together in the same filename. */
+ result1 = (filename ? strrchr(filename, FILESEPARATOR1) : NULL);
+ result2 = (filename ? strrchr(filename, FILESEPARATOR2) : NULL);
+
+ if (result2)
+ result = result2 + 1; /* using FILESEPARATOR2 (the alternative file separator) */
+
+ if (result1)
+ result = result1 + 1; /* using FILESEPARATOR1 (the preferred file separator) */
+
+ if (!result)
+ result = filename; /* neither file separator was found so basename is the whole filename */
+
+ /* special cases of "." and ".." are not considered basenames */
+ if (filename && result &&
+ (strcmp(".", result) == 0 || strcmp("..", result) == 0))
+ result = filename + strlen(filename);
+
+ return result;
+}
+
+
+/* Returns ptr to the file extension within *basename */
+static const char * arg_extension(const char *basename)
+{
+ /* find the last occurrence of '.' in basename */
+ const char *result = (basename ? strrchr(basename, '.') : NULL);
+
+ /* if no '.' was found then return pointer to end of basename */
+ if (basename && !result)
+ result = basename + strlen(basename);
+
+ /* special case: basenames with a single leading dot (eg ".foo") are not considered as true extensions */
+ if (basename && result == basename)
+ result = basename + strlen(basename);
+
+ /* special case: empty extensions (eg "foo.","foo..") are not considered as true extensions */
+ if (basename && result && result[1] == '\0')
+ result = basename + strlen(basename);
+
+ return result;
+}
+
+
+static int arg_file_scanfn(struct arg_file *parent, const char *argval)
+{
+ int errorcode = 0;
+
+ if (parent->count == parent->hdr.maxcount)
+ {
+ /* maximum number of arguments exceeded */
+ errorcode = EMAXCOUNT;
+ }
+ else if (!argval)
+ {
+ /* a valid argument with no argument value was given. */
+ /* This happens when an optional argument value was invoked. */
+ /* leave parent arguiment value unaltered but still count the argument. */
+ parent->count++;
+ }
+ else
+ {
+ parent->filename[parent->count] = argval;
+ parent->basename[parent->count] = arg_basename(argval);
+ parent->extension[parent->count] =
+ arg_extension(parent->basename[parent->count]); /* only seek extensions within the basename (not the file path)*/
+ parent->count++;
+ }
+
+ ARG_TRACE(("%s4:scanfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static int arg_file_checkfn(struct arg_file *parent)
+{
+ int errorcode = (parent->count < parent->hdr.mincount) ? EMINCOUNT : 0;
+
+ ARG_TRACE(("%s:checkfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static void arg_file_errorfn(
+ struct arg_file *parent,
+ FILE *fp,
+ int errorcode,
+ const char *argval,
+ const char *progname)
+{
+ const char *shortopts = parent->hdr.shortopts;
+ const char *longopts = parent->hdr.longopts;
+ const char *datatype = parent->hdr.datatype;
+
+ /* make argval NULL safe */
+ argval = argval ? argval : "";
+
+ fprintf(fp, "%s: ", progname);
+ switch(errorcode)
+ {
+ case EMINCOUNT:
+ fputs("missing option ", fp);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+
+ case EMAXCOUNT:
+ fputs("excess option ", fp);
+ arg_print_option(fp, shortopts, longopts, argval, "\n");
+ break;
+
+ default:
+ fprintf(fp, "unknown error at \"%s\"\n", argval);
+ }
+}
+
+
+struct arg_file * arg_file0(
+ const char * shortopts,
+ const char * longopts,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_filen(shortopts, longopts, datatype, 0, 1, glossary);
+}
+
+
+struct arg_file * arg_file1(
+ const char * shortopts,
+ const char * longopts,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_filen(shortopts, longopts, datatype, 1, 1, glossary);
+}
+
+
+struct arg_file * arg_filen(
+ const char * shortopts,
+ const char * longopts,
+ const char *datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary)
+{
+ size_t nbytes;
+ struct arg_file *result;
+
+ /* foolproof things by ensuring maxcount is not less than mincount */
+ maxcount = (maxcount < mincount) ? mincount : maxcount;
+
+ nbytes = sizeof(struct arg_file) /* storage for struct arg_file */
+ + sizeof(char *) * maxcount /* storage for filename[maxcount] array */
+ + sizeof(char *) * maxcount /* storage for basename[maxcount] array */
+ + sizeof(char *) * maxcount; /* storage for extension[maxcount] array */
+
+ result = (struct arg_file *)malloc(nbytes);
+ if (result)
+ {
+ int i;
+
+ /* init the arg_hdr struct */
+ result->hdr.flag = ARG_HASVALUE;
+ result->hdr.shortopts = shortopts;
+ result->hdr.longopts = longopts;
+ result->hdr.glossary = glossary;
+ result->hdr.datatype = datatype ? datatype : "<file>";
+ result->hdr.mincount = mincount;
+ result->hdr.maxcount = maxcount;
+ result->hdr.parent = result;
+ result->hdr.resetfn = (arg_resetfn *)arg_file_resetfn;
+ result->hdr.scanfn = (arg_scanfn *)arg_file_scanfn;
+ result->hdr.checkfn = (arg_checkfn *)arg_file_checkfn;
+ result->hdr.errorfn = (arg_errorfn *)arg_file_errorfn;
+
+ /* store the filename,basename,extension arrays immediately after the arg_file struct */
+ result->filename = (const char * *)(result + 1);
+ result->basename = result->filename + maxcount;
+ result->extension = result->basename + maxcount;
+ result->count = 0;
+
+ /* foolproof the string pointers by initialising them with empty strings */
+ for (i = 0; i < maxcount; i++)
+ {
+ result->filename[i] = "";
+ result->basename[i] = "";
+ result->extension[i] = "";
+ }
+ }
+
+ ARG_TRACE(("arg_filen() returns %p\n", result));
+ return result;
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+#include <limits.h>
+#include <ctype.h>
+
+#include "argtable3.h"
+
+
+static void arg_int_resetfn(struct arg_int *parent)
+{
+ ARG_TRACE(("%s:resetfn(%p)\n", __FILE__, parent));
+ parent->count = 0;
+}
+
+
+/* strtol0x() is like strtol() except that the numeric string is */
+/* expected to be prefixed by "0X" where X is a user supplied char. */
+/* The string may optionally be prefixed by white space and + or - */
+/* as in +0X123 or -0X123. */
+/* Once the prefix has been scanned, the remainder of the numeric */
+/* string is converted using strtol() with the given base. */
+/* eg: to parse hex str="-0X12324", specify X='X' and base=16. */
+/* eg: to parse oct str="+0o12324", specify X='O' and base=8. */
+/* eg: to parse bin str="-0B01010", specify X='B' and base=2. */
+/* Failure of conversion is indicated by result where *endptr==str. */
+static long int strtol0X(const char * str,
+ const char * *endptr,
+ char X,
+ int base)
+{
+ long int val; /* stores result */
+ int s = 1; /* sign is +1 or -1 */
+ const char *ptr = str; /* ptr to current position in str */
+
+ /* skip leading whitespace */
+ while (ISSPACE(*ptr))
+ ptr++;
+ /* printf("1) %s\n",ptr); */
+
+ /* scan optional sign character */
+ switch (*ptr)
+ {
+ case '+':
+ ptr++;
+ s = 1;
+ break;
+ case '-':
+ ptr++;
+ s = -1;
+ break;
+ default:
+ s = 1;
+ break;
+ }
+ /* printf("2) %s\n",ptr); */
+
+ /* '0X' prefix */
+ if ((*ptr++) != '0')
+ {
+ /* printf("failed to detect '0'\n"); */
+ *endptr = str;
+ return 0;
+ }
+ /* printf("3) %s\n",ptr); */
+ if (toupper(*ptr++) != toupper(X))
+ {
+ /* printf("failed to detect '%c'\n",X); */
+ *endptr = str;
+ return 0;
+ }
+ /* printf("4) %s\n",ptr); */
+
+ /* attempt conversion on remainder of string using strtol() */
+ val = strtol(ptr, (char * *)endptr, base);
+ if (*endptr == ptr)
+ {
+ /* conversion failed */
+ *endptr = str;
+ return 0;
+ }
+
+ /* success */
+ return s * val;
+}
+
+
+/* Returns 1 if str matches suffix (case insensitive). */
+/* Str may contain trailing whitespace, but nothing else. */
+static int detectsuffix(const char *str, const char *suffix)
+{
+ /* scan pairwise through strings until mismatch detected */
+ while( toupper(*str) == toupper(*suffix) )
+ {
+ /* printf("'%c' '%c'\n", *str, *suffix); */
+
+ /* return 1 (success) if match persists until the string terminator */
+ if (*str == '\0')
+ return 1;
+
+ /* next chars */
+ str++;
+ suffix++;
+ }
+ /* printf("'%c' '%c' mismatch\n", *str, *suffix); */
+
+ /* return 0 (fail) if the matching did not consume the entire suffix */
+ if (*suffix != 0)
+ return 0; /* failed to consume entire suffix */
+
+ /* skip any remaining whitespace in str */
+ while (ISSPACE(*str))
+ str++;
+
+ /* return 1 (success) if we have reached end of str else return 0 (fail) */
+ return (*str == '\0') ? 1 : 0;
+}
+
+
+static int arg_int_scanfn(struct arg_int *parent, const char *argval)
+{
+ int errorcode = 0;
+
+ if (parent->count == parent->hdr.maxcount)
+ {
+ /* maximum number of arguments exceeded */
+ errorcode = EMAXCOUNT;
+ }
+ else if (!argval)
+ {
+ /* a valid argument with no argument value was given. */
+ /* This happens when an optional argument value was invoked. */
+ /* leave parent arguiment value unaltered but still count the argument. */
+ parent->count++;
+ }
+ else
+ {
+ long int val;
+ const char *end;
+
+ /* attempt to extract hex integer (eg: +0x123) from argval into val conversion */
+ val = strtol0X(argval, &end, 'X', 16);
+ if (end == argval)
+ {
+ /* hex failed, attempt octal conversion (eg +0o123) */
+ val = strtol0X(argval, &end, 'O', 8);
+ if (end == argval)
+ {
+ /* octal failed, attempt binary conversion (eg +0B101) */
+ val = strtol0X(argval, &end, 'B', 2);
+ if (end == argval)
+ {
+ /* binary failed, attempt decimal conversion with no prefix (eg 1234) */
+ val = strtol(argval, (char * *)&end, 10);
+ if (end == argval)
+ {
+ /* all supported number formats failed */
+ return EBADINT;
+ }
+ }
+ }
+ }
+
+ /* Safety check for integer overflow. WARNING: this check */
+ /* achieves nothing on machines where size(int)==size(long). */
+ if ( val > INT_MAX || val < INT_MIN )
+#ifdef __STDC_WANT_SECURE_LIB__
+ errorcode = EOVERFLOW_;
+#else
+ errorcode = EOVERFLOW;
+#endif
+
+ /* Detect any suffixes (KB,MB,GB) and multiply argument value appropriately. */
+ /* We need to be mindful of integer overflows when using such big numbers. */
+ if (detectsuffix(end, "KB")) /* kilobytes */
+ {
+ if ( val > (INT_MAX / 1024) || val < (INT_MIN / 1024) )
+#ifdef __STDC_WANT_SECURE_LIB__
+ errorcode = EOVERFLOW_; /* Overflow would occur if we proceed */
+#else
+ errorcode = EOVERFLOW; /* Overflow would occur if we proceed */
+#endif
+ else
+ val *= 1024; /* 1KB = 1024 */
+ }
+ else if (detectsuffix(end, "MB")) /* megabytes */
+ {
+ if ( val > (INT_MAX / 1048576) || val < (INT_MIN / 1048576) )
+#ifdef __STDC_WANT_SECURE_LIB__
+ errorcode = EOVERFLOW_; /* Overflow would occur if we proceed */
+#else
+ errorcode = EOVERFLOW; /* Overflow would occur if we proceed */
+#endif
+ else
+ val *= 1048576; /* 1MB = 1024*1024 */
+ }
+ else if (detectsuffix(end, "GB")) /* gigabytes */
+ {
+ if ( val > (INT_MAX / 1073741824) || val < (INT_MIN / 1073741824) )
+#ifdef __STDC_WANT_SECURE_LIB__
+ errorcode = EOVERFLOW_; /* Overflow would occur if we proceed */
+#else
+ errorcode = EOVERFLOW; /* Overflow would occur if we proceed */
+#endif
+ else
+ val *= 1073741824; /* 1GB = 1024*1024*1024 */
+ }
+ else if (!detectsuffix(end, ""))
+ errorcode = EBADINT; /* invalid suffix detected */
+
+ /* if success then store result in parent->ival[] array */
+ if (errorcode == 0)
+ parent->ival[parent->count++] = val;
+ }
+
+ /* printf("%s:scanfn(%p,%p) returns %d\n",__FILE__,parent,argval,errorcode); */
+ return errorcode;
+}
+
+
+static int arg_int_checkfn(struct arg_int *parent)
+{
+ int errorcode = (parent->count < parent->hdr.mincount) ? EMINCOUNT : 0;
+ /*printf("%s:checkfn(%p) returns %d\n",__FILE__,parent,errorcode);*/
+ return errorcode;
+}
+
+
+static void arg_int_errorfn(
+ struct arg_int *parent,
+ FILE *fp,
+ int errorcode,
+ const char *argval,
+ const char *progname)
+{
+ const char *shortopts = parent->hdr.shortopts;
+ const char *longopts = parent->hdr.longopts;
+ const char *datatype = parent->hdr.datatype;
+
+ /* make argval NULL safe */
+ argval = argval ? argval : "";
+
+ fprintf(fp, "%s: ", progname);
+ switch(errorcode)
+ {
+ case EMINCOUNT:
+ fputs("missing option ", fp);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+
+ case EMAXCOUNT:
+ fputs("excess option ", fp);
+ arg_print_option(fp, shortopts, longopts, argval, "\n");
+ break;
+
+ case EBADINT:
+ fprintf(fp, "invalid argument \"%s\" to option ", argval);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+
+#ifdef __STDC_WANT_SECURE_LIB__
+ case EOVERFLOW_:
+#else
+ case EOVERFLOW:
+#endif
+ fputs("integer overflow at option ", fp);
+ arg_print_option(fp, shortopts, longopts, datatype, " ");
+ fprintf(fp, "(%s is too large)\n", argval);
+ break;
+ }
+}
+
+
+struct arg_int * arg_int0(
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_intn(shortopts, longopts, datatype, 0, 1, glossary);
+}
+
+
+struct arg_int * arg_int1(
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_intn(shortopts, longopts, datatype, 1, 1, glossary);
+}
+
+
+struct arg_int * arg_intn(
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary)
+{
+ size_t nbytes;
+ struct arg_int *result;
+
+ /* foolproof things by ensuring maxcount is not less than mincount */
+ maxcount = (maxcount < mincount) ? mincount : maxcount;
+
+ nbytes = sizeof(struct arg_int) /* storage for struct arg_int */
+ + maxcount * sizeof(int); /* storage for ival[maxcount] array */
+
+ result = (struct arg_int *)malloc(nbytes);
+ if (result)
+ {
+ /* init the arg_hdr struct */
+ result->hdr.flag = ARG_HASVALUE;
+ result->hdr.shortopts = shortopts;
+ result->hdr.longopts = longopts;
+ result->hdr.datatype = datatype ? datatype : "<int>";
+ result->hdr.glossary = glossary;
+ result->hdr.mincount = mincount;
+ result->hdr.maxcount = maxcount;
+ result->hdr.parent = result;
+ result->hdr.resetfn = (arg_resetfn *)arg_int_resetfn;
+ result->hdr.scanfn = (arg_scanfn *)arg_int_scanfn;
+ result->hdr.checkfn = (arg_checkfn *)arg_int_checkfn;
+ result->hdr.errorfn = (arg_errorfn *)arg_int_errorfn;
+
+ /* store the ival[maxcount] array immediately after the arg_int struct */
+ result->ival = (int *)(result + 1);
+ result->count = 0;
+ }
+
+ ARG_TRACE(("arg_intn() returns %p\n", result));
+ return result;
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+
+#include "argtable3.h"
+
+
+static void arg_lit_resetfn(struct arg_lit *parent)
+{
+ ARG_TRACE(("%s:resetfn(%p)\n", __FILE__, parent));
+ parent->count = 0;
+}
+
+
+static int arg_lit_scanfn(struct arg_lit *parent, const char *argval)
+{
+ int errorcode = 0;
+ if (parent->count < parent->hdr.maxcount )
+ parent->count++;
+ else
+ errorcode = EMAXCOUNT;
+
+ ARG_TRACE(("%s:scanfn(%p,%s) returns %d\n", __FILE__, parent, argval,
+ errorcode));
+ return errorcode;
+}
+
+
+static int arg_lit_checkfn(struct arg_lit *parent)
+{
+ int errorcode = (parent->count < parent->hdr.mincount) ? EMINCOUNT : 0;
+ ARG_TRACE(("%s:checkfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static void arg_lit_errorfn(
+ struct arg_lit *parent,
+ FILE *fp,
+ int errorcode,
+ const char *argval,
+ const char *progname)
+{
+ const char *shortopts = parent->hdr.shortopts;
+ const char *longopts = parent->hdr.longopts;
+ const char *datatype = parent->hdr.datatype;
+
+ switch(errorcode)
+ {
+ case EMINCOUNT:
+ fprintf(fp, "%s: missing option ", progname);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ fprintf(fp, "\n");
+ break;
+
+ case EMAXCOUNT:
+ fprintf(fp, "%s: extraneous option ", progname);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+ }
+
+ ARG_TRACE(("%s:errorfn(%p, %p, %d, %s, %s)\n", __FILE__, parent, fp,
+ errorcode, argval, progname));
+}
+
+
+struct arg_lit * arg_lit0(
+ const char * shortopts,
+ const char * longopts,
+ const char * glossary)
+{
+ return arg_litn(shortopts, longopts, 0, 1, glossary);
+}
+
+
+struct arg_lit * arg_lit1(
+ const char *shortopts,
+ const char *longopts,
+ const char *glossary)
+{
+ return arg_litn(shortopts, longopts, 1, 1, glossary);
+}
+
+
+struct arg_lit * arg_litn(
+ const char *shortopts,
+ const char *longopts,
+ int mincount,
+ int maxcount,
+ const char *glossary)
+{
+ struct arg_lit *result;
+
+ /* foolproof things by ensuring maxcount is not less than mincount */
+ maxcount = (maxcount < mincount) ? mincount : maxcount;
+
+ result = (struct arg_lit *)malloc(sizeof(struct arg_lit));
+ if (result)
+ {
+ /* init the arg_hdr struct */
+ result->hdr.flag = 0;
+ result->hdr.shortopts = shortopts;
+ result->hdr.longopts = longopts;
+ result->hdr.datatype = NULL;
+ result->hdr.glossary = glossary;
+ result->hdr.mincount = mincount;
+ result->hdr.maxcount = maxcount;
+ result->hdr.parent = result;
+ result->hdr.resetfn = (arg_resetfn *)arg_lit_resetfn;
+ result->hdr.scanfn = (arg_scanfn *)arg_lit_scanfn;
+ result->hdr.checkfn = (arg_checkfn *)arg_lit_checkfn;
+ result->hdr.errorfn = (arg_errorfn *)arg_lit_errorfn;
+
+ /* init local variables */
+ result->count = 0;
+ }
+
+ ARG_TRACE(("arg_litn() returns %p\n", result));
+ return result;
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+
+#include "argtable3.h"
+
+struct arg_rem *arg_rem(const char *datatype, const char *glossary)
+{
+ struct arg_rem *result = (struct arg_rem *)malloc(sizeof(struct arg_rem));
+ if (result)
+ {
+ result->hdr.flag = 0;
+ result->hdr.shortopts = NULL;
+ result->hdr.longopts = NULL;
+ result->hdr.datatype = datatype;
+ result->hdr.glossary = glossary;
+ result->hdr.mincount = 1;
+ result->hdr.maxcount = 1;
+ result->hdr.parent = result;
+ result->hdr.resetfn = NULL;
+ result->hdr.scanfn = NULL;
+ result->hdr.checkfn = NULL;
+ result->hdr.errorfn = NULL;
+ }
+
+ ARG_TRACE(("arg_rem() returns %p\n", result));
+ return result;
+}
+
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "argtable3.h"
+
+
+#ifndef _TREX_H_
+#define _TREX_H_
+/***************************************************************
+ T-Rex a tiny regular expression library
+
+ Copyright (C) 2003-2006 Alberto Demichelis
+
+ This software is provided 'as-is', without any express
+ or implied warranty. In no event will the authors be held
+ liable for any damages arising from the use of this software.
+
+ Permission is granted to anyone to use this software for
+ any purpose, including commercial applications, and to alter
+ it and redistribute it freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented;
+ you must not claim that you wrote the original software.
+ If you use this software in a product, an acknowledgment
+ in the product documentation would be appreciated but
+ is not required.
+
+ 2. Altered source versions must be plainly marked as such,
+ and must not be misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any
+ source distribution.
+
+****************************************************************/
+// THIS FILE HAS BEEN ALTERED from original version to:
+// * fix issues found by static code analisys:
+// - Null pointer dereference in trex_newnode, arg_rex_scanfn and trex_compile
+// * Fix implicit-fallthrough GCC error in trex_charnode
+// * Fix clobbered GCC error in trex_compile
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _UNICODE
+#define TRexChar unsigned short
+#define MAX_CHAR 0xFFFF
+#define _TREXC(c) L##c
+#define trex_strlen wcslen
+#define trex_printf wprintf
+#else
+#define TRexChar char
+#define MAX_CHAR 0xFF
+#define _TREXC(c) (c)
+#define trex_strlen strlen
+#define trex_printf printf
+#endif
+
+#ifndef TREX_API
+#define TREX_API extern
+#endif
+
+#define TRex_True 1
+#define TRex_False 0
+
+#define TREX_ICASE ARG_REX_ICASE
+
+typedef unsigned int TRexBool;
+typedef struct TRex TRex;
+
+typedef struct {
+ const TRexChar *begin;
+ int len;
+} TRexMatch;
+
+TREX_API TRex *trex_compile(const TRexChar *pattern, const TRexChar **error, int flags);
+TREX_API void trex_free(TRex *exp);
+TREX_API TRexBool trex_match(TRex* exp, const TRexChar* text);
+TREX_API TRexBool trex_search(TRex* exp, const TRexChar* text, const TRexChar** out_begin, const TRexChar** out_end);
+TREX_API TRexBool trex_searchrange(TRex* exp, const TRexChar* text_begin, const TRexChar* text_end, const TRexChar** out_begin, const TRexChar** out_end);
+TREX_API int trex_getsubexpcount(TRex* exp);
+TREX_API TRexBool trex_getsubexp(TRex* exp, int n, TRexMatch *subexp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
+
+struct privhdr
+{
+ const char *pattern;
+ int flags;
+};
+
+
+static void arg_rex_resetfn(struct arg_rex *parent)
+{
+ ARG_TRACE(("%s:resetfn(%p)\n", __FILE__, parent));
+ parent->count = 0;
+}
+
+static int arg_rex_scanfn(struct arg_rex *parent, const char *argval)
+{
+ int errorcode = 0;
+ const TRexChar *error = NULL;
+ TRex *rex = NULL;
+ TRexBool is_match = TRex_False;
+
+ if (parent->count == parent->hdr.maxcount )
+ {
+ /* maximum number of arguments exceeded */
+ errorcode = EMAXCOUNT;
+ }
+ else if (!argval)
+ {
+ /* a valid argument with no argument value was given. */
+ /* This happens when an optional argument value was invoked. */
+ /* leave parent argument value unaltered but still count the argument. */
+ parent->count++;
+ }
+ else
+ {
+ struct privhdr *priv = (struct privhdr *)parent->hdr.priv;
+
+ /* test the current argument value for a match with the regular expression */
+ /* if a match is detected, record the argument value in the arg_rex struct */
+
+ rex = trex_compile(priv->pattern, &error, priv->flags);
+ if (!rex)
+ {
+ errorcode = EREGNOMATCH;
+ }
+ else
+ {
+ is_match = trex_match(rex, argval);
+ if (!is_match)
+ errorcode = EREGNOMATCH;
+ else
+ parent->sval[parent->count++] = argval;
+
+ trex_free(rex);
+ }
+ }
+
+ ARG_TRACE(("%s:scanfn(%p) returns %d\n",__FILE__,parent,errorcode));
+ return errorcode;
+}
+
+static int arg_rex_checkfn(struct arg_rex *parent)
+{
+ int errorcode = (parent->count < parent->hdr.mincount) ? EMINCOUNT : 0;
+ //struct privhdr *priv = (struct privhdr*)parent->hdr.priv;
+
+ /* free the regex "program" we constructed in resetfn */
+ //regfree(&(priv->regex));
+
+ /*printf("%s:checkfn(%p) returns %d\n",__FILE__,parent,errorcode);*/
+ return errorcode;
+}
+
+static void arg_rex_errorfn(struct arg_rex *parent,
+ FILE *fp,
+ int errorcode,
+ const char *argval,
+ const char *progname)
+{
+ const char *shortopts = parent->hdr.shortopts;
+ const char *longopts = parent->hdr.longopts;
+ const char *datatype = parent->hdr.datatype;
+
+ /* make argval NULL safe */
+ argval = argval ? argval : "";
+
+ fprintf(fp, "%s: ", progname);
+ switch(errorcode)
+ {
+ case EMINCOUNT:
+ fputs("missing option ", fp);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+
+ case EMAXCOUNT:
+ fputs("excess option ", fp);
+ arg_print_option(fp, shortopts, longopts, argval, "\n");
+ break;
+
+ case EREGNOMATCH:
+ fputs("illegal value ", fp);
+ arg_print_option(fp, shortopts, longopts, argval, "\n");
+ break;
+
+ default:
+ {
+ //char errbuff[256];
+ //regerror(errorcode, NULL, errbuff, sizeof(errbuff));
+ //printf("%s\n", errbuff);
+ }
+ break;
+ }
+}
+
+
+struct arg_rex * arg_rex0(const char * shortopts,
+ const char * longopts,
+ const char * pattern,
+ const char *datatype,
+ int flags,
+ const char *glossary)
+{
+ return arg_rexn(shortopts,
+ longopts,
+ pattern,
+ datatype,
+ 0,
+ 1,
+ flags,
+ glossary);
+}
+
+struct arg_rex * arg_rex1(const char * shortopts,
+ const char * longopts,
+ const char * pattern,
+ const char *datatype,
+ int flags,
+ const char *glossary)
+{
+ return arg_rexn(shortopts,
+ longopts,
+ pattern,
+ datatype,
+ 1,
+ 1,
+ flags,
+ glossary);
+}
+
+
+struct arg_rex * arg_rexn(const char * shortopts,
+ const char * longopts,
+ const char * pattern,
+ const char *datatype,
+ int mincount,
+ int maxcount,
+ int flags,
+ const char *glossary)
+{
+ size_t nbytes;
+ struct arg_rex *result;
+ struct privhdr *priv;
+ int i;
+ const TRexChar *error = NULL;
+ TRex *rex = NULL;
+
+ if (!pattern)
+ {
+ printf(
+ "argtable: ERROR - illegal regular expression pattern \"(NULL)\"\n");
+ printf("argtable: Bad argument table.\n");
+ return NULL;
+ }
+
+ /* foolproof things by ensuring maxcount is not less than mincount */
+ maxcount = (maxcount < mincount) ? mincount : maxcount;
+
+ nbytes = sizeof(struct arg_rex) /* storage for struct arg_rex */
+ + sizeof(struct privhdr) /* storage for private arg_rex data */
+ + maxcount * sizeof(char *); /* storage for sval[maxcount] array */
+
+ result = (struct arg_rex *)malloc(nbytes);
+ if (result == NULL)
+ return result;
+
+ /* init the arg_hdr struct */
+ result->hdr.flag = ARG_HASVALUE;
+ result->hdr.shortopts = shortopts;
+ result->hdr.longopts = longopts;
+ result->hdr.datatype = datatype ? datatype : pattern;
+ result->hdr.glossary = glossary;
+ result->hdr.mincount = mincount;
+ result->hdr.maxcount = maxcount;
+ result->hdr.parent = result;
+ result->hdr.resetfn = (arg_resetfn *)arg_rex_resetfn;
+ result->hdr.scanfn = (arg_scanfn *)arg_rex_scanfn;
+ result->hdr.checkfn = (arg_checkfn *)arg_rex_checkfn;
+ result->hdr.errorfn = (arg_errorfn *)arg_rex_errorfn;
+
+ /* store the arg_rex_priv struct immediately after the arg_rex struct */
+ result->hdr.priv = result + 1;
+ priv = (struct privhdr *)(result->hdr.priv);
+ priv->pattern = pattern;
+ priv->flags = flags;
+
+ /* store the sval[maxcount] array immediately after the arg_rex_priv struct */
+ result->sval = (const char * *)(priv + 1);
+ result->count = 0;
+
+ /* foolproof the string pointers by initializing them to reference empty strings */
+ for (i = 0; i < maxcount; i++)
+ result->sval[i] = "";
+
+ /* here we construct and destroy a regex representation of the regular
+ * expression for no other reason than to force any regex errors to be
+ * trapped now rather than later. If we don't, then errors may go undetected
+ * until an argument is actually parsed.
+ */
+
+ rex = trex_compile(priv->pattern, &error, priv->flags);
+ if (rex == NULL)
+ {
+ ARG_LOG(("argtable: %s \"%s\"\n", error ? error : _TREXC("undefined"), priv->pattern));
+ ARG_LOG(("argtable: Bad argument table.\n"));
+ }
+
+ trex_free(rex);
+
+ ARG_TRACE(("arg_rexn() returns %p\n", result));
+ return result;
+}
+
+
+
+/* see copyright notice in trex.h */
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <setjmp.h>
+
+#ifdef _UINCODE
+#define scisprint iswprint
+#define scstrlen wcslen
+#define scprintf wprintf
+#define _SC(x) L(x)
+#else
+#define scisprint isprint
+#define scstrlen strlen
+#define scprintf printf
+#define _SC(x) (x)
+#endif
+
+#ifdef _DEBUG
+#include <stdio.h>
+
+static const TRexChar *g_nnames[] =
+{
+ _SC("NONE"),_SC("OP_GREEDY"), _SC("OP_OR"),
+ _SC("OP_EXPR"),_SC("OP_NOCAPEXPR"),_SC("OP_DOT"), _SC("OP_CLASS"),
+ _SC("OP_CCLASS"),_SC("OP_NCLASS"),_SC("OP_RANGE"),_SC("OP_CHAR"),
+ _SC("OP_EOL"),_SC("OP_BOL"),_SC("OP_WB")
+};
+
+#endif
+#define OP_GREEDY (MAX_CHAR+1) // * + ? {n}
+#define OP_OR (MAX_CHAR+2)
+#define OP_EXPR (MAX_CHAR+3) //parentesis ()
+#define OP_NOCAPEXPR (MAX_CHAR+4) //parentesis (?:)
+#define OP_DOT (MAX_CHAR+5)
+#define OP_CLASS (MAX_CHAR+6)
+#define OP_CCLASS (MAX_CHAR+7)
+#define OP_NCLASS (MAX_CHAR+8) //negates class the [^
+#define OP_RANGE (MAX_CHAR+9)
+#define OP_CHAR (MAX_CHAR+10)
+#define OP_EOL (MAX_CHAR+11)
+#define OP_BOL (MAX_CHAR+12)
+#define OP_WB (MAX_CHAR+13)
+
+#define TREX_SYMBOL_ANY_CHAR ('.')
+#define TREX_SYMBOL_GREEDY_ONE_OR_MORE ('+')
+#define TREX_SYMBOL_GREEDY_ZERO_OR_MORE ('*')
+#define TREX_SYMBOL_GREEDY_ZERO_OR_ONE ('?')
+#define TREX_SYMBOL_BRANCH ('|')
+#define TREX_SYMBOL_END_OF_STRING ('$')
+#define TREX_SYMBOL_BEGINNING_OF_STRING ('^')
+#define TREX_SYMBOL_ESCAPE_CHAR ('\\')
+
+
+typedef int TRexNodeType;
+
+typedef struct tagTRexNode{
+ TRexNodeType type;
+ int left;
+ int right;
+ int next;
+}TRexNode;
+
+struct TRex{
+ const TRexChar *_eol;
+ const TRexChar *_bol;
+ const TRexChar *_p;
+ int _first;
+ int _op;
+ TRexNode *_nodes;
+ int _nallocated;
+ int _nsize;
+ int _nsubexpr;
+ TRexMatch *_matches;
+ int _currsubexp;
+ void *_jmpbuf;
+ const TRexChar **_error;
+ int _flags;
+};
+
+static int trex_list(TRex *exp);
+
+static int trex_newnode(TRex *exp, TRexNodeType type)
+{
+ TRexNode n;
+ int newid;
+ n.type = type;
+ n.next = n.right = n.left = -1;
+ if(type == OP_EXPR)
+ n.right = exp->_nsubexpr++;
+ if(exp->_nallocated < (exp->_nsize + 1)) {
+ TRexNode *new_nodes = NULL;
+ exp->_nallocated *= 2;
+ new_nodes = (TRexNode *)realloc(exp->_nodes, exp->_nallocated * sizeof(TRexNode));
+ if (!new_nodes)
+ return 0; // return id of _nodes[0] in case of re-allocation failure
+ exp->_nodes = new_nodes;
+ }
+ exp->_nodes[exp->_nsize++] = n;
+ newid = exp->_nsize - 1;
+ return (int)newid;
+}
+
+static void trex_error(TRex *exp,const TRexChar *error)
+{
+ if(exp->_error) *exp->_error = error;
+ longjmp(*((jmp_buf*)exp->_jmpbuf),-1);
+}
+
+static void trex_expect(TRex *exp, int n){
+ if((*exp->_p) != n)
+ trex_error(exp, _SC("expected paren"));
+ exp->_p++;
+}
+
+static TRexChar trex_escapechar(TRex *exp)
+{
+ if(*exp->_p == TREX_SYMBOL_ESCAPE_CHAR){
+ exp->_p++;
+ switch(*exp->_p) {
+ case 'v': exp->_p++; return '\v';
+ case 'n': exp->_p++; return '\n';
+ case 't': exp->_p++; return '\t';
+ case 'r': exp->_p++; return '\r';
+ case 'f': exp->_p++; return '\f';
+ default: return (*exp->_p++);
+ }
+ } else if(!scisprint(*exp->_p)) trex_error(exp,_SC("letter expected"));
+ return (*exp->_p++);
+}
+
+static int trex_charclass(TRex *exp,int classid)
+{
+ int n = trex_newnode(exp,OP_CCLASS);
+ exp->_nodes[n].left = classid;
+ return n;
+}
+
+static int trex_charnode(TRex *exp,TRexBool isclass)
+{
+ TRexChar t;
+ if(*exp->_p == TREX_SYMBOL_ESCAPE_CHAR) {
+ exp->_p++;
+ switch(*exp->_p) {
+ case 'n': exp->_p++; return trex_newnode(exp,'\n');
+ case 't': exp->_p++; return trex_newnode(exp,'\t');
+ case 'r': exp->_p++; return trex_newnode(exp,'\r');
+ case 'f': exp->_p++; return trex_newnode(exp,'\f');
+ case 'v': exp->_p++; return trex_newnode(exp,'\v');
+ case 'a': case 'A': case 'w': case 'W': case 's': case 'S':
+ case 'd': case 'D': case 'x': case 'X': case 'c': case 'C':
+ case 'p': case 'P': case 'l': case 'u':
+ {
+ t = *exp->_p; exp->_p++;
+ return trex_charclass(exp,t);
+ }
+ case 'b':
+ case 'B':
+ if(!isclass) {
+ int node = trex_newnode(exp,OP_WB);
+ exp->_nodes[node].left = *exp->_p;
+ exp->_p++;
+ return node;
+ } // fallthrough
+ //else default
+ default:
+ t = *exp->_p; exp->_p++;
+ return trex_newnode(exp,t);
+ }
+ }
+ else if(!scisprint(*exp->_p)) {
+
+ trex_error(exp,_SC("letter expected"));
+ }
+ t = *exp->_p; exp->_p++;
+ return trex_newnode(exp,t);
+}
+static int trex_class(TRex *exp)
+{
+ int ret = -1;
+ int first = -1,chain;
+ if(*exp->_p == TREX_SYMBOL_BEGINNING_OF_STRING){
+ ret = trex_newnode(exp,OP_NCLASS);
+ exp->_p++;
+ }else ret = trex_newnode(exp,OP_CLASS);
+
+ if(*exp->_p == ']') trex_error(exp,_SC("empty class"));
+ chain = ret;
+ while(*exp->_p != ']' && exp->_p != exp->_eol) {
+ if(*exp->_p == '-' && first != -1){
+ int r,t;
+ if(*exp->_p++ == ']') trex_error(exp,_SC("unfinished range"));
+ r = trex_newnode(exp,OP_RANGE);
+ if(first>*exp->_p) trex_error(exp,_SC("invalid range"));
+ if(exp->_nodes[first].type == OP_CCLASS) trex_error(exp,_SC("cannot use character classes in ranges"));
+ exp->_nodes[r].left = exp->_nodes[first].type;
+ t = trex_escapechar(exp);
+ exp->_nodes[r].right = t;
+ exp->_nodes[chain].next = r;
+ chain = r;
+ first = -1;
+ }
+ else{
+ if(first!=-1){
+ int c = first;
+ exp->_nodes[chain].next = c;
+ chain = c;
+ first = trex_charnode(exp,TRex_True);
+ }
+ else{
+ first = trex_charnode(exp,TRex_True);
+ }
+ }
+ }
+ if(first!=-1){
+ int c = first;
+ exp->_nodes[chain].next = c;
+ chain = c;
+ first = -1;
+ }
+ /* hack? */
+ exp->_nodes[ret].left = exp->_nodes[ret].next;
+ exp->_nodes[ret].next = -1;
+ return ret;
+}
+
+static int trex_parsenumber(TRex *exp)
+{
+ int ret = *exp->_p-'0';
+ int positions = 10;
+ exp->_p++;
+ while(isdigit(*exp->_p)) {
+ ret = ret*10+(*exp->_p++-'0');
+ if(positions==1000000000) trex_error(exp,_SC("overflow in numeric constant"));
+ positions *= 10;
+ };
+ return ret;
+}
+
+static int trex_element(TRex *exp)
+{
+ int ret = -1;
+ switch(*exp->_p)
+ {
+ case '(': {
+ int expr,newn;
+ exp->_p++;
+
+
+ if(*exp->_p =='?') {
+ exp->_p++;
+ trex_expect(exp,':');
+ expr = trex_newnode(exp,OP_NOCAPEXPR);
+ }
+ else
+ expr = trex_newnode(exp,OP_EXPR);
+ newn = trex_list(exp);
+ exp->_nodes[expr].left = newn;
+ ret = expr;
+ trex_expect(exp,')');
+ }
+ break;
+ case '[':
+ exp->_p++;
+ ret = trex_class(exp);
+ trex_expect(exp,']');
+ break;
+ case TREX_SYMBOL_END_OF_STRING: exp->_p++; ret = trex_newnode(exp,OP_EOL);break;
+ case TREX_SYMBOL_ANY_CHAR: exp->_p++; ret = trex_newnode(exp,OP_DOT);break;
+ default:
+ ret = trex_charnode(exp,TRex_False);
+ break;
+ }
+
+ {
+ TRexBool isgreedy = TRex_False;
+ unsigned short p0 = 0, p1 = 0;
+ switch(*exp->_p){
+ case TREX_SYMBOL_GREEDY_ZERO_OR_MORE: p0 = 0; p1 = 0xFFFF; exp->_p++; isgreedy = TRex_True; break;
+ case TREX_SYMBOL_GREEDY_ONE_OR_MORE: p0 = 1; p1 = 0xFFFF; exp->_p++; isgreedy = TRex_True; break;
+ case TREX_SYMBOL_GREEDY_ZERO_OR_ONE: p0 = 0; p1 = 1; exp->_p++; isgreedy = TRex_True; break;
+ case '{':
+ exp->_p++;
+ if(!isdigit(*exp->_p)) trex_error(exp,_SC("number expected"));
+ p0 = (unsigned short)trex_parsenumber(exp);
+ /*******************************/
+ switch(*exp->_p) {
+ case '}':
+ p1 = p0; exp->_p++;
+ break;
+ case ',':
+ exp->_p++;
+ p1 = 0xFFFF;
+ if(isdigit(*exp->_p)){
+ p1 = (unsigned short)trex_parsenumber(exp);
+ }
+ trex_expect(exp,'}');
+ break;
+ default:
+ trex_error(exp,_SC(", or } expected"));
+ }
+ /*******************************/
+ isgreedy = TRex_True;
+ break;
+
+ }
+ if(isgreedy) {
+ int nnode = trex_newnode(exp,OP_GREEDY);
+ exp->_nodes[nnode].left = ret;
+ exp->_nodes[nnode].right = ((p0)<<16)|p1;
+ ret = nnode;
+ }
+ }
+ if((*exp->_p != TREX_SYMBOL_BRANCH) && (*exp->_p != ')') && (*exp->_p != TREX_SYMBOL_GREEDY_ZERO_OR_MORE) && (*exp->_p != TREX_SYMBOL_GREEDY_ONE_OR_MORE) && (*exp->_p != '\0')) {
+ int nnode = trex_element(exp);
+ exp->_nodes[ret].next = nnode;
+ }
+
+ return ret;
+}
+
+static int trex_list(TRex *exp)
+{
+ int ret=-1,e;
+ if(*exp->_p == TREX_SYMBOL_BEGINNING_OF_STRING) {
+ exp->_p++;
+ ret = trex_newnode(exp,OP_BOL);
+ }
+ e = trex_element(exp);
+ if(ret != -1) {
+ exp->_nodes[ret].next = e;
+ }
+ else ret = e;
+
+ if(*exp->_p == TREX_SYMBOL_BRANCH) {
+ int temp,tright;
+ exp->_p++;
+ temp = trex_newnode(exp,OP_OR);
+ exp->_nodes[temp].left = ret;
+ tright = trex_list(exp);
+ exp->_nodes[temp].right = tright;
+ ret = temp;
+ }
+ return ret;
+}
+
+static TRexBool trex_matchcclass(int cclass,TRexChar c)
+{
+ switch(cclass) {
+ case 'a': return isalpha(c)?TRex_True:TRex_False;
+ case 'A': return !isalpha(c)?TRex_True:TRex_False;
+ case 'w': return (isalnum(c) || c == '_')?TRex_True:TRex_False;
+ case 'W': return (!isalnum(c) && c != '_')?TRex_True:TRex_False;
+ case 's': return ISSPACE(c)?TRex_True:TRex_False;
+ case 'S': return !ISSPACE(c)?TRex_True:TRex_False;
+ case 'd': return isdigit(c)?TRex_True:TRex_False;
+ case 'D': return !isdigit(c)?TRex_True:TRex_False;
+ case 'x': return isxdigit(c)?TRex_True:TRex_False;
+ case 'X': return !isxdigit(c)?TRex_True:TRex_False;
+ case 'c': return iscntrl(c)?TRex_True:TRex_False;
+ case 'C': return !iscntrl(c)?TRex_True:TRex_False;
+ case 'p': return ispunct(c)?TRex_True:TRex_False;
+ case 'P': return !ispunct(c)?TRex_True:TRex_False;
+ case 'l': return islower(c)?TRex_True:TRex_False;
+ case 'u': return isupper(c)?TRex_True:TRex_False;
+ }
+ return TRex_False; /*cannot happen*/
+}
+
+#ifdef _MSC_VER
+#pragma warning( push )
+#pragma warning( disable : 4706 )
+#endif
+
+static TRexBool trex_matchclass(TRex* exp,TRexNode *node,TRexChar c)
+{
+ do {
+ switch(node->type) {
+ case OP_RANGE:
+ if (exp->_flags & TREX_ICASE)
+ {
+ if(c >= toupper(node->left) && c <= toupper(node->right)) return TRex_True;
+ if(c >= tolower(node->left) && c <= tolower(node->right)) return TRex_True;
+ }
+ else
+ {
+ if(c >= node->left && c <= node->right) return TRex_True;
+ }
+ break;
+ case OP_CCLASS:
+ if(trex_matchcclass(node->left,c)) return TRex_True;
+ break;
+ default:
+ if (exp->_flags & TREX_ICASE)
+ {
+ if (c == tolower(node->type) || c == toupper(node->type)) return TRex_True;
+ }
+ else
+ {
+ if(c == node->type)return TRex_True;
+ }
+
+ }
+ } while((node->next != -1) && (node = &exp->_nodes[node->next]));
+ return TRex_False;
+}
+
+static const TRexChar *trex_matchnode(TRex* exp,TRexNode *node,const TRexChar *str,TRexNode *next)
+{
+
+ TRexNodeType type = node->type;
+ switch(type) {
+ case OP_GREEDY: {
+ //TRexNode *greedystop = (node->next != -1) ? &exp->_nodes[node->next] : NULL;
+ TRexNode *greedystop = NULL;
+ int p0 = (node->right >> 16)&0x0000FFFF, p1 = node->right&0x0000FFFF, nmaches = 0;
+ const TRexChar *s=str, *good = str;
+
+ if(node->next != -1) {
+ greedystop = &exp->_nodes[node->next];
+ }
+ else {
+ greedystop = next;
+ }
+
+ while((nmaches == 0xFFFF || nmaches < p1)) {
+
+ const TRexChar *stop;
+ if(!(s = trex_matchnode(exp,&exp->_nodes[node->left],s,greedystop)))
+ break;
+ nmaches++;
+ good=s;
+ if(greedystop) {
+ //checks that 0 matches satisfy the expression(if so skips)
+ //if not would always stop(for instance if is a '?')
+ if(greedystop->type != OP_GREEDY ||
+ (greedystop->type == OP_GREEDY && ((greedystop->right >> 16)&0x0000FFFF) != 0))
+ {
+ TRexNode *gnext = NULL;
+ if(greedystop->next != -1) {
+ gnext = &exp->_nodes[greedystop->next];
+ }else if(next && next->next != -1){
+ gnext = &exp->_nodes[next->next];
+ }
+ stop = trex_matchnode(exp,greedystop,s,gnext);
+ if(stop) {
+ //if satisfied stop it
+ if(p0 == p1 && p0 == nmaches) break;
+ else if(nmaches >= p0 && p1 == 0xFFFF) break;
+ else if(nmaches >= p0 && nmaches <= p1) break;
+ }
+ }
+ }
+
+ if(s >= exp->_eol)
+ break;
+ }
+ if(p0 == p1 && p0 == nmaches) return good;
+ else if(nmaches >= p0 && p1 == 0xFFFF) return good;
+ else if(nmaches >= p0 && nmaches <= p1) return good;
+ return NULL;
+ }
+ case OP_OR: {
+ const TRexChar *asd = str;
+ TRexNode *temp=&exp->_nodes[node->left];
+ while( (asd = trex_matchnode(exp,temp,asd,NULL)) ) {
+ if(temp->next != -1)
+ temp = &exp->_nodes[temp->next];
+ else
+ return asd;
+ }
+ asd = str;
+ temp = &exp->_nodes[node->right];
+ while( (asd = trex_matchnode(exp,temp,asd,NULL)) ) {
+ if(temp->next != -1)
+ temp = &exp->_nodes[temp->next];
+ else
+ return asd;
+ }
+ return NULL;
+ break;
+ }
+ case OP_EXPR:
+ case OP_NOCAPEXPR:{
+ TRexNode *n = &exp->_nodes[node->left];
+ const TRexChar *cur = str;
+ int capture = -1;
+ if(node->type != OP_NOCAPEXPR && node->right == exp->_currsubexp) {
+ capture = exp->_currsubexp;
+ exp->_matches[capture].begin = cur;
+ exp->_currsubexp++;
+ }
+
+ do {
+ TRexNode *subnext = NULL;
+ if(n->next != -1) {
+ subnext = &exp->_nodes[n->next];
+ }else {
+ subnext = next;
+ }
+ if(!(cur = trex_matchnode(exp,n,cur,subnext))) {
+ if(capture != -1){
+ exp->_matches[capture].begin = 0;
+ exp->_matches[capture].len = 0;
+ }
+ return NULL;
+ }
+ } while((n->next != -1) && (n = &exp->_nodes[n->next]));
+
+ if(capture != -1)
+ exp->_matches[capture].len = (int)(cur - exp->_matches[capture].begin);
+ return cur;
+ }
+ case OP_WB:
+ if((str == exp->_bol && !ISSPACE(*str))
+ || ((str == exp->_eol && !ISSPACE(*(str-1))))
+ || ((!ISSPACE(*str) && ISSPACE(*(str+1))))
+ || ((ISSPACE(*str) && !ISSPACE(*(str+1)))) ) {
+ return (node->left == 'b')?str:NULL;
+ }
+ return (node->left == 'b')?NULL:str;
+ case OP_BOL:
+ if(str == exp->_bol) return str;
+ return NULL;
+ case OP_EOL:
+ if(str == exp->_eol) return str;
+ return NULL;
+ case OP_DOT:
+ str++;
+ return str;
+ case OP_NCLASS:
+ case OP_CLASS:
+ if(trex_matchclass(exp,&exp->_nodes[node->left],*str)?(type == OP_CLASS?TRex_True:TRex_False):(type == OP_NCLASS?TRex_True:TRex_False)) {
+ str++;
+ return str;
+ }
+ return NULL;
+ case OP_CCLASS:
+ if(trex_matchcclass(node->left,*str)) {
+ str++;
+ return str;
+ }
+ return NULL;
+ default: /* char */
+ if (exp->_flags & TREX_ICASE)
+ {
+ if(*str != tolower(node->type) && *str != toupper(node->type)) return NULL;
+ }
+ else
+ {
+ if (*str != node->type) return NULL;
+ }
+ str++;
+ return str;
+ }
+}
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
+
+/* public api */
+TRex *trex_compile(const TRexChar *pattern,const TRexChar **error,int flags)
+{
+ // allocated data is volatile, its safe to setjmp
+ TRex * volatile exp = NULL;
+ do {
+ exp = (TRex *)malloc(sizeof(TRex));
+ if (!exp) break;
+ memset((void*)exp, 0, sizeof(TRex));
+
+ exp->_eol = exp->_bol = NULL;
+ exp->_p = pattern;
+ exp->_nallocated = (int)scstrlen(pattern) * sizeof(TRexChar);
+ exp->_nodes = (TRexNode *)malloc(exp->_nallocated * sizeof(TRexNode));
+ if (!exp->_nodes) break;
+ exp->_nsize = 0;
+ exp->_matches = 0;
+ exp->_nsubexpr = 0;
+ exp->_first = trex_newnode((TRex*)exp,OP_EXPR);
+ exp->_error = error;
+ exp->_jmpbuf = malloc(sizeof(jmp_buf));
+ if (!exp->_jmpbuf) break;
+ exp->_flags = flags;
+ if(setjmp(*((jmp_buf*)exp->_jmpbuf)) == 0) {
+ int res = trex_list((TRex*)exp);
+ exp->_nodes[exp->_first].left = res;
+ if(*exp->_p!='\0')
+ trex_error((TRex*)exp,_SC("unexpected character"));
+#ifdef _DEBUG
+ {
+ int nsize,i;
+ TRexNode *t;
+ nsize = exp->_nsize;
+ t = &exp->_nodes[0];
+ scprintf(_SC("\n"));
+ for(i = 0;i < nsize; i++) {
+ if(exp->_nodes[i].type>MAX_CHAR)
+ scprintf(_SC("[%02d] %10s "),i,g_nnames[exp->_nodes[i].type-MAX_CHAR]);
+ else
+ scprintf(_SC("[%02d] %10c "),i,exp->_nodes[i].type);
+ scprintf(_SC("left %02d right %02d next %02d\n"),exp->_nodes[i].left,exp->_nodes[i].right,exp->_nodes[i].next);
+ }
+ scprintf(_SC("\n"));
+ }
+#endif
+ exp->_matches = (TRexMatch *) malloc(exp->_nsubexpr * sizeof(TRexMatch));
+ if (!exp->_matches) break;
+ memset(exp->_matches,0,exp->_nsubexpr * sizeof(TRexMatch));
+ }
+ else {
+ break;
+ }
+ return (TRex*)exp;
+ } while (0);
+
+ trex_free((TRex*)exp);
+ return NULL;
+}
+
+void trex_free(TRex *exp)
+{
+ if(exp) {
+ if(exp->_nodes) free(exp->_nodes);
+ if(exp->_jmpbuf) free(exp->_jmpbuf);
+ if(exp->_matches) free(exp->_matches);
+ free(exp);
+ }
+}
+
+TRexBool trex_match(TRex* exp,const TRexChar* text)
+{
+ const TRexChar* res = NULL;
+ exp->_bol = text;
+ exp->_eol = text + scstrlen(text);
+ exp->_currsubexp = 0;
+ res = trex_matchnode(exp,exp->_nodes,text,NULL);
+ if(res == NULL || res != exp->_eol)
+ return TRex_False;
+ return TRex_True;
+}
+
+TRexBool trex_searchrange(TRex* exp,const TRexChar* text_begin,const TRexChar* text_end,const TRexChar** out_begin, const TRexChar** out_end)
+{
+ const TRexChar *cur = NULL;
+ int node = exp->_first;
+ if(text_begin >= text_end) return TRex_False;
+ exp->_bol = text_begin;
+ exp->_eol = text_end;
+ do {
+ cur = text_begin;
+ while(node != -1) {
+ exp->_currsubexp = 0;
+ cur = trex_matchnode(exp,&exp->_nodes[node],cur,NULL);
+ if(!cur)
+ break;
+ node = exp->_nodes[node].next;
+ }
+ text_begin++;
+ } while(cur == NULL && text_begin != text_end);
+
+ if(cur == NULL)
+ return TRex_False;
+
+ --text_begin;
+
+ if(out_begin) *out_begin = text_begin;
+ if(out_end) *out_end = cur;
+ return TRex_True;
+}
+
+TRexBool trex_search(TRex* exp,const TRexChar* text, const TRexChar** out_begin, const TRexChar** out_end)
+{
+ return trex_searchrange(exp,text,text + scstrlen(text),out_begin,out_end);
+}
+
+int trex_getsubexpcount(TRex* exp)
+{
+ return exp->_nsubexpr;
+}
+
+TRexBool trex_getsubexp(TRex* exp, int n, TRexMatch *subexp)
+{
+ if( n<0 || n >= exp->_nsubexpr) return TRex_False;
+ *subexp = exp->_matches[n];
+ return TRex_True;
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+
+#include "argtable3.h"
+
+
+static void arg_str_resetfn(struct arg_str *parent)
+{
+ ARG_TRACE(("%s:resetfn(%p)\n", __FILE__, parent));
+ parent->count = 0;
+}
+
+
+static int arg_str_scanfn(struct arg_str *parent, const char *argval)
+{
+ int errorcode = 0;
+
+ if (parent->count == parent->hdr.maxcount)
+ {
+ /* maximum number of arguments exceeded */
+ errorcode = EMAXCOUNT;
+ }
+ else if (!argval)
+ {
+ /* a valid argument with no argument value was given. */
+ /* This happens when an optional argument value was invoked. */
+ /* leave parent arguiment value unaltered but still count the argument. */
+ parent->count++;
+ }
+ else
+ {
+ parent->sval[parent->count++] = argval;
+ }
+
+ ARG_TRACE(("%s:scanfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static int arg_str_checkfn(struct arg_str *parent)
+{
+ int errorcode = (parent->count < parent->hdr.mincount) ? EMINCOUNT : 0;
+
+ ARG_TRACE(("%s:checkfn(%p) returns %d\n", __FILE__, parent, errorcode));
+ return errorcode;
+}
+
+
+static void arg_str_errorfn(
+ struct arg_str *parent,
+ FILE *fp,
+ int errorcode,
+ const char *argval,
+ const char *progname)
+{
+ const char *shortopts = parent->hdr.shortopts;
+ const char *longopts = parent->hdr.longopts;
+ const char *datatype = parent->hdr.datatype;
+
+ /* make argval NULL safe */
+ argval = argval ? argval : "";
+
+ fprintf(fp, "%s: ", progname);
+ switch(errorcode)
+ {
+ case EMINCOUNT:
+ fputs("missing option ", fp);
+ arg_print_option(fp, shortopts, longopts, datatype, "\n");
+ break;
+
+ case EMAXCOUNT:
+ fputs("excess option ", fp);
+ arg_print_option(fp, shortopts, longopts, argval, "\n");
+ break;
+ }
+}
+
+
+struct arg_str * arg_str0(
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_strn(shortopts, longopts, datatype, 0, 1, glossary);
+}
+
+
+struct arg_str * arg_str1(
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ const char *glossary)
+{
+ return arg_strn(shortopts, longopts, datatype, 1, 1, glossary);
+}
+
+
+struct arg_str * arg_strn(
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary)
+{
+ size_t nbytes;
+ struct arg_str *result;
+
+ /* should not allow this stupid error */
+ /* we should return an error code warning this logic error */
+ /* foolproof things by ensuring maxcount is not less than mincount */
+ maxcount = (maxcount < mincount) ? mincount : maxcount;
+
+ nbytes = sizeof(struct arg_str) /* storage for struct arg_str */
+ + maxcount * sizeof(char *); /* storage for sval[maxcount] array */
+
+ result = (struct arg_str *)malloc(nbytes);
+ if (result)
+ {
+ int i;
+
+ /* init the arg_hdr struct */
+ result->hdr.flag = ARG_HASVALUE;
+ result->hdr.shortopts = shortopts;
+ result->hdr.longopts = longopts;
+ result->hdr.datatype = datatype ? datatype : "<string>";
+ result->hdr.glossary = glossary;
+ result->hdr.mincount = mincount;
+ result->hdr.maxcount = maxcount;
+ result->hdr.parent = result;
+ result->hdr.resetfn = (arg_resetfn *)arg_str_resetfn;
+ result->hdr.scanfn = (arg_scanfn *)arg_str_scanfn;
+ result->hdr.checkfn = (arg_checkfn *)arg_str_checkfn;
+ result->hdr.errorfn = (arg_errorfn *)arg_str_errorfn;
+
+ /* store the sval[maxcount] array immediately after the arg_str struct */
+ result->sval = (const char * *)(result + 1);
+ result->count = 0;
+
+ /* foolproof the string pointers by initialising them to reference empty strings */
+ for (i = 0; i < maxcount; i++)
+ result->sval[i] = "";
+ }
+
+ ARG_TRACE(("arg_strn() returns %p\n", result));
+ return result;
+}
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "argtable3.h"
+
+static
+void arg_register_error(struct arg_end *end,
+ void *parent,
+ int error,
+ const char *argval)
+{
+ /* printf("arg_register_error(%p,%p,%d,%s)\n",end,parent,error,argval); */
+ if (end->count < end->hdr.maxcount)
+ {
+ end->error[end->count] = error;
+ end->parent[end->count] = parent;
+ end->argval[end->count] = argval;
+ end->count++;
+ }
+ else
+ {
+ end->error[end->hdr.maxcount - 1] = ARG_ELIMIT;
+ end->parent[end->hdr.maxcount - 1] = end;
+ end->argval[end->hdr.maxcount - 1] = NULL;
+ }
+}
+
+
+/*
+ * Return index of first table entry with a matching short option
+ * or -1 if no match was found.
+ */
+static
+int find_shortoption(struct arg_hdr * *table, char shortopt)
+{
+ int tabindex;
+ for(tabindex = 0; !(table[tabindex]->flag & ARG_TERMINATOR); tabindex++)
+ {
+ if (table[tabindex]->shortopts &&
+ strchr(table[tabindex]->shortopts, shortopt))
+ return tabindex;
+ }
+ return -1;
+}
+
+
+struct longoptions
+{
+ int getoptval;
+ int noptions;
+ struct option *options;
+};
+
+#if 0
+static
+void dump_longoptions(struct longoptions * longoptions)
+{
+ int i;
+ printf("getoptval = %d\n", longoptions->getoptval);
+ printf("noptions = %d\n", longoptions->noptions);
+ for (i = 0; i < longoptions->noptions; i++)
+ {
+ printf("options[%d].name = \"%s\"\n",
+ i,
+ longoptions->options[i].name);
+ printf("options[%d].has_arg = %d\n", i, longoptions->options[i].has_arg);
+ printf("options[%d].flag = %p\n", i, longoptions->options[i].flag);
+ printf("options[%d].val = %d\n", i, longoptions->options[i].val);
+ }
+}
+#endif
+
+static
+struct longoptions * alloc_longoptions(struct arg_hdr * *table)
+{
+ struct longoptions *result;
+ size_t nbytes;
+ int noptions = 1;
+ size_t longoptlen = 0;
+ int tabindex;
+
+ /*
+ * Determine the total number of option structs required
+ * by counting the number of comma separated long options
+ * in all table entries and return the count in noptions.
+ * note: noptions starts at 1 not 0 because we getoptlong
+ * requires a NULL option entry to terminate the option array.
+ * While we are at it, count the number of chars required
+ * to store private copies of all the longoption strings
+ * and return that count in logoptlen.
+ */
+ tabindex = 0;
+ do
+ {
+ const char *longopts = table[tabindex]->longopts;
+ longoptlen += (longopts ? strlen(longopts) : 0) + 1;
+ while (longopts)
+ {
+ noptions++;
+ longopts = strchr(longopts + 1, ',');
+ }
+ } while(!(table[tabindex++]->flag & ARG_TERMINATOR));
+ /*printf("%d long options consuming %d chars in total\n",noptions,longoptlen);*/
+
+
+ /* allocate storage for return data structure as: */
+ /* (struct longoptions) + (struct options)[noptions] + char[longoptlen] */
+ nbytes = sizeof(struct longoptions)
+ + sizeof(struct option) * noptions
+ + longoptlen;
+ result = (struct longoptions *)malloc(nbytes);
+ if (result)
+ {
+ int option_index = 0;
+ char *store;
+
+ result->getoptval = 0;
+ result->noptions = noptions;
+ result->options = (struct option *)(result + 1);
+ store = (char *)(result->options + noptions);
+
+ for(tabindex = 0; !(table[tabindex]->flag & ARG_TERMINATOR); tabindex++)
+ {
+ const char *longopts = table[tabindex]->longopts;
+
+ while(longopts && *longopts)
+ {
+ char *storestart = store;
+
+ /* copy progressive longopt strings into the store */
+ while (*longopts != 0 && *longopts != ',')
+ *store++ = *longopts++;
+ *store++ = 0;
+ if (*longopts == ',')
+ longopts++;
+ /*fprintf(stderr,"storestart=\"%s\"\n",storestart);*/
+
+ result->options[option_index].name = storestart;
+ result->options[option_index].flag = &(result->getoptval);
+ result->options[option_index].val = tabindex;
+ if (table[tabindex]->flag & ARG_HASOPTVALUE)
+ result->options[option_index].has_arg = 2;
+ else if (table[tabindex]->flag & ARG_HASVALUE)
+ result->options[option_index].has_arg = 1;
+ else
+ result->options[option_index].has_arg = 0;
+
+ option_index++;
+ }
+ }
+ /* terminate the options array with a zero-filled entry */
+ result->options[option_index].name = 0;
+ result->options[option_index].has_arg = 0;
+ result->options[option_index].flag = 0;
+ result->options[option_index].val = 0;
+ }
+
+ /*dump_longoptions(result);*/
+ return result;
+}
+
+static
+char * alloc_shortoptions(struct arg_hdr * *table)
+{
+ char *result;
+ size_t len = 2;
+ int tabindex;
+
+ /* determine the total number of option chars required */
+ for(tabindex = 0; !(table[tabindex]->flag & ARG_TERMINATOR); tabindex++)
+ {
+ struct arg_hdr *hdr = table[tabindex];
+ len += 3 * (hdr->shortopts ? strlen(hdr->shortopts) : 0);
+ }
+
+ result = malloc(len);
+ if (result)
+ {
+ char *res = result;
+
+ /* add a leading ':' so getopt return codes distinguish */
+ /* unrecognised option and options missing argument values */
+ *res++ = ':';
+
+ for(tabindex = 0; !(table[tabindex]->flag & ARG_TERMINATOR); tabindex++)
+ {
+ struct arg_hdr *hdr = table[tabindex];
+ const char *shortopts = hdr->shortopts;
+ while(shortopts && *shortopts)
+ {
+ *res++ = *shortopts++;
+ if (hdr->flag & ARG_HASVALUE)
+ *res++ = ':';
+ if (hdr->flag & ARG_HASOPTVALUE)
+ *res++ = ':';
+ }
+ }
+ /* null terminate the string */
+ *res = 0;
+ }
+
+ /*printf("alloc_shortoptions() returns \"%s\"\n",(result?result:"NULL"));*/
+ return result;
+}
+
+
+/* return index of the table terminator entry */
+static
+int arg_endindex(struct arg_hdr * *table)
+{
+ int tabindex = 0;
+ while (!(table[tabindex]->flag & ARG_TERMINATOR))
+ tabindex++;
+ return tabindex;
+}
+
+
+static
+void arg_parse_tagged(int argc,
+ char * *argv,
+ struct arg_hdr * *table,
+ struct arg_end *endtable)
+{
+ struct longoptions *longoptions;
+ char *shortoptions;
+ int copt;
+
+ /*printf("arg_parse_tagged(%d,%p,%p,%p)\n",argc,argv,table,endtable);*/
+
+ /* allocate short and long option arrays for the given opttable[]. */
+ /* if the allocs fail then put an error msg in the last table entry. */
+ longoptions = alloc_longoptions(table);
+ shortoptions = alloc_shortoptions(table);
+ if (!longoptions || !shortoptions)
+ {
+ /* one or both memory allocs failed */
+ arg_register_error(endtable, endtable, ARG_EMALLOC, NULL);
+ /* free anything that was allocated (this is null safe) */
+ free(shortoptions);
+ free(longoptions);
+ return;
+ }
+
+ /*dump_longoptions(longoptions);*/
+
+ /* reset getopts internal option-index to zero, and disable error reporting */
+ optind = 0;
+ opterr = 0;
+
+ /* fetch and process args using getopt_long */
+ while( (copt =
+ getopt_long(argc, argv, shortoptions, longoptions->options,
+ NULL)) != -1)
+ {
+ /*
+ printf("optarg='%s'\n",optarg);
+ printf("optind=%d\n",optind);
+ printf("copt=%c\n",(char)copt);
+ printf("optopt=%c (%d)\n",optopt, (int)(optopt));
+ */
+ switch(copt)
+ {
+ case 0:
+ {
+ int tabindex = longoptions->getoptval;
+ void *parent = table[tabindex]->parent;
+ /*printf("long option detected from argtable[%d]\n", tabindex);*/
+ if (optarg && optarg[0] == 0 &&
+ (table[tabindex]->flag & ARG_HASVALUE))
+ {
+ /* printf(": long option %s requires an argument\n",argv[optind-1]); */
+ arg_register_error(endtable, endtable, ARG_EMISSARG,
+ argv[optind - 1]);
+ /* continue to scan the (empty) argument value to enforce argument count checking */
+ }
+ if (table[tabindex]->scanfn)
+ {
+ int errorcode = table[tabindex]->scanfn(parent, optarg);
+ if (errorcode != 0)
+ arg_register_error(endtable, parent, errorcode, optarg);
+ }
+ }
+ break;
+
+ case '?':
+ /*
+ * getopt_long() found an unrecognised short option.
+ * if it was a short option its value is in optopt
+ * if it was a long option then optopt=0
+ */
+ switch (optopt)
+ {
+ case 0:
+ /*printf("?0 unrecognised long option %s\n",argv[optind-1]);*/
+ arg_register_error(endtable, endtable, ARG_ELONGOPT,
+ argv[optind - 1]);
+ break;
+ default:
+ /*printf("?* unrecognised short option '%c'\n",optopt);*/
+ arg_register_error(endtable, endtable, optopt, NULL);
+ break;
+ }
+ break;
+
+ case ':':
+ /*
+ * getopt_long() found an option with its argument missing.
+ */
+ /*printf(": option %s requires an argument\n",argv[optind-1]); */
+ arg_register_error(endtable, endtable, ARG_EMISSARG,
+ argv[optind - 1]);
+ break;
+
+ default:
+ {
+ /* getopt_long() found a valid short option */
+ int tabindex = find_shortoption(table, (char)copt);
+ /*printf("short option detected from argtable[%d]\n", tabindex);*/
+ if (tabindex == -1)
+ {
+ /* should never get here - but handle it just in case */
+ /*printf("unrecognised short option %d\n",copt);*/
+ arg_register_error(endtable, endtable, copt, NULL);
+ }
+ else
+ {
+ if (table[tabindex]->scanfn)
+ {
+ void *parent = table[tabindex]->parent;
+ int errorcode = table[tabindex]->scanfn(parent, optarg);
+ if (errorcode != 0)
+ arg_register_error(endtable, parent, errorcode, optarg);
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ free(shortoptions);
+ free(longoptions);
+}
+
+
+static
+void arg_parse_untagged(int argc,
+ char * *argv,
+ struct arg_hdr * *table,
+ struct arg_end *endtable)
+{
+ int tabindex = 0;
+ int errorlast = 0;
+ const char *optarglast = NULL;
+ void *parentlast = NULL;
+
+ /*printf("arg_parse_untagged(%d,%p,%p,%p)\n",argc,argv,table,endtable);*/
+ while (!(table[tabindex]->flag & ARG_TERMINATOR))
+ {
+ void *parent;
+ int errorcode;
+
+ /* if we have exhausted our argv[optind] entries then we have finished */
+ if (optind >= argc)
+ {
+ /*printf("arg_parse_untagged(): argv[] exhausted\n");*/
+ return;
+ }
+
+ /* skip table entries with non-null long or short options (they are not untagged entries) */
+ if (table[tabindex]->longopts || table[tabindex]->shortopts)
+ {
+ /*printf("arg_parse_untagged(): skipping argtable[%d] (tagged argument)\n",tabindex);*/
+ tabindex++;
+ continue;
+ }
+
+ /* skip table entries with NULL scanfn */
+ if (!(table[tabindex]->scanfn))
+ {
+ /*printf("arg_parse_untagged(): skipping argtable[%d] (NULL scanfn)\n",tabindex);*/
+ tabindex++;
+ continue;
+ }
+
+ /* attempt to scan the current argv[optind] with the current */
+ /* table[tabindex] entry. If it succeeds then keep it, otherwise */
+ /* try again with the next table[] entry. */
+ parent = table[tabindex]->parent;
+ errorcode = table[tabindex]->scanfn(parent, argv[optind]);
+ if (errorcode == 0)
+ {
+ /* success, move onto next argv[optind] but stay with same table[tabindex] */
+ /*printf("arg_parse_untagged(): argtable[%d] successfully matched\n",tabindex);*/
+ optind++;
+
+ /* clear the last tentative error */
+ errorlast = 0;
+ }
+ else
+ {
+ /* failure, try same argv[optind] with next table[tabindex] entry */
+ /*printf("arg_parse_untagged(): argtable[%d] failed match\n",tabindex);*/
+ tabindex++;
+
+ /* remember this as a tentative error we may wish to reinstate later */
+ errorlast = errorcode;
+ optarglast = argv[optind];
+ parentlast = parent;
+ }
+
+ }
+
+ /* if a tenative error still remains at this point then register it as a proper error */
+ if (errorlast)
+ {
+ arg_register_error(endtable, parentlast, errorlast, optarglast);
+ optind++;
+ }
+
+ /* only get here when not all argv[] entries were consumed */
+ /* register an error for each unused argv[] entry */
+ while (optind < argc)
+ {
+ /*printf("arg_parse_untagged(): argv[%d]=\"%s\" not consumed\n",optind,argv[optind]);*/
+ arg_register_error(endtable, endtable, ARG_ENOMATCH, argv[optind++]);
+ }
+
+ return;
+}
+
+
+static
+void arg_parse_check(struct arg_hdr * *table, struct arg_end *endtable)
+{
+ int tabindex = 0;
+ /* printf("arg_parse_check()\n"); */
+ do
+ {
+ if (table[tabindex]->checkfn)
+ {
+ void *parent = table[tabindex]->parent;
+ int errorcode = table[tabindex]->checkfn(parent);
+ if (errorcode != 0)
+ arg_register_error(endtable, parent, errorcode, NULL);
+ }
+ } while(!(table[tabindex++]->flag & ARG_TERMINATOR));
+}
+
+
+static
+void arg_reset(void * *argtable)
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ int tabindex = 0;
+ /*printf("arg_reset(%p)\n",argtable);*/
+ do
+ {
+ if (table[tabindex]->resetfn)
+ table[tabindex]->resetfn(table[tabindex]->parent);
+ } while(!(table[tabindex++]->flag & ARG_TERMINATOR));
+}
+
+
+int arg_parse(int argc, char * *argv, void * *argtable)
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ struct arg_end *endtable;
+ int endindex;
+ char * *argvcopy = NULL;
+
+ /*printf("arg_parse(%d,%p,%p)\n",argc,argv,argtable);*/
+
+ /* reset any argtable data from previous invocations */
+ arg_reset(argtable);
+
+ /* locate the first end-of-table marker within the array */
+ endindex = arg_endindex(table);
+ endtable = (struct arg_end *)table[endindex];
+
+ /* Special case of argc==0. This can occur on Texas Instruments DSP. */
+ /* Failure to trap this case results in an unwanted NULL result from */
+ /* the malloc for argvcopy (next code block). */
+ if (argc == 0)
+ {
+ /* We must still perform post-parse checks despite the absence of command line arguments */
+ arg_parse_check(table, endtable);
+
+ /* Now we are finished */
+ return endtable->count;
+ }
+
+ argvcopy = (char **)malloc(sizeof(char *) * (argc + 1));
+ if (argvcopy)
+ {
+ int i;
+
+ /*
+ Fill in the local copy of argv[]. We need a local copy
+ because getopt rearranges argv[] which adversely affects
+ susbsequent parsing attempts.
+ */
+ for (i = 0; i < argc; i++)
+ argvcopy[i] = argv[i];
+
+ argvcopy[argc] = NULL;
+
+ /* parse the command line (local copy) for tagged options */
+ arg_parse_tagged(argc, argvcopy, table, endtable);
+
+ /* parse the command line (local copy) for untagged options */
+ arg_parse_untagged(argc, argvcopy, table, endtable);
+
+ /* if no errors so far then perform post-parse checks otherwise dont bother */
+ if (endtable->count == 0)
+ arg_parse_check(table, endtable);
+
+ /* release the local copt of argv[] */
+ free(argvcopy);
+ }
+ else
+ {
+ /* memory alloc failed */
+ arg_register_error(endtable, endtable, ARG_EMALLOC, NULL);
+ }
+
+ return endtable->count;
+}
+
+
+/*
+ * Concatenate contents of src[] string onto *pdest[] string.
+ * The *pdest pointer is altered to point to the end of the
+ * target string and *pndest is decremented by the same number
+ * of chars.
+ * Does not append more than *pndest chars into *pdest[]
+ * so as to prevent buffer overruns.
+ * Its something like strncat() but more efficient for repeated
+ * calls on the same destination string.
+ * Example of use:
+ * char dest[30] = "good"
+ * size_t ndest = sizeof(dest);
+ * char *pdest = dest;
+ * arg_char(&pdest,"bye ",&ndest);
+ * arg_char(&pdest,"cruel ",&ndest);
+ * arg_char(&pdest,"world!",&ndest);
+ * Results in:
+ * dest[] == "goodbye cruel world!"
+ * ndest == 10
+ */
+static
+void arg_cat(char * *pdest, const char *src, size_t *pndest)
+{
+ char *dest = *pdest;
+ char *end = dest + *pndest;
+
+ /*locate null terminator of dest string */
+ while(dest < end && *dest != 0)
+ dest++;
+
+ /* concat src string to dest string */
+ while(dest < end && *src != 0)
+ *dest++ = *src++;
+
+ /* null terminate dest string */
+ *dest = 0;
+
+ /* update *pdest and *pndest */
+ *pndest = end - dest;
+ *pdest = dest;
+}
+
+
+static
+void arg_cat_option(char *dest,
+ size_t ndest,
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ int optvalue)
+{
+ if (shortopts)
+ {
+ char option[3];
+
+ /* note: option array[] is initialiazed dynamically here to satisfy */
+ /* a deficiency in the watcom compiler wrt static array initializers. */
+ option[0] = '-';
+ option[1] = shortopts[0];
+ option[2] = 0;
+
+ arg_cat(&dest, option, &ndest);
+ if (datatype)
+ {
+ arg_cat(&dest, " ", &ndest);
+ if (optvalue)
+ {
+ arg_cat(&dest, "[", &ndest);
+ arg_cat(&dest, datatype, &ndest);
+ arg_cat(&dest, "]", &ndest);
+ }
+ else
+ arg_cat(&dest, datatype, &ndest);
+ }
+ }
+ else if (longopts)
+ {
+ size_t ncspn;
+
+ /* add "--" tag prefix */
+ arg_cat(&dest, "--", &ndest);
+
+ /* add comma separated option tag */
+ ncspn = strcspn(longopts, ",");
+#ifdef __STDC_WANT_SECURE_LIB__
+ strncat_s(dest, ndest, longopts, (ncspn < ndest) ? ncspn : ndest);
+#else
+ strncat(dest, longopts, (ncspn < ndest) ? ncspn : ndest);
+#endif
+
+ if (datatype)
+ {
+ arg_cat(&dest, "=", &ndest);
+ if (optvalue)
+ {
+ arg_cat(&dest, "[", &ndest);
+ arg_cat(&dest, datatype, &ndest);
+ arg_cat(&dest, "]", &ndest);
+ }
+ else
+ arg_cat(&dest, datatype, &ndest);
+ }
+ }
+ else if (datatype)
+ {
+ if (optvalue)
+ {
+ arg_cat(&dest, "[", &ndest);
+ arg_cat(&dest, datatype, &ndest);
+ arg_cat(&dest, "]", &ndest);
+ }
+ else
+ arg_cat(&dest, datatype, &ndest);
+ }
+}
+
+static
+void arg_cat_optionv(char *dest,
+ size_t ndest,
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ int optvalue,
+ const char *separator)
+{
+ separator = separator ? separator : "";
+
+ if (shortopts)
+ {
+ const char *c = shortopts;
+ while(*c)
+ {
+ /* "-a|-b|-c" */
+ char shortopt[3];
+
+ /* note: shortopt array[] is initialiazed dynamically here to satisfy */
+ /* a deficiency in the watcom compiler wrt static array initializers. */
+ shortopt[0] = '-';
+ shortopt[1] = *c;
+ shortopt[2] = 0;
+
+ arg_cat(&dest, shortopt, &ndest);
+ if (*++c)
+ arg_cat(&dest, separator, &ndest);
+ }
+ }
+
+ /* put separator between long opts and short opts */
+ if (shortopts && longopts)
+ arg_cat(&dest, separator, &ndest);
+
+ if (longopts)
+ {
+ const char *c = longopts;
+ while(*c)
+ {
+ size_t ncspn;
+
+ /* add "--" tag prefix */
+ arg_cat(&dest, "--", &ndest);
+
+ /* add comma separated option tag */
+ ncspn = strcspn(c, ",");
+#ifdef __STDC_WANT_SECURE_LIB__
+ strncat_s(dest, ndest, c, (ncspn < ndest) ? ncspn : ndest);
+#else
+ strncat(dest, c, (ncspn < ndest) ? ncspn : ndest);
+#endif
+ c += ncspn;
+
+ /* add given separator in place of comma */
+ if (*c == ',')
+ {
+ arg_cat(&dest, separator, &ndest);
+ c++;
+ }
+ }
+ }
+
+ if (datatype)
+ {
+ if (longopts)
+ arg_cat(&dest, "=", &ndest);
+ else if (shortopts)
+ arg_cat(&dest, " ", &ndest);
+
+ if (optvalue)
+ {
+ arg_cat(&dest, "[", &ndest);
+ arg_cat(&dest, datatype, &ndest);
+ arg_cat(&dest, "]", &ndest);
+ }
+ else
+ arg_cat(&dest, datatype, &ndest);
+ }
+}
+
+
+/* this function should be deprecated because it doesnt consider optional argument values (ARG_HASOPTVALUE) */
+void arg_print_option(FILE *fp,
+ const char *shortopts,
+ const char *longopts,
+ const char *datatype,
+ const char *suffix)
+{
+ char syntax[200] = "";
+ suffix = suffix ? suffix : "";
+
+ /* there is no way of passing the proper optvalue for optional argument values here, so we must ignore it */
+ arg_cat_optionv(syntax,
+ sizeof(syntax),
+ shortopts,
+ longopts,
+ datatype,
+ 0,
+ "|");
+
+ fputs(syntax, fp);
+ fputs(suffix, fp);
+}
+
+
+/*
+ * Print a GNU style [OPTION] string in which all short options that
+ * do not take argument values are presented in abbreviated form, as
+ * in: -xvfsd, or -xvf[sd], or [-xvsfd]
+ */
+static
+void arg_print_gnuswitch(FILE *fp, struct arg_hdr * *table)
+{
+ int tabindex;
+ char *format1 = " -%c";
+ char *format2 = " [-%c";
+ char *suffix = "";
+
+ /* print all mandatory switches that are without argument values */
+ for(tabindex = 0;
+ table[tabindex] && !(table[tabindex]->flag & ARG_TERMINATOR);
+ tabindex++)
+ {
+ /* skip optional options */
+ if (table[tabindex]->mincount < 1)
+ continue;
+
+ /* skip non-short options */
+ if (table[tabindex]->shortopts == NULL)
+ continue;
+
+ /* skip options that take argument values */
+ if (table[tabindex]->flag & ARG_HASVALUE)
+ continue;
+
+ /* print the short option (only the first short option char, ignore multiple choices)*/
+ fprintf(fp, format1, table[tabindex]->shortopts[0]);
+ format1 = "%c";
+ format2 = "[%c";
+ }
+
+ /* print all optional switches that are without argument values */
+ for(tabindex = 0;
+ table[tabindex] && !(table[tabindex]->flag & ARG_TERMINATOR);
+ tabindex++)
+ {
+ /* skip mandatory args */
+ if (table[tabindex]->mincount > 0)
+ continue;
+
+ /* skip args without short options */
+ if (table[tabindex]->shortopts == NULL)
+ continue;
+
+ /* skip args with values */
+ if (table[tabindex]->flag & ARG_HASVALUE)
+ continue;
+
+ /* print first short option */
+ fprintf(fp, format2, table[tabindex]->shortopts[0]);
+ format2 = "%c";
+ suffix = "]";
+ }
+
+ fprintf(fp, "%s", suffix);
+}
+
+
+void arg_print_syntax(FILE *fp, void * *argtable, const char *suffix)
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ int i, tabindex;
+
+ /* print GNU style [OPTION] string */
+ arg_print_gnuswitch(fp, table);
+
+ /* print remaining options in abbreviated style */
+ for(tabindex = 0;
+ table[tabindex] && !(table[tabindex]->flag & ARG_TERMINATOR);
+ tabindex++)
+ {
+ char syntax[200] = "";
+ const char *shortopts, *longopts, *datatype;
+
+ /* skip short options without arg values (they were printed by arg_print_gnu_switch) */
+ if (table[tabindex]->shortopts &&
+ !(table[tabindex]->flag & ARG_HASVALUE))
+ continue;
+
+ shortopts = table[tabindex]->shortopts;
+ longopts = table[tabindex]->longopts;
+ datatype = table[tabindex]->datatype;
+ arg_cat_option(syntax,
+ sizeof(syntax),
+ shortopts,
+ longopts,
+ datatype,
+ table[tabindex]->flag & ARG_HASOPTVALUE);
+
+ if (strlen(syntax) > 0)
+ {
+ /* print mandatory instances of this option */
+ for (i = 0; i < table[tabindex]->mincount; i++)
+ fprintf(fp, " %s", syntax);
+
+ /* print optional instances enclosed in "[..]" */
+ switch ( table[tabindex]->maxcount - table[tabindex]->mincount )
+ {
+ case 0:
+ break;
+ case 1:
+ fprintf(fp, " [%s]", syntax);
+ break;
+ case 2:
+ fprintf(fp, " [%s] [%s]", syntax, syntax);
+ break;
+ default:
+ fprintf(fp, " [%s]...", syntax);
+ break;
+ }
+ }
+ }
+
+ if (suffix)
+ fprintf(fp, "%s", suffix);
+}
+
+
+void arg_print_syntaxv(FILE *fp, void * *argtable, const char *suffix)
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ int i, tabindex;
+
+ /* print remaining options in abbreviated style */
+ for(tabindex = 0;
+ table[tabindex] && !(table[tabindex]->flag & ARG_TERMINATOR);
+ tabindex++)
+ {
+ char syntax[200] = "";
+ const char *shortopts, *longopts, *datatype;
+
+ shortopts = table[tabindex]->shortopts;
+ longopts = table[tabindex]->longopts;
+ datatype = table[tabindex]->datatype;
+ arg_cat_optionv(syntax,
+ sizeof(syntax),
+ shortopts,
+ longopts,
+ datatype,
+ table[tabindex]->flag & ARG_HASOPTVALUE,
+ "|");
+
+ /* print mandatory options */
+ for (i = 0; i < table[tabindex]->mincount; i++)
+ fprintf(fp, " %s", syntax);
+
+ /* print optional args enclosed in "[..]" */
+ switch ( table[tabindex]->maxcount - table[tabindex]->mincount )
+ {
+ case 0:
+ break;
+ case 1:
+ fprintf(fp, " [%s]", syntax);
+ break;
+ case 2:
+ fprintf(fp, " [%s] [%s]", syntax, syntax);
+ break;
+ default:
+ fprintf(fp, " [%s]...", syntax);
+ break;
+ }
+ }
+
+ if (suffix)
+ fprintf(fp, "%s", suffix);
+}
+
+
+void arg_print_glossary(FILE *fp, void * *argtable, const char *format)
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ int tabindex;
+
+ format = format ? format : " %-20s %s\n";
+ for (tabindex = 0; !(table[tabindex]->flag & ARG_TERMINATOR); tabindex++)
+ {
+ if (table[tabindex]->glossary)
+ {
+ char syntax[200] = "";
+ const char *shortopts = table[tabindex]->shortopts;
+ const char *longopts = table[tabindex]->longopts;
+ const char *datatype = table[tabindex]->datatype;
+ const char *glossary = table[tabindex]->glossary;
+ arg_cat_optionv(syntax,
+ sizeof(syntax),
+ shortopts,
+ longopts,
+ datatype,
+ table[tabindex]->flag & ARG_HASOPTVALUE,
+ ", ");
+ fprintf(fp, format, syntax, glossary);
+ }
+ }
+}
+
+
+/**
+ * Print a piece of text formatted, which means in a column with a
+ * left and a right margin. The lines are wrapped at whitspaces next
+ * to right margin. The function does not indent the first line, but
+ * only the following ones.
+ *
+ * Example:
+ * arg_print_formatted( fp, 0, 5, "Some text that doesn't fit." )
+ * will result in the following output:
+ *
+ * Some
+ * text
+ * that
+ * doesn'
+ * t fit.
+ *
+ * Too long lines will be wrapped in the middle of a word.
+ *
+ * arg_print_formatted( fp, 2, 7, "Some text that doesn't fit." )
+ * will result in the following output:
+ *
+ * Some
+ * text
+ * that
+ * doesn'
+ * t fit.
+ *
+ * As you see, the first line is not indented. This enables output of
+ * lines, which start in a line where output already happened.
+ *
+ * Author: Uli Fouquet
+ */
+static
+void arg_print_formatted( FILE *fp,
+ const unsigned lmargin,
+ const unsigned rmargin,
+ const char *text )
+{
+ const unsigned textlen = (unsigned)strlen( text );
+ unsigned line_start = 0;
+ unsigned line_end = textlen + 1;
+ const unsigned colwidth = (rmargin - lmargin) + 1;
+
+ /* Someone doesn't like us... */
+ if ( line_end < line_start )
+ { fprintf( fp, "%s\n", text ); }
+
+ while (line_end - 1 > line_start )
+ {
+ /* Eat leading whitespaces. This is essential because while
+ wrapping lines, there will often be a whitespace at beginning
+ of line */
+ while ( ISSPACE(*(text + line_start)) )
+ { line_start++; }
+
+ if ((line_end - line_start) > colwidth )
+ { line_end = line_start + colwidth; }
+
+ /* Find last whitespace, that fits into line */
+ while ( ( line_end > line_start )
+ && ( line_end - line_start > colwidth )
+ && !ISSPACE(*(text + line_end)))
+ { line_end--; }
+
+ /* Do not print trailing whitespace. If this text
+ has got only one line, line_end now points to the
+ last char due to initialization. */
+ line_end--;
+
+ /* Output line of text */
+ while ( line_start < line_end )
+ {
+ fputc(*(text + line_start), fp );
+ line_start++;
+ }
+ fputc( '\n', fp );
+
+ /* Initialize another line */
+ if ( line_end + 1 < textlen )
+ {
+ unsigned i;
+
+ for (i = 0; i < lmargin; i++ )
+ { fputc( ' ', fp ); }
+
+ line_end = textlen;
+ }
+
+ /* If we have to print another line, get also the last char. */
+ line_end++;
+
+ } /* lines of text */
+}
+
+/**
+ * Prints the glossary in strict GNU format.
+ * Differences to arg_print_glossary() are:
+ * - wraps lines after 80 chars
+ * - indents lines without shortops
+ * - does not accept formatstrings
+ *
+ * Contributed by Uli Fouquet
+ */
+void arg_print_glossary_gnu(FILE *fp, void * *argtable )
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ int tabindex;
+
+ for(tabindex = 0; !(table[tabindex]->flag & ARG_TERMINATOR); tabindex++)
+ {
+ if (table[tabindex]->glossary)
+ {
+ char syntax[200] = "";
+ const char *shortopts = table[tabindex]->shortopts;
+ const char *longopts = table[tabindex]->longopts;
+ const char *datatype = table[tabindex]->datatype;
+ const char *glossary = table[tabindex]->glossary;
+
+ if ( !shortopts && longopts )
+ {
+ /* Indent trailing line by 4 spaces... */
+ memset( syntax, ' ', 4 );
+ *(syntax + 4) = '\0';
+ }
+
+ arg_cat_optionv(syntax,
+ sizeof(syntax),
+ shortopts,
+ longopts,
+ datatype,
+ table[tabindex]->flag & ARG_HASOPTVALUE,
+ ", ");
+
+ /* If syntax fits not into column, print glossary in new line... */
+ if ( strlen(syntax) > 25 )
+ {
+ fprintf( fp, " %-25s %s\n", syntax, "" );
+ *syntax = '\0';
+ }
+
+ fprintf( fp, " %-25s ", syntax );
+ arg_print_formatted( fp, 28, 79, glossary );
+ }
+ } /* for each table entry */
+
+ fputc( '\n', fp );
+}
+
+
+/**
+ * Checks the argtable[] array for NULL entries and returns 1
+ * if any are found, zero otherwise.
+ */
+int arg_nullcheck(void * *argtable)
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ int tabindex;
+ /*printf("arg_nullcheck(%p)\n",argtable);*/
+
+ if (!table)
+ return 1;
+
+ tabindex = 0;
+ do
+ {
+ /*printf("argtable[%d]=%p\n",tabindex,argtable[tabindex]);*/
+ if (!table[tabindex])
+ return 1;
+ } while(!(table[tabindex++]->flag & ARG_TERMINATOR));
+
+ return 0;
+}
+
+
+/*
+ * arg_free() is deprecated in favour of arg_freetable() due to a flaw in its design.
+ * The flaw results in memory leak in the (very rare) case that an intermediate
+ * entry in the argtable array failed its memory allocation while others following
+ * that entry were still allocated ok. Those subsequent allocations will not be
+ * deallocated by arg_free().
+ * Despite the unlikeliness of the problem occurring, and the even unlikelier event
+ * that it has any deliterious effect, it is fixed regardless by replacing arg_free()
+ * with the newer arg_freetable() function.
+ * We still keep arg_free() for backwards compatibility.
+ */
+void arg_free(void * *argtable)
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ int tabindex = 0;
+ int flag;
+ /*printf("arg_free(%p)\n",argtable);*/
+ do
+ {
+ /*
+ if we encounter a NULL entry then somewhat incorrectly we presume
+ we have come to the end of the array. It isnt strictly true because
+ an intermediate entry could be NULL with other non-NULL entries to follow.
+ The subsequent argtable entries would then not be freed as they should.
+ */
+ if (table[tabindex] == NULL)
+ break;
+
+ flag = table[tabindex]->flag;
+ free(table[tabindex]);
+ table[tabindex++] = NULL;
+
+ } while(!(flag & ARG_TERMINATOR));
+}
+
+/* frees each non-NULL element of argtable[], where n is the size of the number of entries in the array */
+void arg_freetable(void * *argtable, size_t n)
+{
+ struct arg_hdr * *table = (struct arg_hdr * *)argtable;
+ size_t tabindex = 0;
+ /*printf("arg_freetable(%p)\n",argtable);*/
+ for (tabindex = 0; tabindex < n; tabindex++)
+ {
+ if (table[tabindex] == NULL)
+ continue;
+
+ free(table[tabindex]);
+ table[tabindex] = NULL;
+ };
+}
+
diff --git a/ext/argtable3/argtable3.h b/ext/argtable3/argtable3.h
new file mode 100644
index 0000000..1107de2
--- /dev/null
+++ b/ext/argtable3/argtable3.h
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * This file is part of the argtable3 library.
+ *
+ * Copyright (C) 1998-2001,2003-2011,2013 Stewart Heitmann
+ * <sheitmann@users.sourceforge.net>
+ * 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 STEWART HEITMANN 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 STEWART HEITMANN 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.
+ ******************************************************************************/
+
+#ifndef ARGTABLE3
+#define ARGTABLE3
+
+#include <stdio.h> /* FILE */
+#include <time.h> /* struct tm */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ARG_REX_ICASE 1
+
+/* bit masks for arg_hdr.flag */
+enum
+{
+ ARG_TERMINATOR=0x1,
+ ARG_HASVALUE=0x2,
+ ARG_HASOPTVALUE=0x4
+};
+
+typedef void (arg_resetfn)(void *parent);
+typedef int (arg_scanfn)(void *parent, const char *argval);
+typedef int (arg_checkfn)(void *parent);
+typedef void (arg_errorfn)(void *parent, FILE *fp, int error, const char *argval, const char *progname);
+
+
+/*
+* The arg_hdr struct defines properties that are common to all arg_xxx structs.
+* The argtable library requires each arg_xxx struct to have an arg_hdr
+* struct as its first data member.
+* The argtable library functions then use this data to identify the
+* properties of the command line option, such as its option tags,
+* datatype string, and glossary strings, and so on.
+* Moreover, the arg_hdr struct contains pointers to custom functions that
+* are provided by each arg_xxx struct which perform the tasks of parsing
+* that particular arg_xxx arguments, performing post-parse checks, and
+* reporting errors.
+* These functions are private to the individual arg_xxx source code
+* and are the pointer to them are initiliased by that arg_xxx struct's
+* constructor function. The user could alter them after construction
+* if desired, but the original intention is for them to be set by the
+* constructor and left unaltered.
+*/
+struct arg_hdr
+{
+ char flag; /* Modifier flags: ARG_TERMINATOR, ARG_HASVALUE. */
+ const char *shortopts; /* String defining the short options */
+ const char *longopts; /* String defiing the long options */
+ const char *datatype; /* Description of the argument data type */
+ const char *glossary; /* Description of the option as shown by arg_print_glossary function */
+ int mincount; /* Minimum number of occurences of this option accepted */
+ int maxcount; /* Maximum number of occurences if this option accepted */
+ void *parent; /* Pointer to parent arg_xxx struct */
+ arg_resetfn *resetfn; /* Pointer to parent arg_xxx reset function */
+ arg_scanfn *scanfn; /* Pointer to parent arg_xxx scan function */
+ arg_checkfn *checkfn; /* Pointer to parent arg_xxx check function */
+ arg_errorfn *errorfn; /* Pointer to parent arg_xxx error function */
+ void *priv; /* Pointer to private header data for use by arg_xxx functions */
+};
+
+struct arg_rem
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+};
+
+struct arg_lit
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+ int count; /* Number of matching command line args */
+};
+
+struct arg_int
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+ int count; /* Number of matching command line args */
+ int *ival; /* Array of parsed argument values */
+};
+
+struct arg_dbl
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+ int count; /* Number of matching command line args */
+ double *dval; /* Array of parsed argument values */
+};
+
+struct arg_str
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+ int count; /* Number of matching command line args */
+ const char **sval; /* Array of parsed argument values */
+};
+
+struct arg_rex
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+ int count; /* Number of matching command line args */
+ const char **sval; /* Array of parsed argument values */
+};
+
+struct arg_file
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+ int count; /* Number of matching command line args*/
+ const char **filename; /* Array of parsed filenames (eg: /home/foo.bar) */
+ const char **basename; /* Array of parsed basenames (eg: foo.bar) */
+ const char **extension; /* Array of parsed extensions (eg: .bar) */
+};
+
+struct arg_date
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+ const char *format; /* strptime format string used to parse the date */
+ int count; /* Number of matching command line args */
+ struct tm *tmval; /* Array of parsed time values */
+};
+
+enum {ARG_ELIMIT=1, ARG_EMALLOC, ARG_ENOMATCH, ARG_ELONGOPT, ARG_EMISSARG};
+struct arg_end
+{
+ struct arg_hdr hdr; /* The mandatory argtable header struct */
+ int count; /* Number of errors encountered */
+ int *error; /* Array of error codes */
+ void **parent; /* Array of pointers to offending arg_xxx struct */
+ const char **argval; /* Array of pointers to offending argv[] string */
+};
+
+
+/**** arg_xxx constructor functions *********************************/
+
+struct arg_rem* arg_rem(const char* datatype, const char* glossary);
+
+struct arg_lit* arg_lit0(const char* shortopts,
+ const char* longopts,
+ const char* glossary);
+struct arg_lit* arg_lit1(const char* shortopts,
+ const char* longopts,
+ const char *glossary);
+struct arg_lit* arg_litn(const char* shortopts,
+ const char* longopts,
+ int mincount,
+ int maxcount,
+ const char *glossary);
+
+struct arg_key* arg_key0(const char* keyword,
+ int flags,
+ const char* glossary);
+struct arg_key* arg_key1(const char* keyword,
+ int flags,
+ const char* glossary);
+struct arg_key* arg_keyn(const char* keyword,
+ int flags,
+ int mincount,
+ int maxcount,
+ const char* glossary);
+
+struct arg_int* arg_int0(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ const char* glossary);
+struct arg_int* arg_int1(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ const char *glossary);
+struct arg_int* arg_intn(const char* shortopts,
+ const char* longopts,
+ const char *datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary);
+
+struct arg_dbl* arg_dbl0(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ const char* glossary);
+struct arg_dbl* arg_dbl1(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ const char *glossary);
+struct arg_dbl* arg_dbln(const char* shortopts,
+ const char* longopts,
+ const char *datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary);
+
+struct arg_str* arg_str0(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ const char* glossary);
+struct arg_str* arg_str1(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ const char *glossary);
+struct arg_str* arg_strn(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary);
+
+struct arg_rex* arg_rex0(const char* shortopts,
+ const char* longopts,
+ const char* pattern,
+ const char* datatype,
+ int flags,
+ const char* glossary);
+struct arg_rex* arg_rex1(const char* shortopts,
+ const char* longopts,
+ const char* pattern,
+ const char* datatype,
+ int flags,
+ const char *glossary);
+struct arg_rex* arg_rexn(const char* shortopts,
+ const char* longopts,
+ const char* pattern,
+ const char* datatype,
+ int mincount,
+ int maxcount,
+ int flags,
+ const char *glossary);
+
+struct arg_file* arg_file0(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ const char* glossary);
+struct arg_file* arg_file1(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ const char *glossary);
+struct arg_file* arg_filen(const char* shortopts,
+ const char* longopts,
+ const char* datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary);
+
+struct arg_date* arg_date0(const char* shortopts,
+ const char* longopts,
+ const char* format,
+ const char* datatype,
+ const char* glossary);
+struct arg_date* arg_date1(const char* shortopts,
+ const char* longopts,
+ const char* format,
+ const char* datatype,
+ const char *glossary);
+struct arg_date* arg_daten(const char* shortopts,
+ const char* longopts,
+ const char* format,
+ const char* datatype,
+ int mincount,
+ int maxcount,
+ const char *glossary);
+
+struct arg_end* arg_end(int maxerrors);
+
+
+/**** other functions *******************************************/
+int arg_nullcheck(void **argtable);
+int arg_parse(int argc, char **argv, void **argtable);
+void arg_print_option(FILE *fp, const char *shortopts, const char *longopts, const char *datatype, const char *suffix);
+void arg_print_syntax(FILE *fp, void **argtable, const char *suffix);
+void arg_print_syntaxv(FILE *fp, void **argtable, const char *suffix);
+void arg_print_glossary(FILE *fp, void **argtable, const char *format);
+void arg_print_glossary_gnu(FILE *fp, void **argtable);
+void arg_print_errors(FILE* fp, struct arg_end* end, const char* progname);
+void arg_freetable(void **argtable, size_t n);
+
+/**** deprecated functions, for back-compatibility only ********/
+void arg_free(void **argtable);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/ext/dropt/dropt.parts b/ext/argtable3/argtable3.parts
index e2d9b85..f6a3528 100644
--- a/ext/dropt/dropt.parts
+++ b/ext/argtable3/argtable3.parts
@@ -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,37 +15,29 @@
############################################################################
Import('*')
-env.PartVersion("1.1.1")
-env.PartName("dropt")
+env.PartVersion("3.0.3")
+env.PartName("argtable3")
# sourcefiles
-src_files = Pattern(src_dir='src/',
- includes=['*.c'],
- excludes=['test_*'],
- recursive=True).files()
+src_files = Pattern(src_dir='.',
+ includes=['argtable3.c']).files()
#includes to install
-install_headers = Pattern(src_dir='include/',
- includes=['dropt.h'],
- recursive=True).files()
+install_headers = Pattern(src_dir='.',
+ includes=['argtable3.h']).files()
-internal_headers = Pattern(src_dir='include/',
- includes=['dropt_string.h'],
- recursive=True).files()
-
-parts_file = ['dropt.parts']
+parts_file = ['argtable3.parts']
license_file = ['LICENSE']
makefile = ['Makefile']
if 'install_package' in env['MODE']:
- env.InstallTopLevel(src_files, sub_dir='ext/dropt/src')
- env.InstallTopLevel(install_headers + internal_headers,
- sub_dir='ext/dropt/include')
- env.InstallTopLevel(parts_file, sub_dir='ext/dropt')
- env.InstallTopLevel(license_file, sub_dir='ext/dropt')
- env.InstallTopLevel(makefile, sub_dir='ext/dropt')
+ env.InstallTopLevel(src_files, sub_dir='ext/argtable3')
+ env.InstallTopLevel(install_headers, sub_dir='ext/argtable3')
+ env.InstallTopLevel(parts_file, sub_dir='ext/argtable3')
+ env.InstallTopLevel(license_file, sub_dir='ext/argtable3')
+ env.InstallTopLevel(makefile, sub_dir='ext/argtable3')
else:
- env.Append(CPPPATH=[AbsDir('include')])
+ env.Append(CPPPATH='.')
outputs = env.Library('${PART_NAME}', src_files)
sdk_outs = env.Sdk(outputs)
diff --git a/ext/dropt/LICENSE b/ext/dropt/LICENSE
deleted file mode 100644
index aa487e1..0000000
--- a/ext/dropt/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-dropt
-Copyright (c) 2006-2012 James D. Lin <jameslin@cal.berkeley.edu>
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
-
-2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source distribution.
-
-<http://www.opensource.org/licenses/zlib-license.php>
diff --git a/ext/dropt/Makefile b/ext/dropt/Makefile
deleted file mode 100644
index c7e43ed..0000000
--- a/ext/dropt/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/make -f
-
-DROPT_INCLUDE_DIR = ./include
-DROPT_SRC = $(wildcard ./src/*.c)
-DROPT_OBJ = $(DROPT_SRC:.c=.o)
-
-DROPT_LIB = ./src/libdropt.a
-
-$(DROPT_OBJ): %.o: %.c
- $(CC) -o $@ -c $(CFLAGS) -I$(DROPT_INCLUDE_DIR) $<
-
-$(DROPT_LIB): $(DROPT_OBJ)
- $(AR) rc $@ $^
- $(RANLIB) $@
-
-build: all
-
-all: $(DROPT_LIB)
-
-install:
-
-clean:
- rm -f $(DROPT_OBJ) $(DROPT_LIB)
diff --git a/ext/dropt/include/dropt.h b/ext/dropt/include/dropt.h
deleted file mode 100644
index 2cd66b1..0000000
--- a/ext/dropt/include/dropt.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/** dropt.h
- *
- * A deliberately rudimentary command-line option parser.
- *
- * Version 1.1.1
- *
- * Copyright (c) 2006-2012 James D. Lin <jameslin@cal.berkeley.edu>
- *
- * The latest version of this file can be downloaded from:
- * <http://www.taenarum.com/software/dropt/>
- *
- * This software is provided 'as-is', without any express or implied
- * warranty. In no event will the authors be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice may not be removed or altered from any source distribution.
- */
-
-#ifndef DROPT_H
-#define DROPT_H
-
-#include <stdio.h>
-#include <wchar.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#ifndef DROPT_USE_WCHAR
-#if defined _UNICODE && (defined _MSC_VER || defined DROPT_NO_STRING_BUFFERS)
-#define DROPT_USE_WCHAR 1
-#endif
-#endif
-
-#ifdef DROPT_USE_WCHAR
- /* This may be used for both char and string literals. */
- #define DROPT_TEXT_LITERAL(s) L ## s
-
- typedef wchar_t dropt_char;
-#else
- #define DROPT_TEXT_LITERAL(s) s
-
- typedef char dropt_char;
-#endif
-
-
-enum
-{
- /* Errors in the range [0x00, 0x7F] are reserved for dropt. */
- dropt_error_none,
- dropt_error_unknown,
- dropt_error_bad_configuration,
- dropt_error_insufficient_memory,
- dropt_error_invalid_option,
- dropt_error_insufficient_arguments,
- dropt_error_mismatch,
- dropt_error_overflow,
- dropt_error_underflow,
-
- /* Errors in the range [0x80, 0xFFFF] are free for clients to use. */
- dropt_error_custom_start = 0x80,
- dropt_error_custom_last = 0xFFFF
-};
-typedef unsigned int dropt_error;
-
-typedef unsigned char dropt_bool;
-
-/* Opaque. */
-typedef struct dropt_context dropt_context;
-
-
-/** dropt_option_handler_func callbacks are responsible for parsing
- * individual options.
- *
- * dropt_option_handler_decl may be used for declaring the callback
- * functions; dropt_option_handler_func is the actual function pointer
- * type.
- *
- * optionArgument will be NULL if no argument is specified for an option.
- * It will be the empty string if the user explicitly passed an empty
- * string as the argument (e.g. --option="").
- *
- * An option that doesn't expect an argument still can receive a non-NULL
- * value for optionArgument if the user explicitly specified one (e.g.
- * --option=arg).
- *
- * If the option's argument is optional, the handler might be called
- * twice: once with a candidate argument, and if that argument is rejected
- * by the handler, again with no argument. Handlers should be aware of
- * this if they have side-effects.
- *
- * handlerData is the client-specified value specified in the dropt_option
- * table.
- */
-typedef dropt_error dropt_option_handler_decl(dropt_context* context,
- const dropt_char* optionArgument,
- void* handlerData);
-typedef dropt_option_handler_decl* dropt_option_handler_func;
-
-/** dropt_error_handler_func callbacks are responsible for generating error
- * messages. The returned string must be allocated on the heap and must
- * be freeable with free().
- */
-typedef dropt_char* (*dropt_error_handler_func)(dropt_error error,
- const dropt_char* optionName,
- const dropt_char* optionArgument,
- void* handlerData);
-
-/** dropt_strncmp_func callbacks allow callers to provide their own (possibly
- * case-insensitive) string comparison function.
- */
-typedef int (*dropt_strncmp_func)(const dropt_char* s, const dropt_char* t, size_t n);
-
-
-/** Properties defining each option:
- *
- * short_name:
- * The option's short name (e.g. the 'h' in -h).
- * Use '\0' if the option has no short name.
- *
- * long_name:
- * The option's long name (e.g. "help" in --help).
- * Use NULL if the option has no long name.
- *
- * description:
- * The description shown when generating help.
- * May be NULL for undocumented options.
- *
- * arg_description:
- * The description for the option's argument (e.g. --option=argument
- * or --option argument), printed when generating help. If NULL, the
- * option does not take an argument.
- *
- * handler:
- * The handler callback and data invoked in response to encountering
- * the option.
- *
- * handler_data:
- * Callback data for the handler. For typical handlers, this is
- * usually the address of a variable for the handler to modify.
- *
- * attr:
- * Miscellaneous attributes. See below.
- */
-typedef struct dropt_option
-{
- dropt_char short_name;
- const dropt_char* long_name;
- const dropt_char* description;
- const dropt_char* arg_description;
- dropt_option_handler_func handler;
- void* handler_data;
- unsigned int attr;
-} dropt_option;
-
-
-/** Bitwise flags for option attributes:
- *
- * dropt_attr_halt:
- * Stop processing when this option is encountered.
- *
- * dropt_attr_hidden:
- * Don't list the option when generating help. Use this for
- * undocumented options.
- *
- * dropt_attr_optional_val:
- * The option's argument is optional. If an option has this
- * attribute, the handler callback may be invoked twice (once with a
- * potential argument, and if that fails, again with a NULL argument).
- */
-enum
-{
- dropt_attr_halt = (1 << 0),
- dropt_attr_hidden = (1 << 1),
- dropt_attr_optional_val = (1 << 2)
-};
-
-
-typedef struct dropt_help_params
-{
- unsigned int indent;
- unsigned int description_start_column;
- dropt_bool blank_lines_between_options;
-} dropt_help_params;
-
-
-dropt_context* dropt_new_context(const dropt_option* options);
-void dropt_free_context(dropt_context* context);
-
-const dropt_option* dropt_get_options(const dropt_context* context);
-
-void dropt_set_error_handler(dropt_context* context,
- dropt_error_handler_func handler, void* handlerData);
-void dropt_set_strncmp(dropt_context* context, dropt_strncmp_func cmp);
-
-/* Use this only for backward compatibility purposes. */
-void dropt_allow_concatenated_arguments(dropt_context* context, dropt_bool allow);
-
-dropt_char** dropt_parse(dropt_context* context, int argc, dropt_char** argv);
-
-dropt_error dropt_get_error(const dropt_context* context);
-void dropt_get_error_details(const dropt_context* context,
- dropt_char** optionName,
- dropt_char** optionArgument);
-const dropt_char* dropt_get_error_message(dropt_context* context);
-void dropt_clear_error(dropt_context* context);
-
-#ifndef DROPT_NO_STRING_BUFFERS
-dropt_char* dropt_default_error_handler(dropt_error error,
- const dropt_char* optionName,
- const dropt_char* optionArgument);
-
-void dropt_init_help_params(dropt_help_params* helpParams);
-dropt_char* dropt_get_help(const dropt_context* context,
- const dropt_help_params* helpParams);
-void dropt_print_help(FILE* f, const dropt_context* context,
- const dropt_help_params* helpParams);
-#endif
-
-
-/* Stock option handlers for common types. */
-dropt_option_handler_decl dropt_handle_bool;
-dropt_option_handler_decl dropt_handle_verbose_bool;
-dropt_option_handler_decl dropt_handle_int;
-dropt_option_handler_decl dropt_handle_uint;
-dropt_option_handler_decl dropt_handle_double;
-dropt_option_handler_decl dropt_handle_string;
-
-#define DROPT_MISUSE(message) dropt_misuse(message, __FILE__, __LINE__)
-void dropt_misuse(const char* message, const char* filename, int line);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* DROPT_H */
diff --git a/ext/dropt/include/dropt_string.h b/ext/dropt/include/dropt_string.h
deleted file mode 100644
index e890c5a..0000000
--- a/ext/dropt/include/dropt_string.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/** dropt_string.h
- *
- * String routines for dropt.
- *
- * Copyright (c) 2006-2010 James D. Lin <jameslin@cal.berkeley.edu>
- *
- * The latest version of this file can be downloaded from:
- * <http://www.taenarum.com/software/dropt/>
- *
- * This software is provided 'as-is', without any express or implied
- * warranty. In no event will the authors be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice may not be removed or altered from any source distribution.
- */
-
-#ifndef DROPT_STRING_H
-#define DROPT_STRING_H
-
-#include <stdarg.h>
-#include "dropt.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef DROPT_USE_WCHAR
- #define dropt_strlen wcslen
- #define dropt_strcmp wcscmp
- #define dropt_strncmp wcsncmp
- #define dropt_strchr wcschr
- #define dropt_strtol wcstol
- #define dropt_strtoul wcstoul
- #define dropt_strtod wcstod
- #define dropt_tolower towlower
- #define dropt_fputs fputws
-#else
- #define dropt_strlen strlen
- #define dropt_strcmp strcmp
- #define dropt_strncmp strncmp
- #define dropt_strchr strchr
- #define dropt_strtol strtol
- #define dropt_strtoul strtoul
- #define dropt_strtod strtod
- #define dropt_tolower tolower
- #define dropt_fputs fputs
-#endif
-
-void* dropt_safe_malloc(size_t numElements, size_t elementSize);
-void* dropt_safe_realloc(void* p, size_t numElements, size_t elementSize);
-
-dropt_char* dropt_strdup(const dropt_char* s);
-dropt_char* dropt_strndup(const dropt_char* s, size_t n);
-int dropt_stricmp(const dropt_char* s, const dropt_char* t);
-int dropt_strnicmp(const dropt_char* s, const dropt_char* t, size_t n);
-
-
-#ifndef DROPT_NO_STRING_BUFFERS
-typedef struct dropt_stringstream dropt_stringstream;
-
-int dropt_vsnprintf(dropt_char* s, size_t n, const dropt_char* format, va_list args);
-int dropt_snprintf(dropt_char* s, size_t n, const dropt_char* format, ...);
-
-dropt_char* dropt_vasprintf(const dropt_char* format, va_list args);
-dropt_char* dropt_asprintf(const dropt_char* format, ...);
-
-dropt_stringstream* dropt_ssopen(void);
-void dropt_ssclose(dropt_stringstream* ss);
-
-void dropt_ssclear(dropt_stringstream* ss);
-dropt_char* dropt_ssfinalize(dropt_stringstream* ss);
-const dropt_char* dropt_ssgetstring(const dropt_stringstream* ss);
-
-int dropt_vssprintf(dropt_stringstream* ss, const dropt_char* format, va_list args);
-int dropt_ssprintf(dropt_stringstream* ss, const dropt_char* format, ...);
-#endif /* DROPT_NO_STRING_BUFFERS */
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* DROPT_STRING_H */
diff --git a/ext/dropt/src/dropt.c b/ext/dropt/src/dropt.c
deleted file mode 100644
index 917e8fd..0000000
--- a/ext/dropt/src/dropt.c
+++ /dev/null
@@ -1,1562 +0,0 @@
-/** dropt.c
- *
- * A deliberately rudimentary command-line option parser.
- *
- * Copyright (c) 2006-2012 James D. Lin <jameslin@cal.berkeley.edu>
- *
- * The latest version of this file can be downloaded from:
- * <http://www.taenarum.com/software/dropt/>
- *
- * This software is provided 'as-is', without any express or implied
- * warranty. In no event will the authors be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice may not be removed or altered from any source distribution.
- */
-// THIS FILE HAS BEEN ALTERED from original version to:
-// * fix warnings
-// * modify error messages
-// * resolve bool type conflict
-// * fix issues found by static code analisys:
-// * possible leak in dropt_get_help
-// * null pointer dereference in dropt_parse
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <wctype.h>
-#include <assert.h>
-
-#include "dropt.h"
-#include "dropt_string.h"
-
-#if __STDC_VERSION__ >= 199901L
- #include <stdint.h>
- #include <stdbool.h>
-#else
- /* Compatibility junk for things that don't yet support ISO C99. */
- #ifndef SIZE_MAX
- #define SIZE_MAX ((size_t) -1)
- #endif
-
- #ifndef __cplusplus
- #ifndef _Bool
- /// C99 standard name for bool
- #define _Bool char
- /// Boolean type
- typedef char bool;
- /// integer constant 1
- #define true 1
- /// integer constant 0
- #define false 0
- #endif
- #endif // ifndef __cplusplus
-#endif
-#ifndef MIN
-#define MIN(x, y) (((x) < (y)) ? (x) : (y))
-#endif
-
-#ifndef ARRAY_LENGTH
-#define ARRAY_LENGTH(array) (sizeof (array) / sizeof (array)[0])
-#endif
-
-#define IMPLIES(p, q) (!(p) || q)
-
-#define OPTION_TAKES_ARG(option) ((option)->arg_description != NULL)
-
-enum
-{
- default_help_indent = 2,
- default_description_start_column = 6,
-};
-
-
-/** A string that might not be NUL-terminated. */
-typedef struct
-{
- const dropt_char* s;
-
- /* The length of s, excluding any NUL terminator. */
- size_t len;
-} char_array;
-
-
-/** A proxy for a dropt_option used for qsort and bsearch. Instead of
- * sorting the dropt_option table directly, we sort arrays of option_proxy
- * structures. This allows us to have separate arrays sorted by different
- * keys and allows passing along additional data.
- */
-typedef struct
-{
- const dropt_option* option;
-
- /* The qsort and bsearch comparison callbacks don't pass along any
- * client-supplied contextual data, so we have to embed it alongside
- * the regular data.
- */
- const dropt_context* context;
-} option_proxy;
-
-
-struct dropt_context
-{
- const dropt_option* options;
- size_t numOptions;
-
- /* These may be NULL. */
- option_proxy* sortedByLong;
- option_proxy* sortedByShort;
-
- bool allowConcatenatedArgs;
-
- dropt_error_handler_func errorHandler;
- void* errorHandlerData;
-
- struct
- {
- dropt_error err;
- dropt_char* optionName;
- dropt_char* optionArgument;
- dropt_char* message;
- } errorDetails;
-
- /* This isn't named strncmp because platforms might provide a macro
- * version of strncmp, and we want to avoid a potential naming
- * conflict.
- */
- dropt_strncmp_func ncmpstr;
-};
-
-
-typedef struct
-{
- const dropt_option* option;
- const dropt_char* optionArgument;
- dropt_char** argNext;
- int argsLeft;
-} parse_state;
-
-
-/** make_char_array
- *
- * PARAMETERS:
- * IN s : A string. Might not be NUL-terminated.
- * May be NULL.
- * len : The length of s, excluding any NUL terminator.
- *
- * RETURNS:
- * The constructed char_array structure.
- */
-static char_array
-make_char_array(const dropt_char* s, size_t len)
-{
- char_array a;
-
- assert(IMPLIES(s == NULL, len == 0));
-
- a.s = s;
- a.len = len;
- return a;
-}
-
-
-/** cmp_key_option_proxy_long
- *
- * Comparison callback for bsearch. Compares a char_array structure
- * against an option_proxy structure based on long option names.
- *
- * PARAMETERS:
- * IN key : A pointer to the char_array structure to search for.
- * IN item : A pointer to the option_proxy structure being searched
- * against.
- *
- * RETURNS:
- * 0 if key and item are equivalent,
- * < 0 if key should precede item,
- * > 0 if key should follow item.
- */
-static int
-cmp_key_option_proxy_long(const void* key, const void* item)
-{
- const char_array* longName = key;
- const option_proxy* op = item;
-
- size_t optionLen;
- int ret;
-
- assert(longName != NULL);
- assert(op != NULL);
- assert(op->option != NULL);
- assert(op->context != NULL);
- assert(op->context->ncmpstr != NULL);
-
- if (longName->s == op->option->long_name)
- {
- return 0;
- }
- else if (longName->s == NULL)
- {
- return -1;
- }
- else if (op->option->long_name == NULL)
- {
- return +1;
- }
-
- /* Although the longName key might not be NUL-terminated, the
- * option_proxy item we're searching against must be.
- */
- optionLen = dropt_strlen(op->option->long_name);
- ret = op->context->ncmpstr(longName->s,
- op->option->long_name,
- MIN(longName->len, optionLen));
- if (ret != 0)
- {
- return ret;
- }
-
- if (longName->len < optionLen)
- {
- return -1;
- }
- else if (longName->len > optionLen)
- {
- return +1;
- }
-
- return 0;
-}
-
-
-/** cmp_option_proxies_long
- *
- * Comparison callback for qsort. Compares two option_proxy
- * structures based on long option names.
- *
- * PARAMETERS:
- * IN p1, p2 : Pointers to the option_proxy structures to compare.
- *
- * RETURNS:
- * 0 if p1 and p2 are equivalent,
- * < 0 if p1 should precede p2,
- * > 0 if p1 should follow p2.
- */
-static int
-cmp_option_proxies_long(const void* p1, const void* p2)
-{
- const option_proxy* o1 = p1;
- const option_proxy* o2 = p2;
-
- char_array ca1;
-
- assert(o1 != NULL);
- assert(o2 != NULL);
- assert(o1->option != NULL);
- assert(o1->context == o2->context);
-
- ca1 = make_char_array(o1->option->long_name,
- (o1->option->long_name == NULL)
- ? 0
- : dropt_strlen(o1->option->long_name));
- return cmp_key_option_proxy_long(&ca1, o2);
-}
-
-
-/** cmp_key_option_proxy_short
- *
- * Comparison callback for bsearch. Compares a dropt_char against an
- * option_proxy structure based on short option names.
- *
- * PARAMETERS:
- * IN key : A pointer to the dropt_char to search for.
- * IN item : A pointer to the option_proxy structure being searched
- * against.
- *
- * RETURNS:
- * 0 if key and item are equivalent,
- * < 0 if key should precede item,
- * > 0 if key should follow item.
- */
-static int
-cmp_key_option_proxy_short(const void* key, const void* item)
-{
- const dropt_char* shortName = key;
- const option_proxy* op = item;
-
- assert(shortName != NULL);
- assert(op != NULL);
- assert(op->option != NULL);
- assert(op->context != NULL);
- assert(op->context->ncmpstr != NULL);
-
- return op->context->ncmpstr(shortName,
- &op->option->short_name,
- 1);
-}
-
-
-/** cmp_option_proxies_short
- *
- * Comparison callback for qsort. Compares two option_proxy
- * structures based on short option names.
- *
- * PARAMETERS:
- * IN p1, p2 : Pointers to the option_proxy structures to compare.
- *
- * RETURNS:
- * 0 if p1 and p2 are equivalent,
- * < 0 if p1 should precede p2,
- * > 0 if p1 should follow p2.
- */
-static int
-cmp_option_proxies_short(const void* p1, const void* p2)
-{
- const option_proxy* o1 = p1;
- const option_proxy* o2 = p2;
-
- assert(o1 != NULL);
- assert(o2 != NULL);
- assert(o1->option != NULL);
- assert(o1->context == o2->context);
-
- return cmp_key_option_proxy_short(&o1->option->short_name, o2);
-}
-
-
-/** init_lookup_tables
- *
- * Initializes the sorted lookup tables in a dropt context if not
- * already initialized.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * Must not be NULL.
- */
-static void
-init_lookup_tables(dropt_context* context)
-{
- const dropt_option* options;
- size_t n;
-
- assert(context != NULL);
-
- options = context->options;
- n = context->numOptions;
-
- if (context->sortedByLong == NULL)
- {
- context->sortedByLong = dropt_safe_malloc(n, sizeof *(context->sortedByLong));
- if (context->sortedByLong != NULL)
- {
- size_t i;
- for (i = 0; i < n; i++)
- {
- context->sortedByLong[i].option = &options[i];
- context->sortedByLong[i].context = context;
- }
-
- qsort(context->sortedByLong,
- n, sizeof *(context->sortedByLong),
- cmp_option_proxies_long);
- }
- }
-
- if (context->sortedByShort == NULL)
- {
- context->sortedByShort = dropt_safe_malloc(n, sizeof *(context->sortedByShort));
- if (context->sortedByShort != NULL)
- {
- size_t i;
- for (i = 0; i < n; i++)
- {
- context->sortedByShort[i].option = &options[i];
- context->sortedByShort[i].context = context;
- }
-
- qsort(context->sortedByShort,
- n, sizeof *(context->sortedByShort),
- cmp_option_proxies_short);
- }
- }
-}
-
-
-/** free_lookup_tables
- *
- * Frees the sorted lookup tables in a dropt context.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * May be NULL.
- */
-static void
-free_lookup_tables(dropt_context* context)
-{
- if (context != NULL)
- {
- free(context->sortedByLong);
- context->sortedByLong = NULL;
-
- free(context->sortedByShort);
- context->sortedByShort = NULL;
- }
-}
-
-
-/** is_valid_option
- *
- * PARAMETERS:
- * IN option : Specification for an individual option.
- *
- * RETURNS:
- * true if the specified option is valid, false if it's a sentinel
- * value.
- */
-static bool
-is_valid_option(const dropt_option* option)
-{
- return option != NULL
- && !( option->long_name == NULL
- && option->short_name == DROPT_TEXT_LITERAL('\0')
- && option->description == NULL
- && option->arg_description == NULL
- && option->handler == NULL
- && option->handler_data == NULL
- && option->attr == 0);
-}
-
-
-/** find_option_long
- *
- * Finds the option specification for a long option name (i.e., an
- * option of the form "--option").
- *
- * PARAMETERS:
- * IN context : The dropt context.
- * IN longName : The long option name to search for (excluding
- * leading dashes).
- * longName.s must not be NULL.
- *
- * RETURNS:
- * A pointer to the corresponding option specification or NULL if not
- * found.
- */
-static const dropt_option*
-find_option_long(const dropt_context* context,
- char_array longName)
-{
- assert(context != NULL);
- assert(longName.s != NULL);
-
- if (context->sortedByLong != NULL)
- {
- option_proxy* found = bsearch(&longName, context->sortedByLong,
- context->numOptions, sizeof *(context->sortedByLong),
- cmp_key_option_proxy_long);
- return (found == NULL) ? NULL : found->option;
- }
-
- /* Fall back to a linear search. */
- {
- option_proxy item = { 0 };
- item.context = context;
- for (item.option = context->options; is_valid_option(item.option); item.option++)
- {
- if (cmp_key_option_proxy_long(&longName, &item) == 0)
- {
- return item.option;
- }
- }
- }
- return NULL;
-}
-
-
-/** find_option_short
- *
- * Finds the option specification for a short option name (i.e., an
- * option of the form "-o").
- *
- * PARAMETERS:
- * IN context : The dropt context.
- * IN shortName : The short option name to search for.
- *
- * RETURNS:
- * A pointer to the corresponding option specification or NULL if not
- * found.
- */
-static const dropt_option*
-find_option_short(const dropt_context* context, dropt_char shortName)
-{
- assert(context != NULL);
- assert(shortName != DROPT_TEXT_LITERAL('\0'));
- assert(context->ncmpstr != NULL);
-
- if (context->sortedByShort != NULL)
- {
- option_proxy* found = bsearch(&shortName, context->sortedByShort,
- context->numOptions, sizeof *(context->sortedByShort),
- cmp_key_option_proxy_short);
- return (found == NULL) ? NULL : found->option;
- }
-
- /* Fall back to a linear search. */
- {
- const dropt_option* option;
- for (option = context->options; is_valid_option(option); option++)
- {
- if (context->ncmpstr(&shortName, &option->short_name, 1) == 0)
- {
- return option;
- }
- }
- }
- return NULL;
-}
-
-
-/** set_error_details
- *
- * Generates error details in the dropt context.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * Must not be NULL.
- * IN err : The error code.
- * IN optionName : The name of the option we failed on.
- * optionName.s must not be NULL.
- * IN optionArgument : The value of the option we failed on.
- * Pass NULL if unwanted.
- */
-static void
-set_error_details(dropt_context* context, dropt_error err,
- char_array optionName,
- const dropt_char* optionArgument)
-{
- assert(context != NULL);
- assert(optionName.s != NULL);
-
- context->errorDetails.err = err;
-
- free(context->errorDetails.optionName);
- free(context->errorDetails.optionArgument);
-
- context->errorDetails.optionName = dropt_strndup(optionName.s, optionName.len);
- context->errorDetails.optionArgument = (optionArgument == NULL)
- ? NULL
- : dropt_strdup(optionArgument);
-
- /* The message will be generated lazily on retrieval. */
- free(context->errorDetails.message);
- context->errorDetails.message = NULL;
-}
-
-
-/** set_short_option_error_details
- *
- * Generates error details in the dropt context.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * IN err : The error code.
- * IN shortName : the "short" name of the option we failed on.
- * IN optionArgument : The value of the option we failed on.
- * Pass NULL if unwanted.
- */
-static void
-set_short_option_error_details(dropt_context* context, dropt_error err,
- dropt_char shortName, const dropt_char* optionArgument)
-{
- /* "-?" is just a placeholder. */
- dropt_char shortNameBuf[] = DROPT_TEXT_LITERAL("-?");
-
- assert(context != NULL);
- assert(shortName != DROPT_TEXT_LITERAL('\0'));
-
- shortNameBuf[1] = shortName;
-
- set_error_details(context, err,
- make_char_array(shortNameBuf, ARRAY_LENGTH(shortNameBuf) - 1),
- optionArgument);
-}
-
-
-/** dropt_get_error
- *
- * PARAMETERS:
- * IN context : The dropt context.
- * Must not be NULL.
- *
- * RETURNS:
- * The current error code waiting in the dropt context.
- */
-dropt_error
-dropt_get_error(const dropt_context* context)
-{
- if (context == NULL)
- {
- DROPT_MISUSE("No dropt context specified.");
- return dropt_error_bad_configuration;
- }
- return context->errorDetails.err;
-}
-
-
-/** dropt_get_error_details
- *
- * Retrieves details about the current error.
- *
- * PARAMETERS:
- * IN context : The dropt context.
- * OUT optionName : On output, the name of the option we failed
- * on. Do not free this string.
- * Pass NULL if unwanted.
- * OUT optionArgument : On output, the value (possibly NULL) of the
- * option we failed on. Do not free this
- * string.
- * Pass NULL if unwanted.
- */
-void
-dropt_get_error_details(const dropt_context* context,
- dropt_char** optionName, dropt_char** optionArgument)
-{
- if (optionName != NULL) { *optionName = context->errorDetails.optionName; }
- if (optionArgument != NULL) { *optionArgument = context->errorDetails.optionArgument; }
-}
-
-
-/** dropt_get_error_message
- *
- * PARAMETERS:
- * IN context : The dropt context.
- * Must not be NULL.
- *
- * RETURNS:
- * The current error message waiting in the dropt context or the empty
- * string if there are no errors. Note that calling any dropt
- * function other than dropt_get_error, dropt_get_error_details, and
- * dropt_get_error_message may invalidate a previously-returned
- * string.
- */
-const dropt_char*
-dropt_get_error_message(dropt_context* context)
-{
- if (context == NULL)
- {
- DROPT_MISUSE("no dropt context specified.");
- return DROPT_TEXT_LITERAL("");
- }
-
- if (context->errorDetails.err == dropt_error_none)
- {
- return DROPT_TEXT_LITERAL("");
- }
-
- if (context->errorDetails.message == NULL)
- {
- if (context->errorHandler != NULL)
- {
- context->errorDetails.message
- = context->errorHandler(context->errorDetails.err,
- context->errorDetails.optionName,
- context->errorDetails.optionArgument,
- context->errorHandlerData);
- }
- else
- {
-#ifndef DROPT_NO_STRING_BUFFERS
- context->errorDetails.message
- = dropt_default_error_handler(context->errorDetails.err,
- context->errorDetails.optionName,
- context->errorDetails.optionArgument);
-#endif
- }
- }
-
- return (context->errorDetails.message == NULL)
- ? DROPT_TEXT_LITERAL("unknown error")
- : context->errorDetails.message;
-}
-
-
-/** dropt_clear_error
- *
- * Clears the error waiting in the dropt context.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context to free.
- * May be NULL.
- */
-void
-dropt_clear_error(dropt_context* context)
-{
- if (context != NULL)
- {
- context->errorDetails.err = dropt_error_none;
-
- free(context->errorDetails.optionName);
- context->errorDetails.optionName = NULL;
-
- free(context->errorDetails.optionArgument);
- context->errorDetails.optionArgument = NULL;
-
- free(context->errorDetails.message);
- context->errorDetails.message = NULL;
- }
-}
-
-
-#ifndef DROPT_NO_STRING_BUFFERS
-/** dropt_default_error_handler
- *
- * Default error handler.
- *
- * PARAMETERS:
- * IN error : The error code.
- * IN optionName : The name of the option we failed on.
- * IN optionArgument : The value of the option we failed on.
- * Pass NULL if unwanted.
- *
- * RETURNS:
- * An allocated string for the given error. The caller is responsible
- * for calling free() on it when no longer needed.
- * May return NULL.
- */
-dropt_char*
-dropt_default_error_handler(dropt_error error,
- const dropt_char* optionName,
- const dropt_char* optionArgument)
-{
- dropt_char* s = NULL;
-
- const dropt_char* separator = DROPT_TEXT_LITERAL(": ");
-
- if (optionArgument == NULL)
- {
- separator = optionArgument = DROPT_TEXT_LITERAL("");
- }
-
- switch (error)
- {
- case dropt_error_none:
- /* This shouldn't happen (unless client code invokes this
- * directly with dropt_error_none), but it's here for
- * completeness.
- */
- break;
-
- case dropt_error_bad_configuration:
- s = dropt_strdup(DROPT_TEXT_LITERAL("invalid option configuration"));
- break;
-
- case dropt_error_invalid_option:
- s = dropt_asprintf(DROPT_TEXT_LITERAL("invalid option: %s"),
- optionName);
- break;
- case dropt_error_insufficient_arguments:
- s = dropt_asprintf(DROPT_TEXT_LITERAL("value required after option %s"),
- optionName);
- break;
- case dropt_error_mismatch:
- s = dropt_asprintf(DROPT_TEXT_LITERAL("invalid value for option %s%s%s"),
- optionName, separator, optionArgument);
- break;
- case dropt_error_overflow:
- s = dropt_asprintf(DROPT_TEXT_LITERAL("value too large for option %s%s%s"),
- optionName, separator, optionArgument);
- break;
- case dropt_error_underflow:
- s = dropt_asprintf(DROPT_TEXT_LITERAL("value too small for option %s%s%s"),
- optionName, separator, optionArgument);
- break;
- case dropt_error_insufficient_memory:
- s = dropt_strdup(DROPT_TEXT_LITERAL("insufficient memory"));
- break;
- case dropt_error_unknown:
- default:
- s = dropt_asprintf(DROPT_TEXT_LITERAL("unknown error handling option %s"),
- optionName);
- break;
- }
-
- return s;
-}
-
-
-/** dropt_get_help
- *
- * PARAMETERS:
- * IN context : The dropt context.
- * Must not be NULL.
- * IN helpParams : The help parameters.
- * Pass NULL to use the default help parameters.
- *
- * RETURNS:
- * An allocated help string for the available options. The caller is
- * responsible for calling free() on it when no longer needed.
- * Returns NULL on error.
- */
-dropt_char*
-dropt_get_help(const dropt_context* context, const dropt_help_params* helpParams)
-{
- dropt_char* helpText = NULL;
- dropt_stringstream* ss = NULL;
-
- if (context == NULL)
- {
- DROPT_MISUSE("No dropt context specified.");
- return NULL;
- }
-
- ss = dropt_ssopen();
-
- if (ss != NULL)
- {
- const dropt_option* option;
- dropt_help_params hp;
-
- if (helpParams == NULL)
- {
- dropt_init_help_params(&hp);
- }
- else
- {
- hp = *helpParams;
- }
-
- for (option = context->options; is_valid_option(option); option++)
- {
- bool hasLongName = option->long_name != NULL
- && option->long_name[0] != DROPT_TEXT_LITERAL('\0');
- bool hasShortName = option->short_name != DROPT_TEXT_LITERAL('\0');
-
- /* The number of characters printed on the current line so far. */
- int n;
-
- if (option->description == NULL || (option->attr & dropt_attr_hidden))
- {
- /* Undocumented option. Ignore it and move on. */
- continue;
- }
- else if (hasLongName && hasShortName)
- {
- n = dropt_ssprintf(ss, DROPT_TEXT_LITERAL("%*s-%c, --%s"),
- hp.indent, DROPT_TEXT_LITERAL(""),
- option->short_name, option->long_name);
- }
- else if (hasLongName)
- {
- n = dropt_ssprintf(ss, DROPT_TEXT_LITERAL("%*s--%s"),
- hp.indent, DROPT_TEXT_LITERAL(""),
- option->long_name);
- }
- else if (hasShortName)
- {
- n = dropt_ssprintf(ss, DROPT_TEXT_LITERAL("%*s-%c"),
- hp.indent, DROPT_TEXT_LITERAL(""),
- option->short_name);
- }
- else
- {
- /* Comment text. Don't bother with indentation. */
- assert(option->description != NULL);
- dropt_ssprintf(ss, DROPT_TEXT_LITERAL("%s\n"), option->description);
- goto next;
- }
-
- if (n < 0) { n = 0; }
-
- if (option->arg_description != NULL)
- {
- int m = dropt_ssprintf(ss,
- (option->attr & dropt_attr_optional_val)
- ? DROPT_TEXT_LITERAL("[=%s]")
- : DROPT_TEXT_LITERAL("=%s"),
- option->arg_description);
- if (m > 0) { n += m; }
- }
-
- /* Check for equality to make sure that there's at least one
- * space between the option name and its description.
- */
- if ((unsigned int) n >= hp.description_start_column)
- {
- dropt_ssprintf(ss, DROPT_TEXT_LITERAL("\n"));
- n = 0;
- }
-
- {
- const dropt_char* line = option->description;
- while (line != NULL)
- {
- size_t lineLen;
- const dropt_char* nextLine;
- const dropt_char* newline = dropt_strchr(line, DROPT_TEXT_LITERAL('\n'));
-
- if (newline == NULL)
- {
- lineLen = (int)dropt_strlen(line);
- nextLine = NULL;
- }
- else
- {
- lineLen = (int)(newline - line);
- nextLine = newline + 1;
- }
-
- dropt_ssprintf(ss, DROPT_TEXT_LITERAL("%*s%.*s\n"),
- hp.description_start_column - n, DROPT_TEXT_LITERAL(""),
- lineLen, line);
- n = 0;
-
- line = nextLine;
- }
- }
-
- next:
- if (hp.blank_lines_between_options)
- {
- dropt_ssprintf(ss, DROPT_TEXT_LITERAL("\n"));
- }
- }
- helpText = dropt_ssfinalize(ss);
- }
-
- return helpText;
-}
-
-
-/** dropt_print_help
- *
- * Prints help for the available options.
- *
- * PARAMETERS:
- * IN/OUT f : The file stream to print to.
- * IN context : The dropt context.
- * Must not be NULL.
- * IN helpParams : The help parameters.
- * Pass NULL to use the default help parameters.
- */
-void
-dropt_print_help(FILE* f, const dropt_context* context,
- const dropt_help_params* helpParams)
-{
- dropt_char* helpText = dropt_get_help(context, helpParams);
- if (helpText != NULL)
- {
- dropt_fputs(helpText, f);
- free(helpText);
- }
-}
-#endif /* DROPT_NO_STRING_BUFFERS */
-
-
-/** set_option_value
- *
- * Sets the value for a specified option by invoking the option's
- * handler callback.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * IN option : The option.
- * IN optionArgument : The option's value. May be NULL.
- *
- * RETURNS:
- * An error code.
- */
-static dropt_error
-set_option_value(dropt_context* context,
- const dropt_option* option, const dropt_char* optionArgument)
-{
- assert(option != NULL);
-
- if (option->handler == NULL)
- {
- DROPT_MISUSE("No option handler specified.");
- return dropt_error_bad_configuration;
- }
-
- return option->handler(context, optionArgument, option->handler_data);
-}
-
-
-/** parse_option_arg
- *
- * Helper function to dropt_parse to deal with consuming possibly
- * optional arguments.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * IN/OUT ps : The current parse state.
- *
- * RETURNS:
- * An error code.
- */
-static dropt_error
-parse_option_arg(dropt_context* context, parse_state* ps)
-{
- dropt_error err;
-
- bool consumeNextArg = false;
-
- if (OPTION_TAKES_ARG(ps->option) && ps->optionArgument == NULL)
- {
- /* The option expects an argument, but none was specified with '='.
- * Try using the next item from the command-line.
- */
- if (ps->argsLeft > 0 && *(ps->argNext) != NULL)
- {
- consumeNextArg = true;
- ps->optionArgument = *(ps->argNext);
- }
- else if (!(ps->option->attr & dropt_attr_optional_val))
- {
- err = dropt_error_insufficient_arguments;
- goto exit;
- }
- }
-
- /* Even for options that don't ask for arguments, always parse and
- * consume an argument that was specified with '='.
- */
- err = set_option_value(context, ps->option, ps->optionArgument);
-
- if ( err != dropt_error_none
- && (ps->option->attr & dropt_attr_optional_val)
- && consumeNextArg
- && ps->optionArgument != NULL)
- {
- /* The option's handler didn't like the argument we fed it. If the
- * argument was optional, try again without it.
- */
- consumeNextArg = false;
- ps->optionArgument = NULL;
- err = set_option_value(context, ps->option, NULL);
- }
-
-exit:
- if (err == dropt_error_none && consumeNextArg)
- {
- ps->argNext++;
- ps->argsLeft--;
- }
- return err;
-}
-
-
-/** dropt_parse
- *
- * Parses command-line options.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * Must not be NULL.
- * IN argc : The maximum number of arguments to parse from
- * argv.
- * Pass -1 to parse all arguments up to a NULL
- * sentinel value.
- * IN argv : The list of command-line arguments, not including
- * the initial program name.
- *
- * RETURNS:
- * A pointer to the first unprocessed element in argv.
- */
-dropt_char**
-dropt_parse(dropt_context* context,
- int argc, dropt_char** argv)
-{
- dropt_error err = dropt_error_none;
-
- dropt_char* arg;
- parse_state ps;
-
- ps.option = NULL;
- ps.optionArgument = NULL;
- ps.argNext = argv;
-
- if (argv == NULL)
- {
- /* Nothing to do. */
- goto exit;
- }
-
- if (context == NULL)
- {
- DROPT_MISUSE("No dropt context specified.");
- goto exit;
- }
-
-#ifdef DROPT_NO_STRING_BUFFERS
- if (context->errorHandler == NULL)
- {
- DROPT_MISUSE("No error handler specified.");
- set_error_details(context, dropt_error_bad_configuration,
- make_char_array(DROPT_TEXT_LITERAL(""), 0),
- NULL);
- goto exit;
- }
-#endif
-
- if (argc == -1)
- {
- argc = 0;
- while (argv[argc] != NULL) { argc++; }
- }
-
- if (argc == 0)
- {
- /* Nothing to do. */
- goto exit;
- }
-
- init_lookup_tables(context);
-
- ps.argsLeft = argc;
-
- while ( ps.argsLeft-- > 0
- && (arg = *ps.argNext) != NULL
- && arg[0] == DROPT_TEXT_LITERAL('-'))
- {
- assert(err == dropt_error_none);
-
- if (arg[1] == DROPT_TEXT_LITERAL('\0'))
- {
- /* - */
-
- /* This intentionally leaves "-" unprocessed for the caller to
- * deal with. This allows construction of programs that treat
- * "-" to mean "stdin".
- */
- goto exit;
- }
-
- ps.argNext++;
-
- if (arg[1] == DROPT_TEXT_LITERAL('-'))
- {
- const dropt_char* longName = arg + 2;
- if (longName[0] == DROPT_TEXT_LITERAL('\0'))
- {
- /* -- */
-
- /* This is used to mark the end of the option processing
- * to prevent some arguments with leading '-' characters
- * from being treated as options.
- *
- * Don't pass this back to the caller.
- */
- goto exit;
- }
- else if (longName[0] == DROPT_TEXT_LITERAL('='))
- {
- /* Deal with the pathological case of a user supplying
- * "--=".
- */
- err = dropt_error_invalid_option;
- set_error_details(context, err,
- make_char_array(arg, dropt_strlen(arg)),
- NULL);
- goto exit;
- }
- else
- {
- /* --longName */
- const dropt_char* p = dropt_strchr(longName, DROPT_TEXT_LITERAL('='));
- const dropt_char* longNameEnd;
- if (p != NULL)
- {
- /* --longName=arg */
- longNameEnd = p;
- ps.optionArgument = p + 1;
- }
- else
- {
- longNameEnd = longName + dropt_strlen(longName);
- assert(ps.optionArgument == NULL);
- }
-
- /* Pass the length of the option name so that we don't need
- * to mutate the original string by inserting a
- * NUL-terminator.
- */
- ps.option = find_option_long(context,
- make_char_array(longName,
- longNameEnd - longName));
- if (ps.option == NULL)
- {
- err = dropt_error_invalid_option;
- set_error_details(context, err,
- make_char_array(arg, longNameEnd - arg),
- NULL);
- }
- else
- {
- err = parse_option_arg(context, &ps);
- if (err != dropt_error_none)
- {
- set_error_details(context, err,
- make_char_array(arg, longNameEnd - arg),
- ps.optionArgument);
- }
- }
-
- if ( err != dropt_error_none
- || ps.option->attr & dropt_attr_halt)
- {
- goto exit;
- }
- }
- }
- else
- {
- /* Short name. (-x) */
- size_t len;
- size_t j;
-
- if (arg[1] == DROPT_TEXT_LITERAL('='))
- {
- /* Deal with the pathological case of a user supplying
- * "-=".
- */
- err = dropt_error_invalid_option;
- set_error_details(context, err,
- make_char_array(arg, dropt_strlen(arg)),
- NULL);
- goto exit;
- }
- else
- {
- const dropt_char* p = dropt_strchr(arg, DROPT_TEXT_LITERAL('='));
- if (p != NULL)
- {
- /* -x=arg */
- len = p - arg;
- ps.optionArgument = p + 1;
- }
- else
- {
- len = dropt_strlen(arg);
- assert(ps.optionArgument == NULL);
- }
- }
-
- for (j = 1; j < len; j++)
- {
- ps.option = find_option_short(context, arg[j]);
- if (ps.option == NULL)
- {
- err = dropt_error_invalid_option;
- set_short_option_error_details(context, err, arg[j], NULL);
- goto exit;
- }
- else if (j + 1 == len)
- {
- /* The last short option in a condensed list gets
- * to use an argument.
- */
- err = parse_option_arg(context, &ps);
- if (err != dropt_error_none)
- {
- set_short_option_error_details(context, err, arg[j],
- ps.optionArgument);
- goto exit;
- }
- }
- else if ( context->allowConcatenatedArgs
- && OPTION_TAKES_ARG(ps.option)
- && j == 1)
- {
- err = set_option_value(context, ps.option, &arg[j + 1]);
-
- if ( err != dropt_error_none
- && (ps.option->attr & dropt_attr_optional_val))
- {
- err = set_option_value(context, ps.option, NULL);
- }
-
- if (err != dropt_error_none)
- {
- set_short_option_error_details(context, err, arg[j], &arg[j + 1]);
- goto exit;
- }
-
- /* Skip to the next argument. */
- break;
- }
- else if ( OPTION_TAKES_ARG(ps.option)
- && !(ps.option->attr & dropt_attr_optional_val))
- {
- /* Short options with required arguments can't be used
- * in condensed lists except in the last position.
- *
- * e.g. -abcd arg
- * ^
- */
- err = dropt_error_insufficient_arguments;
- set_short_option_error_details(context, err, arg[j], NULL);
- goto exit;
- }
- else
- {
- err = set_option_value(context, ps.option, NULL);
- if (err != dropt_error_none)
- {
- set_short_option_error_details(context, err, arg[j], NULL);
- goto exit;
- }
- }
-
- if (ps.option->attr & dropt_attr_halt) { goto exit; }
- }
- }
-
- ps.option = NULL;
- ps.optionArgument = NULL;
- }
-
-exit:
- return ps.argNext;
-}
-
-
-/** dropt_new_context
- *
- * Creates a new dropt context.
- *
- * PARAMETERS:
- * IN options : The list of option specifications.
- * Must not be NULL.
- *
- * RETURNS:
- * An allocated dropt context. The caller is responsible for freeing
- * it with dropt_free_context when no longer needed.
- * Returns NULL on error.
- */
-dropt_context*
-dropt_new_context(const dropt_option* options)
-{
- dropt_context* context = NULL;
- size_t n;
-
- if (options == NULL)
- {
- DROPT_MISUSE("No option list specified.");
- goto exit;
- }
-
- /* Sanity-check the options. */
- for (n = 0; is_valid_option(&options[n]); n++)
- {
- if ( options[n].short_name == DROPT_TEXT_LITERAL('=')
- || ( options[n].long_name != NULL
- && dropt_strchr(options[n].long_name, DROPT_TEXT_LITERAL('=')) != NULL))
- {
- DROPT_MISUSE("Invalid option list. '=' may not be used in an option name.");
- goto exit;
- }
- }
-
- context = malloc(sizeof *context);
- if (context == NULL)
- {
- goto exit;
- }
- else
- {
- dropt_context emptyContext = { 0 };
- *context = emptyContext;
-
- context->options = options;
- context->numOptions = n;
- dropt_set_strncmp(context, NULL);
- }
-
-exit:
- return context;
-}
-
-
-/** dropt_free_context
- *
- * Frees a dropt context.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context to free.
- * May be NULL.
- */
-void
-dropt_free_context(dropt_context* context)
-{
- dropt_clear_error(context);
- free_lookup_tables(context);
- free(context);
-}
-
-
-/** dropt_get_options
- *
- * PARAMETERS:
- * IN context : The dropt context.
- * Must not be NULL.
- *
- * RETURNS:
- * The context's list of option specifications.
- */
-const dropt_option*
-dropt_get_options(const dropt_context* context)
-{
- if (context == NULL)
- {
- DROPT_MISUSE("No dropt context specified.");
- return NULL;
- }
-
- return context->options;
-}
-
-
-/** dropt_init_help_params
- *
- * Initializes a dropt_help_params structure with the default
- * values.
- *
- * PARAMETERS:
- * OUT helpParams : On output, set to the default help parameters.
- * Must not be NULL.
- */
-void
-dropt_init_help_params(dropt_help_params* helpParams)
-{
- if (helpParams == NULL)
- {
- DROPT_MISUSE("No dropt help parameters specified.");
- return;
- }
-
- helpParams->indent = default_help_indent;
- helpParams->description_start_column = default_description_start_column;
- helpParams->blank_lines_between_options = true;
-}
-
-
-/** dropt_set_error_handler
- *
- * Sets the callback function used to generate error strings from
- * error codes.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * Must not be NULL.
- * IN handler : The error handler callback.
- * Pass NULL to use the default error handler.
- * IN handlerData : Caller-defined callback data.
- */
-void
-dropt_set_error_handler(dropt_context* context, dropt_error_handler_func handler, void* handlerData)
-{
- if (context == NULL)
- {
- DROPT_MISUSE("No dropt context specified.");
- return;
- }
-
- context->errorHandler = handler;
- context->errorHandlerData = handlerData;
-}
-
-
-/** dropt_set_strncmp
- *
- * Sets the callback function used to compare strings.
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * Must not be NULL.
- * IN cmp : The string comparison function.
- * Pass NULL to use the default string comparison
- * function.
- */
-void
-dropt_set_strncmp(dropt_context* context, dropt_strncmp_func cmp)
-{
- if (context == NULL)
- {
- DROPT_MISUSE("No dropt context specified.");
- return;
- }
-
- if (cmp == NULL) { cmp = dropt_strncmp; }
- context->ncmpstr = cmp;
-
- /* Changing the sort method invalidates our existing lookup tables. */
- free_lookup_tables(context);
-}
-
-
-/** dropt_allow_concatenated_arguments
- *
- * Specifies whether "short" options are allowed to have concatenated
- * arguments (i.e. without space or '=' separators, such as -oARGUMENT).
- *
- * (Concatenated arguments are disallowed by default.)
- *
- * PARAMETERS:
- * IN/OUT context : The dropt context.
- * IN allow : Pass 1 if concatenated arguments should be allowed,
- * 0 otherwise.
- */
-void
-dropt_allow_concatenated_arguments(dropt_context* context, dropt_bool allow)
-{
- if (context == NULL)
- {
- DROPT_MISUSE("No dropt context specified.");
- return;
- }
-
- context->allowConcatenatedArgs = (allow != 0);
-}
-
-
-/** dropt_misuse
- *
- * Prints a diagnostic for logical errors caused by external clients
- * calling into dropt improperly.
- *
- * In debug builds, terminates the program and prints the filename and
- * line number of the failure.
- *
- * For logical errors entirely internal to dropt, use assert()
- * instead.
- *
- * PARAMETERS:
- * IN message : The error message.
- * Must not be NULL.
- * IN filename : The name of the file where the logical error
- * occurred.
- * Must not be NULL.
- * IN line : The line number where the logical error occurred.
- */
-void
-dropt_misuse(const char* message, const char* filename, int line)
-{
-#ifdef NDEBUG
- (void)filename;
- (void)line;
- fprintf(stderr, "dropt: %s\n", message);
-#else
- fprintf(stderr, "dropt: %s (%s: %d)\n", message, filename, line);
- abort();
-#endif
-}
diff --git a/ext/dropt/src/dropt_handlers.c b/ext/dropt/src/dropt_handlers.c
deleted file mode 100644
index 412d571..0000000
--- a/ext/dropt/src/dropt_handlers.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/** dropt_handlers.c
- *
- * Default type handlers for dropt.
- *
- * Copyright (c) 2006-2012 James D. Lin <jameslin@cal.berkeley.edu>
- *
- * The latest version of this file can be downloaded from:
- * <http://www.taenarum.com/software/dropt/>
- *
- * This software is provided 'as-is', without any express or implied
- * warranty. In no event will the authors be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice may not be removed or altered from any source distribution.
- */
-// THIS FILE HAS BEEN ALTERED from original version to fix warnings
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <float.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "dropt.h"
-#include "dropt_string.h"
-
-#define ABS(x) (((x) < 0) ? -(x) : (x))
-
-typedef enum { false, true } bool;
-
-/** dropt_handle_bool
- *
- * Parses a boolean value from the given string if possible.
- *
- * PARAMETERS:
- * IN/OUT context : The options context.
- * IN optionArgument : A string representing a boolean value (0 or 1).
- * If NULL, the boolean value is assumed to be
- * true.
- * OUT handlerData : A dropt_bool*.
- * On success, set to the interpreted boolean
- * value.
- * On error, left untouched.
- *
- * RETURNS:
- * dropt_error_none
- * dropt_error_unknown
- * dropt_error_bad_configuration
- * dropt_error_mismatch
- */
-dropt_error
-dropt_handle_bool(dropt_context* context, const dropt_char* optionArgument,
- void* handlerData)
-{
- dropt_error err = dropt_error_none;
- bool val = false;
- dropt_bool* out = handlerData;
-
- if (out == NULL)
- {
- DROPT_MISUSE("No handler data specified.");
- err = dropt_error_bad_configuration;
- }
- else if (optionArgument == NULL)
- {
- /* No explicit argument implies that the option is being turned on. */
- val = true;
- }
- else if (optionArgument[0] == DROPT_TEXT_LITERAL('\0'))
- {
- err = dropt_error_mismatch;
- }
- else
- {
- unsigned int i = 0;
- err = dropt_handle_uint(context, optionArgument, &i);
- if (err == dropt_error_none)
- {
- switch (i)
- {
- case 0:
- val = false;
- break;
- case 1:
- val = true;
- break;
- default:
- err = dropt_error_mismatch;
- break;
- }
- }
- else if (err == dropt_error_overflow)
- {
- err = dropt_error_mismatch;
- }
- }
-
- if (err == dropt_error_none) { *out = val; }
- return err;
-}
-
-
-/** dropt_handle_verbose_bool
- *
- * Like dropt_handle_bool but accepts "true" and "false" string
- * values.
- *
- * PARAMETERS:
- * IN/OUT context : The options context.
- * IN optionArgument : A string representing a boolean value.
- * If NULL, the boolean value is assumed to be
- * true.
- * OUT handlerData : A dropt_bool*.
- * On success, set to the interpreted boolean
- * value.
- * On error, left untouched.
- *
- * RETURNS:
- * See dropt_handle_bool.
- */
-dropt_error
-dropt_handle_verbose_bool(dropt_context* context, const dropt_char* optionArgument,
- void* handlerData)
-{
- dropt_error err = dropt_handle_bool(context, optionArgument, handlerData);
- if (err == dropt_error_mismatch)
- {
- bool val = false;
- dropt_bool* out = handlerData;
-
- /* dropt_handle_bool already checks for this. */
- assert(out != NULL);
-
- if (dropt_stricmp(optionArgument, DROPT_TEXT_LITERAL("false")) == 0)
- {
- val = false;
- err = dropt_error_none;
- }
- else if (dropt_stricmp(optionArgument, DROPT_TEXT_LITERAL("true")) == 0)
- {
- val = true;
- err = dropt_error_none;
- }
-
- if (err == dropt_error_none) { *out = val; }
- }
- return err;
-}
-
-
-/** dropt_handle_int
- *
- * Parses an integer from the given string.
- *
- * PARAMETERS:
- * IN/OUT context : The options context.
- * IN optionArgument : A string representing a base-10 integer.
- * If NULL, returns dropt_error_insufficient_arguments.
- * OUT handlerData : An int*.
- * On success, set to the interpreted integer.
- * On error, left untouched.
- *
- * RETURNS:
- * dropt_error_none
- * dropt_error_unknown
- * dropt_error_bad_configuration
- * dropt_error_insufficient_arguments
- * dropt_error_mismatch
- * dropt_error_overflow
- */
-dropt_error
-dropt_handle_int(dropt_context* context, const dropt_char* optionArgument,
- void* handlerData)
-{
- dropt_error err = dropt_error_none;
- int val = 0;
- int* out = handlerData;
- (void)context;
-
- if (out == NULL)
- {
- DROPT_MISUSE("No handler data specified.");
- err = dropt_error_bad_configuration;
- }
- else if (optionArgument == NULL || optionArgument[0] == DROPT_TEXT_LITERAL('\0'))
- {
- err = dropt_error_insufficient_arguments;
- }
- else
- {
- dropt_char* end;
- long n;
- errno = 0;
- n = dropt_strtol(optionArgument, &end, 10);
-
- /* Check that we matched at least one digit.
- * (strtol/strtoul will return 0 if fed a string with no digits.)
- */
- if (*end == DROPT_TEXT_LITERAL('\0') && end > optionArgument)
- {
- if (errno == ERANGE || n < INT_MIN || n > INT_MAX)
- {
- err = dropt_error_overflow;
- val = (n < 0) ? INT_MIN : INT_MAX;
- }
- else if (errno == 0)
- {
- val = (int) n;
- }
- else
- {
- err = dropt_error_unknown;
- }
- }
- else
- {
- err = dropt_error_mismatch;
- }
- }
-
- if (err == dropt_error_none) { *out = val; }
- return err;
-}
-
-
-/** dropt_handle_uint
- *
- * Parses an unsigned integer from the given string.
- *
- * PARAMETERS:
- * IN/OUT context : The options context.
- * IN optionArgument : A string representing an unsigned base-10
- * integer.
- * If NULL, returns dropt_error_insufficient_arguments.
- * OUT handlerData : An unsigned int*.
- * On success, set to the interpreted integer.
- * On error, left untouched.
- *
- * RETURNS:
- * dropt_error_none
- * dropt_error_unknown
- * dropt_error_bad_configuration
- * dropt_error_insufficient_arguments
- * dropt_error_mismatch
- * dropt_error_overflow
- */
-dropt_error
-dropt_handle_uint(dropt_context* context, const dropt_char* optionArgument,
- void* handlerData)
-{
- dropt_error err = dropt_error_none;
- int val = 0;
- unsigned int* out = handlerData;
- (void)context;
-
- if (out == NULL)
- {
- DROPT_MISUSE("No handler data specified.");
- err = dropt_error_bad_configuration;
- }
- else if ( optionArgument == NULL
- || optionArgument[0] == DROPT_TEXT_LITERAL('\0'))
- {
- err = dropt_error_insufficient_arguments;
- }
- else if (optionArgument[0] == DROPT_TEXT_LITERAL('-'))
- {
- err = dropt_error_mismatch;
- }
- else
- {
- dropt_char* end;
- unsigned long n;
- errno = 0;
- n = dropt_strtoul(optionArgument, &end, 10);
-
- /* Check that we matched at least one digit.
- * (strtol/strtoul will return 0 if fed a string with no digits.)
- */
- if (*end == DROPT_TEXT_LITERAL('\0') && end > optionArgument)
- {
- if (errno == ERANGE || n > UINT_MAX)
- {
- err = dropt_error_overflow;
- val = UINT_MAX;
- }
- else if (errno == 0)
- {
- val = (unsigned int) n;
- }
- else
- {
- err = dropt_error_unknown;
- }
- }
- else
- {
- err = dropt_error_mismatch;
- }
- }
-
- if (err == dropt_error_none) { *out = val; }
- return err;
-}
-
-
-/** dropt_handle_double
- *
- * Parses a double from the given string.
- *
- * PARAMETERS:
- * IN/OUT context : The options context.
- * IN optionArgument : A string representing a base-10 floating-point
- * number.
- * If NULL, returns dropt_error_insufficient_arguments.
- * OUT handlerData : A double*.
- * On success, set to the interpreted double.
- * On error, left untouched.
- *
- * RETURNS:
- * dropt_error_none
- * dropt_error_unknown
- * dropt_error_bad_configuration
- * dropt_error_insufficient_arguments
- * dropt_error_mismatch
- * dropt_error_overflow
- * dropt_error_underflow
- */
-dropt_error
-dropt_handle_double(dropt_context* context, const dropt_char* optionArgument,
- void* handlerData)
-{
- dropt_error err = dropt_error_none;
- double val = 0.0;
- double* out = handlerData;
- (void)context;
-
- if (out == NULL)
- {
- DROPT_MISUSE("No handler data specified.");
- err = dropt_error_bad_configuration;
- }
- else if ( optionArgument == NULL
- || optionArgument[0] == DROPT_TEXT_LITERAL('\0'))
- {
- err = dropt_error_insufficient_arguments;
- }
- else
- {
- dropt_char* end;
- errno = 0;
- val = dropt_strtod(optionArgument, &end);
-
- /* Check that we matched at least one digit.
- * (strtod will return 0 if fed a string with no digits.)
- */
- if (*end == DROPT_TEXT_LITERAL('\0') && end > optionArgument)
- {
- if (errno == ERANGE)
- {
- /* Note that setting errno to ERANGE for underflow errors
- * is implementation-defined behavior, but glibc, BSD's
- * libc, and Microsoft's CRT all have implementations of
- * strtod documented to return 0 and to set errno to ERANGE
- * for such cases.
- */
- err = (ABS(val) <= DBL_MIN)
- ? dropt_error_underflow
- : dropt_error_overflow;
- }
- else if (errno != 0)
- {
- err = dropt_error_unknown;
- }
- }
- else
- {
- err = dropt_error_mismatch;
- }
- }
-
- if (err == dropt_error_none) { *out = val; }
- return err;
-}
-
-
-/** dropt_handle_string
- *
- * Obtains a string.
- *
- * PARAMETERS:
- * IN/OUT context : The options context.
- * IN optionArgument : A string.
- * If NULL, returns dropt_error_insufficient_arguments.
- * OUT handlerData : A dropt_char**.
- * On success, set to the input string. The
- * string is NOT copied from the original argv
- * array, so do not free it.
- * On error, left untouched.
- *
- * RETURNS:
- * dropt_error_none
- * dropt_error_bad_configuration
- * dropt_error_insufficient_arguments
- */
-dropt_error
-dropt_handle_string(dropt_context* context, const dropt_char* optionArgument,
- void* handlerData)
-{
- dropt_error err = dropt_error_none;
- const dropt_char** out = handlerData;
- (void)context;
-
- if (out == NULL)
- {
- DROPT_MISUSE("No handler data specified.");
- err = dropt_error_bad_configuration;
- }
- else if (optionArgument == NULL)
- {
- err = dropt_error_insufficient_arguments;
- }
-
- if (err == dropt_error_none) { *out = optionArgument; }
- return err;
-}
diff --git a/ext/dropt/src/dropt_string.c b/ext/dropt/src/dropt_string.c
deleted file mode 100644
index 32e6575..0000000
--- a/ext/dropt/src/dropt_string.c
+++ /dev/null
@@ -1,690 +0,0 @@
-/** dropt_string.c
- *
- * String routines for dropt.
- *
- * Copyright (c) 2006-2012 James D. Lin <jameslin@cal.berkeley.edu>
- *
- * The latest version of this file can be downloaded from:
- * <http://www.taenarum.com/software/dropt/>
- *
- * This software is provided 'as-is', without any express or implied
- * warranty. In no event will the authors be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice may not be removed or altered from any source distribution.
- */
-// This file has been altered to convert a call to the unsafe memcpy to a
-// local loop.
-#ifdef _MSC_VER
- #include <tchar.h>
-#endif
-
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-#include <wctype.h>
-#include <stdio.h>
-#include <assert.h>
-
-#if __STDC_VERSION__ >= 199901L
- #include <stdint.h>
-#else
- /* Compatibility junk for things that don't yet support ISO C99. */
- #if defined _MSC_VER || defined __BORLANDC__
- #ifndef va_copy
- #define va_copy(dest, src) (dest = (src))
- #endif
- #else
- #ifndef va_copy
- #error Unsupported platform. va_copy is not defined.
- #endif
- #endif
-
- #ifndef SIZE_MAX
- #define SIZE_MAX ((size_t) -1)
- #endif
-#endif
-
-#include "dropt_string.h"
-
-#ifndef MAX
-#define MAX(x, y) (((x) > (y)) ? (x) : (y))
-#endif
-
-#ifndef MIN
-#define MIN(x, y) (((x) < (y)) ? (x) : (y))
-#endif
-
-#ifdef DROPT_DEBUG_STRING_BUFFERS
- enum { default_stringstream_buffer_size = 1 };
- #define GROWN_STRINGSTREAM_BUFFER_SIZE(oldSize, minAmount) \
- ((oldSize) + (minAmount))
-#else
- enum { default_stringstream_buffer_size = 256 };
- #define GROWN_STRINGSTREAM_BUFFER_SIZE(oldSize, minAmount) \
- MAX((oldSize) * 2, (oldSize) + (minAmount))
-#endif
-
-
-#ifndef DROPT_NO_STRING_BUFFERS
-struct dropt_stringstream
-{
- dropt_char* string; /* The string buffer. */
- size_t maxSize; /* Size of the string buffer, in dropt_char-s, including space for NUL. */
- size_t used; /* Number of elements used in the string buffer, excluding NUL. */
-};
-#endif
-
-
-/** dropt_safe_malloc
- *
- * A version of malloc that checks for integer overflow.
- *
- * PARAMETERS:
- * IN numElements : The number of elements to allocate.
- * IN elementSize : The size of each element, in bytes.
- *
- * RETURNS:
- * A pointer to the allocated memory.
- * Returns NULL if numElements is 0.
- * Returns NULL on error.
- */
-void*
-dropt_safe_malloc(size_t numElements, size_t elementSize)
-{
- return dropt_safe_realloc(NULL, numElements, elementSize);
-}
-
-
-/** dropt_safe_realloc
- *
- * Wrapper around realloc to check for integer overflow.
- *
- * PARAMETERS:
- * IN/OUT p : A pointer to the memory block to resize.
- * If NULL, a new memory block of the specified size
- * will be allocated.
- * IN numElements : The number of elements to allocate.
- * If 0, frees p.
- * IN elementSize : The size of each element, in bytes.
- *
- * RETURNS:
- * A pointer to the allocated memory.
- * Returns NULL if numElements is 0.
- * Returns NULL on error.
- */
-void*
-dropt_safe_realloc(void* p, size_t numElements, size_t elementSize)
-{
- size_t numBytes;
-
- /* elementSize shouldn't legally be 0, but we check for it in case a
- * caller got the argument order wrong.
- */
- if (numElements == 0 || elementSize == 0)
- {
- /* The behavior of realloc(p, 0) is implementation-defined. Let's
- * enforce a particular behavior.
- */
- free(p);
-
- assert(elementSize != 0);
- return NULL;
- }
-
- numBytes = numElements * elementSize;
- if (numBytes / elementSize != numElements)
- {
- /* Overflow. */
- return NULL;
- }
-
- return realloc(p, numBytes);
-}
-
-
-/** dropt_strdup
- *
- * Duplicates a string.
- *
- * PARAMETERS:
- * IN s : A NUL-terminated string to duplicate.
- *
- * RETURNS:
- * The duplicated string. The caller is responsible for calling
- * free() on it when no longer needed.
- * Returns NULL on error.
- */
-dropt_char*
-dropt_strdup(const dropt_char* s)
-{
- return dropt_strndup(s, SIZE_MAX);
-}
-
-
-/** dropt_strndup
- *
- * Duplicates the first n characters of a string.
- *
- * PARAMETERS:
- * IN s : The string to duplicate.
- * IN n : The maximum number of dropt_char-s to copy, excluding the
- * NUL-terminator.
- *
- * RETURNS:
- * The duplicated string, which is always NUL-terminated. The caller
- * is responsible for calling free() on it when no longer needed.
- * Returns NULL on error.
- */
-dropt_char*
-dropt_strndup(const dropt_char* s, size_t n)
-{
- dropt_char* copy;
- size_t len = 0;
- size_t i = 0;
-
- assert(s != NULL);
-
- while (len < n && s[len] != DROPT_TEXT_LITERAL('\0'))
- {
- len++;
- }
-
- if (len + 1 < len)
- {
- /* This overflow check shouldn't be strictly necessary. len can be
- * at most SIZE_MAX, so SIZE_MAX + 1 can wrap around to 0, but
- * dropt_safe_malloc will return NULL for a 0-sized allocation.
- * However, favor defensive paranoia.
- */
- return NULL;
- }
-
- copy = dropt_safe_malloc(len + 1 /* NUL */, sizeof *copy);
- if (copy != NULL)
- {
- for(i = 0; i < len; i+=1){
- copy[i] = s[i];
- }
- copy[len] = DROPT_TEXT_LITERAL('\0');
- }
-
- return copy;
-}
-
-
-/** dropt_stricmp
- *
- * Compares two NUL-terminated strings ignoring case differences. Not
- * recommended for non-ASCII strings.
- *
- * PARAMETERS:
- * IN s, t : The strings to compare.
- *
- * RETURNS:
- * 0 if the strings are equivalent,
- * < 0 if s is lexically less than t,
- * > 0 if s is lexically greater than t.
- */
-int
-dropt_stricmp(const dropt_char* s, const dropt_char* t)
-{
- assert(s != NULL);
- assert(t != NULL);
- return dropt_strnicmp(s, t, SIZE_MAX);
-}
-
-
-/** dropt_strnicmp
- *
- * Compares the first n characters of two strings, ignoring case
- * differences. Not recommended for non-ASCII strings.
- *
- * PARAMETERS:
- * IN s, t : The strings to compare.
- * IN n : The maximum number of dropt_char-s to compare.
- *
- * RETURNS:
- * 0 if the strings are equivalent,
- * < 0 if s is lexically less than t,
- * > 0 if s is lexically greater than t.
- */
-int
-dropt_strnicmp(const dropt_char* s, const dropt_char* t, size_t n)
-{
- assert(s != NULL);
- assert(t != NULL);
-
- if (s == t) { return 0; }
-
- while (n--)
- {
- if (*s == DROPT_TEXT_LITERAL('\0') && *t == DROPT_TEXT_LITERAL('\0'))
- {
- break;
- }
- else if (*s == *t || dropt_tolower(*s) == dropt_tolower(*t))
- {
- s++;
- t++;
- }
- else
- {
- return (dropt_tolower(*s) < dropt_tolower(*t))
- ? -1
- : +1;
- }
- }
-
- return 0;
-}
-
-
-#ifndef DROPT_NO_STRING_BUFFERS
-/** dropt_vsnprintf
- *
- * vsnprintf wrapper to provide ISO C99-compliant behavior.
- *
- * PARAMETERS:
- * OUT s : The destination buffer. May be NULL if n is 0.
- * If non-NULL, always NUL-terminated.
- * IN n : The size of the destination buffer, measured in
- * dropt_char-s.
- * IN format : printf-style format specifier. Must not be NULL.
- * IN args : Arguments to insert into the formatted string.
- *
- * RETURNS:
- * The number of characters that would be written to the destination
- * buffer if it's sufficiently large, excluding the NUL-terminator.
- * Returns -1 on error.
- */
-int
-dropt_vsnprintf(dropt_char* s, size_t n, const dropt_char* format, va_list args)
-{
-#if __STDC_VERSION__ >= 199901L || __GNUC__
- /* ISO C99-compliant.
- *
- * As far as I can tell, gcc's implementation of vsnprintf has always
- * matched the behavior required by the C99 standard (which is to
- * return the necessary buffer size).
- *
- * Note that this won't work with wchar_t because there is no true,
- * standard wchar_t equivalent of snprintf. swprintf comes close but
- * doesn't return the necessary buffer size (and the standard does not
- * provide a guaranteed way to test if truncation occurred), and its
- * format string can't be used interchangeably with snprintf.
- *
- * It's simpler not to support wchar_t on non-Windows platforms.
- */
- assert(format != NULL);
- return vsnprintf(s, n, format, args);
-#elif defined __BORLANDC__
- /* Borland's compiler neglects to NUL-terminate. */
- int ret;
- assert(format != NULL);
- ret = vsnprintf(s, n, format, args);
- if (n != 0) { s[n - 1] = DROPT_TEXT_LITERAL('\0'); }
- return ret;
-#elif defined _MSC_VER
- /* _vsntprintf and _vsnprintf_s on Windows don't have C99 semantics;
- * they return -1 if truncation occurs.
- */
- va_list argsCopy;
- int ret;
-
- assert(format != NULL);
-
- va_copy(argsCopy, args);
- ret = _vsctprintf(format, argsCopy);
- va_end(argsCopy);
-
- if (n != 0)
- {
- assert(s != NULL);
-
- #if _MSC_VER >= 1400
- (void) _vsntprintf_s(s, n, _TRUNCATE, format, args);
- #else
- /* This version doesn't necessarily NUL-terminate. Sigh. */
- (void) _vsnprintf(s, n, format, args);
- s[n - 1] = DROPT_TEXT_LITERAL('\0');
- #endif
- }
-
- return ret;
-
-#else
- #error Unsupported platform. dropt_vsnprintf unimplemented.
- return -1;
-#endif
-}
-
-
-/** See dropt_vsnprintf. */
-int
-dropt_snprintf(dropt_char* s, size_t n, const dropt_char* format, ...)
-{
- int ret;
- va_list args;
- va_start(args, format);
- ret = dropt_vsnprintf(s, n, format, args);
- va_end(args);
- return ret;
-}
-
-
-/** dropt_vasprintf
- *
- * Allocates a formatted string with vprintf semantics.
- *
- * PARAMETERS:
- * IN format : printf-style format specifier. Must not be NULL.
- * IN args : Arguments to insert into the formatted string.
- *
- * RETURNS:
- * The formatted string, which is always NUL-terminated. The caller
- * is responsible for calling free() on it when no longer needed.
- * Returns NULL on error.
- */
-dropt_char*
-dropt_vasprintf(const dropt_char* format, va_list args)
-{
- dropt_char* s = NULL;
- int len;
- va_list argsCopy;
- assert(format != NULL);
-
- va_copy(argsCopy, args);
- len = dropt_vsnprintf(NULL, 0, format, argsCopy);
- va_end(argsCopy);
-
- if (len >= 0)
- {
- size_t n = len + 1 /* NUL */;
- s = dropt_safe_malloc(n, sizeof *s);
- if (s != NULL)
- {
- dropt_vsnprintf(s, n, format, args);
- }
- }
-
- return s;
-}
-
-
-/** See dropt_vasprintf. */
-dropt_char*
-dropt_asprintf(const dropt_char* format, ...)
-{
- dropt_char* s;
-
- va_list args;
- va_start(args, format);
- s = dropt_vasprintf(format, args);
- va_end(args);
-
- return s;
-}
-
-
-/** dropt_ssopen
- *
- * Constructs a new dropt_stringstream.
- *
- * RETURNS:
- * An initialized dropt_stringstream. The caller is responsible for
- * calling either dropt_ssclose() or dropt_ssfinalize() on it when
- * no longer needed.
- * Returns NULL on error.
- */
-dropt_stringstream*
-dropt_ssopen(void)
-{
- dropt_stringstream* ss = malloc(sizeof *ss);
- if (ss != NULL)
- {
- ss->used = 0;
- ss->maxSize = default_stringstream_buffer_size;
- ss->string = dropt_safe_malloc(ss->maxSize, sizeof *ss->string);
- if (ss->string == NULL)
- {
- free(ss);
- ss = NULL;
- }
- else
- {
- ss->string[0] = DROPT_TEXT_LITERAL('\0');
- }
- }
- return ss;
-}
-
-
-/** dropt_ssclose
- *
- * Destroys a dropt_stringstream.
- *
- * PARAMETERS:
- * IN/OUT ss : The dropt_stringstream.
- */
-void
-dropt_ssclose(dropt_stringstream* ss)
-{
- if (ss != NULL)
- {
- free(ss->string);
- free(ss);
- }
-}
-
-
-/** dropt_ssgetfreespace
- *
- * RETURNS:
- * The amount of free space in the dropt_stringstream's internal
- * buffer, measured in dropt_char-s. Space used for the
- * NUL-terminator is considered free. (The amount of free space
- * therefore is always positive.)
- */
-static size_t
-dropt_ssgetfreespace(const dropt_stringstream* ss)
-{
- assert(ss != NULL);
- assert(ss->maxSize > 0);
- assert(ss->maxSize > ss->used);
- return ss->maxSize - ss->used;
-}
-
-
-/** dropt_ssresize
- *
- * Resizes a dropt_stringstream's internal buffer. If the requested
- * size is less than the amount of buffer already in use, the buffer
- * will be shrunk to the minimum size necessary.
- *
- * PARAMETERS:
- * IN/OUT ss : The dropt_stringstream.
- * IN n : The desired buffer size, in dropt_char-s.
- *
- * RETURNS:
- * The new size of the dropt_stringstream's buffer in dropt_char-s,
- * including space for a terminating NUL.
- */
-static size_t
-dropt_ssresize(dropt_stringstream* ss, size_t n)
-{
- assert(ss != NULL);
-
- /* Don't allow shrinking if it will truncate the string. */
- if (n < ss->maxSize) { n = MAX(n, ss->used + 1 /* NUL */); }
-
- /* There should always be a buffer to point to. */
- assert(n > 0);
-
- if (n != ss->maxSize)
- {
- dropt_char* p = dropt_safe_realloc(ss->string, n, sizeof *ss->string);
- if (p != NULL)
- {
- ss->string = p;
- ss->maxSize = n;
- assert(ss->maxSize > 0);
- }
- }
- return ss->maxSize;
-}
-
-
-/** dropt_ssclear
- *
- * Clears and re-initializes a dropt_stringstream.
- *
- * PARAMETERS:
- * IN/OUT ss : The dropt_stringstream
- */
-void
-dropt_ssclear(dropt_stringstream* ss)
-{
- assert(ss != NULL);
-
- ss->string[0] = DROPT_TEXT_LITERAL('\0');
- ss->used = 0;
-
- dropt_ssresize(ss, default_stringstream_buffer_size);
-}
-
-
-/** dropt_ssfinalize
- *
- * Finalizes a dropt_stringstream; returns the contained string and
- * destroys the dropt_stringstream.
- *
- * PARAMETERS:
- * IN/OUT ss : The dropt_stringstream.
- *
- * RETURNS:
- * The dropt_stringstream's string, which is always NUL-terminated.
- * Note that the caller assumes ownership of the returned string and
- * is responsible for calling free() on it when no longer needed.
- */
-dropt_char*
-dropt_ssfinalize(dropt_stringstream* ss)
-{
- dropt_char* s;
- assert(ss != NULL);
-
- /* Shrink to fit. */
- dropt_ssresize(ss, 0);
-
- s = ss->string;
- ss->string = NULL;
-
- dropt_ssclose(ss);
-
- return s;
-}
-
-
-/** dropt_ssgetstring
- *
- * PARAMETERS:
- * IN ss : The dropt_stringstream.
- *
- * RETURNS:
- * The dropt_stringstream's string, which is always NUL-terminated.
- * The returned string will no longer be valid if further operations
- * are performed on the dropt_stringstream or if the
- * dropt_stringstream is closed.
- */
-const dropt_char*
-dropt_ssgetstring(const dropt_stringstream* ss)
-{
- assert(ss != NULL);
- return ss->string;
-}
-
-
-/** dropt_vssprintf
- *
- * Appends a formatted string with vprintf semantics to a
- * dropt_stringstream.
- *
- * PARAMETERS:
- * IN/OUT ss : The dropt_stringstream.
- * IN format : printf-style format specifier. Must not be NULL.
- * IN args : Arguments to insert into the formatted string.
- *
- * RETURNS:
- * The number of characters written to the dropt_stringstream,
- * excluding the NUL-terminator.
- * Returns a negative value on error.
- */
-int
-dropt_vssprintf(dropt_stringstream* ss, const dropt_char* format, va_list args)
-{
- int n;
- va_list argsCopy;
- assert(ss != NULL);
- assert(format != NULL);
-
- va_copy(argsCopy, args);
- n = dropt_vsnprintf(NULL, 0, format, argsCopy);
- va_end(argsCopy);
-
- if (n > 0)
- {
- size_t available = dropt_ssgetfreespace(ss);
- if ((unsigned int) n >= available)
- {
- /* It's possible that newSize < ss->maxSize if
- * GROWN_STRINGSTREAM_BUFFER_SIZE overflows, but it should be
- * safe since we'll recompute the available space.
- */
- size_t newSize = GROWN_STRINGSTREAM_BUFFER_SIZE(ss->maxSize, n);
- dropt_ssresize(ss, newSize);
- available = dropt_ssgetfreespace(ss);
- }
- assert(available > 0); /* Space always is reserved for NUL. */
-
- /* snprintf's family of functions return the number of characters
- * that would be output with a sufficiently large buffer, excluding
- * NUL.
- */
- n = dropt_vsnprintf(ss->string + ss->used, available, format, args);
-
- /* We couldn't allocate enough space. */
- if ((unsigned int) n >= available) { n = -1; }
-
- if (n > 0) { ss->used += n; }
- }
- return n;
-}
-
-
-/** See dropt_vssprintf. */
-int
-dropt_ssprintf(dropt_stringstream* ss, const dropt_char* format, ...)
-{
- int n;
-
- va_list args;
- va_start(args, format);
- n = dropt_vssprintf(ss, format, args);
- va_end(args);
-
- return n;
-}
-#endif /* DROPT_NO_STRING_BUFFERS */
diff --git a/ext/ipp/ippcp.parts b/ext/ipp/ippcp.parts
index 084620c..1af7fc2 100644
--- a/ext/ipp/ippcp.parts
+++ b/ext/ipp/ippcp.parts
@@ -72,10 +72,6 @@ env.Append(CPPDEFINES=['_DISABLE_ALG_MD5_',
env.ExportCPPPATH([AbsDir('sources/include/')])
-#disable warning for misleading indentation from GCC 6
-if env['TARGET_PLATFORM']['OS'] == 'posix':
- env.Append(CCFLAGS='-Wno-misleading-indentation')
-
if 'install_package' in env['MODE']:
# All files at /ext/ipp/source/include
env.InstallTopLevel(install_headers, sub_dir='ext/ipp/include')
diff --git a/ext/ipp/sources/ippcp/src/pcpbnca.c b/ext/ipp/sources/ippcp/src/pcpbnca.c
index 356b25e..dca29d5 100644
--- a/ext/ipp/sources/ippcp/src/pcpbnca.c
+++ b/ext/ipp/sources/ippcp/src/pcpbnca.c
@@ -50,6 +50,11 @@
#include "pcpbn.h"
#include "pcptool.h"
+#if defined(__GNUC__) && (__GNUC__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
+
/* BN(1) and reference */
static IppsBigNumStateChunk cpChunk_BN1 = {
{
@@ -1300,3 +1305,6 @@ IPPFUN(IppStatus, ippsModInv_BN, (IppsBigNumState* pA, IppsBigNumState* pM, Ipps
}
}
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
diff --git a/ext/ipp/sources/ippcp/src/pcpbnu32misc.c b/ext/ipp/sources/ippcp/src/pcpbnu32misc.c
index 8c243b2..3768862 100644
--- a/ext/ipp/sources/ippcp/src/pcpbnu32misc.c
+++ b/ext/ipp/sources/ippcp/src/pcpbnu32misc.c
@@ -37,6 +37,10 @@
#include "pcpbnumisc.h"
#include "pcpbnu32misc.h"
+#if defined(__GNUC__) && (__GNUC__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
/*
// number of leading zeros
@@ -227,3 +231,7 @@ cpSize cpToOctStr_BNU32(Ipp8u* pStr, cpSize strLen, const Ipp32u* pBNU, cpSize b
return 0;
}
}
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
diff --git a/ext/ipp/sources/ippcp/src/pcpbnumisc.c b/ext/ipp/sources/ippcp/src/pcpbnumisc.c
index b87f780..d007272 100644
--- a/ext/ipp/sources/ippcp/src/pcpbnumisc.c
+++ b/ext/ipp/sources/ippcp/src/pcpbnumisc.c
@@ -38,6 +38,10 @@
#include "owncp.h"
#include "pcpbnumisc.h"
+#if defined(__GNUC__) && (__GNUC__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
/*
// number of leading zeros
@@ -292,3 +296,7 @@ cpSize cpToOctStr_BNU(Ipp8u* pStr, cpSize strLen, const BNU_CHUNK_T* pA, cpSize
return 0;
}
}
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
diff --git a/ext/ipp/sources/ippcp/src/pcpgfpecpointstuff.c b/ext/ipp/sources/ippcp/src/pcpgfpecpointstuff.c
index 1aca04a..9032526 100644
--- a/ext/ipp/sources/ippcp/src/pcpgfpecpointstuff.c
+++ b/ext/ipp/sources/ippcp/src/pcpgfpecpointstuff.c
@@ -41,6 +41,10 @@
#include "owncp.h"
#include "pcpgfpecstuff.h"
+#if defined(__GNUC__) && (__GNUC__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
int gfec_MakePoint(IppsGFpECPoint* pPoint, const BNU_CHUNK_T* pElm, IppsGFpECState* pEC)
@@ -1147,3 +1151,7 @@ IppsGFpECPoint* gfec_BasePointProduct(IppsGFpECPoint* pR,
ECP_POINT_FLAGS(pR) = gfec_IsPointAtInfinity(pR)? 0 : ECP_FINITE_POINT;
return pR;
}
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
diff --git a/ext/ipp/sources/ippcp/src/pcpgfpxstuff.c b/ext/ipp/sources/ippcp/src/pcpgfpxstuff.c
index a5ed5c6..76650b8 100644
--- a/ext/ipp/sources/ippcp/src/pcpgfpxstuff.c
+++ b/ext/ipp/sources/ippcp/src/pcpgfpxstuff.c
@@ -45,6 +45,10 @@
#include "pcpgfpxstuff.h"
+#if defined(__GNUC__) && (__GNUC__ >= 6)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmisleading-indentation"
+#endif
BNU_CHUNK_T* cpGFpxRand(BNU_CHUNK_T* pR, IppsGFpState* pGFpx, IppBitSupplier rndFunc, void* pRndParam)
@@ -685,3 +689,7 @@ BNU_CHUNK_T* cpGFpxMultiExp(BNU_CHUNK_T* pR, const BNU_CHUNK_T* ppA[], const BNU
return pR;
}
}
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
diff --git a/parts-site/configurations/debug/gcc_win32_any.py b/parts-site/configurations/debug/gcc_win32-any.py
index a7b3069..a7b3069 100644
--- a/parts-site/configurations/debug/gcc_win32_any.py
+++ b/parts-site/configurations/debug/gcc_win32-any.py
diff --git a/parts-site/configurations/debug/intelc_win32-any_win32-x86.py b/parts-site/configurations/debug/intelc_win32-any_win32-x86.py
index c95da26..fcf2965 100644
--- a/parts-site/configurations/debug/intelc_win32-any_win32-x86.py
+++ b/parts-site/configurations/debug/intelc_win32-any_win32-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/debug/intelc_win32-any_win32-x86_64.py b/parts-site/configurations/debug/intelc_win32-any_win32-x86_64.py
index 9af6428..7e595f1 100644
--- a/parts-site/configurations/debug/intelc_win32-any_win32-x86_64.py
+++ b/parts-site/configurations/debug/intelc_win32-any_win32-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/configurations/debug/msvc_win32-any_win32-x86.py b/parts-site/configurations/debug/msvc_win32-any_win32-x86.py
index 713a33f..dc2127d 100644
--- a/parts-site/configurations/debug/msvc_win32-any_win32-x86.py
+++ b/parts-site/configurations/debug/msvc_win32-any_win32-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/debug/msvc_win32-any_win32-x86_64.py b/parts-site/configurations/debug/msvc_win32-any_win32-x86_64.py
index e665283..1cc4085 100644
--- a/parts-site/configurations/debug/msvc_win32-any_win32-x86_64.py
+++ b/parts-site/configurations/debug/msvc_win32-any_win32-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/configurations/size_optimized_release/__init__.py b/parts-site/configurations/embedded/__init__.py
index 4849215..1088b0b 100644
--- a/parts-site/configurations/size_optimized_release/__init__.py
+++ b/parts-site/configurations/embedded/__init__.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016-2017 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.
@@ -17,4 +17,4 @@
from parts.config import DefineConfiguration
-DefineConfiguration("size_optimized_release", dependsOn='default')
+DefineConfiguration("embedded", dependsOn='default')
diff --git a/parts-site/configurations/embedded/gcc.py b/parts-site/configurations/embedded/gcc.py
new file mode 100644
index 0000000..4b853a1
--- /dev/null
+++ b/parts-site/configurations/embedded/gcc.py
@@ -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.
+############################################################################
+# pylint: disable=locally-disabled, invalid-name, missing-docstring
+
+"""gcc compiler configuration for embedded
+"""
+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=[
+ # optimize for size
+ '-Os',
+ # prevent using built in stdlib replacement functions
+ '-fno-builtin',
+ '-fno-stack-protector',
+ '-fomit-frame-pointer',
+ '-fno-asynchronous-unwind-tables',
+ # allow linker to optimize out not used stuff
+ '-fdata-sections',
+ '-ffunction-sections',
+ # only export specified functions
+ '-fvisibility=hidden',
+ # shared object friendly
+ '-fPIC',
+ # treat warnings as errors
+ '-Werror',
+ # enable all warnings
+ '-Wall',
+ # extra warnings
+ '-Wextra',
+ # Allow struct initilization with {0}
+ '-Wno-missing-braces',
+ # dump stack usage to file
+ '-fstack-usage',
+ # dump control flow graph
+ '-fdump-tree-cfg-raw',
+ ],
+ CPPDEFINES=[
+ 'NDEBUG',
+ ],
+ LINKFLAGS=[
+ # do not link standard system libraries
+ '-nodefaultlibs',
+ '-nostdlib',
+ # do not use stadard system startup
+ '-nostartfiles',
+ # remove all symbol table and relocation information
+ '-s',
+ # link only what is used
+ '-Xlinker',
+ '--gc-sections',
+ ],))
diff --git a/parts-site/configurations/size_optimized_release/gcc_win32-any.py b/parts-site/configurations/embedded/gcc_win32-any.py
index d940ad1..b7ac98f 100644
--- a/parts-site/configurations/size_optimized_release/gcc_win32-any.py
+++ b/parts-site/configurations/embedded/gcc_win32-any.py
@@ -1,5 +1,5 @@
############################################################################
-# Copyright 2016-2017 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.
@@ -14,24 +14,28 @@
# limitations under the License.
############################################################################
# pylint: disable=locally-disabled, invalid-name, missing-docstring
-"""gcc compiler configuration for size
+
+"""win32 gcc compiler configuration for embedded
"""
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
+ # optimize for size
'-Os',
+ # prevent using built in stdlib replacement functions
+ '-fno-builtin',
+ '-fno-stack-protector',
+ '-fomit-frame-pointer',
+ '-fno-asynchronous-unwind-tables',
+ # allow linker to optimize out not used stuff
'-fdata-sections',
'-ffunction-sections',
# treat warnings as errors
@@ -40,25 +44,29 @@ config.VersionRange(
'-Wall',
# extra warnings
'-Wextra',
- # disable warnings due to gcc 4.8.5 issues
+ # Allow struct initilization with {0}
'-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',
+ # dump stack usage to file
+ '-fstack-usage',
+ # dump control flow graph
+ '-fdump-tree-cfg-raw',
+ ],
+ CPPDEFINES=[
+ 'NDEBUG',
+ ],
+ SHLINKFLAGS=[
+ # do not use stadard system entrypoint
+ '-e 0',
],
- CPPDEFINES=['NDEBUG', '_FORTIFY_SOURCE=2', '__int64=long long'],
LINKFLAGS=[
- '-fstack-protector',
+ # do not link standard system libraries
+ '-nodefaultlibs',
+ '-nostdlib',
+ # do not use stadard system startup
+ '-nostartfiles',
+ # remove all symbol table and relocation information
+ '-s',
# link only what is used
'-Xlinker',
- '--gc-sections'
- ], ))
+ '--gc-sections',
+ ],))
diff --git a/parts-site/configurations/size_optimized_release/g++_win32-any.py b/parts-site/configurations/embedded/intelc_posix-any.py
index aeaed20..b94b90c 100644
--- a/parts-site/configurations/size_optimized_release/g++_win32-any.py
+++ b/parts-site/configurations/embedded/intelc_posix-any.py
@@ -14,45 +14,53 @@
# limitations under the License.
############################################################################
# pylint: disable=locally-disabled, invalid-name, missing-docstring
-"""g++ compiler configuration for size
+
+"""Intel posix compiler configuration for embedded
"""
from parts.config import ConfigValues, configuration
-
def map_default_version(env):
- return env['GCC_VERSION']
-
+ return env['INTELC_VERSION']
config = configuration(map_default_version)
config.VersionRange(
- "3-*",
+ "7-*",
append=ConfigValues(
CCFLAGS=[
- '',
- # size optimization
+ # second level optimization
'-Os',
+ # prevent using built in stdlib replacement functions
+ '-fno-builtin',
+ '-fno-stack-protector',
+ '-fomit-frame-pointer',
+ '-fno-asynchronous-unwind-tables',
+ # allow linker to optimize out not used stuff
'-fdata-sections',
'-ffunction-sections',
+ # only export specified functions
+ '-fvisibility=hidden',
+ # shared object friendly
+ '-fPIC',
# 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',
],
- CPPDEFINES=['NDEBUG', '_FORTIFY_SOURCE=2', '__int64=long long'],
LINKFLAGS=[
- '-fstack-protector',
+ # do not link standard system libraries
+ '-nodefaultlibs',
+ '-nostdlib',
+ # do not use stadard system startup
+ '-nostartfiles',
+ # remove all symbol table and relocation information
+ '-s',
# link only what is used
'-Xlinker',
- '--gc-sections'
- ], ))
+ '--gc-sections',
+ ],))
diff --git a/parts-site/configurations/embedded/intelc_win32-any.py b/parts-site/configurations/embedded/intelc_win32-any.py
new file mode 100644
index 0000000..8bdde1c
--- /dev/null
+++ b/parts-site/configurations/embedded/intelc_win32-any.py
@@ -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.
+############################################################################
+# 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['INTELC_VERSION']
+
+config = configuration(map_default_version)
+
+config.VersionRange("7-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ # Compile using multiple processes
+ '/MP',
+ # SDL: Stack-based Buffer Overrun Detection
+ '/GS-',
+ # minimize size
+ '/O1',
+ # allow non standart comment in C
+ '/wd991',
+ # typedef forward with the same name
+ '/wd344',
+ # disable language extensions
+ '/Za',
+ # Use multi-thread static libc
+ '/MT',
+ # treat all warnings as errors
+ '/Wall',
+ '/WX',
+ '/nologo'],
+ CXXFLAGS=[
+ '/EHsc',
+ # disable RTTI
+ '/GR-'],
+ LINKFLAGS=[
+ # no default libraries
+ '/NODEFAULTLIB',
+ # prevent linker from references _main in dll
+ '/NOENTRY',
+ # elminiate unreferenced functions + data
+ '/OPT:REF',
+ # SDL: Data Execution Prevention
+ '/NXCOMPAT',
+ # SDL: Image Randomization
+ '/DYNAMICBASE',
+ # treat linker warnings as errors
+ '/WX',
+ '/nologo'
+ ],
+ CPPDEFINES=['NDEBUG']
+ )
+ )
diff --git a/parts-site/configurations/embedded/msvc_win32-any.py b/parts-site/configurations/embedded/msvc_win32-any.py
new file mode 100644
index 0000000..33f63ca
--- /dev/null
+++ b/parts-site/configurations/embedded/msvc_win32-any.py
@@ -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.
+############################################################################
+# pylint: disable=locally-disabled, invalid-name, missing-docstring
+"""msvc win32 compiler configuration for embedded
+"""
+from parts.config import ConfigValues, configuration
+
+
+def map_default_version(env):
+ return env['MSVC_VERSION']
+
+
+config = configuration(map_default_version)
+
+config.VersionRange(
+ "7-*",
+ append=ConfigValues(
+ CCFLAGS=[
+ # minimize size
+ '/O1',
+ # Use multi-thread static libc
+ '/MT',
+ # allow single line comment in C
+ '/wd4001',
+ # allow functions to auto inline
+ '/wd4711',
+ # allow compiler to append padding to structs
+ '/wd4820',
+ # allow while (0)
+ '/wd4127',
+ # whole program optimization
+ #'/GL',
+ # disable language extensions
+ '/Za',
+ # SDL: Stack-based Buffer Overrun Detection
+ '/GS-',
+ # SDL: Compiler settings validation
+ #'/sdl-',
+ # Compile using multiple processes
+ '/MP',
+ # treat all warnings as errors
+ '/WX',
+ '/Wall',
+ '/nologo'
+ ],
+ CXXFLAGS=[
+ '/EHsc',
+ # disable RTTI
+ '/GR-'
+ ],
+ LINKFLAGS=[
+ # no default libraries
+ '/NODEFAULTLIB',
+ # prevent linker from references _main in dll
+ '/NOENTRY',
+ # elminiate unreferenced functions + data
+ '/OPT:REF',
+ # whole program optimization
+ #'/LTCG',
+ # SDL: Data Execution Prevention
+ '/NXCOMPAT',
+ # SDL: Image Randomization
+ '/DYNAMICBASE',
+ # SDL: Safe Exception Handling
+ #'/SAFESEH', # not compatible with x64
+ # treat linker warnings as errors
+ '/WX',
+ # target platform
+ #'/MACHINE:X64',
+ '/nologo'
+ ],
+ CPPDEFINES=['NDEBUG']))
diff --git a/parts-site/configurations/release/intelc_win32-any_win32-x86.py b/parts-site/configurations/release/intelc_win32-any_win32-x86.py
index 54b8f08..0ec984a 100644
--- a/parts-site/configurations/release/intelc_win32-any_win32-x86.py
+++ b/parts-site/configurations/release/intelc_win32-any_win32-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.
@@ -42,8 +42,7 @@ config.VersionRange("7-*",
'/nologo'],
CXXFLAGS=['/EHsc',
'/GR'],
- LINKFLAGS=['/LTCG',
- '/WX',
+ LINKFLAGS=['/WX',
'/SAFESEH',
'/NXCOMPAT',
'/DYNAMICBASE',
diff --git a/parts-site/configurations/release/intelc_win32-any_win32-x86_64.py b/parts-site/configurations/release/intelc_win32-any_win32-x86_64.py
index 44e28ed..aa76509 100644
--- a/parts-site/configurations/release/intelc_win32-any_win32-x86_64.py
+++ b/parts-site/configurations/release/intelc_win32-any_win32-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.
@@ -41,8 +41,7 @@ config.VersionRange("7-*",
'/nologo'],
CXXFLAGS=['/EHsc',
'/GR'],
- LINKFLAGS=['/LTCG',
- '/WX',
+ LINKFLAGS=['/WX',
'/NXCOMPAT',
'/DYNAMICBASE',
'/MACHINE:X64',
diff --git a/parts-site/configurations/release/msvc_win32-any_win32-x86.py b/parts-site/configurations/release/msvc_win32-any_win32-x86.py
index 9f00330..4154ba3 100644
--- a/parts-site/configurations/release/msvc_win32-any_win32-x86.py
+++ b/parts-site/configurations/release/msvc_win32-any_win32-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.
@@ -48,8 +48,7 @@ config.VersionRange("7-*",
'/nologo'],
CXXFLAGS=['/EHsc',
'/GR'],
- LINKFLAGS=['/LTCG',
- '/WX',
+ LINKFLAGS=['/WX',
'/SAFESEH',
'/NXCOMPAT',
'/DYNAMICBASE',
diff --git a/parts-site/configurations/release/msvc_win32-any_win32-x86_64.py b/parts-site/configurations/release/msvc_win32-any_win32-x86_64.py
index 8ef46ef..a83c0e1 100644
--- a/parts-site/configurations/release/msvc_win32-any_win32-x86_64.py
+++ b/parts-site/configurations/release/msvc_win32-any_win32-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.
@@ -47,8 +47,7 @@ config.VersionRange("7-*",
'/nologo'],
CXXFLAGS=['/EHsc',
'/GR'],
- LINKFLAGS=['/LTCG',
- '/WX',
+ LINKFLAGS=['/WX',
'/NXCOMPAT',
'/DYNAMICBASE',
'/MACHINE:X64',
diff --git a/parts-site/configurations/size_optimized_release/g++.py b/parts-site/configurations/size_optimized_release/g++.py
deleted file mode 100644
index feb20a3..0000000
--- a/parts-site/configurations/size_optimized_release/g++.py
+++ /dev/null
@@ -1,57 +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.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""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=['',
- # size optimization
- '-Os',
- '-fdata-sections',
- '-ffunction-sections',
- # treat warnings as errors
- '-Werror',
- # enable all warnings
- '-Wall',
- # extra warnings
- '-Wextra',
- '-Wformat',
- '-Wformat-security',
- '-fstack-protector',
- '-fPIC'],
- CXXFLAGS=['',
- # modern C++ features support
- '-std=c++0x'],
- CPPDEFINES=['NDEBUG',
- '_FORTIFY_SOURCE=2'],
- LINKFLAGS=['-fstack-protector',
- '-znoexecstack',
- '-zrelro',
- '-znow',
- '-pie',
- # 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
deleted file mode 100644
index 238a878..0000000
--- a/parts-site/configurations/size_optimized_release/gcc.py
+++ /dev/null
@@ -1,65 +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.
-############################################################################
-# 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',
- '-fPIC'],
- CPPDEFINES=['NDEBUG',
- '_FORTIFY_SOURCE=2'],
- LINKFLAGS=['-fstack-protector',
- '-znoexecstack',
- '-zrelro',
- '-znow',
- '-pie',
- # 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
deleted file mode 100644
index b01de68..0000000
--- a/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86.py
+++ /dev/null
@@ -1,58 +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.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""Intel posix compiler configuration for size
-"""
-
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['INTELC_VERSION']
-
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- append=ConfigValues(
- CCFLAGS=['',
- '-O2',
- '-fdata-sections',
- '-ffunction-sections',
- # treat warnings as errors
- '-Werror',
- # enable all warnings
- '-Wall',
- # extra warnings
- '-Wextra',
- '-Wformat',
- '-Wformat-security',
- '-fstack-protector',
- '-fPIC'],
- CXXFLAGS=['',
- # modern C++ features support
- '-std=c++0x'],
- CPPDEFINES=['NDEBUG',
- '_FORTIFY_SOURCE=2'],
- LINKFLAGS=['-fstack-protector',
- '-znoexecstack',
- '-zrelro',
- '-znow',
- '-pie',
- # link only what is used
- '-Xlinker', '--gc-sections'],
- )
- )
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
deleted file mode 100644
index b56d164..0000000
--- a/parts-site/configurations/size_optimized_release/intelc_posix-any_posix-x86_64.py
+++ /dev/null
@@ -1,59 +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.
-############################################################################
-# pylint: disable=locally-disabled, invalid-name, missing-docstring
-
-"""Intel posix compiler configuration for size
-"""
-
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['INTELC_VERSION']
-
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- 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',
- '-fPIC'],
- CXXFLAGS=['',
- # modern C++ features support
- '-std=c++0x'],
- CPPDEFINES=['NDEBUG',
- '_FORTIFY_SOURCE=2'],
- LINKFLAGS=['-fstack-protector',
- '-znoexecstack',
- '-zrelro',
- '-znow',
- '-pie',
- # link only what is used
- '-Xlinker', '--gc-sections'],
- )
- )
diff --git a/parts-site/configurations/size_optimized_release/intelc_win32-any_win32-x86.py b/parts-site/configurations/size_optimized_release/intelc_win32-any_win32-x86.py
deleted file mode 100644
index e653441..0000000
--- a/parts-site/configurations/size_optimized_release/intelc_win32-any_win32-x86.py
+++ /dev/null
@@ -1,59 +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 size
-"""
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['INTELC_VERSION']
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- append=ConfigValues(
- CCFLAGS=['',
- # size optimization
- '/O2',
- '/Os',
- '/Gy',
- '/Oi',
- '/MP',
- '/GS',
- '/W4',
- '/Gy',
- '/Zc:wchar_t',
- '/Z7',
- '/fp:precise',
- '/WX',
- '/Zc:forScope',
- '/Gd',
- '/MT',
- '/nologo'],
- CXXFLAGS=['/EHsc',
- '/GR'],
- LINKFLAGS=['/LTCG',
- '/WX',
- '/SAFESEH',
- '/NXCOMPAT',
- '/DYNAMICBASE',
- '/nologo',
- # link only what is used
- '/OPT:REF'],
- CPPDEFINES=['NDEBUG']
- )
- )
diff --git a/parts-site/configurations/size_optimized_release/intelc_win32-any_win32-x86_64.py b/parts-site/configurations/size_optimized_release/intelc_win32-any_win32-x86_64.py
deleted file mode 100644
index 4bad016..0000000
--- a/parts-site/configurations/size_optimized_release/intelc_win32-any_win32-x86_64.py
+++ /dev/null
@@ -1,58 +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 size
-"""
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['INTELC_VERSION']
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- append=ConfigValues(
- CCFLAGS=['',
- # size optimization
- '/O2',
- '/Os',
- '/Gy',
- '/Oi',
- '/MP',
- '/GS',
- '/W4',
- '/Gy',
- '/Zc:wchar_t',
- '/Z7',
- '/fp:precise',
- '/WX',
- '/Zc:forScope',
- '/MT',
- '/nologo'],
- CXXFLAGS=['/EHsc',
- '/GR'],
- LINKFLAGS=['/LTCG',
- '/WX',
- '/NXCOMPAT',
- '/DYNAMICBASE',
- '/MACHINE:X64',
- '/nologo',
- # link only what is used
- '/OPT:REF'],
- CPPDEFINES=['NDEBUG']
- )
- )
diff --git a/parts-site/configurations/size_optimized_release/msvc_win32-any_win32-x86.py b/parts-site/configurations/size_optimized_release/msvc_win32-any_win32-x86.py
deleted file mode 100644
index ddcf1ae..0000000
--- a/parts-site/configurations/size_optimized_release/msvc_win32-any_win32-x86.py
+++ /dev/null
@@ -1,65 +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 size
-"""
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['MSVC_VERSION']
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- append=ConfigValues(
- CCFLAGS=['',
- # size optimization
- '/O2',
- '/Os',
- '/Gy',
- '/Oi',
- '/MP',
- '/GS',
- '/W4',
- '/wd4127', # allow while (0)
- '/wd4592', # VS2015U1 limitation
- #'/wd4366', # ok unaligned &
- #'/wd4204', # allow x= {a,b}
- #'/wd4221', # allow x = {&y}
- '/Gy',
- '/Zc:wchar_t',
- '/Z7',
- '/fp:precise',
- '/WX',
- '/Zc:forScope',
- '/Gd',
- '/MT',
- '/sdl',
- '/nologo'],
- CXXFLAGS=['/EHsc',
- '/GR'],
- LINKFLAGS=['/LTCG',
- '/WX',
- '/SAFESEH',
- '/NXCOMPAT',
- '/DYNAMICBASE',
- '/nologo',
- # link only what is used
- '/OPT:REF'],
- CPPDEFINES=['NDEBUG']
- )
- )
diff --git a/parts-site/configurations/size_optimized_release/msvc_win32-any_win32-x86_64.py b/parts-site/configurations/size_optimized_release/msvc_win32-any_win32-x86_64.py
deleted file mode 100644
index a404a06..0000000
--- a/parts-site/configurations/size_optimized_release/msvc_win32-any_win32-x86_64.py
+++ /dev/null
@@ -1,64 +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 size
-"""
-from parts.config import ConfigValues, configuration
-
-def map_default_version(env):
- return env['MSVC_VERSION']
-
-config = configuration(map_default_version)
-
-config.VersionRange("7-*",
- append=ConfigValues(
- CCFLAGS=['',
- # size optimization
- '/O2',
- '/Os',
- '/Gy',
- '/Oi',
- '/MP',
- '/GS',
- '/W4',
- '/wd4127', # allow while (0)
- '/wd4592', # VS2015U1 limitation
- #'/wd4366', # ok unaligned &
- #'/wd4204', # allow x= {a,b}
- #'/wd4221', # allow x = {&y}
- '/Gy',
- '/Zc:wchar_t',
- '/Z7',
- '/fp:precise',
- '/WX',
- '/Zc:forScope',
- '/MT',
- '/sdl',
- '/nologo'],
- CXXFLAGS=['/EHsc',
- '/GR'],
- LINKFLAGS=['/LTCG',
- '/WX',
- '/NXCOMPAT',
- '/DYNAMICBASE',
- '/MACHINE:X64',
- '/nologo',
- # link only what is used
- '/OPT:REF'],
- CPPDEFINES=['NDEBUG']
- )
- )
diff --git a/tools/Makefile b/tools/Makefile
index b3b402f..c79e980 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -30,7 +30,7 @@ REVOKESIG_EXE = ./revokesig/src/revokesig$(EXE_EXTENSION)
EPID_SDK_ROOT_DIR = ..
EXAMPLE_DIR = $(EPID_SDK_ROOT_DIR)/example
-LIB_DROPT_DIR = $(EPID_SDK_ROOT_DIR)/ext/dropt/src
+LIB_ARGTABLE_DIR = $(EPID_SDK_ROOT_DIR)/ext/argtable3
LIB_UTIL_DIR = $(EPID_SDK_ROOT_DIR)/example/util/src
LIB_IPPCP_DIR = $(EPID_SDK_ROOT_DIR)/ext/ipp/sources/ippcp/src
LIB_MEMBER_DIR = $(EPID_SDK_ROOT_DIR)/epid/member
@@ -38,11 +38,11 @@ LIB_COMMON_DIR = $(EPID_SDK_ROOT_DIR)/epid/common
#set linker flags
LDFLAGS += -L$(LIB_UTIL_DIR) \
- -L$(LIB_DROPT_DIR) \
+ -L$(LIB_ARGTABLE_DIR) \
-L$(LIB_IPPCP_DIR) \
-L$(LIB_COMMON_DIR) \
-lcommon \
- -lippcp -lutil -ldropt
+ -lippcp -lutil -largtable3
$(EXTRACTGRPS_EXE): $(EXTRACTGRPS_OBJ)
$(CC) -o $@ $^ $(LDFLAGS)
@@ -50,7 +50,7 @@ $(EXTRACTGRPS_EXE): $(EXTRACTGRPS_OBJ)
$(EXTRACTGRPS_OBJ): %.o: %.c
$(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
-I${EXAMPLE_DIR} -I$(EXTRACTGRPS_INCLUDE_DIR) \
- -I${LIB_DROPT_DIR}/../include \
+ -I${LIB_ARGTABLE_DIR} \
-c $^
$(EXTRACTKEYS_EXE): $(EXTRACTKEYS_OBJ)
@@ -59,7 +59,7 @@ $(EXTRACTKEYS_EXE): $(EXTRACTKEYS_OBJ)
$(EXTRACTKEYS_OBJ): %.o: %.c
$(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
-I${EXAMPLE_DIR} -I$(EXTRACTKEYS_INCLUDE_DIR) \
- -I${LIB_DROPT_DIR}/../include \
+ -I${LIB_ARGTABLE_DIR} \
-c $^
$(REVOKEGRP_EXE): $(REVOKEGRP_OBJ)
@@ -68,17 +68,21 @@ $(REVOKEGRP_EXE): $(REVOKEGRP_OBJ)
$(REVOKEGRP_OBJ): %.o: %.c
$(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
-I${EXAMPLE_DIR} -I$(REVOKEGRP_INCLUDE_DIR) \
- -I${LIB_DROPT_DIR}/../include \
+ -I${LIB_ARGTABLE_DIR} \
-c $^
+MEMBER_LIBS = -lmember
+ifneq ($(TINY),)
+ MEMBER_LIBS += -lmath -ltiny_stdlib
+endif
$(REVOKEKEY_EXE): $(REVOKEKEY_OBJ)
- $(CC) -o $@ $^ -L$(LIB_MEMBER_DIR) -lmember $(LDFLAGS)
+ $(CC) -o $@ $^ -L$(LIB_MEMBER_DIR) $(MEMBER_LIBS) $(LDFLAGS)
$(REVOKEKEY_OBJ): %.o: %.c
$(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
-I$(LIB_MEMBER_DIR)/../.. \
-I${EXAMPLE_DIR} -I$(REVOKEKEY_INCLUDE_DIR) \
- -I${LIB_DROPT_DIR}/../include \
+ -I${LIB_ARGTABLE_DIR} \
-c $^
$(REVOKESIG_EXE): $(REVOKESIG_OBJ)
@@ -87,7 +91,7 @@ $(REVOKESIG_EXE): $(REVOKESIG_OBJ)
$(REVOKESIG_OBJ): %.o: %.c
$(CC) -o $@ $(CFLAGS) -I$(EPID_SDK_ROOT_DIR) \
-I${EXAMPLE_DIR} -I$(REVOKESIG_INCLUDE_DIR) \
- -I${LIB_DROPT_DIR}/../include \
+ -I${LIB_ARGTABLE_DIR} \
-c $^
#target part
diff --git a/tools/extractgrps/extractgrps.parts b/tools/extractgrps/extractgrps.parts
index 93aa46c..264e63e 100644
--- a/tools/extractgrps/extractgrps.parts
+++ b/tools/extractgrps/extractgrps.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.
@@ -31,7 +31,7 @@ else:
env.DependsOn([
Component('common'),
Component('util'),
- Component('dropt')
+ Component('argtable3')
])
if env['TARGET_PLATFORM']['OS'] == 'win32':
diff --git a/tools/extractgrps/src/main.c b/tools/extractgrps/src/main.c
index 0f30d8f..d02271a 100644
--- a/tools/extractgrps/src/main.c
+++ b/tools/extractgrps/src/main.c
@@ -20,7 +20,7 @@
* \brief Extract group keys from group key output file
*/
-#include <dropt.h>
+#include <argtable3.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -33,6 +33,8 @@
#include "util/strutil.h"
#define PROGRAM_NAME "extractgrps"
+#define ARGPARSE_ERROR_MAX 20
+#define ARGTABLE_SIZE 5
#pragma pack(1)
/// Intel(R) EPID Key Output File Entry
@@ -52,138 +54,118 @@ int main(int argc, char* argv[]) {
size_t num_keys_extracted = 0;
size_t num_keys_in_file = 0;
- char* end = NULL;
FILE* file = NULL;
- unsigned int i = 0;
+ int i = 0;
size_t bytes_read = 0;
- // File to extract keys from
- static char* keyfile_name = NULL;
-
- // Number of keys to extract
- static size_t num_keys_to_extract = 0;
-
- // help flag parameter
- static bool show_help = false;
-
// Verbose flag parameter
- static bool verbose = false;
-
- dropt_option options[] = {
- {'h', "help", "display this help and exit", NULL, dropt_handle_bool,
- &show_help, dropt_attr_halt},
- {'v', "verbose", "print status messages to stdout", NULL,
- dropt_handle_bool, &verbose},
+ static bool verbose_flag = false;
+
+ struct arg_file* keyfile =
+ arg_file1(NULL, NULL, "FILE", "FILE containing keys to extract");
+ struct arg_int* num_keys_to_extract =
+ arg_int1(NULL, NULL, "NUM", "number of keys to extract");
+ struct arg_lit* help = arg_lit0(NULL, "help", "display this help and exit");
+ struct arg_lit* verbose =
+ arg_lit0("v", "verbose", "print status messages to stdout");
+ struct arg_end* end = arg_end(ARGPARSE_ERROR_MAX);
+ void* argtable[ARGTABLE_SIZE];
+ int nerrors;
+
+ /* initialize the argtable array with ptrs to the arg_xxx structures
+ * constructed above */
+ argtable[0] = keyfile;
+ argtable[1] = num_keys_to_extract;
+ argtable[2] = help;
+ argtable[3] = verbose;
+ argtable[4] = end;
- {0} /* Required sentinel value. */
- };
-
- dropt_context* dropt_ctx = NULL;
// set program name for logging
set_prog_name(PROGRAM_NAME);
do {
- dropt_ctx = dropt_new_context(options);
- if (!dropt_ctx) {
+ /* verify the argtable[] entries were allocated sucessfully */
+ if (arg_nullcheck(argtable) != 0) {
+ /* NULL entries were detected, some allocations must have failed */
+ printf("%s: insufficient memory\n", PROGRAM_NAME);
ret_value = EXIT_FAILURE;
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.
- */
- 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));
- if (dropt_error_invalid_option == dropt_get_error(dropt_ctx)) {
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- }
- ret_value = EXIT_FAILURE;
- break;
- } else if (show_help) {
- log_fmt(
- "Usage: %s [OPTION]... [FILE] [NUM]\n"
- "Extract the first NUM group certs from FILE to current "
- "directory\n"
- "\n"
- "Options:\n",
- PROGRAM_NAME);
- dropt_print_help(stdout, dropt_ctx, NULL);
- ret_value = EXIT_SUCCESS;
- break;
- } else {
- // number of arguments rest
- size_t rest_count = 0;
-
- if (verbose) {
- verbose = ToggleVerbosity();
- }
-
- // count number of arguments rest
- while (rest[rest_count]) rest_count++;
-
- if (2 != rest_count) {
- log_error("unexpected number of arguments", *rest);
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- ret_value = EXIT_FAILURE;
- break;
- }
+ }
- keyfile_name = rest[0];
+ /* Parse the command line as defined by argtable[] */
+ nerrors = arg_parse(argc, argv, argtable);
+
+ if (help->count > 0) {
+ log_fmt(
+ "Usage: %s [OPTION]... [FILE] [NUM]\n"
+ "Extract the first NUM group certs from FILE to current "
+ "directory\n"
+ "\n"
+ "Options:\n",
+ PROGRAM_NAME);
+ arg_print_glossary(stdout, argtable, " %-25s %s\n");
+ ret_value = EXIT_SUCCESS;
+ break;
+ }
+ if (verbose->count > 0) {
+ verbose_flag = ToggleVerbosity();
+ }
+ /* If the parser returned any errors then display them and exit */
+ if (nerrors > 0) {
+ /* Display the error details contained in the arg_end struct.*/
+ arg_print_errors(stderr, end, PROGRAM_NAME);
+ fprintf(stderr, "Try '%s --help' for more information.\n", PROGRAM_NAME);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
- num_keys_to_extract = strtoul(rest[1], &end, 10);
- if ('\0' != *end) {
- log_error("input '%s' is invalid: not a valid number of group keys",
- rest[1]);
- ret_value = EXIT_FAILURE;
- break;
- }
- }
+ if (num_keys_to_extract->ival[0] < 0) {
+ log_error("unable extract negative number of keys");
+ ret_value = EXIT_FAILURE;
+ break;
}
// check file existence
- if (!FileExists(keyfile_name)) {
- log_error("cannot access '%s'", keyfile_name);
+ if (!FileExists(keyfile->filename[0])) {
+ log_error("cannot access '%s'", keyfile->filename[0]);
ret_value = EXIT_FAILURE;
break;
}
- keyfile_size = GetFileSize(keyfile_name);
+ keyfile_size = GetFileSize(keyfile->filename[0]);
if (0 != keyfile_size % sizeof(EpidBinaryGroupCertificate)) {
log_error(
"input file '%s' is invalid: does not contain integral number of "
"group keys",
- keyfile_name);
+ keyfile->filename[0]);
ret_value = EXIT_FAILURE;
break;
}
num_keys_in_file = keyfile_size / sizeof(EpidBinaryGroupCertificate);
- if (num_keys_to_extract > num_keys_in_file) {
- log_error("can not extract %d keys: only %d in file", num_keys_to_extract,
- num_keys_in_file);
+ if ((unsigned int)num_keys_to_extract->ival[0] > num_keys_in_file) {
+ log_error("can not extract %d keys: only %d in file",
+ num_keys_to_extract->ival[0], num_keys_in_file);
ret_value = EXIT_FAILURE;
break;
}
- file = fopen(keyfile_name, "rb");
+ file = fopen(keyfile->filename[0], "rb");
if (!file) {
- log_error("failed read from '%s'", keyfile_name);
+ log_error("failed read from '%s'", keyfile->filename[0]);
ret_value = EXIT_FAILURE;
break;
}
// start extraction
- for (i = 0; i < num_keys_to_extract; i++) {
+ for (i = 0; i < num_keys_to_extract->ival[0]; i++) {
EpidBinaryGroupCertificate temp;
int seek_failed = 0;
seek_failed = fseek(file, i * sizeof(temp), SEEK_SET);
bytes_read = fread(&temp, 1, sizeof(temp), file);
if (seek_failed || bytes_read != sizeof(temp)) {
- log_error("failed to extract key #%lu from '%s'", i, keyfile_name);
+ log_error("failed to extract key #%lu from '%s'", i,
+ keyfile->filename[0]);
} else {
// ulong max = 4294967295
char outkeyname[256] = {0};
@@ -192,7 +174,7 @@ int main(int argc, char* argv[]) {
memcmp(&kEpidFileTypeCode[kGroupPubKeyFile], &temp.header.file_type,
sizeof(temp.header.file_type))) {
log_error("failed to extract key #%lu from '%s': file is invalid", i,
- keyfile_name);
+ keyfile->filename[0]);
ret_value = EXIT_FAILURE;
break;
}
@@ -203,7 +185,8 @@ int main(int argc, char* argv[]) {
break;
}
if (0 != WriteLoud(&temp, sizeof(temp), outkeyname)) {
- log_error("failed to write key #%lu from '%s'", i, keyfile_name);
+ log_error("failed to write key #%lu from '%s'", i,
+ keyfile->filename[0]);
} else {
num_keys_extracted++;
}
@@ -221,7 +204,7 @@ int main(int argc, char* argv[]) {
file = NULL;
}
- dropt_free_context(dropt_ctx);
+ arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
return ret_value;
}
diff --git a/tools/extractkeys/extractkeys.parts b/tools/extractkeys/extractkeys.parts
index 89e3f0d..e441513 100644
--- a/tools/extractkeys/extractkeys.parts
+++ b/tools/extractkeys/extractkeys.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.
@@ -31,7 +31,7 @@ else:
env.DependsOn([
Component('common'),
Component('util'),
- Component('dropt')
+ Component('argtable3')
])
if env['TARGET_PLATFORM']['OS'] == 'win32':
diff --git a/tools/extractkeys/src/main.c b/tools/extractkeys/src/main.c
index dd97986..21e928a 100644
--- a/tools/extractkeys/src/main.c
+++ b/tools/extractkeys/src/main.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <dropt.h>
+#include <argtable3.h>
#include "epid/common/types.h"
#include "util/buffutil.h"
#include "util/envutil.h"
@@ -33,7 +33,8 @@
#include "util/strutil.h"
#define PROGRAM_NAME "extractkeys"
-#define MANDATORY_PARAM_COUNT 2
+#define ARGPARSE_ERROR_MAX 20
+#define ARGTABLE_SIZE 6
#pragma pack(1)
/// Intel(R) EPID Key Output File Entry
@@ -71,111 +72,89 @@ int main(int argc, char* argv[]) {
size_t num_keys_extracted = 0;
size_t num_keys_in_file = 0;
- char* end = NULL;
FILE* file = NULL;
- // File to extract keys from
- static char* keyfile_name = NULL;
-
- // Number of keys to extract
- static size_t num_keys_to_extract = 0;
-
- // help flag parameter
- static bool show_help = false;
-
// Verbose flag parameter
- static bool verbose = false;
-
- // Compressed flag parameter
- static bool compressed = false;
+ static bool verbose_flag = false;
- unsigned int i = 0;
+ int i = 0;
size_t bytes_read = 0;
- dropt_option options[] = {
- {'c', "compressed", "extract compressed keys", NULL, dropt_handle_bool,
- &compressed},
- {'h', "help", "display this help and exit", NULL, dropt_handle_bool,
- &show_help, dropt_attr_halt},
- {'v', "verbose", "print status messages to stdout", NULL,
- dropt_handle_bool, &verbose},
+ struct arg_file* keyfile =
+ arg_file1(NULL, NULL, "FILE", "FILE containing keys to extract");
+ struct arg_int* num_keys_to_extract =
+ arg_int1(NULL, NULL, "NUM", "number of keys to extract");
+ struct arg_lit* compressed =
+ arg_lit0("c", "compressed", "extract compressed keys");
+ struct arg_lit* help = arg_lit0(NULL, "help", "display this help and exit");
+ struct arg_lit* verbose =
+ arg_lit0("v", "verbose", "print status messages to stdout");
+ struct arg_end* end = arg_end(ARGPARSE_ERROR_MAX);
+ void* argtable[ARGTABLE_SIZE];
+ int nerrors;
+
+ /* initialize the argtable array with ptrs to the arg_xxx structures
+ * constructed above */
+ argtable[0] = keyfile;
+ argtable[1] = num_keys_to_extract;
+ argtable[2] = compressed;
+ argtable[3] = help;
+ argtable[4] = verbose;
+ argtable[5] = end;
- {0} /* Required sentinel value. */
- };
-
- dropt_context* dropt_ctx = NULL;
- (void)argc;
// set program name for logging
set_prog_name(PROGRAM_NAME);
-
do {
- dropt_ctx = dropt_new_context(options);
-
- if (dropt_ctx && 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));
- if (dropt_error_invalid_option == dropt_get_error(dropt_ctx)) {
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- }
- ret_value = EXIT_FAILURE;
- break;
- } else if (show_help) {
- log_fmt(
- "Usage: %s [OPTION]... [FILE] [NUM]\n"
-
- "Extract the first NUM private keys from FILE to current "
- "directory.\n\n"
- "Options:\n",
- PROGRAM_NAME);
- dropt_print_help(stdout, dropt_ctx, NULL);
- ret_value = EXIT_SUCCESS;
- break;
- } else {
- size_t rest_count = 0;
- if (verbose) verbose = ToggleVerbosity();
-
- // count number of arguments rest
- while (rest[rest_count]) rest_count++;
- if (rest_count != MANDATORY_PARAM_COUNT) {
- log_error(
- "%s arguments: found %i positional arguments, expected %i",
- (rest_count < MANDATORY_PARAM_COUNT) ? "missing" : "too many",
- rest_count, MANDATORY_PARAM_COUNT);
-
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- ret_value = EXIT_FAILURE;
- break;
- }
-
- keyfile_name = *(rest);
+ /* verify the argtable[] entries were allocated sucessfully */
+ if (arg_nullcheck(argtable) != 0) {
+ /* NULL entries were detected, some allocations must have failed */
+ printf("%s: insufficient memory\n", PROGRAM_NAME);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
- num_keys_to_extract = strtoul(*(rest + 1), &end, 10);
- if ('\0' != *end) {
- log_error("input '%s' is invalid: not a valid number of keys",
- *(rest + 1));
- ret_value = EXIT_FAILURE;
- break;
- }
- }
+ /* Parse the command line as defined by argtable[] */
+ nerrors = arg_parse(argc, argv, argtable);
+
+ if (help->count > 0) {
+ log_fmt(
+ "Usage: %s [OPTION]... [FILE] [NUM]\n"
+ "Extract the first NUM private keys from FILE to current "
+ "directory.\n"
+ "\n"
+ "Options:\n",
+ PROGRAM_NAME);
+ arg_print_glossary(stdout, argtable, " %-25s %s\n");
+ ret_value = EXIT_SUCCESS;
+ break;
+ }
+ if (verbose->count > 0) {
+ verbose_flag = ToggleVerbosity();
+ }
+ /* If the parser returned any errors then display them and exit */
+ if (nerrors > 0) {
+ /* Display the error details contained in the arg_end struct.*/
+ arg_print_errors(stderr, end, PROGRAM_NAME);
+ fprintf(stderr, "Try '%s --help' for more information.\n", PROGRAM_NAME);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
- } else {
+ if (num_keys_to_extract->ival[0] < 0) {
+ log_error("unable extract negative number of keys");
ret_value = EXIT_FAILURE;
break;
}
// check file existence
- if (!FileExists(keyfile_name)) {
- log_error("cannot access '%s'", keyfile_name);
+ if (!FileExists(keyfile->filename[0])) {
+ log_error("cannot access '%s'", keyfile->filename[0]);
ret_value = EXIT_FAILURE;
break;
}
- keyfile_size = GetFileSize(keyfile_name);
- if (compressed) {
+ keyfile_size = GetFileSize(keyfile->filename[0]);
+ if (compressed->count > 0) {
privkey_size = sizeof(CompressedPrivKey);
privkey = &(((EpidCompressedKeyOutputFileKey*)&temp[0])->privkey);
keyfile_entry_size = sizeof(EpidCompressedKeyOutputFileKey);
@@ -189,34 +168,35 @@ int main(int argc, char* argv[]) {
log_error(
"input file '%s' is invalid: does not contain integral number of "
"keys",
- keyfile_name);
+ keyfile->filename[0]);
ret_value = EXIT_FAILURE;
break;
}
num_keys_in_file = keyfile_size / keyfile_entry_size;
- if (num_keys_to_extract > num_keys_in_file) {
- log_error("can not extract %d keys: only %d in file", num_keys_to_extract,
- num_keys_in_file);
+ if ((unsigned int)num_keys_to_extract->ival[0] > num_keys_in_file) {
+ log_error("can not extract %d keys: only %d in file",
+ num_keys_to_extract->ival[0], num_keys_in_file);
ret_value = EXIT_FAILURE;
break;
}
- file = fopen(keyfile_name, "rb");
+ file = fopen(keyfile->filename[0], "rb");
if (!file) {
- log_error("failed read from '%s'", keyfile_name);
+ log_error("failed read from '%s'", keyfile->filename[0]);
ret_value = EXIT_FAILURE;
break;
}
// start extraction
- for (i = 0; i < num_keys_to_extract; ++i) {
+ for (i = 0; i < num_keys_to_extract->ival[0]; ++i) {
int seek_failed = 0;
seek_failed = fseek(file, (int)(i * keyfile_entry_size), SEEK_SET);
bytes_read = fread(&temp, 1, keyfile_entry_size, file);
if (seek_failed || bytes_read != keyfile_entry_size) {
- log_error("failed to extract key #%lu from '%s'", i, keyfile_name);
+ log_error("failed to extract key #%lu from '%s'", i,
+ keyfile->filename[0]);
} else {
char outkeyname[256] = {0};
snprintf(outkeyname, sizeof(outkeyname), "mprivkey%010u.dat", i);
@@ -227,7 +207,8 @@ int main(int argc, char* argv[]) {
break;
}
if (0 != WriteLoud(privkey, privkey_size, outkeyname)) {
- log_error("failed to write key #%lu from '%s'", i, keyfile_name);
+ log_error("failed to write key #%lu from '%s'", i,
+ keyfile->filename[0]);
} else {
num_keys_extracted++;
}
@@ -245,8 +226,7 @@ int main(int argc, char* argv[]) {
file = NULL;
}
- dropt_free_context(dropt_ctx);
- dropt_ctx = NULL;
+ arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
return ret_value;
}
diff --git a/tools/revokegrp/revokegrp.parts b/tools/revokegrp/revokegrp.parts
index 053c88f..ca95854 100644
--- a/tools/revokegrp/revokegrp.parts
+++ b/tools/revokegrp/revokegrp.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.
@@ -31,7 +31,7 @@ else:
env.DependsOn([
Component('common'),
Component('util'),
- Component('dropt')
+ Component('argtable3')
])
if env['TARGET_PLATFORM']['OS'] == 'win32':
diff --git a/tools/revokegrp/src/main.c b/tools/revokegrp/src/main.c
index 0716a5a..fc55e66 100644
--- a/tools/revokegrp/src/main.c
+++ b/tools/revokegrp/src/main.c
@@ -21,7 +21,7 @@
*
*/
-#include <dropt.h>
+#include <argtable3.h>
#include <stdlib.h>
#include <string.h>
#include "epid/common/file_parser.h"
@@ -38,7 +38,12 @@ const OctStr16 kEpidFileVersion = {2, 0};
#define REASON_DEFAULT 0
#define GROUP_PUB_KEY_SIZE \
(sizeof(EpidFileHeader) + sizeof(GroupPubKey) + sizeof(EcdsaSignature))
-#define STRINGIZE(a) #a
+#define ARGPARSE_ERROR_MAX 20
+#define ARGTABLE_SIZE 7
+
+// Defined function to get defined number as string
+#define STRINGIZE_(x) #x
+#define STRINGIZE(x) STRINGIZE_(x)
#pragma pack(1)
/// Group revocation request entry
@@ -88,122 +93,103 @@ int main(int argc, char* argv[]) {
// User Settings
- // Group revocation request file name parameter
- static char* req_file = NULL;
-
- // Group public key file name parameter
- static char* pubkey_file = NULL;
-
- // CA certificate file name parameter
- static char* cacert_file = NULL;
-
- // Revocation reason
- static uint32_t reason = REASON_DEFAULT;
-
- // help flag parameter
- static bool show_help = false;
-
// Verbose flag parameter
- static bool verbose = false;
-
- dropt_option options[] = {
- {'\0', "gpubkey",
- "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")",
- "FILE", dropt_handle_string, &pubkey_file},
- {'\0', "capubkey", "load IoT Issuing CA public key from FILE", "FILE",
- dropt_handle_string, &cacert_file},
- {'\0', "reason",
- "revocation reason (default: " STRINGIZE(REASON_DEFAULT) ")", "FILE",
- dropt_handle_uint, &reason},
- {'\0', "req",
- "append signature revocation request to FILE (default: " REQFILE_DEFAULT
- ")",
- "FILE", dropt_handle_string, &req_file},
-
- {'h', "help", "display this help and exit", NULL, dropt_handle_bool,
- &show_help, dropt_attr_halt},
- {'v', "verbose", "print status messages to stdout", NULL,
- dropt_handle_bool, &verbose},
-
- {0} /* Required sentinel value. */
- };
- dropt_context* dropt_ctx = NULL;
+ static bool verbose_flag = false;
+
+ struct arg_file* pubkey_file = arg_file0(
+ NULL, "gpubkey", "FILE",
+ "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")");
+ struct arg_file* cacert_file = arg_file1(
+ NULL, "capubkey", "FILE", "load IoT Issuing CA public key from FILE");
+ struct arg_int* reason =
+ arg_int0(NULL, "reason", "NUM",
+ "revocation reason (default: " STRINGIZE(REASON_DEFAULT) ")");
+ struct arg_file* req_file = arg_file0(
+ NULL, "req", "FILE",
+ "append signature revocation request to FILE (default: " REQFILE_DEFAULT
+ ")");
+ struct arg_lit* help = arg_lit0(NULL, "help", "display this help and exit");
+ struct arg_lit* verbose =
+ arg_lit0("v", "verbose", "print status messages to stdout");
+ struct arg_end* end = arg_end(ARGPARSE_ERROR_MAX);
+ void* argtable[ARGTABLE_SIZE];
+ int nerrors;
+
+ /* initialize the argtable array with ptrs to the arg_xxx structures
+ * constructed above */
+ argtable[0] = pubkey_file;
+ argtable[1] = cacert_file;
+ argtable[2] = reason;
+ argtable[3] = req_file;
+ argtable[4] = help;
+ argtable[5] = verbose;
+ argtable[6] = end;
+
// set program name for logging
set_prog_name(PROGRAM_NAME);
do {
- dropt_ctx = dropt_new_context(options);
- if (!dropt_ctx) {
+ /* verify the argtable[] entries were allocated sucessfully */
+ if (arg_nullcheck(argtable) != 0) {
+ /* NULL entries were detected, some allocations must have failed */
+ printf("%s: insufficient memory\n", PROGRAM_NAME);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
+
+ /* set any command line default values prior to parsing */
+ pubkey_file->filename[0] = PUBKEYFILE_DEFAULT;
+ req_file->filename[0] = REQFILE_DEFAULT;
+ reason->ival[0] = REASON_DEFAULT;
+
+ /* Parse the command line as defined by argtable[] */
+ nerrors = arg_parse(argc, argv, argtable);
+
+ if (help->count > 0) {
+ log_fmt(
+ "Usage: %s [OPTION]...\n"
+ "Revoke Intel(R) EPID group\n"
+ "\n"
+ "Options:\n",
+ PROGRAM_NAME);
+ arg_print_glossary(stdout, argtable, " %-25s %s\n");
+ ret_value = EXIT_SUCCESS;
+ break;
+ }
+ if (verbose->count > 0) {
+ verbose_flag = ToggleVerbosity();
+ }
+ /* If the parser returned any errors then display them and exit */
+ if (nerrors > 0) {
+ /* Display the error details contained in the arg_end struct.*/
+ arg_print_errors(stderr, end, PROGRAM_NAME);
+ fprintf(stderr, "Try '%s --help' for more information.\n", PROGRAM_NAME);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
+ if (reason->ival[0] < 0 || reason->ival[0] > UCHAR_MAX) {
+ log_error(
+ "unexpected reason value. Value of the reason must be in a range "
+ "from 0 to %d",
+ UCHAR_MAX);
ret_value = EXIT_FAILURE;
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.
- */
- 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));
- if (dropt_error_invalid_option == dropt_get_error(dropt_ctx)) {
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- }
- ret_value = EXIT_FAILURE;
- break;
- } else if (show_help) {
- log_fmt(
- "Usage: %s [OPTION]...\n"
- "Revoke Intel(R) EPID group\n"
- "\n"
- "Options:\n",
- PROGRAM_NAME);
- dropt_print_help(stdout, dropt_ctx, NULL);
- ret_value = EXIT_SUCCESS;
- break;
- } else if (*rest) {
- // we have unparsed (positional) arguments
- log_error("invalid argument: %s", *rest);
- fprintf(stderr, "Try '%s --help' for more information\n", PROGRAM_NAME);
- ret_value = EXIT_FAILURE;
- break;
- } else {
- if (reason > UCHAR_MAX) {
- log_error(
- "unexpected reason value. Value of the reason must be lesser or "
- "equal to %d",
- UCHAR_MAX);
- ret_value = EXIT_FAILURE;
- break;
- }
- if (verbose) {
- verbose = ToggleVerbosity();
- }
- if (!pubkey_file) {
- pubkey_file = PUBKEYFILE_DEFAULT;
- }
- if (!cacert_file) {
- log_error("issuing CA public key must be specified");
- ret_value = EXIT_FAILURE;
- break;
- }
- if (!req_file) {
- req_file = REQFILE_DEFAULT;
- }
- if (verbose) {
- log_msg("\nOption values:");
- log_msg(" pubkey_file : %s", pubkey_file);
- log_msg(" cacert_file : %s", cacert_file);
- log_msg(" reason : %d", reason);
- log_msg(" req_file : %s", req_file);
- log_msg("");
- }
- }
+ }
+ if (verbose_flag) {
+ log_msg("\nOption values:");
+ log_msg(" pubkey_file : %s", pubkey_file->filename[0]);
+ log_msg(" cacert_file : %s", cacert_file->filename[0]);
+ log_msg(" reason : %d", reason->ival[0]);
+ log_msg(" req_file : %s", req_file->filename[0]);
+ log_msg("");
}
- ret_value = MakeRequest(cacert_file, pubkey_file, req_file, (uint8_t)reason,
- verbose);
+ ret_value = MakeRequest(cacert_file->filename[0], pubkey_file->filename[0],
+ req_file->filename[0], (uint8_t)reason->ival[0],
+ verbose_flag);
} while (0);
- dropt_free_context(dropt_ctx);
+
+ arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
+
return ret_value;
}
diff --git a/tools/revokekey/revokekey.parts b/tools/revokekey/revokekey.parts
index 5517349..57015e2 100644
--- a/tools/revokekey/revokekey.parts
+++ b/tools/revokekey/revokekey.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.
@@ -32,7 +32,7 @@ else:
Component('common'),
Component('member'),
Component('util'),
- Component('dropt')
+ Component('argtable3')
])
if env['TARGET_PLATFORM']['OS'] == 'win32':
diff --git a/tools/revokekey/src/main.c b/tools/revokekey/src/main.c
index 9efb759..d8f7d30 100644
--- a/tools/revokekey/src/main.c
+++ b/tools/revokekey/src/main.c
@@ -21,7 +21,7 @@
*
*/
-#include <dropt.h>
+#include <argtable3.h>
#include <stdlib.h>
#include <string.h>
@@ -38,6 +38,8 @@ const OctStr16 kEpidFileVersion = {2, 0};
#define PRIVKEY_DEFAULT "mprivkey.dat"
#define REQFILE_DEFAULT "privreq.dat"
#define PUBKEYFILE_DEFAULT "pubkey.bin"
+#define ARGPARSE_ERROR_MAX 20
+#define ARGTABLE_SIZE 8
/// Partial signature request, includes all but message.
typedef struct PrivRlRequestTop {
@@ -237,120 +239,104 @@ int MakeRequest(PrivKey const* priv_key, char const* req_file, bool verbose) {
int main(int argc, char* argv[]) {
int retval = EXIT_FAILURE;
- // User Settings
- // Private key file name parameter
- static char* privkey_file = NULL;
- static char* gpubkey_file = NULL;
- static char* capubkey_file = NULL;
-
- // Private key revocation request file name parameter
- static char* req_file = NULL;
-
- // help flag parameter
- static bool show_help = false;
-
// Verbose flag parameter
- static bool verbose = false;
+ static bool verbose_flag = false;
// Private key
PrivKey priv_key;
- dropt_option options[] = {
- {'\0', "mprivkey",
- "load private key to revoke from FILE (default: " PRIVKEY_DEFAULT ")",
- "FILE", dropt_handle_string, &privkey_file},
- {'\0', "req",
- "append signature revocation request to FILE (default: " REQFILE_DEFAULT
- ")",
- "FILE", dropt_handle_string, &req_file},
- {'h', "help", "display this help and exit", NULL, dropt_handle_bool,
- &show_help, dropt_attr_halt},
- {'v', "verbose", "print status messages to stdout", NULL,
- dropt_handle_bool, &verbose},
- {'\0', '\0', "The following options are only needed for compressed keys:",
- NULL, dropt_handle_string, NULL},
- {'\0', "gpubkey",
- "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")",
- "FILE", dropt_handle_string, &gpubkey_file},
- {'\0', "capubkey", "load IoT Issuing CA public key from FILE", "FILE",
- dropt_handle_string, &capubkey_file},
- {0} /* Required sentinel value. */
- };
-
- dropt_context* dropt_ctx = NULL;
+ struct arg_file* privkey_file = arg_file0(
+ NULL, "mprivkey", "FILE",
+ "load private key to revoke from FILE (default: " PRIVKEY_DEFAULT ")");
+ struct arg_file* req_file = arg_file0(
+ NULL, "req", "FILE",
+ "append signature revocation request to FILE (default: " REQFILE_DEFAULT
+ ")");
+ struct arg_lit* help = arg_lit0(NULL, "help", "display this help and exit");
+ struct arg_lit* verbose =
+ arg_lit0("v", "verbose", "print status messages to stdout");
+ struct arg_rem* comment_line = arg_rem(
+ NULL, "The following options are only needed for compressed keys:");
+ struct arg_file* gpubkey_file = arg_file0(
+ NULL, "gpubkey", "FILE",
+ "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")");
+ struct arg_file* capubkey_file = arg_file0(
+ NULL, "capubkey", "FILE", "load IoT Issuing CA public key from FILE");
+ struct arg_end* end = arg_end(ARGPARSE_ERROR_MAX);
+ void* argtable[ARGTABLE_SIZE];
+ int nerrors;
+
+ /* initialize the argtable array with ptrs to the arg_xxx structures
+ * constructed above */
+ argtable[0] = privkey_file;
+ argtable[1] = req_file;
+ argtable[2] = help;
+ argtable[3] = verbose;
+ argtable[4] = comment_line;
+ argtable[5] = gpubkey_file;
+ argtable[6] = capubkey_file;
+ argtable[7] = end;
// set program name for logging
set_prog_name(PROGRAM_NAME);
-
do {
- dropt_ctx = dropt_new_context(options);
- if (!dropt_ctx) {
+ /* verify the argtable[] entries were allocated sucessfully */
+ if (arg_nullcheck(argtable) != 0) {
+ /* NULL entries were detected, some allocations must have failed */
+ printf("%s: insufficient memory\n", PROGRAM_NAME);
retval = EXIT_FAILURE;
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.
- */
- 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));
- if (dropt_error_invalid_option == dropt_get_error(dropt_ctx)) {
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- }
- retval = EXIT_FAILURE;
- break;
- } else if (show_help) {
- log_fmt(
- "Usage: %s [OPTION]...\n"
- "Revoke Intel(R) EPID signature\n"
- "\n"
- "Options:\n",
- PROGRAM_NAME);
- dropt_print_help(stdout, dropt_ctx, NULL);
- retval = EXIT_SUCCESS;
- break;
- } else if (*rest) {
- // we have unparsed (positional) arguments
- log_error("invalid argument: %s", *rest);
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- retval = EXIT_FAILURE;
- break;
- } else {
- if (verbose) {
- verbose = ToggleVerbosity();
- }
- if (!privkey_file) {
- privkey_file = PRIVKEY_DEFAULT;
- }
- if (!gpubkey_file) {
- gpubkey_file = PUBKEYFILE_DEFAULT;
- }
- if (!req_file) {
- req_file = REQFILE_DEFAULT;
- }
- if (verbose) {
- log_msg("\nOption values:");
- log_msg(" mprivkey : %s", privkey_file);
- log_msg(" req : %s", req_file);
- log_msg(" gpubkey : %s", gpubkey_file);
- log_msg(" capubkey : %s", capubkey_file);
- log_msg("");
- }
- }
}
- retval = OpenKey(privkey_file, gpubkey_file, capubkey_file, &priv_key);
+ /* set any command line default values prior to parsing */
+ privkey_file->filename[0] = PRIVKEY_DEFAULT;
+ gpubkey_file->filename[0] = PUBKEYFILE_DEFAULT;
+ req_file->filename[0] = REQFILE_DEFAULT;
+ capubkey_file->filename[0] = NULL;
+
+ /* Parse the command line as defined by argtable[] */
+ nerrors = arg_parse(argc, argv, argtable);
+
+ if (help->count > 0) {
+ log_fmt(
+ "Usage: %s [OPTION]...\n"
+ "Revoke Intel(R) EPID signature\n"
+ "\n"
+ "Options:\n",
+ PROGRAM_NAME);
+ arg_print_glossary(stdout, argtable, " %-25s %s\n");
+ retval = EXIT_SUCCESS;
+ break;
+ }
+ if (verbose->count > 0) {
+ verbose_flag = ToggleVerbosity();
+ }
+ /* If the parser returned any errors then display them and exit */
+ if (nerrors > 0) {
+ /* Display the error details contained in the arg_end struct.*/
+ arg_print_errors(stderr, end, PROGRAM_NAME);
+ fprintf(stderr, "Try '%s --help' for more information.\n", PROGRAM_NAME);
+ retval = EXIT_FAILURE;
+ break;
+ }
+ if (verbose_flag) {
+ log_msg("\nOption values:");
+ log_msg(" mprivkey : %s", privkey_file->filename[0]);
+ log_msg(" req : %s", req_file->filename[0]);
+ log_msg(" gpubkey : %s", gpubkey_file->filename[0]);
+ log_msg(" capubkey : %s", capubkey_file->filename[0]);
+ log_msg("");
+ }
+
+ retval = OpenKey(privkey_file->filename[0], gpubkey_file->filename[0],
+ capubkey_file->filename[0], &priv_key);
if (EXIT_SUCCESS != retval) {
break;
}
- retval = MakeRequest(&priv_key, req_file, verbose);
+ retval = MakeRequest(&priv_key, req_file->filename[0], verbose_flag);
} while (0);
- dropt_free_context(dropt_ctx);
+ arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
return retval;
}
diff --git a/tools/revokesig/revokesig.parts b/tools/revokesig/revokesig.parts
index 5dc108d..3343c31 100644
--- a/tools/revokesig/revokesig.parts
+++ b/tools/revokesig/revokesig.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.
@@ -31,7 +31,7 @@ else:
env.DependsOn([
Component('common'),
Component('util'),
- Component('dropt')
+ Component('argtable3')
])
if env['TARGET_PLATFORM']['OS'] == 'win32':
diff --git a/tools/revokesig/src/main.c b/tools/revokesig/src/main.c
index 9a1ea35..91264a4 100644
--- a/tools/revokesig/src/main.c
+++ b/tools/revokesig/src/main.c
@@ -21,7 +21,7 @@
*
*/
-#include <dropt.h>
+#include <argtable3.h>
#include <stdlib.h>
#include <string.h>
#include "epid/common/file_parser.h"
@@ -36,6 +36,8 @@
#define SIG_DEFAULT "sig.dat"
#define GROUP_PUB_KEY_SIZE \
(sizeof(EpidFileHeader) + sizeof(GroupPubKey) + sizeof(EcdsaSignature))
+#define ARGPARSE_ERROR_MAX 20
+#define ARGTABLE_SIZE 9
#pragma pack(1)
/// Partial signature request, includes components through sig.
@@ -107,147 +109,124 @@ int main(int argc, char* argv[]) {
// intermediate return value for C style functions
int ret_value = EXIT_FAILURE;
- // Signature file name parameter
- static char* sig_file = NULL;
-
// Message string parameter
static char* msg_str = NULL;
size_t msg_size = 0;
- static char* msg_file = NULL;
char* msg_buf = NULL; // message loaded from msg_file
- // Signature revocation request file name parameter
- static char* req_file = NULL;
-
- // Group public key file name parameter
- static char* pubkey_file = NULL;
-
- // CA certificate file name parameter
- static char* cacert_file = NULL;
-
- // help flag parameter
- static bool show_help = false;
-
// Verbose flag parameter
- static bool verbose = false;
-
- dropt_option options[] = {
- {'\0', "sig",
- "load signature to revoke from FILE (default: " SIG_DEFAULT ")", "FILE",
- dropt_handle_string, &sig_file},
- {'\0', "msg", "MESSAGE used to generate signature to revoke", "MESSAGE",
- dropt_handle_string, &msg_str},
- {'\0', "msgfile",
- "FILE containing message used to generate signature to revoke", "FILE",
- dropt_handle_string, &msg_file},
- {'\0', "gpubkey",
- "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")",
- "FILE", dropt_handle_string, &pubkey_file},
- {'\0', "capubkey", "load IoT Issuing CA public key from FILE", "FILE",
- dropt_handle_string, &cacert_file},
- {'\0', "req",
- "append signature revocation request to FILE (default: " REQFILE_DEFAULT
- ")",
- "FILE", dropt_handle_string, &req_file},
-
- {'h', "help", "display this help and exit", NULL, dropt_handle_bool,
- &show_help, dropt_attr_halt},
- {'v', "verbose", "print status messages to stdout", NULL,
- dropt_handle_bool, &verbose},
-
- {0} /* Required sentinel value. */
- };
-
- dropt_context* dropt_ctx = NULL;
+ static bool verbose_flag = false;
+
+ struct arg_file* sig_file = arg_file0(
+ NULL, "sig", "FILE",
+ "load signature to revoke from FILE (default: " SIG_DEFAULT ")");
+ struct arg_str* msg =
+ arg_str0(NULL, "msg", "MESSAGE",
+ "MESSAGE used to generate signature to revoke (default: empty)");
+ struct arg_file* msg_file =
+ arg_file0(NULL, "msgfile", "FILE",
+ "FILE containing message used to generate signature to revoke");
+ struct arg_file* pubkey_file = arg_file0(
+ NULL, "gpubkey", "FILE",
+ "load group public key from FILE (default: " PUBKEYFILE_DEFAULT ")");
+ struct arg_file* cacert_file = arg_file1(
+ NULL, "capubkey", "FILE", "load IoT Issuing CA public key from FILE");
+ struct arg_file* req_file = arg_file0(
+ NULL, "req", "FILE",
+ "append signature revocation request to FILE (default: " REQFILE_DEFAULT
+ ")");
+ struct arg_lit* help = arg_lit0(NULL, "help", "display this help and exit");
+ struct arg_lit* verbose =
+ arg_lit0("v", "verbose", "print status messages to stdout");
+ struct arg_end* end = arg_end(ARGPARSE_ERROR_MAX);
+ void* argtable[ARGTABLE_SIZE];
+ int nerrors;
+
+ /* initialize the argtable array with ptrs to the arg_xxx structures
+ * constructed above */
+ argtable[0] = sig_file;
+ argtable[1] = msg;
+ argtable[2] = msg_file;
+ argtable[3] = pubkey_file;
+ argtable[4] = cacert_file;
+ argtable[5] = req_file;
+ argtable[6] = help;
+ argtable[7] = verbose;
+ argtable[8] = end;
+
// set program name for logging
set_prog_name(PROGRAM_NAME);
do {
- dropt_ctx = dropt_new_context(options);
- if (!dropt_ctx) {
+ /* verify the argtable[] entries were allocated sucessfully */
+ if (arg_nullcheck(argtable) != 0) {
+ /* NULL entries were detected, some allocations must have failed */
+ printf("%s: insufficient memory\n", PROGRAM_NAME);
ret_value = EXIT_FAILURE;
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.
- */
- 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));
- if (dropt_error_invalid_option == dropt_get_error(dropt_ctx)) {
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
- }
- ret_value = EXIT_FAILURE;
- break;
- } else if (show_help) {
- log_fmt(
- "Usage: %s [OPTION]...\n"
- "Revoke Intel(R) EPID signature\n"
- "\n"
- "Options:\n",
- PROGRAM_NAME);
- dropt_print_help(stdout, dropt_ctx, NULL);
- ret_value = EXIT_SUCCESS;
- break;
- } else if (*rest) {
- // we have unparsed (positional) arguments
- log_error("invalid argument: %s", *rest);
- fprintf(stderr, "Try '%s --help' for more information.\n",
- PROGRAM_NAME);
+ }
+
+ /* set any command line default values prior to parsing */
+ sig_file->filename[0] = SIG_DEFAULT;
+ pubkey_file->filename[0] = PUBKEYFILE_DEFAULT;
+ req_file->filename[0] = REQFILE_DEFAULT;
+
+ /* Parse the command line as defined by argtable[] */
+ nerrors = arg_parse(argc, argv, argtable);
+
+ if (help->count > 0) {
+ log_fmt(
+ "Usage: %s [OPTION]...\n"
+ "Revoke Intel(R) EPID signature\n"
+ "\n"
+ "Options:\n",
+ PROGRAM_NAME);
+ arg_print_glossary(stdout, argtable, " %-25s %s\n");
+ ret_value = EXIT_SUCCESS;
+ break;
+ }
+ if (verbose->count > 0) {
+ verbose_flag = ToggleVerbosity();
+ }
+ /* If the parser returned any errors then display them and exit */
+ if (nerrors > 0) {
+ /* Display the error details contained in the arg_end struct.*/
+ arg_print_errors(stderr, end, PROGRAM_NAME);
+ fprintf(stderr, "Try '%s --help' for more information.\n", PROGRAM_NAME);
+ ret_value = EXIT_FAILURE;
+ break;
+ }
+
+ if (msg->count > 0 && msg_file->count > 0) {
+ log_error("options --msg and --msgfile cannot be used together");
+ ret_value = EXIT_FAILURE;
+ break;
+ } else if (msg->count > 0) {
+ msg_str = (char*)msg->sval[0];
+ msg_size = strlen(msg_str);
+ } else if (msg_file->count > 0) {
+ msg_buf = NewBufferFromFile(msg_file->filename[0], &msg_size);
+ if (!msg_buf) {
ret_value = EXIT_FAILURE;
break;
- } else {
- if (verbose) {
- verbose = ToggleVerbosity();
- }
- if (!sig_file) {
- sig_file = SIG_DEFAULT;
- }
-
- if (msg_str && msg_file) {
- log_error("--msg and --msgfile cannot be used together");
- ret_value = EXIT_FAILURE;
- break;
- } else if (msg_str) {
- msg_size = strlen(msg_str);
- } else if (msg_file) {
- msg_buf = NewBufferFromFile(msg_file, &msg_size);
- if (!msg_buf) {
- ret_value = EXIT_FAILURE;
- break;
- }
- msg_str = msg_buf;
- } else {
- msg_size = 0;
- }
-
- if (!pubkey_file) {
- pubkey_file = PUBKEYFILE_DEFAULT;
- }
- if (!cacert_file) {
- log_error("issuing CA public key must be specified");
- ret_value = EXIT_FAILURE;
- break;
- }
- if (!req_file) {
- req_file = REQFILE_DEFAULT;
- }
- if (verbose) {
- log_msg("\nOption values:");
- log_msg(" sig_file : %s", sig_file);
- log_msg(" msg_str : %s", msg_str);
- log_msg(" pubkey_file : %s", pubkey_file);
- log_msg(" cacert_file : %s", cacert_file);
- log_msg(" req_file : %s", req_file);
- log_msg("");
- }
}
+ msg_str = msg_buf;
+ } else {
+ msg_size = 0;
+ }
+
+ if (verbose_flag) {
+ log_msg("\nOption values:");
+ log_msg(" sig_file : %s", sig_file->filename[0]);
+ log_msg(" msg_str : %s", msg_str);
+ log_msg(" pubkey_file : %s", pubkey_file->filename[0]);
+ log_msg(" cacert_file : %s", cacert_file->filename[0]);
+ log_msg(" req_file : %s", req_file->filename[0]);
+ log_msg("");
}
- ret_value = MakeRequest(cacert_file, sig_file, pubkey_file, req_file,
- msg_str, msg_size, verbose);
+ ret_value = MakeRequest(cacert_file->filename[0], sig_file->filename[0],
+ pubkey_file->filename[0], req_file->filename[0],
+ msg_str, msg_size, verbose_flag);
} while (0);
if (msg_buf) {
@@ -255,7 +234,7 @@ int main(int argc, char* argv[]) {
msg_buf = NULL;
}
- dropt_free_context(dropt_ctx);
+ arg_freetable(argtable, sizeof(argtable) / sizeof(argtable[0]));
return ret_value;
}
@@ -389,7 +368,7 @@ int MakeRequest(char const* cacert_file, char const* sig_file,
log_msg("");
log_msg(" [in] Signature Len: %d", (int)sig_size);
log_msg(" [in] Signature: ");
- PrintBuffer(&sig, sig_size);
+ PrintBuffer(sig, sig_size);
log_msg("");
log_msg(" [in] Message Len: %d", (int)msg_size);
log_msg(" [in] Message: ");