Copy disabled (too large)
Download .txt
Showing preview only (13,295K chars total). Download the full file to get everything.
Repository: wchuanmu/RfTPM
Branch: main
Commit: b35536b01d03
Files: 1163
Total size: 12.5 MB
Directory structure:
gitextract_jxt2uhi3/
├── README.md
├── cryptomini/
│ ├── .vscode/
│ │ └── settings.json
│ ├── README.md
│ ├── aes/
│ │ ├── aes_cbc.c
│ │ ├── aes_core.c
│ │ └── aes_local.h
│ ├── bn/
│ │ ├── README.pod
│ │ ├── bn_add.c
│ │ ├── bn_asm.c
│ │ ├── bn_ctx.c
│ │ ├── bn_div.c
│ │ ├── bn_exp.c
│ │ ├── bn_gcd.c
│ │ ├── bn_intern.c
│ │ ├── bn_lib.c
│ │ ├── bn_local.h
│ │ ├── bn_mod.c
│ │ ├── bn_mont.c
│ │ ├── bn_mul.c
│ │ ├── bn_nist.c
│ │ ├── bn_rand.c
│ │ ├── bn_recp.c
│ │ ├── bn_shift.c
│ │ ├── bn_sqr.c
│ │ ├── bn_word.c
│ │ └── rsaz_exp.h
│ ├── camellia/
│ │ ├── camellia.c
│ │ ├── cmll_local.h
│ │ └── cmll_misc.c
│ ├── cryptlib.c
│ ├── e_os.h
│ ├── ec/
│ │ ├── ec_cvt.c
│ │ ├── ec_key.c
│ │ ├── ec_lib.c
│ │ ├── ec_local.h
│ │ ├── ec_mult.c
│ │ ├── ecdh_ossl.c
│ │ ├── ecp_mont.c
│ │ ├── ecp_nist.c
│ │ └── ecp_smpl.c
│ ├── include/
│ │ ├── crypto/
│ │ │ ├── __DECC_INCLUDE_EPILOGUE.H
│ │ │ ├── __DECC_INCLUDE_PROLOGUE.H
│ │ │ ├── aria.h
│ │ │ ├── asn1.h
│ │ │ ├── async.h
│ │ │ ├── bn.h
│ │ │ ├── bn_conf.h
│ │ │ ├── bn_conf.h.in
│ │ │ ├── bn_dh.h
│ │ │ ├── bn_srp.h
│ │ │ ├── chacha.h
│ │ │ ├── cryptlib.h
│ │ │ ├── ctype.h
│ │ │ ├── dso_conf.h
│ │ │ ├── dso_conf.h.in
│ │ │ ├── ec.h
│ │ │ ├── engine.h
│ │ │ ├── err.h
│ │ │ ├── evp.h
│ │ │ ├── lhash.h
│ │ │ ├── md32_common.h
│ │ │ ├── objects.h
│ │ │ ├── poly1305.h
│ │ │ ├── rand.h
│ │ │ ├── sha.h
│ │ │ ├── siphash.h
│ │ │ ├── sm2.h
│ │ │ ├── sm2err.h
│ │ │ ├── sm3.h
│ │ │ ├── sm4.h
│ │ │ ├── store.h
│ │ │ └── x509.h
│ │ ├── intercept/
│ │ │ └── intercept.h
│ │ ├── internal/
│ │ │ ├── __DECC_INCLUDE_EPILOGUE.H
│ │ │ ├── __DECC_INCLUDE_PROLOGUE.H
│ │ │ ├── bio.h
│ │ │ ├── comp.h
│ │ │ ├── conf.h
│ │ │ ├── constant_time.h
│ │ │ ├── cryptlib.h
│ │ │ ├── dane.h
│ │ │ ├── dso.h
│ │ │ ├── dsoerr.h
│ │ │ ├── err.h
│ │ │ ├── nelem.h
│ │ │ ├── numbers.h
│ │ │ ├── o_dir.h
│ │ │ ├── o_str.h
│ │ │ ├── refcount.h
│ │ │ ├── sockets.h
│ │ │ ├── sslconf.h
│ │ │ ├── thread_once.h
│ │ │ └── tsan_assist.h
│ │ └── openssl/
│ │ ├── __DECC_INCLUDE_EPILOGUE.H
│ │ ├── __DECC_INCLUDE_PROLOGUE.H
│ │ ├── aes.h
│ │ ├── asn1.h
│ │ ├── asn1_mac.h
│ │ ├── asn1err.h
│ │ ├── asn1t.h
│ │ ├── async.h
│ │ ├── asyncerr.h
│ │ ├── bio.h
│ │ ├── bioerr.h
│ │ ├── blowfish.h
│ │ ├── bn.h
│ │ ├── bnerr.h
│ │ ├── buffer.h
│ │ ├── buffererr.h
│ │ ├── camellia.h
│ │ ├── cast.h
│ │ ├── cmac.h
│ │ ├── cms.h
│ │ ├── cmserr.h
│ │ ├── comp.h
│ │ ├── comperr.h
│ │ ├── conf.h
│ │ ├── conf_api.h
│ │ ├── conferr.h
│ │ ├── crypto.h
│ │ ├── cryptoerr.h
│ │ ├── ct.h
│ │ ├── cterr.h
│ │ ├── des.h
│ │ ├── dh.h
│ │ ├── dherr.h
│ │ ├── dsa.h
│ │ ├── dsaerr.h
│ │ ├── dtls1.h
│ │ ├── e_os2.h
│ │ ├── ebcdic.h
│ │ ├── ec.h
│ │ ├── ecdh.h
│ │ ├── ecdsa.h
│ │ ├── ecerr.h
│ │ ├── engine.h
│ │ ├── engineerr.h
│ │ ├── err.h
│ │ ├── evp.h
│ │ ├── evperr.h
│ │ ├── hmac.h
│ │ ├── idea.h
│ │ ├── kdf.h
│ │ ├── kdferr.h
│ │ ├── lhash.h
│ │ ├── md2.h
│ │ ├── md4.h
│ │ ├── md5.h
│ │ ├── mdc2.h
│ │ ├── modes.h
│ │ ├── obj_mac.h
│ │ ├── objects.h
│ │ ├── objectserr.h
│ │ ├── ocsp.h
│ │ ├── ocsperr.h
│ │ ├── opensslconf.h
│ │ ├── opensslconf.h.in
│ │ ├── opensslv.h
│ │ ├── ossl_typ.h
│ │ ├── pem.h
│ │ ├── pem2.h
│ │ ├── pemerr.h
│ │ ├── pkcs12.h
│ │ ├── pkcs12err.h
│ │ ├── pkcs7.h
│ │ ├── pkcs7err.h
│ │ ├── rand.h
│ │ ├── rand_drbg.h
│ │ ├── randerr.h
│ │ ├── rc2.h
│ │ ├── rc4.h
│ │ ├── rc5.h
│ │ ├── ripemd.h
│ │ ├── rsa.h
│ │ ├── rsaerr.h
│ │ ├── safestack.h
│ │ ├── seed.h
│ │ ├── sha.h
│ │ ├── srp.h
│ │ ├── srtp.h
│ │ ├── ssl.h
│ │ ├── ssl2.h
│ │ ├── ssl3.h
│ │ ├── sslerr.h
│ │ ├── stack.h
│ │ ├── store.h
│ │ ├── storeerr.h
│ │ ├── symhacks.h
│ │ ├── tls1.h
│ │ ├── ts.h
│ │ ├── tserr.h
│ │ ├── txt_db.h
│ │ ├── ui.h
│ │ ├── uierr.h
│ │ ├── whrlpool.h
│ │ ├── x509.h
│ │ ├── x509_vfy.h
│ │ ├── x509err.h
│ │ ├── x509v3.h
│ │ └── x509v3err.h
│ ├── intercept/
│ │ ├── err.c
│ │ ├── intercept.c
│ │ └── rand.c
│ ├── makefile
│ ├── mem.c
│ ├── mem_clr.c
│ ├── mem_sec.c
│ ├── sha/
│ │ ├── sha1_one.c
│ │ ├── sha1dgst.c
│ │ ├── sha256.c
│ │ ├── sha512.c
│ │ └── sha_local.h
│ └── threads_none.c
├── ftpm-driver/
│ ├── .vscode/
│ │ └── settings.json
│ ├── Makefile
│ ├── ftpm-driver.mod
│ ├── ftpm-ioctl.c
│ ├── ftpm-sbi.c
│ ├── ftpm-sbi.h
│ ├── ftpm.c
│ ├── ftpm.h
│ ├── ftpm_user.h
│ ├── rtpm-controller.c
│ └── rtpm-driver.mod
├── ftpm-opensbi/
│ ├── .clang-format
│ ├── .gitignore
│ ├── .vscode/
│ │ └── settings.json
│ ├── CONTRIBUTORS.md
│ ├── COPYING.BSD
│ ├── Kconfig
│ ├── ThirdPartyNotices.md
│ ├── docs/
│ │ ├── contributing.md
│ │ ├── domain_support.md
│ │ ├── doxygen.cfg
│ │ ├── external/
│ │ │ └── coreboot.md
│ │ ├── firmware/
│ │ │ ├── fw.md
│ │ │ ├── fw_dynamic.md
│ │ │ ├── fw_jump.md
│ │ │ ├── fw_payload.md
│ │ │ ├── payload_linux.md
│ │ │ └── payload_uboot.md
│ │ ├── library_usage.md
│ │ ├── platform/
│ │ │ ├── andes-ae350.md
│ │ │ ├── fpga-ariane.md
│ │ │ ├── fpga-openpiton.md
│ │ │ ├── generic.md
│ │ │ ├── nuclei_ux600.md
│ │ │ ├── platform.md
│ │ │ ├── qemu_virt.md
│ │ │ ├── renesas-rzfive.md
│ │ │ ├── shakti_cclass.md
│ │ │ ├── sifive_fu540.md
│ │ │ ├── spike.md
│ │ │ └── thead-c9xx.md
│ │ ├── platform_guide.md
│ │ ├── platform_requirements.md
│ │ └── pmu_support.md
│ ├── firmware/
│ │ ├── Kconfig
│ │ ├── external_deps.mk
│ │ ├── fw_base.S
│ │ ├── fw_base.ldS
│ │ ├── fw_dynamic.S
│ │ ├── fw_dynamic.elf.ldS
│ │ ├── fw_jump.S
│ │ ├── fw_jump.elf.ldS
│ │ ├── fw_payload.S
│ │ ├── fw_payload.elf.ldS
│ │ ├── objects.mk
│ │ └── payloads/
│ │ ├── objects.mk
│ │ ├── test.elf.ldS
│ │ ├── test_head.S
│ │ └── test_main.c
│ ├── include/
│ │ ├── fatfs/
│ │ │ ├── diskio.h
│ │ │ ├── ff.h
│ │ │ └── ffconf.h
│ │ ├── ftpm/
│ │ │ ├── ACT.h
│ │ │ ├── ACT_SetTimeout_fp.h
│ │ │ ├── ACT_spt_fp.h
│ │ │ ├── ActivateCredential_fp.h
│ │ │ ├── AlgorithmCap_fp.h
│ │ │ ├── AlgorithmTests_fp.h
│ │ │ ├── Attest_spt_fp.h
│ │ │ ├── BaseTypes.h
│ │ │ ├── Bits_fp.h
│ │ │ ├── BnConvert.h
│ │ │ ├── BnConvert_fp.h
│ │ │ ├── BnMath_fp.h
│ │ │ ├── BnMemory_fp.h
│ │ │ ├── BnOssl.h
│ │ │ ├── BnSupport_Interface.h
│ │ │ ├── BnToOsslMath.h
│ │ │ ├── BnToOsslMath_fp.h
│ │ │ ├── BnToOsslSupport.h
│ │ │ ├── BnToOsslSym.h
│ │ │ ├── BnUtil_fp.h
│ │ │ ├── BnValues.h
│ │ │ ├── Capabilities.h
│ │ │ ├── CertifyCreation_fp.h
│ │ │ ├── CertifyX509_fp.h
│ │ │ ├── Certify_fp.h
│ │ │ ├── ChangeEPS_fp.h
│ │ │ ├── ChangePPS_fp.h
│ │ │ ├── ClearControl_fp.h
│ │ │ ├── Clear_fp.h
│ │ │ ├── ClockRateAdjust_fp.h
│ │ │ ├── ClockSet_fp.h
│ │ │ ├── CommandAttributeData.h
│ │ │ ├── CommandAttributes.h
│ │ │ ├── CommandAudit_fp.h
│ │ │ ├── CommandCodeAttributes_fp.h
│ │ │ ├── CommandDispatchData.h
│ │ │ ├── CommandDispatcher_fp.h
│ │ │ ├── Commands.h
│ │ │ ├── Commit_fp.h
│ │ │ ├── CompilerDependencies.h
│ │ │ ├── CompilerDependencies_gcc.h
│ │ │ ├── CompilerDependencies_msvc.h
│ │ │ ├── ContextLoad_fp.h
│ │ │ ├── ContextSave_fp.h
│ │ │ ├── Context_spt_fp.h
│ │ │ ├── CreateLoaded_fp.h
│ │ │ ├── CreatePrimary_fp.h
│ │ │ ├── Create_fp.h
│ │ │ ├── CryptCmac_fp.h
│ │ │ ├── CryptDes_fp.h
│ │ │ ├── CryptEcc.h
│ │ │ ├── CryptEccCrypt_fp.h
│ │ │ ├── CryptEccKeyExchange_fp.h
│ │ │ ├── CryptEccMain_fp.h
│ │ │ ├── CryptEccSignature_fp.h
│ │ │ ├── CryptHash.h
│ │ │ ├── CryptHash_fp.h
│ │ │ ├── CryptPrimeSieve_fp.h
│ │ │ ├── CryptPrime_fp.h
│ │ │ ├── CryptRand.h
│ │ │ ├── CryptRand_fp.h
│ │ │ ├── CryptRsa.h
│ │ │ ├── CryptRsa_fp.h
│ │ │ ├── CryptSelfTest_fp.h
│ │ │ ├── CryptSmac_fp.h
│ │ │ ├── CryptSym.h
│ │ │ ├── CryptSym_fp.h
│ │ │ ├── CryptTest.h
│ │ │ ├── CryptUtil_fp.h
│ │ │ ├── DA_fp.h
│ │ │ ├── DebugHelpers_fp.h
│ │ │ ├── DictionaryAttackLockReset_fp.h
│ │ │ ├── DictionaryAttackParameters_fp.h
│ │ │ ├── Duplicate_fp.h
│ │ │ ├── ECC_Decrypt_fp.h
│ │ │ ├── ECC_Encrypt_fp.h
│ │ │ ├── ECC_Parameters_fp.h
│ │ │ ├── ECDH_KeyGen_fp.h
│ │ │ ├── ECDH_ZGen_fp.h
│ │ │ ├── EC_Ephemeral_fp.h
│ │ │ ├── EccTestData.h
│ │ │ ├── EncryptDecrypt2_fp.h
│ │ │ ├── EncryptDecrypt_fp.h
│ │ │ ├── EncryptDecrypt_spt_fp.h
│ │ │ ├── Entity_fp.h
│ │ │ ├── EventSequenceComplete_fp.h
│ │ │ ├── EvictControl_fp.h
│ │ │ ├── ExecCommand_fp.h
│ │ │ ├── FlushContext_fp.h
│ │ │ ├── GetCapability_fp.h
│ │ │ ├── GetCommandAuditDigest_fp.h
│ │ │ ├── GetRandom_fp.h
│ │ │ ├── GetSessionAuditDigest_fp.h
│ │ │ ├── GetTestResult_fp.h
│ │ │ ├── GetTime_fp.h
│ │ │ ├── Global.h
│ │ │ ├── GpMacros.h
│ │ │ ├── HMAC_Start_fp.h
│ │ │ ├── HMAC_fp.h
│ │ │ ├── Handle_fp.h
│ │ │ ├── HashSequenceStart_fp.h
│ │ │ ├── HashTestData.h
│ │ │ ├── Hash_fp.h
│ │ │ ├── HierarchyChangeAuth_fp.h
│ │ │ ├── HierarchyControl_fp.h
│ │ │ ├── Hierarchy_fp.h
│ │ │ ├── Import_fp.h
│ │ │ ├── IncrementalSelfTest_fp.h
│ │ │ ├── InternalRoutines.h
│ │ │ ├── IoBuffers_fp.h
│ │ │ ├── KdfTestData.h
│ │ │ ├── LibSupport.h
│ │ │ ├── LoadExternal_fp.h
│ │ │ ├── Load_fp.h
│ │ │ ├── Locality_fp.h
│ │ │ ├── MAC_Start_fp.h
│ │ │ ├── MAC_fp.h
│ │ │ ├── MakeCredential_fp.h
│ │ │ ├── Manufacture_fp.h
│ │ │ ├── Marshal.h
│ │ │ ├── Marshal_fp.h
│ │ │ ├── MathLibraryInterface.h
│ │ │ ├── MathLibraryInterfaceTypes.h
│ │ │ ├── MathOnByteBuffers_fp.h
│ │ │ ├── Memory_fp.h
│ │ │ ├── MinMax.h
│ │ │ ├── NV.h
│ │ │ ├── NVDynamic_fp.h
│ │ │ ├── NVReserved_fp.h
│ │ │ ├── NV_Certify_fp.h
│ │ │ ├── NV_ChangeAuth_fp.h
│ │ │ ├── NV_DefineSpace2_fp.h
│ │ │ ├── NV_DefineSpace_fp.h
│ │ │ ├── NV_Extend_fp.h
│ │ │ ├── NV_GlobalWriteLock_fp.h
│ │ │ ├── NV_Increment_fp.h
│ │ │ ├── NV_ReadLock_fp.h
│ │ │ ├── NV_ReadPublic2_fp.h
│ │ │ ├── NV_ReadPublic_fp.h
│ │ │ ├── NV_Read_fp.h
│ │ │ ├── NV_SetBits_fp.h
│ │ │ ├── NV_UndefineSpaceSpecial_fp.h
│ │ │ ├── NV_UndefineSpace_fp.h
│ │ │ ├── NV_WriteLock_fp.h
│ │ │ ├── NV_Write_fp.h
│ │ │ ├── NV_spt_fp.h
│ │ │ ├── OIDs.h
│ │ │ ├── ObjectChangeAuth_fp.h
│ │ │ ├── Object_fp.h
│ │ │ ├── Object_spt_fp.h
│ │ │ ├── PCR_Allocate_fp.h
│ │ │ ├── PCR_Event_fp.h
│ │ │ ├── PCR_Extend_fp.h
│ │ │ ├── PCR_Read_fp.h
│ │ │ ├── PCR_Reset_fp.h
│ │ │ ├── PCR_SetAuthPolicy_fp.h
│ │ │ ├── PCR_SetAuthValue_fp.h
│ │ │ ├── PCR_fp.h
│ │ │ ├── PP_Commands_fp.h
│ │ │ ├── PP_fp.h
│ │ │ ├── PRNG_TestVectors.h
│ │ │ ├── Platform.h
│ │ │ ├── PlatformACT.h
│ │ │ ├── PlatformACT_fp.h
│ │ │ ├── PlatformClock.h
│ │ │ ├── PlatformData.h
│ │ │ ├── Platform_fp.h
│ │ │ ├── PolicyAuthValue_fp.h
│ │ │ ├── PolicyAuthorizeNV_fp.h
│ │ │ ├── PolicyAuthorize_fp.h
│ │ │ ├── PolicyCapability_fp.h
│ │ │ ├── PolicyCommandCode_fp.h
│ │ │ ├── PolicyCounterTimer_fp.h
│ │ │ ├── PolicyCpHash_fp.h
│ │ │ ├── PolicyDuplicationSelect_fp.h
│ │ │ ├── PolicyGetDigest_fp.h
│ │ │ ├── PolicyLocality_fp.h
│ │ │ ├── PolicyNV_fp.h
│ │ │ ├── PolicyNameHash_fp.h
│ │ │ ├── PolicyNvWritten_fp.h
│ │ │ ├── PolicyOR_fp.h
│ │ │ ├── PolicyPCR_fp.h
│ │ │ ├── PolicyParameters_fp.h
│ │ │ ├── PolicyPassword_fp.h
│ │ │ ├── PolicyPhysicalPresence_fp.h
│ │ │ ├── PolicyRestart_fp.h
│ │ │ ├── PolicySecret_fp.h
│ │ │ ├── PolicySigned_fp.h
│ │ │ ├── PolicyTemplate_fp.h
│ │ │ ├── PolicyTicket_fp.h
│ │ │ ├── Policy_spt_fp.h
│ │ │ ├── Power_fp.h
│ │ │ ├── PropertyCap_fp.h
│ │ │ ├── Quote_fp.h
│ │ │ ├── RSA_Decrypt_fp.h
│ │ │ ├── RSA_Encrypt_fp.h
│ │ │ ├── RTPM.h
│ │ │ ├── ReadClock_fp.h
│ │ │ ├── ReadPublic_fp.h
│ │ │ ├── ResponseCodeProcessing_fp.h
│ │ │ ├── Response_fp.h
│ │ │ ├── Rewrap_fp.h
│ │ │ ├── RsaKeyCache_fp.h
│ │ │ ├── RsaTestData.h
│ │ │ ├── SelfTest.h
│ │ │ ├── SelfTest_fp.h
│ │ │ ├── SequenceComplete_fp.h
│ │ │ ├── SequenceUpdate_fp.h
│ │ │ ├── SessionProcess_fp.h
│ │ │ ├── Session_fp.h
│ │ │ ├── SetAlgorithmSet_fp.h
│ │ │ ├── SetCapability_fp.h
│ │ │ ├── SetCommandCodeAuditStatus_fp.h
│ │ │ ├── SetPrimaryPolicy_fp.h
│ │ │ ├── Shutdown_fp.h
│ │ │ ├── Sign_fp.h
│ │ │ ├── Simulator_fp.h
│ │ │ ├── StartAuthSession_fp.h
│ │ │ ├── Startup_fp.h
│ │ │ ├── StirRandom_fp.h
│ │ │ ├── SymmetricTest.h
│ │ │ ├── SymmetricTestData.h
│ │ │ ├── TPMB.h
│ │ │ ├── TableMarshal.h
│ │ │ ├── TableMarshalDefines.h
│ │ │ ├── TableMarshalTypes.h
│ │ │ ├── TcpServerPosix_fp.h
│ │ │ ├── TcpServer_fp.h
│ │ │ ├── TestParms_fp.h
│ │ │ ├── Ticket_fp.h
│ │ │ ├── Time_fp.h
│ │ │ ├── Tpm.h
│ │ │ ├── TpmASN1.h
│ │ │ ├── TpmASN1_fp.h
│ │ │ ├── TpmAlgorithmDefines.h
│ │ │ ├── TpmBigNum.h
│ │ │ ├── TpmBuildSwitches.h
│ │ │ ├── TpmCalculatedAttributes.h
│ │ │ ├── TpmEcc_Signature_ECDAA_fp.h
│ │ │ ├── TpmEcc_Signature_ECDSA_fp.h
│ │ │ ├── TpmEcc_Signature_SM2_fp.h
│ │ │ ├── TpmEcc_Signature_Schnorr_fp.h
│ │ │ ├── TpmEcc_Signature_Util_fp.h
│ │ │ ├── TpmEcc_Util_fp.h
│ │ │ ├── TpmError.h
│ │ │ ├── TpmFail_fp.h
│ │ │ ├── TpmMath_Debug_fp.h
│ │ │ ├── TpmMath_Util_fp.h
│ │ │ ├── TpmProfile.h
│ │ │ ├── TpmProfile_CommandList.h
│ │ │ ├── TpmProfile_Common.h
│ │ │ ├── TpmProfile_ErrorCodes.h
│ │ │ ├── TpmProfile_Misc.h
│ │ │ ├── TpmSizeChecks_fp.h
│ │ │ ├── TpmTcpProtocol.h
│ │ │ ├── TpmToOsslHash.h
│ │ │ ├── TpmToOsslSupport_fp.h
│ │ │ ├── TpmToOsslSym.h
│ │ │ ├── TpmToTpmBigNumMath.h
│ │ │ ├── TpmTypes.h
│ │ │ ├── Unmarshal_fp.h
│ │ │ ├── Unseal_fp.h
│ │ │ ├── VendorInfo.h
│ │ │ ├── Vendor_TCG_Test_fp.h
│ │ │ ├── VerifyConfiguration.h
│ │ │ ├── VerifySignature_fp.h
│ │ │ ├── X509.h
│ │ │ ├── X509_ECC_fp.h
│ │ │ ├── X509_RSA_fp.h
│ │ │ ├── X509_spt_fp.h
│ │ │ ├── ZGen_2Phase_fp.h
│ │ │ ├── _TPM_Hash_Data_fp.h
│ │ │ ├── _TPM_Hash_End_fp.h
│ │ │ ├── _TPM_Hash_Start_fp.h
│ │ │ ├── _TPM_Init_fp.h
│ │ │ ├── endian_swap.h
│ │ │ ├── ftpm.h
│ │ │ ├── intercept.h
│ │ │ ├── mprv.h
│ │ │ ├── ntc2_fp.h
│ │ │ ├── ntc2lib.h
│ │ │ ├── pcrstruct.h
│ │ │ ├── platform_pcr_fp.h
│ │ │ ├── platform_public_interface.h
│ │ │ ├── platform_to_tpm_interface.h
│ │ │ ├── simulatorPrivate.h
│ │ │ ├── simulator_sysheaders.h
│ │ │ ├── tpm_public.h
│ │ │ ├── tpm_radix.h
│ │ │ ├── tpm_to_platform_interface.h
│ │ │ └── tpm_to_tpm_interface.h
│ │ ├── sbi/
│ │ │ ├── fw_dynamic.h
│ │ │ ├── riscv_asm.h
│ │ │ ├── riscv_atomic.h
│ │ │ ├── riscv_barrier.h
│ │ │ ├── riscv_elf.h
│ │ │ ├── riscv_encoding.h
│ │ │ ├── riscv_fp.h
│ │ │ ├── riscv_io.h
│ │ │ ├── riscv_locks.h
│ │ │ ├── sbi_bitmap.h
│ │ │ ├── sbi_bitops.h
│ │ │ ├── sbi_console.h
│ │ │ ├── sbi_const.h
│ │ │ ├── sbi_csr_detect.h
│ │ │ ├── sbi_domain.h
│ │ │ ├── sbi_ecall.h
│ │ │ ├── sbi_ecall_interface.h
│ │ │ ├── sbi_emulate_csr.h
│ │ │ ├── sbi_error.h
│ │ │ ├── sbi_fifo.h
│ │ │ ├── sbi_hart.h
│ │ │ ├── sbi_hartmask.h
│ │ │ ├── sbi_hfence.h
│ │ │ ├── sbi_hsm.h
│ │ │ ├── sbi_illegal_insn.h
│ │ │ ├── sbi_init.h
│ │ │ ├── sbi_ipi.h
│ │ │ ├── sbi_irqchip.h
│ │ │ ├── sbi_list.h
│ │ │ ├── sbi_math.h
│ │ │ ├── sbi_misaligned_ldst.h
│ │ │ ├── sbi_platform.h
│ │ │ ├── sbi_pmu.h
│ │ │ ├── sbi_scratch.h
│ │ │ ├── sbi_string.h
│ │ │ ├── sbi_system.h
│ │ │ ├── sbi_timer.h
│ │ │ ├── sbi_tlb.h
│ │ │ ├── sbi_trap.h
│ │ │ ├── sbi_types.h
│ │ │ ├── sbi_unpriv.h
│ │ │ └── sbi_version.h
│ │ └── sbi_utils/
│ │ ├── fdt/
│ │ │ ├── fdt_domain.h
│ │ │ ├── fdt_fixup.h
│ │ │ ├── fdt_helper.h
│ │ │ └── fdt_pmu.h
│ │ ├── gpio/
│ │ │ ├── fdt_gpio.h
│ │ │ └── gpio.h
│ │ ├── i2c/
│ │ │ ├── fdt_i2c.h
│ │ │ └── i2c.h
│ │ ├── ipi/
│ │ │ ├── aclint_mswi.h
│ │ │ ├── andes_plicsw.h
│ │ │ └── fdt_ipi.h
│ │ ├── irqchip/
│ │ │ ├── aplic.h
│ │ │ ├── fdt_irqchip.h
│ │ │ ├── fdt_irqchip_plic.h
│ │ │ ├── imsic.h
│ │ │ └── plic.h
│ │ ├── reset/
│ │ │ └── fdt_reset.h
│ │ ├── serial/
│ │ │ ├── cadence-uart.h
│ │ │ ├── fdt_serial.h
│ │ │ ├── gaisler-uart.h
│ │ │ ├── litex-uart.h
│ │ │ ├── renesas-scif.h
│ │ │ ├── semihosting.h
│ │ │ ├── shakti-uart.h
│ │ │ ├── sifive-uart.h
│ │ │ ├── uart8250.h
│ │ │ └── xlnx_uartlite.h
│ │ ├── sys/
│ │ │ ├── htif.h
│ │ │ └── sifive_test.h
│ │ └── timer/
│ │ ├── aclint_mtimer.h
│ │ ├── andes_plmt.h
│ │ └── fdt_timer.h
│ ├── lib/
│ │ ├── sbi/
│ │ │ ├── Kconfig
│ │ │ ├── objects.mk
│ │ │ ├── riscv_asm.c
│ │ │ ├── riscv_atomic.c
│ │ │ ├── riscv_hardfp.S
│ │ │ ├── riscv_locks.c
│ │ │ ├── sbi_bitmap.c
│ │ │ ├── sbi_bitops.c
│ │ │ ├── sbi_console.c
│ │ │ ├── sbi_domain.c
│ │ │ ├── sbi_ecall.c
│ │ │ ├── sbi_ecall_base.c
│ │ │ ├── sbi_ecall_exts.carray
│ │ │ ├── sbi_ecall_hsm.c
│ │ │ ├── sbi_ecall_ipi.c
│ │ │ ├── sbi_ecall_legacy.c
│ │ │ ├── sbi_ecall_pmu.c
│ │ │ ├── sbi_ecall_rfence.c
│ │ │ ├── sbi_ecall_srst.c
│ │ │ ├── sbi_ecall_time.c
│ │ │ ├── sbi_ecall_vendor.c
│ │ │ ├── sbi_emulate_csr.c
│ │ │ ├── sbi_expected_trap.S
│ │ │ ├── sbi_fifo.c
│ │ │ ├── sbi_hart.c
│ │ │ ├── sbi_hfence.S
│ │ │ ├── sbi_hsm.c
│ │ │ ├── sbi_illegal_insn.c
│ │ │ ├── sbi_init.c
│ │ │ ├── sbi_ipi.c
│ │ │ ├── sbi_irqchip.c
│ │ │ ├── sbi_math.c
│ │ │ ├── sbi_misaligned_ldst.c
│ │ │ ├── sbi_platform.c
│ │ │ ├── sbi_pmu.c
│ │ │ ├── sbi_scratch.c
│ │ │ ├── sbi_string.c
│ │ │ ├── sbi_system.c
│ │ │ ├── sbi_timer.c
│ │ │ ├── sbi_tlb.c
│ │ │ ├── sbi_trap.c
│ │ │ └── sbi_unpriv.c
│ │ └── utils/
│ │ ├── Kconfig
│ │ ├── fdt/
│ │ │ ├── Kconfig
│ │ │ ├── fdt_domain.c
│ │ │ ├── fdt_fixup.c
│ │ │ ├── fdt_helper.c
│ │ │ ├── fdt_pmu.c
│ │ │ └── objects.mk
│ │ ├── gpio/
│ │ │ ├── Kconfig
│ │ │ ├── fdt_gpio.c
│ │ │ ├── fdt_gpio_drivers.carray
│ │ │ ├── fdt_gpio_sifive.c
│ │ │ ├── gpio.c
│ │ │ └── objects.mk
│ │ ├── i2c/
│ │ │ ├── Kconfig
│ │ │ ├── fdt_i2c.c
│ │ │ ├── fdt_i2c_adapter_drivers.carray
│ │ │ ├── fdt_i2c_sifive.c
│ │ │ ├── i2c.c
│ │ │ └── objects.mk
│ │ ├── ipi/
│ │ │ ├── Kconfig
│ │ │ ├── aclint_mswi.c
│ │ │ ├── andes_plicsw.c
│ │ │ ├── fdt_ipi.c
│ │ │ ├── fdt_ipi_drivers.carray
│ │ │ ├── fdt_ipi_mswi.c
│ │ │ ├── fdt_ipi_plicsw.c
│ │ │ └── objects.mk
│ │ ├── irqchip/
│ │ │ ├── Kconfig
│ │ │ ├── aplic.c
│ │ │ ├── fdt_irqchip.c
│ │ │ ├── fdt_irqchip_aplic.c
│ │ │ ├── fdt_irqchip_drivers.carray
│ │ │ ├── fdt_irqchip_imsic.c
│ │ │ ├── fdt_irqchip_plic.c
│ │ │ ├── imsic.c
│ │ │ ├── objects.mk
│ │ │ └── plic.c
│ │ ├── libfdt/
│ │ │ ├── .clang-format
│ │ │ ├── Kconfig
│ │ │ ├── Makefile.libfdt
│ │ │ ├── TODO
│ │ │ ├── fdt.c
│ │ │ ├── fdt.h
│ │ │ ├── fdt_addresses.c
│ │ │ ├── fdt_check.c
│ │ │ ├── fdt_empty_tree.c
│ │ │ ├── fdt_overlay.c
│ │ │ ├── fdt_ro.c
│ │ │ ├── fdt_rw.c
│ │ │ ├── fdt_strerror.c
│ │ │ ├── fdt_sw.c
│ │ │ ├── fdt_wip.c
│ │ │ ├── libfdt.h
│ │ │ ├── libfdt_env.h
│ │ │ ├── libfdt_internal.h
│ │ │ ├── objects.mk
│ │ │ └── version.lds
│ │ ├── libquad/
│ │ │ ├── divdi3.c
│ │ │ ├── include/
│ │ │ │ ├── limits.h
│ │ │ │ └── sys/
│ │ │ │ ├── cdefs.h
│ │ │ │ └── types.h
│ │ │ ├── moddi3.c
│ │ │ ├── objects.mk
│ │ │ ├── qdivrem.c
│ │ │ ├── quad.h
│ │ │ ├── udivdi3.c
│ │ │ └── umoddi3.c
│ │ ├── reset/
│ │ │ ├── Kconfig
│ │ │ ├── fdt_reset.c
│ │ │ ├── fdt_reset_atcwdt200.c
│ │ │ ├── fdt_reset_drivers.carray
│ │ │ ├── fdt_reset_gpio.c
│ │ │ ├── fdt_reset_htif.c
│ │ │ ├── fdt_reset_sifive_test.c
│ │ │ ├── fdt_reset_sunxi_wdt.c
│ │ │ ├── fdt_reset_thead.c
│ │ │ ├── fdt_reset_thead.h
│ │ │ ├── fdt_reset_thead_asm.S
│ │ │ └── objects.mk
│ │ ├── serial/
│ │ │ ├── Kconfig
│ │ │ ├── cadence-uart.c
│ │ │ ├── fdt_serial.c
│ │ │ ├── fdt_serial_cadence.c
│ │ │ ├── fdt_serial_drivers.carray
│ │ │ ├── fdt_serial_gaisler.c
│ │ │ ├── fdt_serial_htif.c
│ │ │ ├── fdt_serial_litex.c
│ │ │ ├── fdt_serial_renesas_scif.c
│ │ │ ├── fdt_serial_shakti.c
│ │ │ ├── fdt_serial_sifive.c
│ │ │ ├── fdt_serial_uart8250.c
│ │ │ ├── fdt_serial_xlnx_uartlite.c
│ │ │ ├── gaisler-uart.c
│ │ │ ├── litex-uart.c
│ │ │ ├── objects.mk
│ │ │ ├── renesas_scif.c
│ │ │ ├── semihosting.c
│ │ │ ├── shakti-uart.c
│ │ │ ├── sifive-uart.c
│ │ │ ├── uart8250.c
│ │ │ └── xlnx-uartlite.c
│ │ ├── sys/
│ │ │ ├── Kconfig
│ │ │ ├── htif.c
│ │ │ ├── objects.mk
│ │ │ └── sifive_test.c
│ │ └── timer/
│ │ ├── Kconfig
│ │ ├── aclint_mtimer.c
│ │ ├── andes_plmt.c
│ │ ├── fdt_timer.c
│ │ ├── fdt_timer_drivers.carray
│ │ ├── fdt_timer_mtimer.c
│ │ ├── fdt_timer_plmt.c
│ │ └── objects.mk
│ ├── platform/
│ │ ├── fpga/
│ │ │ ├── ariane/
│ │ │ │ ├── Kconfig
│ │ │ │ ├── configs/
│ │ │ │ │ └── defconfig
│ │ │ │ ├── objects.mk
│ │ │ │ └── platform.c
│ │ │ └── openpiton/
│ │ │ ├── Kconfig
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── objects.mk
│ │ │ └── platform.c
│ │ ├── generic/
│ │ │ ├── Kconfig
│ │ │ ├── allwinner/
│ │ │ │ ├── objects.mk
│ │ │ │ └── sun20i-d1.c
│ │ │ ├── andes/
│ │ │ │ ├── ae350.c
│ │ │ │ └── objects.mk
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── include/
│ │ │ │ ├── platform_override.h
│ │ │ │ └── thead_c9xx.h
│ │ │ ├── objects.mk
│ │ │ ├── platform.c
│ │ │ ├── platform_override_modules.carray
│ │ │ ├── renesas/
│ │ │ │ └── rzfive/
│ │ │ │ ├── objects.mk
│ │ │ │ └── rzfive.c
│ │ │ └── sifive/
│ │ │ ├── fu540.c
│ │ │ ├── fu740.c
│ │ │ └── objects.mk
│ │ ├── kendryte/
│ │ │ └── k210/
│ │ │ ├── Kconfig
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── k210.dts
│ │ │ ├── objects.mk
│ │ │ ├── platform.c
│ │ │ └── platform.h
│ │ ├── nuclei/
│ │ │ └── ux600/
│ │ │ ├── Kconfig
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── objects.mk
│ │ │ └── platform.c
│ │ ├── template/
│ │ │ ├── Kconfig
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── objects.mk
│ │ │ └── platform.c
│ │ └── vivado-risc-v/
│ │ ├── Kconfig
│ │ ├── configs/
│ │ │ └── defconfig
│ │ ├── fatfs/
│ │ │ ├── diskio.c
│ │ │ ├── ffsystem.c
│ │ │ └── ffunicode.c
│ │ ├── objects.mk
│ │ └── platform.c
│ ├── scripts/
│ │ ├── Kconfiglib/
│ │ │ ├── LICENSE.txt
│ │ │ ├── allnoconfig.py
│ │ │ ├── allyesconfig.py
│ │ │ ├── defconfig.py
│ │ │ ├── genconfig.py
│ │ │ ├── kconfiglib.py
│ │ │ ├── menuconfig.py
│ │ │ ├── oldconfig.py
│ │ │ ├── olddefconfig.py
│ │ │ ├── savedefconfig.py
│ │ │ └── setconfig.py
│ │ ├── carray.sh
│ │ ├── create-binary-archive.sh
│ │ └── d2c.sh
│ └── src/
│ ├── ACTCommands.c
│ ├── ACT_spt.c
│ ├── AlgorithmCap.c
│ ├── AlgorithmTests.c
│ ├── AsymmetricCommands.c
│ ├── Attest_spt.c
│ ├── AttestationCommands.c
│ ├── AuditCommands.c
│ ├── Bits.c
│ ├── BnConvert.c
│ ├── BnEccConstants.c
│ ├── BnMath.c
│ ├── BnMemory.c
│ ├── BnToOsslMath.c
│ ├── BnUtil.c
│ ├── Cancel.c
│ ├── CapabilityCommands.c
│ ├── Clock.c
│ ├── ClockCommands.c
│ ├── CommandAudit.c
│ ├── CommandCodeAttributes.c
│ ├── CommandDispatcher.c
│ ├── ContextCommands.c
│ ├── Context_spt.c
│ ├── CryptCmac.c
│ ├── CryptDes.c
│ ├── CryptEccCrypt.c
│ ├── CryptEccData.c
│ ├── CryptEccKeyExchange.c
│ ├── CryptEccMain.c
│ ├── CryptEccSignature.c
│ ├── CryptHash.c
│ ├── CryptPrime.c
│ ├── CryptPrimeSieve.c
│ ├── CryptRand.c
│ ├── CryptRsa.c
│ ├── CryptSelfTest.c
│ ├── CryptSmac.c
│ ├── CryptSym.c
│ ├── CryptUtil.c
│ ├── DA.c
│ ├── DebugHelpers.c
│ ├── DictionaryCommands.c
│ ├── DuplicationCommands.c
│ ├── EACommands.c
│ ├── EccConstantData.inl
│ ├── EncryptDecrypt_spt.c
│ ├── Entity.c
│ ├── Entropy.c
│ ├── EphemeralCommands.c
│ ├── ExecCommand.c
│ ├── ExtraData.c
│ ├── Global.c
│ ├── Handle.c
│ ├── HashCommands.c
│ ├── Hierarchy.c
│ ├── HierarchyCommands.c
│ ├── IntegrityCommands.c
│ ├── IoBuffers.c
│ ├── LICENSE
│ ├── Locality.c
│ ├── LocalityPlat.c
│ ├── ManagementCommands.c
│ ├── Manufacture.c
│ ├── Marshal.c
│ ├── MathOnByteBuffers.c
│ ├── Memory.c
│ ├── NVCommands.c
│ ├── NVDynamic.c
│ ├── NVMem.c
│ ├── NVMem.c.bak
│ ├── NVReserved.c
│ ├── NV_spt.c
│ ├── Object.c
│ ├── ObjectCommands.c
│ ├── Object_spt.c
│ ├── PCR.c
│ ├── PP.c
│ ├── PPPlat.c
│ ├── PlatformACT.c
│ ├── PlatformData.c
│ ├── PlatformPCR.c
│ ├── Policy_spt.c
│ ├── Power.c
│ ├── PowerPlat.c
│ ├── PrimeData.c
│ ├── PropertyCap.c
│ ├── RandomCommands.c
│ ├── Response.c
│ ├── ResponseCodeProcessing.c
│ ├── RsaKeyCache.c
│ ├── RunCommand.c
│ ├── Session.c
│ ├── SessionCommands.c
│ ├── SessionProcess.c
│ ├── SigningCommands.c
│ ├── StartupCommands.c
│ ├── SymmetricCommands.c
│ ├── TPMCmdp.c
│ ├── TableDrivenMarshal.c
│ ├── TableMarshalData.c
│ ├── TestingCommands.c
│ ├── Ticket.c
│ ├── Time.c
│ ├── TpmAsn1.c
│ ├── TpmBigNumThunks.c
│ ├── TpmEcc_Signature_ECDAA.c
│ ├── TpmEcc_Signature_ECDSA.c
│ ├── TpmEcc_Signature_SM2.c
│ ├── TpmEcc_Signature_Schnorr.c
│ ├── TpmEcc_Signature_Util.c
│ ├── TpmEcc_Util.c
│ ├── TpmFail.c
│ ├── TpmMath_Debug.c
│ ├── TpmMath_Util.c
│ ├── TpmSizeChecks.c
│ ├── TpmToOsslSupport.c
│ ├── Unique.c
│ ├── Unmarshal.c
│ ├── VendorInfo.c
│ ├── Vendor_TCG_Test.c
│ ├── X509_ECC.c
│ ├── X509_RSA.c
│ ├── X509_spt.c
│ ├── ftpm-sbi-opensbi.c
│ ├── ftpm.c
│ ├── intercept.c
│ ├── makefile.mac
│ ├── makefile.mak
│ ├── makefile11
│ ├── mprv.S
│ ├── ntc2.c
│ └── ntc2lib.c
└── ibmtss-ftpm/
├── .gitignore
├── CommandAttributeData.c
├── CommandAttributeData12.c
├── Commands.c
├── Commands12.c
├── Makefile.am
├── Unmarshal.c
├── Unmarshal12.c
├── activatecredential.c
├── applink.c
├── certify.c
├── certifycreation.c
├── certifyx509.c
├── changeeps.c
├── changepps.c
├── clear.c
├── clearcontrol.c
├── clockrateadjust.c
├── clockset.c
├── commit.c
├── contextload.c
├── contextsave.c
├── create.c
├── createek.c
├── createekcert.c
├── createloaded.c
├── createprimary.c
├── cryptoutils.c
├── dictionaryattacklockreset.c
├── dictionaryattackparameters.c
├── duplicate.c
├── eccdecrypt.c
├── eccencrypt.c
├── eccparameters.c
├── ecephemeral.c
├── efilib.c
├── ekutils.c
├── encryptdecrypt.c
├── eventextend.c
├── eventlib.c
├── eventsequencecomplete.c
├── evictcontrol.c
├── flushcontext.c
├── getcapability.c
├── getcommandauditdigest.c
├── getcryptolibrary.c
├── getrandom.c
├── getsessionauditdigest.c
├── gettestresult.c
├── gettime.c
├── hash.c
├── hashsequencestart.c
├── hierarchychangeauth.c
├── hierarchycontrol.c
├── hmac.c
├── hmacstart.c
├── imaextend.c
├── imalib.c
├── import.c
├── importpem.c
├── load.c
├── loadexternal.c
├── makecredential.c
├── makefile-common
├── makefile-common12
├── makefile-common20
├── makefile.mac
├── makefile.mak
├── makefile.min
├── makefile.nofile
├── makefiletpm12
├── makefiletpm20
├── makefiletpmc
├── ntc2getconfig.c
├── ntc2lib.c
├── ntc2lockconfig.c
├── ntc2preconfig.c
├── nvcertify.c
├── nvchangeauth.c
├── nvdefinespace.c
├── nvextend.c
├── nvglobalwritelock.c
├── nvincrement.c
├── nvread.c
├── nvreadlock.c
├── nvreadpublic.c
├── nvsetbits.c
├── nvundefinespace.c
├── nvundefinespacespecial.c
├── nvwrite.c
├── nvwritelock.c
├── objectchangeauth.c
├── objecttemplates.c
├── pcrallocate.c
├── pcrevent.c
├── pcrextend.c
├── pcrread.c
├── pcrreset.c
├── policyauthorize.c
├── policyauthorizenv.c
├── policyauthvalue.c
├── policycapability.c
├── policycommandcode.c
├── policycountertimer.c
├── policycphash.c
├── policyduplicationselect.c
├── policygetdigest.c
├── policymaker.c
├── policymakerpcr.c
├── policynamehash.c
├── policynv.c
├── policynvwritten.c
├── policyor.c
├── policyparameters.c
├── policypassword.c
├── policypcr.c
├── policyrestart.c
├── policysecret.c
├── policysigned.c
├── policytemplate.c
├── policyticket.c
├── powerup.c
├── printattr.c
├── publicname.c
├── quote.c
├── readclock.c
├── readpublic.c
├── returncode.c
├── rewrap.c
├── rsadecrypt.c
├── rsaencrypt.c
├── sequencecomplete.c
├── sequenceupdate.c
├── setcommandcodeauditstatus.c
├── setprimarypolicy.c
├── shutdown.c
├── sign.c
├── signapp.c
├── startauthsession.c
├── startup.c
├── stirrandom.c
├── timepacket.c
├── tpm2pem.c
├── tpmcmd.c
├── tpmproxy.c
├── tpmpublic2eccpoint.c
├── tss.c
├── tss12.c
├── tss20.c
├── tssauth.c
├── tssauth12.c
├── tssauth20.c
├── tssccattributes.c
├── tssccattributes12.c
├── tsscrypto.c
├── tsscryptoh.c
├── tssdev.c
├── tssdevskiboot.c
├── tssfile.c
├── tssftpm.c
├── tssmarshal.c
├── tssmarshal12.c
├── tssntc.c
├── tssprint.c
├── tssprintcmd.c
├── tssproperties.c
├── tssresponsecode.c
├── tsssocket.c
├── tsstbsi.c
├── tsstransmit.c
├── tssutils.c
├── tssutilsverbose.c
├── unseal.c
├── verifysignature.c
├── writeapp.c
└── zgen2phase.c
================================================
FILE CONTENTS
================================================
================================================
FILE: README.md
================================================
# RfTPM: A Firmware TPM Implementation for RISC-V
RfTPM is the first firmware TPM (fTPM) architecture designed for RISC-V platforms. It provides secure TPM functionalities, including isolated execution, secure storage, secure boot, and remote attestation, without requiring additional hardware costs.
## Features
- **Firmware TPM for RISC-V**: Implements TPM functionalities without dedicated hardware.
- **Isolated Execution**: Runs as an OpenSBI extension in machine mode (M-mode) on RISC-V.
- **Secure Storage**: Ensures the integrity and confidentiality of TPM persistent data.
- **Efficient Communication**: Securely interacts with higher-level TPM applications.
## Build and Installation
### Prerequisites
Ensure that your environment includes:
- A RISC-V toolchain
- QEMU or a real RISC-V platform for testing
### Building and Installing
#### 1. Set Up Environment Variables
Before compiling, define the necessary paths:
```sh
export BUILD_DIR=/path/to/build-linux-stable-host
export FTPM_DIR=/path/to/rfTPM
export RISCV_TOOLCHAIN=/opt/riscv/bin
```
#### 2. Compile libcryptomini
```sh
make
```
#### 3. Compile ftpm-opensbi
```sh
make CROSS_COMPILE=$RISCV_TOOLCHAIN/riscv64-unknown-elf- \
PLATFORM=generic \
FW_PAYLOAD_PATH=$BUILD_DIR/arch/riscv/boot/Image \
FW_PAYLOAD=y \
PLATFORM_RISCV_XLEN=64 \
PLATFORM_RISCV_ISA=rv64imafdc \
PLATFORM_RISCV_ABI=lp64d
```
#### 4. Compile ftpm-driver
```sh
make -C $BUILD_DIR \
O=$BUILD_DIR \
ARCH=riscv \
CROSS_COMPILE=$RISCV_TOOLCHAIN/riscv64-unknown-linux-gnu- \
M=$FTPM_DIR/ftpm-driver modules
```
#### 5. Compile ibmtss-ftpm
```sh
make -f makefiletpm20
```
================================================
FILE: cryptomini/.vscode/settings.json
================================================
{
"files.associations": {
"intercept.h": "c"
}
}
================================================
FILE: cryptomini/README.md
================================================
# CRYPTOMINI
pruned libcrypto for vTPM on RISC-V
================================================
FILE: cryptomini/aes/aes_cbc.c
================================================
/*
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
/*
* AES low level APIs are deprecated for public use, but still ok for internal
* use where we're using them to implement the higher level EVP interface, as is
* the case here.
*/
// #include "internal/deprecated.h"
#include <string.h>
#include <openssl/aes.h>
#include <openssl/modes.h>
void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const void *key,
unsigned char ivec[16], block128_f block)
{
size_t n;
const unsigned char *iv = ivec;
if (len == 0)
return;
// #if !defined(OPENSSL_SMALL_FOOTPRINT)
// if (STRICT_ALIGNMENT &&
// ((size_t)in | (size_t)out | (size_t)ivec) % sizeof(size_t) != 0) {
// while (len >= 16) {
// for (n = 0; n < 16; ++n)
// out[n] = in[n] ^ iv[n];
// (*block) (out, out, key);
// iv = out;
// len -= 16;
// in += 16;
// out += 16;
// }
// } else {
// while (len >= 16) {
// for (n = 0; n < 16; n += sizeof(size_t))
// *(size_t_aX *)(out + n) =
// *(size_t_aX *)(in + n) ^ *(size_t_aX *)(iv + n);
// (*block) (out, out, key);
// iv = out;
// len -= 16;
// in += 16;
// out += 16;
// }
// }
// #endif
while (len) {
for (n = 0; n < 16 && n < len; ++n)
out[n] = in[n] ^ iv[n];
for (; n < 16; ++n)
out[n] = iv[n];
(*block) (out, out, key);
iv = out;
if (len <= 16)
break;
len -= 16;
in += 16;
out += 16;
}
if (ivec != iv)
memcpy(ivec, iv, 16);
}
void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
size_t len, const void *key,
unsigned char ivec[16], block128_f block)
{
size_t n;
union {
size_t t[16 / sizeof(size_t)];
unsigned char c[16];
} tmp;
if (len == 0)
return;
// #if !defined(OPENSSL_SMALL_FOOTPRINT)
// if (in != out) {
// const unsigned char *iv = ivec;
// if (STRICT_ALIGNMENT &&
// ((size_t)in | (size_t)out | (size_t)ivec) % sizeof(size_t) != 0) {
// while (len >= 16) {
// (*block) (in, out, key);
// for (n = 0; n < 16; ++n)
// out[n] ^= iv[n];
// iv = in;
// len -= 16;
// in += 16;
// out += 16;
// }
// } else if (16 % sizeof(size_t) == 0) { /* always true */
// while (len >= 16) {
// size_t_aX *out_t = (size_t_aX *)out;
// size_t_aX *iv_t = (size_t_aX *)iv;
// (*block) (in, out, key);
// for (n = 0; n < 16 / sizeof(size_t); n++)
// out_t[n] ^= iv_t[n];
// iv = in;
// len -= 16;
// in += 16;
// out += 16;
// }
// }
// if (ivec != iv)
// memcpy(ivec, iv, 16);
// } else {
// if (STRICT_ALIGNMENT &&
// ((size_t)in | (size_t)out | (size_t)ivec) % sizeof(size_t) != 0) {
// unsigned char c;
// while (len >= 16) {
// (*block) (in, tmp.c, key);
// for (n = 0; n < 16; ++n) {
// c = in[n];
// out[n] = tmp.c[n] ^ ivec[n];
// ivec[n] = c;
// }
// len -= 16;
// in += 16;
// out += 16;
// }
// } else if (16 % sizeof(size_t) == 0) { /* always true */
// while (len >= 16) {
// size_t c;
// size_t_aX *out_t = (size_t_aX *)out;
// size_t_aX *ivec_t = (size_t_aX *)ivec;
// const size_t_aX *in_t = (const size_t_aX *)in;
// (*block) (in, tmp.c, key);
// for (n = 0; n < 16 / sizeof(size_t); n++) {
// c = in_t[n];
// out_t[n] = tmp.t[n] ^ ivec_t[n];
// ivec_t[n] = c;
// }
// len -= 16;
// in += 16;
// out += 16;
// }
// }
// }
// #endif
while (len) {
unsigned char c;
(*block) (in, tmp.c, key);
for (n = 0; n < 16 && n < len; ++n) {
c = in[n];
out[n] = tmp.c[n] ^ ivec[n];
ivec[n] = c;
}
if (len <= 16) {
for (; n < 16; ++n)
ivec[n] = in[n];
break;
}
len -= 16;
in += 16;
out += 16;
}
}
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
size_t len, const AES_KEY *key,
unsigned char *ivec, const int enc)
{
if (enc)
CRYPTO_cbc128_encrypt(in, out, len, key, ivec,
(block128_f) AES_encrypt);
else
CRYPTO_cbc128_decrypt(in, out, len, key, ivec,
(block128_f) AES_decrypt);
}
================================================
FILE: cryptomini/aes/aes_core.c
================================================
/*
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
/**
* rijndael-alg-fst.c
*
* @version 3.0 (December 2000)
*
* Optimised ANSI C code for the Rijndael cipher (now AES)
*
* @author Vincent Rijmen
* @author Antoon Bosselaers
* @author Paulo Barreto
*
* This code is hereby placed in the public domain.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''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 AUTHORS 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.
*/
/* Note: rewritten a little bit to provide error control and an OpenSSL-
compatible API */
#include <assert.h>
#include <stdlib.h>
#include <openssl/crypto.h>
#include <openssl/aes.h>
#include "aes_local.h"
#if defined(OPENSSL_AES_CONST_TIME) && !defined(AES_ASM)
typedef union {
unsigned char b[8];
u32 w[2];
u64 d;
} uni;
/*
* Compute w := (w * x) mod (x^8 + x^4 + x^3 + x^1 + 1)
* Therefore the name "xtime".
*/
static void XtimeWord(u32 *w)
{
u32 a, b;
a = *w;
b = a & 0x80808080u;
a ^= b;
b -= b >> 7;
b &= 0x1B1B1B1Bu;
b ^= a << 1;
*w = b;
}
static void XtimeLong(u64 *w)
{
u64 a, b;
a = *w;
b = a & 0x8080808080808080uLL;
a ^= b;
b -= b >> 7;
b &= 0x1B1B1B1B1B1B1B1BuLL;
b ^= a << 1;
*w = b;
}
/*
* This computes w := S * w ^ -1 + c, where c = {01100011}.
* Instead of using GF(2^8) mod (x^8+x^4+x^3+x+1} we do the inversion
* in GF(GF(GF(2^2)^2)^2) mod (X^2+X+8)
* and GF(GF(2^2)^2) mod (X^2+X+2)
* and GF(2^2) mod (X^2+X+1)
* The first part of the algorithm below transfers the coordinates
* {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80} =>
* {1,Y,Y^2,Y^3,Y^4,Y^5,Y^6,Y^7} with Y=0x41:
* {0x01,0x41,0x66,0x6c,0x56,0x9a,0x58,0xc4}
* The last part undoes the coordinate transfer and the final affine
* transformation S:
* b[i] = b[i] + b[(i+4)%8] + b[(i+5)%8] + b[(i+6)%8] + b[(i+7)%8] + c[i]
* in one step.
* The multiplication in GF(2^2^2^2) is done in ordinary coords:
* A = (a0*1 + a1*x^4)
* B = (b0*1 + b1*x^4)
* AB = ((a0*b0 + 8*a1*b1)*1 + (a1*b0 + (a0+a1)*b1)*x^4)
* When A = (a0,a1) is given we want to solve AB = 1:
* (a) 1 = a0*b0 + 8*a1*b1
* (b) 0 = a1*b0 + (a0+a1)*b1
* => multiply (a) by a1 and (b) by a0
* (c) a1 = a1*a0*b0 + (8*a1*a1)*b1
* (d) 0 = a1*a0*b0 + (a0*a0+a1*a0)*b1
* => add (c) + (d)
* (e) a1 = (a0*a0 + a1*a0 + 8*a1*a1)*b1
* => therefore
* b1 = (a0*a0 + a1*a0 + 8*a1*a1)^-1 * a1
* => and adding (a1*b0) to (b) we get
* (f) a1*b0 = (a0+a1)*b1
* => therefore
* b0 = (a0*a0 + a1*a0 + 8*a1*a1)^-1 * (a0+a1)
* Note this formula also works for the case
* (a0+a1)*a0 + 8*a1*a1 = 0
* if the inverse element for 0^-1 is mapped to 0.
* Repeat the same for GF(2^2^2) and GF(2^2).
* We get the following algorithm:
* inv8(a0,a1):
* x0 = a0^a1
* [y0,y1] = mul4([x0,a1],[a0,a1]); (*)
* y1 = mul4(8,y1);
* t = inv4(y0^y1);
* [b0,b1] = mul4([x0,a1],[t,t]); (*)
* return [b0,b1];
* The non-linear multiplies (*) can be done in parallel at no extra cost.
*/
static void SubWord(u32 *w)
{
u32 x, y, a1, a2, a3, a4, a5, a6;
x = *w;
y = ((x & 0xFEFEFEFEu) >> 1) | ((x & 0x01010101u) << 7);
x &= 0xDDDDDDDDu;
x ^= y & 0x57575757u;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0x1C1C1C1Cu;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0x4A4A4A4Au;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0x42424242u;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0x64646464u;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0xE0E0E0E0u;
a1 = x;
a1 ^= (x & 0xF0F0F0F0u) >> 4;
a2 = ((x & 0xCCCCCCCCu) >> 2) | ((x & 0x33333333u) << 2);
a3 = x & a1;
a3 ^= (a3 & 0xAAAAAAAAu) >> 1;
a3 ^= (((x << 1) & a1) ^ ((a1 << 1) & x)) & 0xAAAAAAAAu;
a4 = a2 & a1;
a4 ^= (a4 & 0xAAAAAAAAu) >> 1;
a4 ^= (((a2 << 1) & a1) ^ ((a1 << 1) & a2)) & 0xAAAAAAAAu;
a5 = (a3 & 0xCCCCCCCCu) >> 2;
a3 ^= ((a4 << 2) ^ a4) & 0xCCCCCCCCu;
a4 = a5 & 0x22222222u;
a4 |= a4 >> 1;
a4 ^= (a5 << 1) & 0x22222222u;
a3 ^= a4;
a5 = a3 & 0xA0A0A0A0u;
a5 |= a5 >> 1;
a5 ^= (a3 << 1) & 0xA0A0A0A0u;
a4 = a5 & 0xC0C0C0C0u;
a6 = a4 >> 2;
a4 ^= (a5 << 2) & 0xC0C0C0C0u;
a5 = a6 & 0x20202020u;
a5 |= a5 >> 1;
a5 ^= (a6 << 1) & 0x20202020u;
a4 |= a5;
a3 ^= a4 >> 4;
a3 &= 0x0F0F0F0Fu;
a2 = a3;
a2 ^= (a3 & 0x0C0C0C0Cu) >> 2;
a4 = a3 & a2;
a4 ^= (a4 & 0x0A0A0A0A0Au) >> 1;
a4 ^= (((a3 << 1) & a2) ^ ((a2 << 1) & a3)) & 0x0A0A0A0Au;
a5 = a4 & 0x08080808u;
a5 |= a5 >> 1;
a5 ^= (a4 << 1) & 0x08080808u;
a4 ^= a5 >> 2;
a4 &= 0x03030303u;
a4 ^= (a4 & 0x02020202u) >> 1;
a4 |= a4 << 2;
a3 = a2 & a4;
a3 ^= (a3 & 0x0A0A0A0Au) >> 1;
a3 ^= (((a2 << 1) & a4) ^ ((a4 << 1) & a2)) & 0x0A0A0A0Au;
a3 |= a3 << 4;
a2 = ((a1 & 0xCCCCCCCCu) >> 2) | ((a1 & 0x33333333u) << 2);
x = a1 & a3;
x ^= (x & 0xAAAAAAAAu) >> 1;
x ^= (((a1 << 1) & a3) ^ ((a3 << 1) & a1)) & 0xAAAAAAAAu;
a4 = a2 & a3;
a4 ^= (a4 & 0xAAAAAAAAu) >> 1;
a4 ^= (((a2 << 1) & a3) ^ ((a3 << 1) & a2)) & 0xAAAAAAAAu;
a5 = (x & 0xCCCCCCCCu) >> 2;
x ^= ((a4 << 2) ^ a4) & 0xCCCCCCCCu;
a4 = a5 & 0x22222222u;
a4 |= a4 >> 1;
a4 ^= (a5 << 1) & 0x22222222u;
x ^= a4;
y = ((x & 0xFEFEFEFEu) >> 1) | ((x & 0x01010101u) << 7);
x &= 0x39393939u;
x ^= y & 0x3F3F3F3Fu;
y = ((y & 0xFCFCFCFCu) >> 2) | ((y & 0x03030303u) << 6);
x ^= y & 0x97979797u;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0x9B9B9B9Bu;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0x3C3C3C3Cu;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0xDDDDDDDDu;
y = ((y & 0xFEFEFEFEu) >> 1) | ((y & 0x01010101u) << 7);
x ^= y & 0x72727272u;
x ^= 0x63636363u;
*w = x;
}
static void SubLong(u64 *w)
{
u64 x, y, a1, a2, a3, a4, a5, a6;
x = *w;
y = ((x & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((x & 0x0101010101010101uLL) << 7);
x &= 0xDDDDDDDDDDDDDDDDuLL;
x ^= y & 0x5757575757575757uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x1C1C1C1C1C1C1C1CuLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x4A4A4A4A4A4A4A4AuLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x4242424242424242uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x6464646464646464uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0xE0E0E0E0E0E0E0E0uLL;
a1 = x;
a1 ^= (x & 0xF0F0F0F0F0F0F0F0uLL) >> 4;
a2 = ((x & 0xCCCCCCCCCCCCCCCCuLL) >> 2) | ((x & 0x3333333333333333uLL) << 2);
a3 = x & a1;
a3 ^= (a3 & 0xAAAAAAAAAAAAAAAAuLL) >> 1;
a3 ^= (((x << 1) & a1) ^ ((a1 << 1) & x)) & 0xAAAAAAAAAAAAAAAAuLL;
a4 = a2 & a1;
a4 ^= (a4 & 0xAAAAAAAAAAAAAAAAuLL) >> 1;
a4 ^= (((a2 << 1) & a1) ^ ((a1 << 1) & a2)) & 0xAAAAAAAAAAAAAAAAuLL;
a5 = (a3 & 0xCCCCCCCCCCCCCCCCuLL) >> 2;
a3 ^= ((a4 << 2) ^ a4) & 0xCCCCCCCCCCCCCCCCuLL;
a4 = a5 & 0x2222222222222222uLL;
a4 |= a4 >> 1;
a4 ^= (a5 << 1) & 0x2222222222222222uLL;
a3 ^= a4;
a5 = a3 & 0xA0A0A0A0A0A0A0A0uLL;
a5 |= a5 >> 1;
a5 ^= (a3 << 1) & 0xA0A0A0A0A0A0A0A0uLL;
a4 = a5 & 0xC0C0C0C0C0C0C0C0uLL;
a6 = a4 >> 2;
a4 ^= (a5 << 2) & 0xC0C0C0C0C0C0C0C0uLL;
a5 = a6 & 0x2020202020202020uLL;
a5 |= a5 >> 1;
a5 ^= (a6 << 1) & 0x2020202020202020uLL;
a4 |= a5;
a3 ^= a4 >> 4;
a3 &= 0x0F0F0F0F0F0F0F0FuLL;
a2 = a3;
a2 ^= (a3 & 0x0C0C0C0C0C0C0C0CuLL) >> 2;
a4 = a3 & a2;
a4 ^= (a4 & 0x0A0A0A0A0A0A0A0AuLL) >> 1;
a4 ^= (((a3 << 1) & a2) ^ ((a2 << 1) & a3)) & 0x0A0A0A0A0A0A0A0AuLL;
a5 = a4 & 0x0808080808080808uLL;
a5 |= a5 >> 1;
a5 ^= (a4 << 1) & 0x0808080808080808uLL;
a4 ^= a5 >> 2;
a4 &= 0x0303030303030303uLL;
a4 ^= (a4 & 0x0202020202020202uLL) >> 1;
a4 |= a4 << 2;
a3 = a2 & a4;
a3 ^= (a3 & 0x0A0A0A0A0A0A0A0AuLL) >> 1;
a3 ^= (((a2 << 1) & a4) ^ ((a4 << 1) & a2)) & 0x0A0A0A0A0A0A0A0AuLL;
a3 |= a3 << 4;
a2 = ((a1 & 0xCCCCCCCCCCCCCCCCuLL) >> 2) | ((a1 & 0x3333333333333333uLL) << 2);
x = a1 & a3;
x ^= (x & 0xAAAAAAAAAAAAAAAAuLL) >> 1;
x ^= (((a1 << 1) & a3) ^ ((a3 << 1) & a1)) & 0xAAAAAAAAAAAAAAAAuLL;
a4 = a2 & a3;
a4 ^= (a4 & 0xAAAAAAAAAAAAAAAAuLL) >> 1;
a4 ^= (((a2 << 1) & a3) ^ ((a3 << 1) & a2)) & 0xAAAAAAAAAAAAAAAAuLL;
a5 = (x & 0xCCCCCCCCCCCCCCCCuLL) >> 2;
x ^= ((a4 << 2) ^ a4) & 0xCCCCCCCCCCCCCCCCuLL;
a4 = a5 & 0x2222222222222222uLL;
a4 |= a4 >> 1;
a4 ^= (a5 << 1) & 0x2222222222222222uLL;
x ^= a4;
y = ((x & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((x & 0x0101010101010101uLL) << 7);
x &= 0x3939393939393939uLL;
x ^= y & 0x3F3F3F3F3F3F3F3FuLL;
y = ((y & 0xFCFCFCFCFCFCFCFCuLL) >> 2) | ((y & 0x0303030303030303uLL) << 6);
x ^= y & 0x9797979797979797uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x9B9B9B9B9B9B9B9BuLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x3C3C3C3C3C3C3C3CuLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0xDDDDDDDDDDDDDDDDuLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x7272727272727272uLL;
x ^= 0x6363636363636363uLL;
*w = x;
}
/*
* This computes w := (S^-1 * (w + c))^-1
*/
static void InvSubLong(u64 *w)
{
u64 x, y, a1, a2, a3, a4, a5, a6;
x = *w;
x ^= 0x6363636363636363uLL;
y = ((x & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((x & 0x0101010101010101uLL) << 7);
x &= 0xFDFDFDFDFDFDFDFDuLL;
x ^= y & 0x5E5E5E5E5E5E5E5EuLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0xF3F3F3F3F3F3F3F3uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0xF5F5F5F5F5F5F5F5uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x7878787878787878uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x7777777777777777uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x1515151515151515uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0xA5A5A5A5A5A5A5A5uLL;
a1 = x;
a1 ^= (x & 0xF0F0F0F0F0F0F0F0uLL) >> 4;
a2 = ((x & 0xCCCCCCCCCCCCCCCCuLL) >> 2) | ((x & 0x3333333333333333uLL) << 2);
a3 = x & a1;
a3 ^= (a3 & 0xAAAAAAAAAAAAAAAAuLL) >> 1;
a3 ^= (((x << 1) & a1) ^ ((a1 << 1) & x)) & 0xAAAAAAAAAAAAAAAAuLL;
a4 = a2 & a1;
a4 ^= (a4 & 0xAAAAAAAAAAAAAAAAuLL) >> 1;
a4 ^= (((a2 << 1) & a1) ^ ((a1 << 1) & a2)) & 0xAAAAAAAAAAAAAAAAuLL;
a5 = (a3 & 0xCCCCCCCCCCCCCCCCuLL) >> 2;
a3 ^= ((a4 << 2) ^ a4) & 0xCCCCCCCCCCCCCCCCuLL;
a4 = a5 & 0x2222222222222222uLL;
a4 |= a4 >> 1;
a4 ^= (a5 << 1) & 0x2222222222222222uLL;
a3 ^= a4;
a5 = a3 & 0xA0A0A0A0A0A0A0A0uLL;
a5 |= a5 >> 1;
a5 ^= (a3 << 1) & 0xA0A0A0A0A0A0A0A0uLL;
a4 = a5 & 0xC0C0C0C0C0C0C0C0uLL;
a6 = a4 >> 2;
a4 ^= (a5 << 2) & 0xC0C0C0C0C0C0C0C0uLL;
a5 = a6 & 0x2020202020202020uLL;
a5 |= a5 >> 1;
a5 ^= (a6 << 1) & 0x2020202020202020uLL;
a4 |= a5;
a3 ^= a4 >> 4;
a3 &= 0x0F0F0F0F0F0F0F0FuLL;
a2 = a3;
a2 ^= (a3 & 0x0C0C0C0C0C0C0C0CuLL) >> 2;
a4 = a3 & a2;
a4 ^= (a4 & 0x0A0A0A0A0A0A0A0AuLL) >> 1;
a4 ^= (((a3 << 1) & a2) ^ ((a2 << 1) & a3)) & 0x0A0A0A0A0A0A0A0AuLL;
a5 = a4 & 0x0808080808080808uLL;
a5 |= a5 >> 1;
a5 ^= (a4 << 1) & 0x0808080808080808uLL;
a4 ^= a5 >> 2;
a4 &= 0x0303030303030303uLL;
a4 ^= (a4 & 0x0202020202020202uLL) >> 1;
a4 |= a4 << 2;
a3 = a2 & a4;
a3 ^= (a3 & 0x0A0A0A0A0A0A0A0AuLL) >> 1;
a3 ^= (((a2 << 1) & a4) ^ ((a4 << 1) & a2)) & 0x0A0A0A0A0A0A0A0AuLL;
a3 |= a3 << 4;
a2 = ((a1 & 0xCCCCCCCCCCCCCCCCuLL) >> 2) | ((a1 & 0x3333333333333333uLL) << 2);
x = a1 & a3;
x ^= (x & 0xAAAAAAAAAAAAAAAAuLL) >> 1;
x ^= (((a1 << 1) & a3) ^ ((a3 << 1) & a1)) & 0xAAAAAAAAAAAAAAAAuLL;
a4 = a2 & a3;
a4 ^= (a4 & 0xAAAAAAAAAAAAAAAAuLL) >> 1;
a4 ^= (((a2 << 1) & a3) ^ ((a3 << 1) & a2)) & 0xAAAAAAAAAAAAAAAAuLL;
a5 = (x & 0xCCCCCCCCCCCCCCCCuLL) >> 2;
x ^= ((a4 << 2) ^ a4) & 0xCCCCCCCCCCCCCCCCuLL;
a4 = a5 & 0x2222222222222222uLL;
a4 |= a4 >> 1;
a4 ^= (a5 << 1) & 0x2222222222222222uLL;
x ^= a4;
y = ((x & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((x & 0x0101010101010101uLL) << 7);
x &= 0xB5B5B5B5B5B5B5B5uLL;
x ^= y & 0x4040404040404040uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x8080808080808080uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x1616161616161616uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0xEBEBEBEBEBEBEBEBuLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x9797979797979797uLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0xFBFBFBFBFBFBFBFBuLL;
y = ((y & 0xFEFEFEFEFEFEFEFEuLL) >> 1) | ((y & 0x0101010101010101uLL) << 7);
x ^= y & 0x7D7D7D7D7D7D7D7DuLL;
*w = x;
}
static void ShiftRows(u64 *state)
{
unsigned char s[4];
unsigned char *s0;
int r;
s0 = (unsigned char *)state;
for (r = 0; r < 4; r++) {
s[0] = s0[0*4 + r];
s[1] = s0[1*4 + r];
s[2] = s0[2*4 + r];
s[3] = s0[3*4 + r];
s0[0*4 + r] = s[(r+0) % 4];
s0[1*4 + r] = s[(r+1) % 4];
s0[2*4 + r] = s[(r+2) % 4];
s0[3*4 + r] = s[(r+3) % 4];
}
}
static void InvShiftRows(u64 *state)
{
unsigned char s[4];
unsigned char *s0;
int r;
s0 = (unsigned char *)state;
for (r = 0; r < 4; r++) {
s[0] = s0[0*4 + r];
s[1] = s0[1*4 + r];
s[2] = s0[2*4 + r];
s[3] = s0[3*4 + r];
s0[0*4 + r] = s[(4-r) % 4];
s0[1*4 + r] = s[(5-r) % 4];
s0[2*4 + r] = s[(6-r) % 4];
s0[3*4 + r] = s[(7-r) % 4];
}
}
static void MixColumns(u64 *state)
{
uni s1;
uni s;
int c;
for (c = 0; c < 2; c++) {
s1.d = state[c];
s.d = s1.d;
s.d ^= ((s.d & 0xFFFF0000FFFF0000uLL) >> 16)
| ((s.d & 0x0000FFFF0000FFFFuLL) << 16);
s.d ^= ((s.d & 0xFF00FF00FF00FF00uLL) >> 8)
| ((s.d & 0x00FF00FF00FF00FFuLL) << 8);
s.d ^= s1.d;
XtimeLong(&s1.d);
s.d ^= s1.d;
s.b[0] ^= s1.b[1];
s.b[1] ^= s1.b[2];
s.b[2] ^= s1.b[3];
s.b[3] ^= s1.b[0];
s.b[4] ^= s1.b[5];
s.b[5] ^= s1.b[6];
s.b[6] ^= s1.b[7];
s.b[7] ^= s1.b[4];
state[c] = s.d;
}
}
static void InvMixColumns(u64 *state)
{
uni s1;
uni s;
int c;
for (c = 0; c < 2; c++) {
s1.d = state[c];
s.d = s1.d;
s.d ^= ((s.d & 0xFFFF0000FFFF0000uLL) >> 16)
| ((s.d & 0x0000FFFF0000FFFFuLL) << 16);
s.d ^= ((s.d & 0xFF00FF00FF00FF00uLL) >> 8)
| ((s.d & 0x00FF00FF00FF00FFuLL) << 8);
s.d ^= s1.d;
XtimeLong(&s1.d);
s.d ^= s1.d;
s.b[0] ^= s1.b[1];
s.b[1] ^= s1.b[2];
s.b[2] ^= s1.b[3];
s.b[3] ^= s1.b[0];
s.b[4] ^= s1.b[5];
s.b[5] ^= s1.b[6];
s.b[6] ^= s1.b[7];
s.b[7] ^= s1.b[4];
XtimeLong(&s1.d);
s1.d ^= ((s1.d & 0xFFFF0000FFFF0000uLL) >> 16)
| ((s1.d & 0x0000FFFF0000FFFFuLL) << 16);
s.d ^= s1.d;
XtimeLong(&s1.d);
s1.d ^= ((s1.d & 0xFF00FF00FF00FF00uLL) >> 8)
| ((s1.d & 0x00FF00FF00FF00FFuLL) << 8);
s.d ^= s1.d;
state[c] = s.d;
}
}
static void AddRoundKey(u64 *state, const u64 *w)
{
state[0] ^= w[0];
state[1] ^= w[1];
}
static void Cipher(const unsigned char *in, unsigned char *out,
const u64 *w, int nr)
{
u64 state[2];
int i;
memcpy(state, in, 16);
AddRoundKey(state, w);
for (i = 1; i < nr; i++) {
SubLong(&state[0]);
SubLong(&state[1]);
ShiftRows(state);
MixColumns(state);
AddRoundKey(state, w + i*2);
}
SubLong(&state[0]);
SubLong(&state[1]);
ShiftRows(state);
AddRoundKey(state, w + nr*2);
memcpy(out, state, 16);
}
static void InvCipher(const unsigned char *in, unsigned char *out,
const u64 *w, int nr)
{
u64 state[2];
int i;
memcpy(state, in, 16);
AddRoundKey(state, w + nr*2);
for (i = nr - 1; i > 0; i--) {
InvShiftRows(state);
InvSubLong(&state[0]);
InvSubLong(&state[1]);
AddRoundKey(state, w + i*2);
InvMixColumns(state);
}
InvShiftRows(state);
InvSubLong(&state[0]);
InvSubLong(&state[1]);
AddRoundKey(state, w);
memcpy(out, state, 16);
}
static void RotWord(u32 *x)
{
unsigned char *w0;
unsigned char tmp;
w0 = (unsigned char *)x;
tmp = w0[0];
w0[0] = w0[1];
w0[1] = w0[2];
w0[2] = w0[3];
w0[3] = tmp;
}
static void KeyExpansion(const unsigned char *key, u64 *w,
int nr, int nk)
{
u32 rcon;
uni prev;
u32 temp;
int i, n;
memcpy(w, key, nk*4);
memcpy(&rcon, "\1\0\0\0", 4);
n = nk/2;
prev.d = w[n-1];
for (i = n; i < (nr+1)*2; i++) {
temp = prev.w[1];
if (i % n == 0) {
RotWord(&temp);
SubWord(&temp);
temp ^= rcon;
XtimeWord(&rcon);
} else if (nk > 6 && i % n == 2) {
SubWord(&temp);
}
prev.d = w[i-n];
prev.w[0] ^= temp;
prev.w[1] ^= prev.w[0];
w[i] = prev.d;
}
}
/**
* Expand the cipher key into the encryption key schedule.
*/
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key)
{
u64 *rk;
if (!userKey || !key)
return -1;
if (bits != 128 && bits != 192 && bits != 256)
return -2;
rk = (u64*)key->rd_key;
if (bits == 128)
key->rounds = 10;
else if (bits == 192)
key->rounds = 12;
else
key->rounds = 14;
KeyExpansion(userKey, rk, key->rounds, bits/32);
return 0;
}
/**
* Expand the cipher key into the decryption key schedule.
*/
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key)
{
return AES_set_encrypt_key(userKey, bits, key);
}
/*
* Encrypt a single block
* in and out can overlap
*/
void AES_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key)
{
const u64 *rk;
assert(in && out && key);
rk = (u64*)key->rd_key;
Cipher(in, out, rk, key->rounds);
}
/*
* Decrypt a single block
* in and out can overlap
*/
void AES_decrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key)
{
const u64 *rk;
assert(in && out && key);
rk = (u64*)key->rd_key;
InvCipher(in, out, rk, key->rounds);
}
#elif !defined(AES_ASM)
/*-
Te0[x] = S [x].[02, 01, 01, 03];
Te1[x] = S [x].[03, 02, 01, 01];
Te2[x] = S [x].[01, 03, 02, 01];
Te3[x] = S [x].[01, 01, 03, 02];
Td0[x] = Si[x].[0e, 09, 0d, 0b];
Td1[x] = Si[x].[0b, 0e, 09, 0d];
Td2[x] = Si[x].[0d, 0b, 0e, 09];
Td3[x] = Si[x].[09, 0d, 0b, 0e];
Td4[x] = Si[x].[01];
*/
static const u32 Te0[256] = {
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
};
static const u32 Te1[256] = {
0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
};
static const u32 Te2[256] = {
0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
};
static const u32 Te3[256] = {
0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
};
static const u32 Td0[256] = {
0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
};
static const u32 Td1[256] = {
0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
};
static const u32 Td2[256] = {
0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
};
static const u32 Td3[256] = {
0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
};
static const u8 Td4[256] = {
0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, 0xffU, 0x87U,
0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU,
0x54U, 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU,
0xeeU, 0x4cU, 0x95U, 0x0bU, 0x42U, 0xfaU, 0xc3U, 0x4eU,
0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, 0xb2U,
0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U,
0x72U, 0xf8U, 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U,
0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, 0x65U, 0xb6U, 0x92U,
0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU,
0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U,
0x90U, 0xd8U, 0xabU, 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU,
0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, 0x45U, 0x06U,
0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U,
0xc1U, 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU,
0x3aU, 0x91U, 0x11U, 0x41U, 0x4fU, 0x67U, 0xdcU, 0xeaU,
0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, 0x73U,
0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U,
0xe2U, 0xf9U, 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU,
0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, 0x29U, 0xc5U, 0x89U,
0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU,
0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U,
0x9aU, 0xdbU, 0xc0U, 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U,
0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, 0xc7U, 0x31U,
0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU,
0x60U, 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU,
0x2dU, 0xe5U, 0x7aU, 0x9fU, 0x93U, 0xc9U, 0x9cU, 0xefU,
0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, 0xb0U,
0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U,
0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
};
static const u32 rcon[] = {
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000,
0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
};
/**
* Expand the cipher key into the encryption key schedule.
*/
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key)
{
u32 *rk;
int i = 0;
u32 temp;
if (!userKey || !key)
return -1;
if (bits != 128 && bits != 192 && bits != 256)
return -2;
rk = key->rd_key;
if (bits == 128)
key->rounds = 10;
else if (bits == 192)
key->rounds = 12;
else
key->rounds = 14;
rk[0] = GETU32(userKey );
rk[1] = GETU32(userKey + 4);
rk[2] = GETU32(userKey + 8);
rk[3] = GETU32(userKey + 12);
if (bits == 128) {
while (1) {
temp = rk[3];
rk[4] = rk[0] ^
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
(Te1[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[5] = rk[1] ^ rk[4];
rk[6] = rk[2] ^ rk[5];
rk[7] = rk[3] ^ rk[6];
if (++i == 10) {
return 0;
}
rk += 4;
}
}
rk[4] = GETU32(userKey + 16);
rk[5] = GETU32(userKey + 20);
if (bits == 192) {
while (1) {
temp = rk[ 5];
rk[ 6] = rk[ 0] ^
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
(Te1[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[ 7] = rk[ 1] ^ rk[ 6];
rk[ 8] = rk[ 2] ^ rk[ 7];
rk[ 9] = rk[ 3] ^ rk[ 8];
if (++i == 8) {
return 0;
}
rk[10] = rk[ 4] ^ rk[ 9];
rk[11] = rk[ 5] ^ rk[10];
rk += 6;
}
}
rk[6] = GETU32(userKey + 24);
rk[7] = GETU32(userKey + 28);
if (bits == 256) {
while (1) {
temp = rk[ 7];
rk[ 8] = rk[ 0] ^
(Te2[(temp >> 16) & 0xff] & 0xff000000) ^
(Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te0[(temp ) & 0xff] & 0x0000ff00) ^
(Te1[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[ 9] = rk[ 1] ^ rk[ 8];
rk[10] = rk[ 2] ^ rk[ 9];
rk[11] = rk[ 3] ^ rk[10];
if (++i == 7) {
return 0;
}
temp = rk[11];
rk[12] = rk[ 4] ^
(Te2[(temp >> 24) ] & 0xff000000) ^
(Te3[(temp >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(temp >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(temp ) & 0xff] & 0x000000ff);
rk[13] = rk[ 5] ^ rk[12];
rk[14] = rk[ 6] ^ rk[13];
rk[15] = rk[ 7] ^ rk[14];
rk += 8;
}
}
return 0;
}
/**
* Expand the cipher key into the decryption key schedule.
*/
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key)
{
u32 *rk;
int i, j, status;
u32 temp;
/* first, start with an encryption schedule */
status = AES_set_encrypt_key(userKey, bits, key);
if (status < 0)
return status;
rk = key->rd_key;
/* invert the order of the round keys: */
for (i = 0, j = 4*(key->rounds); i < j; i += 4, j -= 4) {
temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp;
temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
}
/* apply the inverse MixColumn transform to all round keys but the first and the last: */
for (i = 1; i < (key->rounds); i++) {
rk += 4;
rk[0] =
Td0[Te1[(rk[0] >> 24) ] & 0xff] ^
Td1[Te1[(rk[0] >> 16) & 0xff] & 0xff] ^
Td2[Te1[(rk[0] >> 8) & 0xff] & 0xff] ^
Td3[Te1[(rk[0] ) & 0xff] & 0xff];
rk[1] =
Td0[Te1[(rk[1] >> 24) ] & 0xff] ^
Td1[Te1[(rk[1] >> 16) & 0xff] & 0xff] ^
Td2[Te1[(rk[1] >> 8) & 0xff] & 0xff] ^
Td3[Te1[(rk[1] ) & 0xff] & 0xff];
rk[2] =
Td0[Te1[(rk[2] >> 24) ] & 0xff] ^
Td1[Te1[(rk[2] >> 16) & 0xff] & 0xff] ^
Td2[Te1[(rk[2] >> 8) & 0xff] & 0xff] ^
Td3[Te1[(rk[2] ) & 0xff] & 0xff];
rk[3] =
Td0[Te1[(rk[3] >> 24) ] & 0xff] ^
Td1[Te1[(rk[3] >> 16) & 0xff] & 0xff] ^
Td2[Te1[(rk[3] >> 8) & 0xff] & 0xff] ^
Td3[Te1[(rk[3] ) & 0xff] & 0xff];
}
return 0;
}
/*
* Encrypt a single block
* in and out can overlap
*/
void AES_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key) {
const u32 *rk;
u32 s0, s1, s2, s3, t0, t1, t2, t3;
#ifndef FULL_UNROLL
int r;
#endif /* ?FULL_UNROLL */
assert(in && out && key);
rk = key->rd_key;
/*
* map byte array block to cipher state
* and add initial round key:
*/
s0 = GETU32(in ) ^ rk[0];
s1 = GETU32(in + 4) ^ rk[1];
s2 = GETU32(in + 8) ^ rk[2];
s3 = GETU32(in + 12) ^ rk[3];
#ifdef FULL_UNROLL
/* round 1: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7];
/* round 2: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11];
/* round 3: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15];
/* round 4: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19];
/* round 5: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23];
/* round 6: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27];
/* round 7: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31];
/* round 8: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35];
/* round 9: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39];
if (key->rounds > 10) {
/* round 10: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43];
/* round 11: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47];
if (key->rounds > 12) {
/* round 12: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51];
/* round 13: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55];
}
}
rk += key->rounds << 2;
#else /* !FULL_UNROLL */
/*
* Nr - 1 full rounds:
*/
r = key->rounds >> 1;
for (;;) {
t0 =
Te0[(s0 >> 24) ] ^
Te1[(s1 >> 16) & 0xff] ^
Te2[(s2 >> 8) & 0xff] ^
Te3[(s3 ) & 0xff] ^
rk[4];
t1 =
Te0[(s1 >> 24) ] ^
Te1[(s2 >> 16) & 0xff] ^
Te2[(s3 >> 8) & 0xff] ^
Te3[(s0 ) & 0xff] ^
rk[5];
t2 =
Te0[(s2 >> 24) ] ^
Te1[(s3 >> 16) & 0xff] ^
Te2[(s0 >> 8) & 0xff] ^
Te3[(s1 ) & 0xff] ^
rk[6];
t3 =
Te0[(s3 >> 24) ] ^
Te1[(s0 >> 16) & 0xff] ^
Te2[(s1 >> 8) & 0xff] ^
Te3[(s2 ) & 0xff] ^
rk[7];
rk += 8;
if (--r == 0) {
break;
}
s0 =
Te0[(t0 >> 24) ] ^
Te1[(t1 >> 16) & 0xff] ^
Te2[(t2 >> 8) & 0xff] ^
Te3[(t3 ) & 0xff] ^
rk[0];
s1 =
Te0[(t1 >> 24) ] ^
Te1[(t2 >> 16) & 0xff] ^
Te2[(t3 >> 8) & 0xff] ^
Te3[(t0 ) & 0xff] ^
rk[1];
s2 =
Te0[(t2 >> 24) ] ^
Te1[(t3 >> 16) & 0xff] ^
Te2[(t0 >> 8) & 0xff] ^
Te3[(t1 ) & 0xff] ^
rk[2];
s3 =
Te0[(t3 >> 24) ] ^
Te1[(t0 >> 16) & 0xff] ^
Te2[(t1 >> 8) & 0xff] ^
Te3[(t2 ) & 0xff] ^
rk[3];
}
#endif /* ?FULL_UNROLL */
/*
* apply last round and
* map cipher state to byte array block:
*/
s0 =
(Te2[(t0 >> 24) ] & 0xff000000) ^
(Te3[(t1 >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(t2 >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(t3 ) & 0xff] & 0x000000ff) ^
rk[0];
PUTU32(out , s0);
s1 =
(Te2[(t1 >> 24) ] & 0xff000000) ^
(Te3[(t2 >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(t3 >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(t0 ) & 0xff] & 0x000000ff) ^
rk[1];
PUTU32(out + 4, s1);
s2 =
(Te2[(t2 >> 24) ] & 0xff000000) ^
(Te3[(t3 >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(t0 >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(t1 ) & 0xff] & 0x000000ff) ^
rk[2];
PUTU32(out + 8, s2);
s3 =
(Te2[(t3 >> 24) ] & 0xff000000) ^
(Te3[(t0 >> 16) & 0xff] & 0x00ff0000) ^
(Te0[(t1 >> 8) & 0xff] & 0x0000ff00) ^
(Te1[(t2 ) & 0xff] & 0x000000ff) ^
rk[3];
PUTU32(out + 12, s3);
}
/*
* Decrypt a single block
* in and out can overlap
*/
void AES_decrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key)
{
const u32 *rk;
u32 s0, s1, s2, s3, t0, t1, t2, t3;
#ifndef FULL_UNROLL
int r;
#endif /* ?FULL_UNROLL */
assert(in && out && key);
rk = key->rd_key;
/*
* map byte array block to cipher state
* and add initial round key:
*/
s0 = GETU32(in ) ^ rk[0];
s1 = GETU32(in + 4) ^ rk[1];
s2 = GETU32(in + 8) ^ rk[2];
s3 = GETU32(in + 12) ^ rk[3];
#ifdef FULL_UNROLL
/* round 1: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7];
/* round 2: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11];
/* round 3: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15];
/* round 4: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19];
/* round 5: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23];
/* round 6: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27];
/* round 7: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31];
/* round 8: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35];
/* round 9: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39];
if (key->rounds > 10) {
/* round 10: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43];
/* round 11: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47];
if (key->rounds > 12) {
/* round 12: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51];
/* round 13: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55];
}
}
rk += key->rounds << 2;
#else /* !FULL_UNROLL */
/*
* Nr - 1 full rounds:
*/
r = key->rounds >> 1;
for (;;) {
t0 =
Td0[(s0 >> 24) ] ^
Td1[(s3 >> 16) & 0xff] ^
Td2[(s2 >> 8) & 0xff] ^
Td3[(s1 ) & 0xff] ^
rk[4];
t1 =
Td0[(s1 >> 24) ] ^
Td1[(s0 >> 16) & 0xff] ^
Td2[(s3 >> 8) & 0xff] ^
Td3[(s2 ) & 0xff] ^
rk[5];
t2 =
Td0[(s2 >> 24) ] ^
Td1[(s1 >> 16) & 0xff] ^
Td2[(s0 >> 8) & 0xff] ^
Td3[(s3 ) & 0xff] ^
rk[6];
t3 =
Td0[(s3 >> 24) ] ^
Td1[(s2 >> 16) & 0xff] ^
Td2[(s1 >> 8) & 0xff] ^
Td3[(s0 ) & 0xff] ^
rk[7];
rk += 8;
if (--r == 0) {
break;
}
s0 =
Td0[(t0 >> 24) ] ^
Td1[(t3 >> 16) & 0xff] ^
Td2[(t2 >> 8) & 0xff] ^
Td3[(t1 ) & 0xff] ^
rk[0];
s1 =
Td0[(t1 >> 24) ] ^
Td1[(t0 >> 16) & 0xff] ^
Td2[(t3 >> 8) & 0xff] ^
Td3[(t2 ) & 0xff] ^
rk[1];
s2 =
Td0[(t2 >> 24) ] ^
Td1[(t1 >> 16) & 0xff] ^
Td2[(t0 >> 8) & 0xff] ^
Td3[(t3 ) & 0xff] ^
rk[2];
s3 =
Td0[(t3 >> 24) ] ^
Td1[(t2 >> 16) & 0xff] ^
Td2[(t1 >> 8) & 0xff] ^
Td3[(t0 ) & 0xff] ^
rk[3];
}
#endif /* ?FULL_UNROLL */
/*
* apply last round and
* map cipher state to byte array block:
*/
s0 =
((u32)Td4[(t0 >> 24) ] << 24) ^
((u32)Td4[(t3 >> 16) & 0xff] << 16) ^
((u32)Td4[(t2 >> 8) & 0xff] << 8) ^
((u32)Td4[(t1 ) & 0xff]) ^
rk[0];
PUTU32(out , s0);
s1 =
((u32)Td4[(t1 >> 24) ] << 24) ^
((u32)Td4[(t0 >> 16) & 0xff] << 16) ^
((u32)Td4[(t3 >> 8) & 0xff] << 8) ^
((u32)Td4[(t2 ) & 0xff]) ^
rk[1];
PUTU32(out + 4, s1);
s2 =
((u32)Td4[(t2 >> 24) ] << 24) ^
((u32)Td4[(t1 >> 16) & 0xff] << 16) ^
((u32)Td4[(t0 >> 8) & 0xff] << 8) ^
((u32)Td4[(t3 ) & 0xff]) ^
rk[2];
PUTU32(out + 8, s2);
s3 =
((u32)Td4[(t3 >> 24) ] << 24) ^
((u32)Td4[(t2 >> 16) & 0xff] << 16) ^
((u32)Td4[(t1 >> 8) & 0xff] << 8) ^
((u32)Td4[(t0 ) & 0xff]) ^
rk[3];
PUTU32(out + 12, s3);
}
#else /* AES_ASM */
static const u8 Te4[256] = {
0x63U, 0x7cU, 0x77U, 0x7bU, 0xf2U, 0x6bU, 0x6fU, 0xc5U,
0x30U, 0x01U, 0x67U, 0x2bU, 0xfeU, 0xd7U, 0xabU, 0x76U,
0xcaU, 0x82U, 0xc9U, 0x7dU, 0xfaU, 0x59U, 0x47U, 0xf0U,
0xadU, 0xd4U, 0xa2U, 0xafU, 0x9cU, 0xa4U, 0x72U, 0xc0U,
0xb7U, 0xfdU, 0x93U, 0x26U, 0x36U, 0x3fU, 0xf7U, 0xccU,
0x34U, 0xa5U, 0xe5U, 0xf1U, 0x71U, 0xd8U, 0x31U, 0x15U,
0x04U, 0xc7U, 0x23U, 0xc3U, 0x18U, 0x96U, 0x05U, 0x9aU,
0x07U, 0x12U, 0x80U, 0xe2U, 0xebU, 0x27U, 0xb2U, 0x75U,
0x09U, 0x83U, 0x2cU, 0x1aU, 0x1bU, 0x6eU, 0x5aU, 0xa0U,
0x52U, 0x3bU, 0xd6U, 0xb3U, 0x29U, 0xe3U, 0x2fU, 0x84U,
0x53U, 0xd1U, 0x00U, 0xedU, 0x20U, 0xfcU, 0xb1U, 0x5bU,
0x6aU, 0xcbU, 0xbeU, 0x39U, 0x4aU, 0x4cU, 0x58U, 0xcfU,
0xd0U, 0xefU, 0xaaU, 0xfbU, 0x43U, 0x4dU, 0x33U, 0x85U,
0x45U, 0xf9U, 0x02U, 0x7fU, 0x50U, 0x3cU, 0x9fU, 0xa8U,
0x51U, 0xa3U, 0x40U, 0x8fU, 0x92U, 0x9dU, 0x38U, 0xf5U,
0xbcU, 0xb6U, 0xdaU, 0x21U, 0x10U, 0xffU, 0xf3U, 0xd2U,
0xcdU, 0x0cU, 0x13U, 0xecU, 0x5fU, 0x97U, 0x44U, 0x17U,
0xc4U, 0xa7U, 0x7eU, 0x3dU, 0x64U, 0x5dU, 0x19U, 0x73U,
0x60U, 0x81U, 0x4fU, 0xdcU, 0x22U, 0x2aU, 0x90U, 0x88U,
0x46U, 0xeeU, 0xb8U, 0x14U, 0xdeU, 0x5eU, 0x0bU, 0xdbU,
0xe0U, 0x32U, 0x3aU, 0x0aU, 0x49U, 0x06U, 0x24U, 0x5cU,
0xc2U, 0xd3U, 0xacU, 0x62U, 0x91U, 0x95U, 0xe4U, 0x79U,
0xe7U, 0xc8U, 0x37U, 0x6dU, 0x8dU, 0xd5U, 0x4eU, 0xa9U,
0x6cU, 0x56U, 0xf4U, 0xeaU, 0x65U, 0x7aU, 0xaeU, 0x08U,
0xbaU, 0x78U, 0x25U, 0x2eU, 0x1cU, 0xa6U, 0xb4U, 0xc6U,
0xe8U, 0xddU, 0x74U, 0x1fU, 0x4bU, 0xbdU, 0x8bU, 0x8aU,
0x70U, 0x3eU, 0xb5U, 0x66U, 0x48U, 0x03U, 0xf6U, 0x0eU,
0x61U, 0x35U, 0x57U, 0xb9U, 0x86U, 0xc1U, 0x1dU, 0x9eU,
0xe1U, 0xf8U, 0x98U, 0x11U, 0x69U, 0xd9U, 0x8eU, 0x94U,
0x9bU, 0x1eU, 0x87U, 0xe9U, 0xceU, 0x55U, 0x28U, 0xdfU,
0x8cU, 0xa1U, 0x89U, 0x0dU, 0xbfU, 0xe6U, 0x42U, 0x68U,
0x41U, 0x99U, 0x2dU, 0x0fU, 0xb0U, 0x54U, 0xbbU, 0x16U
};
static const u32 rcon[] = {
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000,
0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
};
/**
* Expand the cipher key into the encryption key schedule.
*/
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key)
{
u32 *rk;
int i = 0;
u32 temp;
if (!userKey || !key)
return -1;
if (bits != 128 && bits != 192 && bits != 256)
return -2;
rk = key->rd_key;
if (bits == 128)
key->rounds = 10;
else if (bits == 192)
key->rounds = 12;
else
key->rounds = 14;
rk[0] = GETU32(userKey );
rk[1] = GETU32(userKey + 4);
rk[2] = GETU32(userKey + 8);
rk[3] = GETU32(userKey + 12);
if (bits == 128) {
while (1) {
temp = rk[3];
rk[4] = rk[0] ^
((u32)Te4[(temp >> 16) & 0xff] << 24) ^
((u32)Te4[(temp >> 8) & 0xff] << 16) ^
((u32)Te4[(temp ) & 0xff] << 8) ^
((u32)Te4[(temp >> 24) ]) ^
rcon[i];
rk[5] = rk[1] ^ rk[4];
rk[6] = rk[2] ^ rk[5];
rk[7] = rk[3] ^ rk[6];
if (++i == 10) {
return 0;
}
rk += 4;
}
}
rk[4] = GETU32(userKey + 16);
rk[5] = GETU32(userKey + 20);
if (bits == 192) {
while (1) {
temp = rk[ 5];
rk[ 6] = rk[ 0] ^
((u32)Te4[(temp >> 16) & 0xff] << 24) ^
((u32)Te4[(temp >> 8) & 0xff] << 16) ^
((u32)Te4[(temp ) & 0xff] << 8) ^
((u32)Te4[(temp >> 24) ]) ^
rcon[i];
rk[ 7] = rk[ 1] ^ rk[ 6];
rk[ 8] = rk[ 2] ^ rk[ 7];
rk[ 9] = rk[ 3] ^ rk[ 8];
if (++i == 8) {
return 0;
}
rk[10] = rk[ 4] ^ rk[ 9];
rk[11] = rk[ 5] ^ rk[10];
rk += 6;
}
}
rk[6] = GETU32(userKey + 24);
rk[7] = GETU32(userKey + 28);
if (bits == 256) {
while (1) {
temp = rk[ 7];
rk[ 8] = rk[ 0] ^
((u32)Te4[(temp >> 16) & 0xff] << 24) ^
((u32)Te4[(temp >> 8) & 0xff] << 16) ^
((u32)Te4[(temp ) & 0xff] << 8) ^
((u32)Te4[(temp >> 24) ]) ^
rcon[i];
rk[ 9] = rk[ 1] ^ rk[ 8];
rk[10] = rk[ 2] ^ rk[ 9];
rk[11] = rk[ 3] ^ rk[10];
if (++i == 7) {
return 0;
}
temp = rk[11];
rk[12] = rk[ 4] ^
((u32)Te4[(temp >> 24) ] << 24) ^
((u32)Te4[(temp >> 16) & 0xff] << 16) ^
((u32)Te4[(temp >> 8) & 0xff] << 8) ^
((u32)Te4[(temp ) & 0xff]);
rk[13] = rk[ 5] ^ rk[12];
rk[14] = rk[ 6] ^ rk[13];
rk[15] = rk[ 7] ^ rk[14];
rk += 8;
}
}
return 0;
}
/**
* Expand the cipher key into the decryption key schedule.
*/
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key)
{
u32 *rk;
int i, j, status;
u32 temp;
/* first, start with an encryption schedule */
status = AES_set_encrypt_key(userKey, bits, key);
if (status < 0)
return status;
rk = key->rd_key;
/* invert the order of the round keys: */
for (i = 0, j = 4*(key->rounds); i < j; i += 4, j -= 4) {
temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp;
temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
}
/* apply the inverse MixColumn transform to all round keys but the first and the last: */
for (i = 1; i < (key->rounds); i++) {
rk += 4;
for (j = 0; j < 4; j++) {
u32 tp1, tp2, tp4, tp8, tp9, tpb, tpd, tpe, m;
tp1 = rk[j];
m = tp1 & 0x80808080;
tp2 = ((tp1 & 0x7f7f7f7f) << 1) ^
((m - (m >> 7)) & 0x1b1b1b1b);
m = tp2 & 0x80808080;
tp4 = ((tp2 & 0x7f7f7f7f) << 1) ^
((m - (m >> 7)) & 0x1b1b1b1b);
m = tp4 & 0x80808080;
tp8 = ((tp4 & 0x7f7f7f7f) << 1) ^
((m - (m >> 7)) & 0x1b1b1b1b);
tp9 = tp8 ^ tp1;
tpb = tp9 ^ tp2;
tpd = tp9 ^ tp4;
tpe = tp8 ^ tp4 ^ tp2;
#if defined(ROTATE)
rk[j] = tpe ^ ROTATE(tpd,16) ^
ROTATE(tp9,24) ^ ROTATE(tpb,8);
#else
rk[j] = tpe ^ (tpd >> 16) ^ (tpd << 16) ^
(tp9 >> 8) ^ (tp9 << 24) ^
(tpb >> 24) ^ (tpb << 8);
#endif
}
}
return 0;
}
#endif /* AES_ASM */
================================================
FILE: cryptomini/aes/aes_local.h
================================================
/*
* Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#ifndef OSSL_CRYPTO_AES_LOCAL_H
# define OSSL_CRYPTO_AES_LOCAL_H
# include <openssl/e_os2.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
# define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
# define GETU32(p) SWAP(*((u32 *)(p)))
# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); }
# else
# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); }
# endif
typedef unsigned long long u64;
# ifdef AES_LONG
typedef unsigned long u32;
# else
typedef unsigned int u32;
# endif
typedef unsigned short u16;
typedef unsigned char u8;
# define MAXKC (256/32)
# define MAXKB (256/8)
# define MAXNR 14
/* This controls loop-unrolling in aes_core.c */
# undef FULL_UNROLL
#endif /* !OSSL_CRYPTO_AES_LOCAL_H */
================================================
FILE: cryptomini/bn/README.pod
================================================
=pod
=head1 NAME
bn_mul_words, bn_mul_add_words, bn_sqr_words, bn_div_words,
bn_add_words, bn_sub_words, bn_mul_comba4, bn_mul_comba8,
bn_sqr_comba4, bn_sqr_comba8, bn_cmp_words, bn_mul_normal,
bn_mul_low_normal, bn_mul_recursive, bn_mul_part_recursive,
bn_mul_low_recursive, bn_sqr_normal, bn_sqr_recursive,
bn_expand, bn_wexpand, bn_expand2, bn_fix_top, bn_check_top,
bn_print, bn_dump, bn_set_max, bn_set_high, bn_set_low - BIGNUM
library internal functions
=head1 SYNOPSIS
#include <openssl/bn.h>
BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w);
BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num,
BN_ULONG w);
void bn_sqr_words(BN_ULONG *rp, BN_ULONG *ap, int num);
BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);
BN_ULONG bn_add_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,
int num);
BN_ULONG bn_sub_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,
int num);
void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a);
void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a);
int bn_cmp_words(BN_ULONG *a, BN_ULONG *b, int n);
void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b,
int nb);
void bn_mul_low_normal(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n);
void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
int dna, int dnb, BN_ULONG *tmp);
void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b,
int n, int tna, int tnb, BN_ULONG *tmp);
void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b,
int n2, BN_ULONG *tmp);
void bn_sqr_normal(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG *tmp);
void bn_sqr_recursive(BN_ULONG *r, BN_ULONG *a, int n2, BN_ULONG *tmp);
void mul(BN_ULONG r, BN_ULONG a, BN_ULONG w, BN_ULONG c);
void mul_add(BN_ULONG r, BN_ULONG a, BN_ULONG w, BN_ULONG c);
void sqr(BN_ULONG r0, BN_ULONG r1, BN_ULONG a);
BIGNUM *bn_expand(BIGNUM *a, int bits);
BIGNUM *bn_wexpand(BIGNUM *a, int n);
BIGNUM *bn_expand2(BIGNUM *a, int n);
void bn_fix_top(BIGNUM *a);
void bn_check_top(BIGNUM *a);
void bn_print(BIGNUM *a);
void bn_dump(BN_ULONG *d, int n);
void bn_set_max(BIGNUM *a);
void bn_set_high(BIGNUM *r, BIGNUM *a, int n);
void bn_set_low(BIGNUM *r, BIGNUM *a, int n);
=head1 DESCRIPTION
This page documents the internal functions used by the OpenSSL
B<BIGNUM> implementation. They are described here to facilitate
debugging and extending the library. They are I<not> to be used by
applications.
=head2 The BIGNUM structure
typedef struct bignum_st BIGNUM;
struct bignum_st
{
BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
int top; /* Index of last used d +1. */
/* The next are internal book keeping for bn_expand. */
int dmax; /* Size of the d array. */
int neg; /* one if the number is negative */
int flags;
};
The integer value is stored in B<d>, a malloc()ed array of words (B<BN_ULONG>),
least significant word first. A B<BN_ULONG> can be either 16, 32 or 64 bits
in size, depending on the 'number of bits' (B<BITS2>) specified in
C<openssl/bn.h>.
B<dmax> is the size of the B<d> array that has been allocated. B<top>
is the number of words being used, so for a value of 4, bn.d[0]=4 and
bn.top=1. B<neg> is 1 if the number is negative. When a B<BIGNUM> is
B<0>, the B<d> field can be B<NULL> and B<top> == B<0>.
B<flags> is a bit field of flags which are defined in C<openssl/bn.h>. The
flags begin with B<BN_FLG_>. The macros BN_set_flags(b, n) and
BN_get_flags(b, n) exist to enable or fetch flag(s) B<n> from B<BIGNUM>
structure B<b>.
Various routines in this library require the use of temporary
B<BIGNUM> variables during their execution. Since dynamic memory
allocation to create B<BIGNUM>s is rather expensive when used in
conjunction with repeated subroutine calls, the B<BN_CTX> structure is
used. This structure contains B<BN_CTX_NUM> B<BIGNUM>s, see
L<BN_CTX_start(3)>.
=head2 Low-level arithmetic operations
These functions are implemented in C and for several platforms in
assembly language:
bn_mul_words(B<rp>, B<ap>, B<num>, B<w>) operates on the B<num> word
arrays B<rp> and B<ap>. It computes B<ap> * B<w>, places the result
in B<rp>, and returns the high word (carry).
bn_mul_add_words(B<rp>, B<ap>, B<num>, B<w>) operates on the B<num>
word arrays B<rp> and B<ap>. It computes B<ap> * B<w> + B<rp>, places
the result in B<rp>, and returns the high word (carry).
bn_sqr_words(B<rp>, B<ap>, B<n>) operates on the B<num> word array
B<ap> and the 2*B<num> word array B<ap>. It computes B<ap> * B<ap>
word-wise, and places the low and high bytes of the result in B<rp>.
bn_div_words(B<h>, B<l>, B<d>) divides the two word number (B<h>, B<l>)
by B<d> and returns the result.
bn_add_words(B<rp>, B<ap>, B<bp>, B<num>) operates on the B<num> word
arrays B<ap>, B<bp> and B<rp>. It computes B<ap> + B<bp>, places the
result in B<rp>, and returns the high word (carry).
bn_sub_words(B<rp>, B<ap>, B<bp>, B<num>) operates on the B<num> word
arrays B<ap>, B<bp> and B<rp>. It computes B<ap> - B<bp>, places the
result in B<rp>, and returns the carry (1 if B<bp> E<gt> B<ap>, 0
otherwise).
bn_mul_comba4(B<r>, B<a>, B<b>) operates on the 4 word arrays B<a> and
B<b> and the 8 word array B<r>. It computes B<a>*B<b> and places the
result in B<r>.
bn_mul_comba8(B<r>, B<a>, B<b>) operates on the 8 word arrays B<a> and
B<b> and the 16 word array B<r>. It computes B<a>*B<b> and places the
result in B<r>.
bn_sqr_comba4(B<r>, B<a>, B<b>) operates on the 4 word arrays B<a> and
B<b> and the 8 word array B<r>.
bn_sqr_comba8(B<r>, B<a>, B<b>) operates on the 8 word arrays B<a> and
B<b> and the 16 word array B<r>.
The following functions are implemented in C:
bn_cmp_words(B<a>, B<b>, B<n>) operates on the B<n> word arrays B<a>
and B<b>. It returns 1, 0 and -1 if B<a> is greater than, equal and
less than B<b>.
bn_mul_normal(B<r>, B<a>, B<na>, B<b>, B<nb>) operates on the B<na>
word array B<a>, the B<nb> word array B<b> and the B<na>+B<nb> word
array B<r>. It computes B<a>*B<b> and places the result in B<r>.
bn_mul_low_normal(B<r>, B<a>, B<b>, B<n>) operates on the B<n> word
arrays B<r>, B<a> and B<b>. It computes the B<n> low words of
B<a>*B<b> and places the result in B<r>.
bn_mul_recursive(B<r>, B<a>, B<b>, B<n2>, B<dna>, B<dnb>, B<t>) operates
on the word arrays B<a> and B<b> of length B<n2>+B<dna> and B<n2>+B<dnb>
(B<dna> and B<dnb> are currently allowed to be 0 or negative) and the 2*B<n2>
word arrays B<r> and B<t>. B<n2> must be a power of 2. It computes
B<a>*B<b> and places the result in B<r>.
bn_mul_part_recursive(B<r>, B<a>, B<b>, B<n>, B<tna>, B<tnb>, B<tmp>)
operates on the word arrays B<a> and B<b> of length B<n>+B<tna> and
B<n>+B<tnb> and the 4*B<n> word arrays B<r> and B<tmp>.
bn_mul_low_recursive(B<r>, B<a>, B<b>, B<n2>, B<tmp>) operates on the
B<n2> word arrays B<r> and B<tmp> and the B<n2>/2 word arrays B<a>
and B<b>.
BN_mul() calls bn_mul_normal(), or an optimized implementation if the
factors have the same size: bn_mul_comba8() is used if they are 8
words long, bn_mul_recursive() if they are larger than
B<BN_MULL_SIZE_NORMAL> and the size is an exact multiple of the word
size, and bn_mul_part_recursive() for others that are larger than
B<BN_MULL_SIZE_NORMAL>.
bn_sqr_normal(B<r>, B<a>, B<n>, B<tmp>) operates on the B<n> word array
B<a> and the 2*B<n> word arrays B<tmp> and B<r>.
The implementations use the following macros which, depending on the
architecture, may use "long long" C operations or inline assembler.
They are defined in C<bn_local.h>.
mul(B<r>, B<a>, B<w>, B<c>) computes B<w>*B<a>+B<c> and places the
low word of the result in B<r> and the high word in B<c>.
mul_add(B<r>, B<a>, B<w>, B<c>) computes B<w>*B<a>+B<r>+B<c> and
places the low word of the result in B<r> and the high word in B<c>.
sqr(B<r0>, B<r1>, B<a>) computes B<a>*B<a> and places the low word
of the result in B<r0> and the high word in B<r1>.
=head2 Size changes
bn_expand() ensures that B<b> has enough space for a B<bits> bit
number. bn_wexpand() ensures that B<b> has enough space for an
B<n> word number. If the number has to be expanded, both macros
call bn_expand2(), which allocates a new B<d> array and copies the
data. They return B<NULL> on error, B<b> otherwise.
The bn_fix_top() macro reduces B<a-E<gt>top> to point to the most
significant non-zero word plus one when B<a> has shrunk.
=head2 Debugging
bn_check_top() verifies that C<((a)-E<gt>top E<gt>= 0 && (a)-E<gt>top
E<lt>= (a)-E<gt>dmax)>. A violation will cause the program to abort.
bn_print() prints B<a> to stderr. bn_dump() prints B<n> words at B<d>
(in reverse order, i.e. most significant word first) to stderr.
bn_set_max() makes B<a> a static number with a B<dmax> of its current size.
This is used by bn_set_low() and bn_set_high() to make B<r> a read-only
B<BIGNUM> that contains the B<n> low or high words of B<a>.
If B<BN_DEBUG> is not defined, bn_check_top(), bn_print(), bn_dump()
and bn_set_max() are defined as empty macros.
=head1 SEE ALSO
L<bn(3)>
=head1 COPYRIGHT
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the OpenSSL license (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
================================================
FILE: cryptomini/bn/bn_add.c
================================================
/*
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include "internal/cryptlib.h"
#include "bn_local.h"
/* signed add of b to a. */
int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{
int ret, r_neg, cmp_res;
bn_check_top(a);
bn_check_top(b);
if (a->neg == b->neg) {
r_neg = a->neg;
ret = BN_uadd(r, a, b);
} else {
cmp_res = BN_ucmp(a, b);
if (cmp_res > 0) {
r_neg = a->neg;
ret = BN_usub(r, a, b);
} else if (cmp_res < 0) {
r_neg = b->neg;
ret = BN_usub(r, b, a);
} else {
r_neg = 0;
BN_zero(r);
ret = 1;
}
}
r->neg = r_neg;
bn_check_top(r);
return ret;
}
/* signed sub of b from a. */
int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{
int ret, r_neg, cmp_res;
bn_check_top(a);
bn_check_top(b);
if (a->neg != b->neg) {
r_neg = a->neg;
ret = BN_uadd(r, a, b);
} else {
cmp_res = BN_ucmp(a, b);
if (cmp_res > 0) {
r_neg = a->neg;
ret = BN_usub(r, a, b);
} else if (cmp_res < 0) {
r_neg = !b->neg;
ret = BN_usub(r, b, a);
} else {
r_neg = 0;
BN_zero(r);
ret = 1;
}
}
r->neg = r_neg;
bn_check_top(r);
return ret;
}
/* unsigned add of b to a, r can be equal to a or b. */
int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{
int max, min, dif;
const BN_ULONG *ap, *bp;
BN_ULONG *rp, carry, t1, t2;
bn_check_top(a);
bn_check_top(b);
if (a->top < b->top) {
const BIGNUM *tmp;
tmp = a;
a = b;
b = tmp;
}
max = a->top;
min = b->top;
dif = max - min;
if (bn_wexpand(r, max + 1) == NULL)
return 0;
r->top = max;
ap = a->d;
bp = b->d;
rp = r->d;
carry = bn_add_words(rp, ap, bp, min);
rp += min;
ap += min;
while (dif) {
dif--;
t1 = *(ap++);
t2 = (t1 + carry) & BN_MASK2;
*(rp++) = t2;
carry &= (t2 == 0);
}
*rp = carry;
r->top += carry;
r->neg = 0;
bn_check_top(r);
return 1;
}
/* unsigned subtraction of b from a, a must be larger than b. */
int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
{
int max, min, dif;
BN_ULONG t1, t2, borrow, *rp;
const BN_ULONG *ap, *bp;
bn_check_top(a);
bn_check_top(b);
max = a->top;
min = b->top;
dif = max - min;
if (dif < 0) { /* hmm... should not be happening */
BNerr(BN_F_BN_USUB, BN_R_ARG2_LT_ARG3);
return 0;
}
if (bn_wexpand(r, max) == NULL)
return 0;
ap = a->d;
bp = b->d;
rp = r->d;
borrow = bn_sub_words(rp, ap, bp, min);
ap += min;
rp += min;
while (dif) {
dif--;
t1 = *(ap++);
t2 = (t1 - borrow) & BN_MASK2;
*(rp++) = t2;
borrow &= (t1 == 0);
}
while (max && *--rp == 0)
max--;
r->top = max;
r->neg = 0;
bn_pollute(r);
return 1;
}
================================================
FILE: cryptomini/bn/bn_asm.c
================================================
/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <assert.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
#include "bn_local.h"
#if defined(BN_LLONG) || defined(BN_UMULT_HIGH)
BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
BN_ULONG w)
{
BN_ULONG c1 = 0;
assert(num >= 0);
if (num <= 0)
return c1;
# ifndef OPENSSL_SMALL_FOOTPRINT
while (num & ~3) {
mul_add(rp[0], ap[0], w, c1);
mul_add(rp[1], ap[1], w, c1);
mul_add(rp[2], ap[2], w, c1);
mul_add(rp[3], ap[3], w, c1);
ap += 4;
rp += 4;
num -= 4;
}
# endif
while (num) {
mul_add(rp[0], ap[0], w, c1);
ap++;
rp++;
num--;
}
return c1;
}
BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w)
{
BN_ULONG c1 = 0;
assert(num >= 0);
if (num <= 0)
return c1;
# ifndef OPENSSL_SMALL_FOOTPRINT
while (num & ~3) {
mul(rp[0], ap[0], w, c1);
mul(rp[1], ap[1], w, c1);
mul(rp[2], ap[2], w, c1);
mul(rp[3], ap[3], w, c1);
ap += 4;
rp += 4;
num -= 4;
}
# endif
while (num) {
mul(rp[0], ap[0], w, c1);
ap++;
rp++;
num--;
}
return c1;
}
void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n)
{
assert(n >= 0);
if (n <= 0)
return;
# ifndef OPENSSL_SMALL_FOOTPRINT
while (n & ~3) {
sqr(r[0], r[1], a[0]);
sqr(r[2], r[3], a[1]);
sqr(r[4], r[5], a[2]);
sqr(r[6], r[7], a[3]);
a += 4;
r += 8;
n -= 4;
}
# endif
while (n) {
sqr(r[0], r[1], a[0]);
a++;
r += 2;
n--;
}
}
#else /* !(defined(BN_LLONG) ||
* defined(BN_UMULT_HIGH)) */
BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
BN_ULONG w)
{
BN_ULONG c = 0;
BN_ULONG bl, bh;
assert(num >= 0);
if (num <= 0)
return (BN_ULONG)0;
bl = LBITS(w);
bh = HBITS(w);
# ifndef OPENSSL_SMALL_FOOTPRINT
while (num & ~3) {
mul_add(rp[0], ap[0], bl, bh, c);
mul_add(rp[1], ap[1], bl, bh, c);
mul_add(rp[2], ap[2], bl, bh, c);
mul_add(rp[3], ap[3], bl, bh, c);
ap += 4;
rp += 4;
num -= 4;
}
# endif
while (num) {
mul_add(rp[0], ap[0], bl, bh, c);
ap++;
rp++;
num--;
}
return c;
}
BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w)
{
BN_ULONG carry = 0;
BN_ULONG bl, bh;
assert(num >= 0);
if (num <= 0)
return (BN_ULONG)0;
bl = LBITS(w);
bh = HBITS(w);
# ifndef OPENSSL_SMALL_FOOTPRINT
while (num & ~3) {
mul(rp[0], ap[0], bl, bh, carry);
mul(rp[1], ap[1], bl, bh, carry);
mul(rp[2], ap[2], bl, bh, carry);
mul(rp[3], ap[3], bl, bh, carry);
ap += 4;
rp += 4;
num -= 4;
}
# endif
while (num) {
mul(rp[0], ap[0], bl, bh, carry);
ap++;
rp++;
num--;
}
return carry;
}
void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n)
{
assert(n >= 0);
if (n <= 0)
return;
# ifndef OPENSSL_SMALL_FOOTPRINT
while (n & ~3) {
sqr64(r[0], r[1], a[0]);
sqr64(r[2], r[3], a[1]);
sqr64(r[4], r[5], a[2]);
sqr64(r[6], r[7], a[3]);
a += 4;
r += 8;
n -= 4;
}
# endif
while (n) {
sqr64(r[0], r[1], a[0]);
a++;
r += 2;
n--;
}
}
#endif /* !(defined(BN_LLONG) ||
* defined(BN_UMULT_HIGH)) */
#if defined(BN_LLONG) && defined(BN_DIV2W)
BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
{
return ((BN_ULONG)(((((BN_ULLONG) h) << BN_BITS2) | l) / (BN_ULLONG) d));
}
#else
/* Divide h,l by d and return the result. */
/* I need to test this some more :-( */
BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
{
BN_ULONG dh, dl, q, ret = 0, th, tl, t;
int i, count = 2;
if (d == 0)
return BN_MASK2;
i = BN_num_bits_word(d);
assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i));
i = BN_BITS2 - i;
if (h >= d)
h -= d;
if (i) {
d <<= i;
h = (h << i) | (l >> (BN_BITS2 - i));
l <<= i;
}
dh = (d & BN_MASK2h) >> BN_BITS4;
dl = (d & BN_MASK2l);
for (;;) {
if ((h >> BN_BITS4) == dh)
q = BN_MASK2l;
else
q = h / dh;
th = q * dh;
tl = dl * q;
for (;;) {
t = h - th;
if ((t & BN_MASK2h) ||
((tl) <= ((t << BN_BITS4) | ((l & BN_MASK2h) >> BN_BITS4))))
break;
q--;
th -= dh;
tl -= dl;
}
t = (tl >> BN_BITS4);
tl = (tl << BN_BITS4) & BN_MASK2h;
th += t;
if (l < tl)
th++;
l -= tl;
if (h < th) {
h += d;
q--;
}
h -= th;
if (--count == 0)
break;
ret = q << BN_BITS4;
h = ((h << BN_BITS4) | (l >> BN_BITS4)) & BN_MASK2;
l = (l & BN_MASK2l) << BN_BITS4;
}
ret |= q;
return ret;
}
#endif /* !defined(BN_LLONG) && defined(BN_DIV2W) */
#ifdef BN_LLONG
BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
int n)
{
BN_ULLONG ll = 0;
assert(n >= 0);
if (n <= 0)
return (BN_ULONG)0;
# ifndef OPENSSL_SMALL_FOOTPRINT
while (n & ~3) {
ll += (BN_ULLONG) a[0] + b[0];
r[0] = (BN_ULONG)ll & BN_MASK2;
ll >>= BN_BITS2;
ll += (BN_ULLONG) a[1] + b[1];
r[1] = (BN_ULONG)ll & BN_MASK2;
ll >>= BN_BITS2;
ll += (BN_ULLONG) a[2] + b[2];
r[2] = (BN_ULONG)ll & BN_MASK2;
ll >>= BN_BITS2;
ll += (BN_ULLONG) a[3] + b[3];
r[3] = (BN_ULONG)ll & BN_MASK2;
ll >>= BN_BITS2;
a += 4;
b += 4;
r += 4;
n -= 4;
}
# endif
while (n) {
ll += (BN_ULLONG) a[0] + b[0];
r[0] = (BN_ULONG)ll & BN_MASK2;
ll >>= BN_BITS2;
a++;
b++;
r++;
n--;
}
return (BN_ULONG)ll;
}
#else /* !BN_LLONG */
BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
int n)
{
BN_ULONG c, l, t;
assert(n >= 0);
if (n <= 0)
return (BN_ULONG)0;
c = 0;
# ifndef OPENSSL_SMALL_FOOTPRINT
while (n & ~3) {
t = a[0];
t = (t + c) & BN_MASK2;
c = (t < c);
l = (t + b[0]) & BN_MASK2;
c += (l < t);
r[0] = l;
t = a[1];
t = (t + c) & BN_MASK2;
c = (t < c);
l = (t + b[1]) & BN_MASK2;
c += (l < t);
r[1] = l;
t = a[2];
t = (t + c) & BN_MASK2;
c = (t < c);
l = (t + b[2]) & BN_MASK2;
c += (l < t);
r[2] = l;
t = a[3];
t = (t + c) & BN_MASK2;
c = (t < c);
l = (t + b[3]) & BN_MASK2;
c += (l < t);
r[3] = l;
a += 4;
b += 4;
r += 4;
n -= 4;
}
# endif
while (n) {
t = a[0];
t = (t + c) & BN_MASK2;
c = (t < c);
l = (t + b[0]) & BN_MASK2;
c += (l < t);
r[0] = l;
a++;
b++;
r++;
n--;
}
return (BN_ULONG)c;
}
#endif /* !BN_LLONG */
BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
int n)
{
BN_ULONG t1, t2;
int c = 0;
assert(n >= 0);
if (n <= 0)
return (BN_ULONG)0;
#ifndef OPENSSL_SMALL_FOOTPRINT
while (n & ~3) {
t1 = a[0];
t2 = b[0];
r[0] = (t1 - t2 - c) & BN_MASK2;
if (t1 != t2)
c = (t1 < t2);
t1 = a[1];
t2 = b[1];
r[1] = (t1 - t2 - c) & BN_MASK2;
if (t1 != t2)
c = (t1 < t2);
t1 = a[2];
t2 = b[2];
r[2] = (t1 - t2 - c) & BN_MASK2;
if (t1 != t2)
c = (t1 < t2);
t1 = a[3];
t2 = b[3];
r[3] = (t1 - t2 - c) & BN_MASK2;
if (t1 != t2)
c = (t1 < t2);
a += 4;
b += 4;
r += 4;
n -= 4;
}
#endif
while (n) {
t1 = a[0];
t2 = b[0];
r[0] = (t1 - t2 - c) & BN_MASK2;
if (t1 != t2)
c = (t1 < t2);
a++;
b++;
r++;
n--;
}
return c;
}
#if defined(BN_MUL_COMBA) && !defined(OPENSSL_SMALL_FOOTPRINT)
# undef bn_mul_comba8
# undef bn_mul_comba4
# undef bn_sqr_comba8
# undef bn_sqr_comba4
/* mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) */
/* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */
/* sqr_add_c(a,i,c0,c1,c2) -- c+=a[i]^2 for three word number c=(c2,c1,c0) */
/*
* sqr_add_c2(a,i,c0,c1,c2) -- c+=2*a[i]*a[j] for three word number
* c=(c2,c1,c0)
*/
# ifdef BN_LLONG
/*
* Keep in mind that additions to multiplication result can not
* overflow, because its high half cannot be all-ones.
*/
# define mul_add_c(a,b,c0,c1,c2) do { \
BN_ULONG hi; \
BN_ULLONG t = (BN_ULLONG)(a)*(b); \
t += c0; /* no carry */ \
c0 = (BN_ULONG)Lw(t); \
hi = (BN_ULONG)Hw(t); \
c1 = (c1+hi)&BN_MASK2; if (c1<hi) c2++; \
} while(0)
# define mul_add_c2(a,b,c0,c1,c2) do { \
BN_ULONG hi; \
BN_ULLONG t = (BN_ULLONG)(a)*(b); \
BN_ULLONG tt = t+c0; /* no carry */ \
c0 = (BN_ULONG)Lw(tt); \
hi = (BN_ULONG)Hw(tt); \
c1 = (c1+hi)&BN_MASK2; if (c1<hi) c2++; \
t += c0; /* no carry */ \
c0 = (BN_ULONG)Lw(t); \
hi = (BN_ULONG)Hw(t); \
c1 = (c1+hi)&BN_MASK2; if (c1<hi) c2++; \
} while(0)
# define sqr_add_c(a,i,c0,c1,c2) do { \
BN_ULONG hi; \
BN_ULLONG t = (BN_ULLONG)a[i]*a[i]; \
t += c0; /* no carry */ \
c0 = (BN_ULONG)Lw(t); \
hi = (BN_ULONG)Hw(t); \
c1 = (c1+hi)&BN_MASK2; if (c1<hi) c2++; \
} while(0)
# define sqr_add_c2(a,i,j,c0,c1,c2) \
mul_add_c2((a)[i],(a)[j],c0,c1,c2)
# elif defined(BN_UMULT_LOHI)
/*
* Keep in mind that additions to hi can not overflow, because
* the high word of a multiplication result cannot be all-ones.
*/
# define mul_add_c(a,b,c0,c1,c2) do { \
BN_ULONG ta = (a), tb = (b); \
BN_ULONG lo, hi; \
BN_UMULT_LOHI(lo,hi,ta,tb); \
c0 += lo; hi += (c0<lo)?1:0; \
c1 += hi; c2 += (c1<hi)?1:0; \
} while(0)
# define mul_add_c2(a,b,c0,c1,c2) do { \
BN_ULONG ta = (a), tb = (b); \
BN_ULONG lo, hi, tt; \
BN_UMULT_LOHI(lo,hi,ta,tb); \
c0 += lo; tt = hi+((c0<lo)?1:0); \
c1 += tt; c2 += (c1<tt)?1:0; \
c0 += lo; hi += (c0<lo)?1:0; \
c1 += hi; c2 += (c1<hi)?1:0; \
} while(0)
# define sqr_add_c(a,i,c0,c1,c2) do { \
BN_ULONG ta = (a)[i]; \
BN_ULONG lo, hi; \
BN_UMULT_LOHI(lo,hi,ta,ta); \
c0 += lo; hi += (c0<lo)?1:0; \
c1 += hi; c2 += (c1<hi)?1:0; \
} while(0)
# define sqr_add_c2(a,i,j,c0,c1,c2) \
mul_add_c2((a)[i],(a)[j],c0,c1,c2)
# elif defined(BN_UMULT_HIGH)
/*
* Keep in mind that additions to hi can not overflow, because
* the high word of a multiplication result cannot be all-ones.
*/
# define mul_add_c(a,b,c0,c1,c2) do { \
BN_ULONG ta = (a), tb = (b); \
BN_ULONG lo = ta * tb; \
BN_ULONG hi = BN_UMULT_HIGH(ta,tb); \
c0 += lo; hi += (c0<lo)?1:0; \
c1 += hi; c2 += (c1<hi)?1:0; \
} while(0)
# define mul_add_c2(a,b,c0,c1,c2) do { \
BN_ULONG ta = (a), tb = (b), tt; \
BN_ULONG lo = ta * tb; \
BN_ULONG hi = BN_UMULT_HIGH(ta,tb); \
c0 += lo; tt = hi + ((c0<lo)?1:0); \
c1 += tt; c2 += (c1<tt)?1:0; \
c0 += lo; hi += (c0<lo)?1:0; \
c1 += hi; c2 += (c1<hi)?1:0; \
} while(0)
# define sqr_add_c(a,i,c0,c1,c2) do { \
BN_ULONG ta = (a)[i]; \
BN_ULONG lo = ta * ta; \
BN_ULONG hi = BN_UMULT_HIGH(ta,ta); \
c0 += lo; hi += (c0<lo)?1:0; \
c1 += hi; c2 += (c1<hi)?1:0; \
} while(0)
# define sqr_add_c2(a,i,j,c0,c1,c2) \
mul_add_c2((a)[i],(a)[j],c0,c1,c2)
# else /* !BN_LLONG */
/*
* Keep in mind that additions to hi can not overflow, because
* the high word of a multiplication result cannot be all-ones.
*/
# define mul_add_c(a,b,c0,c1,c2) do { \
BN_ULONG lo = LBITS(a), hi = HBITS(a); \
BN_ULONG bl = LBITS(b), bh = HBITS(b); \
mul64(lo,hi,bl,bh); \
c0 = (c0+lo)&BN_MASK2; if (c0<lo) hi++; \
c1 = (c1+hi)&BN_MASK2; if (c1<hi) c2++; \
} while(0)
# define mul_add_c2(a,b,c0,c1,c2) do { \
BN_ULONG tt; \
BN_ULONG lo = LBITS(a), hi = HBITS(a); \
BN_ULONG bl = LBITS(b), bh = HBITS(b); \
mul64(lo,hi,bl,bh); \
tt = hi; \
c0 = (c0+lo)&BN_MASK2; if (c0<lo) tt++; \
c1 = (c1+tt)&BN_MASK2; if (c1<tt) c2++; \
c0 = (c0+lo)&BN_MASK2; if (c0<lo) hi++; \
c1 = (c1+hi)&BN_MASK2; if (c1<hi) c2++; \
} while(0)
# define sqr_add_c(a,i,c0,c1,c2) do { \
BN_ULONG lo, hi; \
sqr64(lo,hi,(a)[i]); \
c0 = (c0+lo)&BN_MASK2; if (c0<lo) hi++; \
c1 = (c1+hi)&BN_MASK2; if (c1<hi) c2++; \
} while(0)
# define sqr_add_c2(a,i,j,c0,c1,c2) \
mul_add_c2((a)[i],(a)[j],c0,c1,c2)
# endif /* !BN_LLONG */
void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
{
BN_ULONG c1, c2, c3;
c1 = 0;
c2 = 0;
c3 = 0;
mul_add_c(a[0], b[0], c1, c2, c3);
r[0] = c1;
c1 = 0;
mul_add_c(a[0], b[1], c2, c3, c1);
mul_add_c(a[1], b[0], c2, c3, c1);
r[1] = c2;
c2 = 0;
mul_add_c(a[2], b[0], c3, c1, c2);
mul_add_c(a[1], b[1], c3, c1, c2);
mul_add_c(a[0], b[2], c3, c1, c2);
r[2] = c3;
c3 = 0;
mul_add_c(a[0], b[3], c1, c2, c3);
mul_add_c(a[1], b[2], c1, c2, c3);
mul_add_c(a[2], b[1], c1, c2, c3);
mul_add_c(a[3], b[0], c1, c2, c3);
r[3] = c1;
c1 = 0;
mul_add_c(a[4], b[0], c2, c3, c1);
mul_add_c(a[3], b[1], c2, c3, c1);
mul_add_c(a[2], b[2], c2, c3, c1);
mul_add_c(a[1], b[3], c2, c3, c1);
mul_add_c(a[0], b[4], c2, c3, c1);
r[4] = c2;
c2 = 0;
mul_add_c(a[0], b[5], c3, c1, c2);
mul_add_c(a[1], b[4], c3, c1, c2);
mul_add_c(a[2], b[3], c3, c1, c2);
mul_add_c(a[3], b[2], c3, c1, c2);
mul_add_c(a[4], b[1], c3, c1, c2);
mul_add_c(a[5], b[0], c3, c1, c2);
r[5] = c3;
c3 = 0;
mul_add_c(a[6], b[0], c1, c2, c3);
mul_add_c(a[5], b[1], c1, c2, c3);
mul_add_c(a[4], b[2], c1, c2, c3);
mul_add_c(a[3], b[3], c1, c2, c3);
mul_add_c(a[2], b[4], c1, c2, c3);
mul_add_c(a[1], b[5], c1, c2, c3);
mul_add_c(a[0], b[6], c1, c2, c3);
r[6] = c1;
c1 = 0;
mul_add_c(a[0], b[7], c2, c3, c1);
mul_add_c(a[1], b[6], c2, c3, c1);
mul_add_c(a[2], b[5], c2, c3, c1);
mul_add_c(a[3], b[4], c2, c3, c1);
mul_add_c(a[4], b[3], c2, c3, c1);
mul_add_c(a[5], b[2], c2, c3, c1);
mul_add_c(a[6], b[1], c2, c3, c1);
mul_add_c(a[7], b[0], c2, c3, c1);
r[7] = c2;
c2 = 0;
mul_add_c(a[7], b[1], c3, c1, c2);
mul_add_c(a[6], b[2], c3, c1, c2);
mul_add_c(a[5], b[3], c3, c1, c2);
mul_add_c(a[4], b[4], c3, c1, c2);
mul_add_c(a[3], b[5], c3, c1, c2);
mul_add_c(a[2], b[6], c3, c1, c2);
mul_add_c(a[1], b[7], c3, c1, c2);
r[8] = c3;
c3 = 0;
mul_add_c(a[2], b[7], c1, c2, c3);
mul_add_c(a[3], b[6], c1, c2, c3);
mul_add_c(a[4], b[5], c1, c2, c3);
mul_add_c(a[5], b[4], c1, c2, c3);
mul_add_c(a[6], b[3], c1, c2, c3);
mul_add_c(a[7], b[2], c1, c2, c3);
r[9] = c1;
c1 = 0;
mul_add_c(a[7], b[3], c2, c3, c1);
mul_add_c(a[6], b[4], c2, c3, c1);
mul_add_c(a[5], b[5], c2, c3, c1);
mul_add_c(a[4], b[6], c2, c3, c1);
mul_add_c(a[3], b[7], c2, c3, c1);
r[10] = c2;
c2 = 0;
mul_add_c(a[4], b[7], c3, c1, c2);
mul_add_c(a[5], b[6], c3, c1, c2);
mul_add_c(a[6], b[5], c3, c1, c2);
mul_add_c(a[7], b[4], c3, c1, c2);
r[11] = c3;
c3 = 0;
mul_add_c(a[7], b[5], c1, c2, c3);
mul_add_c(a[6], b[6], c1, c2, c3);
mul_add_c(a[5], b[7], c1, c2, c3);
r[12] = c1;
c1 = 0;
mul_add_c(a[6], b[7], c2, c3, c1);
mul_add_c(a[7], b[6], c2, c3, c1);
r[13] = c2;
c2 = 0;
mul_add_c(a[7], b[7], c3, c1, c2);
r[14] = c3;
r[15] = c1;
}
void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
{
BN_ULONG c1, c2, c3;
c1 = 0;
c2 = 0;
c3 = 0;
mul_add_c(a[0], b[0], c1, c2, c3);
r[0] = c1;
c1 = 0;
mul_add_c(a[0], b[1], c2, c3, c1);
mul_add_c(a[1], b[0], c2, c3, c1);
r[1] = c2;
c2 = 0;
mul_add_c(a[2], b[0], c3, c1, c2);
mul_add_c(a[1], b[1], c3, c1, c2);
mul_add_c(a[0], b[2], c3, c1, c2);
r[2] = c3;
c3 = 0;
mul_add_c(a[0], b[3], c1, c2, c3);
mul_add_c(a[1], b[2], c1, c2, c3);
mul_add_c(a[2], b[1], c1, c2, c3);
mul_add_c(a[3], b[0], c1, c2, c3);
r[3] = c1;
c1 = 0;
mul_add_c(a[3], b[1], c2, c3, c1);
mul_add_c(a[2], b[2], c2, c3, c1);
mul_add_c(a[1], b[3], c2, c3, c1);
r[4] = c2;
c2 = 0;
mul_add_c(a[2], b[3], c3, c1, c2);
mul_add_c(a[3], b[2], c3, c1, c2);
r[5] = c3;
c3 = 0;
mul_add_c(a[3], b[3], c1, c2, c3);
r[6] = c1;
r[7] = c2;
}
void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
{
BN_ULONG c1, c2, c3;
c1 = 0;
c2 = 0;
c3 = 0;
sqr_add_c(a, 0, c1, c2, c3);
r[0] = c1;
c1 = 0;
sqr_add_c2(a, 1, 0, c2, c3, c1);
r[1] = c2;
c2 = 0;
sqr_add_c(a, 1, c3, c1, c2);
sqr_add_c2(a, 2, 0, c3, c1, c2);
r[2] = c3;
c3 = 0;
sqr_add_c2(a, 3, 0, c1, c2, c3);
sqr_add_c2(a, 2, 1, c1, c2, c3);
r[3] = c1;
c1 = 0;
sqr_add_c(a, 2, c2, c3, c1);
sqr_add_c2(a, 3, 1, c2, c3, c1);
sqr_add_c2(a, 4, 0, c2, c3, c1);
r[4] = c2;
c2 = 0;
sqr_add_c2(a, 5, 0, c3, c1, c2);
sqr_add_c2(a, 4, 1, c3, c1, c2);
sqr_add_c2(a, 3, 2, c3, c1, c2);
r[5] = c3;
c3 = 0;
sqr_add_c(a, 3, c1, c2, c3);
sqr_add_c2(a, 4, 2, c1, c2, c3);
sqr_add_c2(a, 5, 1, c1, c2, c3);
sqr_add_c2(a, 6, 0, c1, c2, c3);
r[6] = c1;
c1 = 0;
sqr_add_c2(a, 7, 0, c2, c3, c1);
sqr_add_c2(a, 6, 1, c2, c3, c1);
sqr_add_c2(a, 5, 2, c2, c3, c1);
sqr_add_c2(a, 4, 3, c2, c3, c1);
r[7] = c2;
c2 = 0;
sqr_add_c(a, 4, c3, c1, c2);
sqr_add_c2(a, 5, 3, c3, c1, c2);
sqr_add_c2(a, 6, 2, c3, c1, c2);
sqr_add_c2(a, 7, 1, c3, c1, c2);
r[8] = c3;
c3 = 0;
sqr_add_c2(a, 7, 2, c1, c2, c3);
sqr_add_c2(a, 6, 3, c1, c2, c3);
sqr_add_c2(a, 5, 4, c1, c2, c3);
r[9] = c1;
c1 = 0;
sqr_add_c(a, 5, c2, c3, c1);
sqr_add_c2(a, 6, 4, c2, c3, c1);
sqr_add_c2(a, 7, 3, c2, c3, c1);
r[10] = c2;
c2 = 0;
sqr_add_c2(a, 7, 4, c3, c1, c2);
sqr_add_c2(a, 6, 5, c3, c1, c2);
r[11] = c3;
c3 = 0;
sqr_add_c(a, 6, c1, c2, c3);
sqr_add_c2(a, 7, 5, c1, c2, c3);
r[12] = c1;
c1 = 0;
sqr_add_c2(a, 7, 6, c2, c3, c1);
r[13] = c2;
c2 = 0;
sqr_add_c(a, 7, c3, c1, c2);
r[14] = c3;
r[15] = c1;
}
void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
{
BN_ULONG c1, c2, c3;
c1 = 0;
c2 = 0;
c3 = 0;
sqr_add_c(a, 0, c1, c2, c3);
r[0] = c1;
c1 = 0;
sqr_add_c2(a, 1, 0, c2, c3, c1);
r[1] = c2;
c2 = 0;
sqr_add_c(a, 1, c3, c1, c2);
sqr_add_c2(a, 2, 0, c3, c1, c2);
r[2] = c3;
c3 = 0;
sqr_add_c2(a, 3, 0, c1, c2, c3);
sqr_add_c2(a, 2, 1, c1, c2, c3);
r[3] = c1;
c1 = 0;
sqr_add_c(a, 2, c2, c3, c1);
sqr_add_c2(a, 3, 1, c2, c3, c1);
r[4] = c2;
c2 = 0;
sqr_add_c2(a, 3, 2, c3, c1, c2);
r[5] = c3;
c3 = 0;
sqr_add_c(a, 3, c1, c2, c3);
r[6] = c1;
r[7] = c2;
}
# ifdef OPENSSL_NO_ASM
# ifdef OPENSSL_BN_ASM_MONT
# include <alloca.h>
/*
* This is essentially reference implementation, which may or may not
* result in performance improvement. E.g. on IA-32 this routine was
* observed to give 40% faster rsa1024 private key operations and 10%
* faster rsa4096 ones, while on AMD64 it improves rsa1024 sign only
* by 10% and *worsens* rsa4096 sign by 15%. Once again, it's a
* reference implementation, one to be used as starting point for
* platform-specific assembler. Mentioned numbers apply to compiler
* generated code compiled with and without -DOPENSSL_BN_ASM_MONT and
* can vary not only from platform to platform, but even for compiler
* versions. Assembler vs. assembler improvement coefficients can
* [and are known to] differ and are to be documented elsewhere.
*/
int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
const BN_ULONG *np, const BN_ULONG *n0p, int num)
{
BN_ULONG c0, c1, ml, *tp, n0;
# ifdef mul64
BN_ULONG mh;
# endif
volatile BN_ULONG *vp;
int i = 0, j;
# if 0 /* template for platform-specific
* implementation */
if (ap == bp)
return bn_sqr_mont(rp, ap, np, n0p, num);
# endif
vp = tp = alloca((num + 2) * sizeof(BN_ULONG));
n0 = *n0p;
c0 = 0;
ml = bp[0];
# ifdef mul64
mh = HBITS(ml);
ml = LBITS(ml);
for (j = 0; j < num; ++j)
mul(tp[j], ap[j], ml, mh, c0);
# else
for (j = 0; j < num; ++j)
mul(tp[j], ap[j], ml, c0);
# endif
tp[num] = c0;
tp[num + 1] = 0;
goto enter;
for (i = 0; i < num; i++) {
c0 = 0;
ml = bp[i];
# ifdef mul64
mh = HBITS(ml);
ml = LBITS(ml);
for (j = 0; j < num; ++j)
mul_add(tp[j], ap[j], ml, mh, c0);
# else
for (j = 0; j < num; ++j)
mul_add(tp[j], ap[j], ml, c0);
# endif
c1 = (tp[num] + c0) & BN_MASK2;
tp[num] = c1;
tp[num + 1] = (c1 < c0 ? 1 : 0);
enter:
c1 = tp[0];
ml = (c1 * n0) & BN_MASK2;
c0 = 0;
# ifdef mul64
mh = HBITS(ml);
ml = LBITS(ml);
mul_add(c1, np[0], ml, mh, c0);
# else
mul_add(c1, ml, np[0], c0);
# endif
for (j = 1; j < num; j++) {
c1 = tp[j];
# ifdef mul64
mul_add(c1, np[j], ml, mh, c0);
# else
mul_add(c1, ml, np[j], c0);
# endif
tp[j - 1] = c1 & BN_MASK2;
}
c1 = (tp[num] + c0) & BN_MASK2;
tp[num - 1] = c1;
tp[num] = tp[num + 1] + (c1 < c0 ? 1 : 0);
}
if (tp[num] != 0 || tp[num - 1] >= np[num - 1]) {
c0 = bn_sub_words(rp, tp, np, num);
if (tp[num] != 0 || c0 == 0) {
for (i = 0; i < num + 2; i++)
vp[i] = 0;
return 1;
}
}
for (i = 0; i < num; i++)
rp[i] = tp[i], vp[i] = 0;
vp[num] = 0;
vp[num + 1] = 0;
return 1;
}
# else
/*
* Return value of 0 indicates that multiplication/convolution was not
* performed to signal the caller to fall down to alternative/original
* code-path.
*/
int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
const BN_ULONG *np, const BN_ULONG *n0, int num)
{
return 0;
}
# endif /* OPENSSL_BN_ASM_MONT */
# endif
#else /* !BN_MUL_COMBA */
/* hmm... is it faster just to do a multiply? */
# undef bn_sqr_comba4
# undef bn_sqr_comba8
void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
{
BN_ULONG t[8];
bn_sqr_normal(r, a, 4, t);
}
void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
{
BN_ULONG t[16];
bn_sqr_normal(r, a, 8, t);
}
void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
{
r[4] = bn_mul_words(&(r[0]), a, 4, b[0]);
r[5] = bn_mul_add_words(&(r[1]), a, 4, b[1]);
r[6] = bn_mul_add_words(&(r[2]), a, 4, b[2]);
r[7] = bn_mul_add_words(&(r[3]), a, 4, b[3]);
}
void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
{
r[8] = bn_mul_words(&(r[0]), a, 8, b[0]);
r[9] = bn_mul_add_words(&(r[1]), a, 8, b[1]);
r[10] = bn_mul_add_words(&(r[2]), a, 8, b[2]);
r[11] = bn_mul_add_words(&(r[3]), a, 8, b[3]);
r[12] = bn_mul_add_words(&(r[4]), a, 8, b[4]);
r[13] = bn_mul_add_words(&(r[5]), a, 8, b[5]);
r[14] = bn_mul_add_words(&(r[6]), a, 8, b[6]);
r[15] = bn_mul_add_words(&(r[7]), a, 8, b[7]);
}
# ifdef OPENSSL_NO_ASM
# ifdef OPENSSL_BN_ASM_MONT
# include <alloca.h>
int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
const BN_ULONG *np, const BN_ULONG *n0p, int num)
{
BN_ULONG c0, c1, *tp, n0 = *n0p;
volatile BN_ULONG *vp;
int i = 0, j;
vp = tp = alloca((num + 2) * sizeof(BN_ULONG));
for (i = 0; i <= num; i++)
tp[i] = 0;
for (i = 0; i < num; i++) {
c0 = bn_mul_add_words(tp, ap, num, bp[i]);
c1 = (tp[num] + c0) & BN_MASK2;
tp[num] = c1;
tp[num + 1] = (c1 < c0 ? 1 : 0);
c0 = bn_mul_add_words(tp, np, num, tp[0] * n0);
c1 = (tp[num] + c0) & BN_MASK2;
tp[num] = c1;
tp[num + 1] += (c1 < c0 ? 1 : 0);
for (j = 0; j <= num; j++)
tp[j] = tp[j + 1];
}
if (tp[num] != 0 || tp[num - 1] >= np[num - 1]) {
c0 = bn_sub_words(rp, tp, np, num);
if (tp[num] != 0 || c0 == 0) {
for (i = 0; i < num + 2; i++)
vp[i] = 0;
return 1;
}
}
for (i = 0; i < num; i++)
rp[i] = tp[i], vp[i] = 0;
vp[num] = 0;
vp[num + 1] = 0;
return 1;
}
# else
int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
const BN_ULONG *np, const BN_ULONG *n0, int num)
{
return 0;
}
# endif /* OPENSSL_BN_ASM_MONT */
# endif
#endif /* !BN_MUL_COMBA */
================================================
FILE: cryptomini/bn/bn_ctx.c
================================================
/*
* Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include "internal/cryptlib.h"
#include "bn_local.h"
/*-
* TODO list
*
* 1. Check a bunch of "(words+1)" type hacks in various bignum functions and
* check they can be safely removed.
* - Check +1 and other ugliness in BN_from_montgomery()
*
* 2. Consider allowing a BN_new_ex() that, at least, lets you specify an
* appropriate 'block' size that will be honoured by bn_expand_internal() to
* prevent piddly little reallocations. OTOH, profiling bignum expansions in
* BN_CTX doesn't show this to be a big issue.
*/
/* How many bignums are in each "pool item"; */
#define BN_CTX_POOL_SIZE 16
/* The stack frame info is resizing, set a first-time expansion size; */
#define BN_CTX_START_FRAMES 32
/***********/
/* BN_POOL */
/***********/
/* A bundle of bignums that can be linked with other bundles */
typedef struct bignum_pool_item {
/* The bignum values */
BIGNUM vals[BN_CTX_POOL_SIZE];
/* Linked-list admin */
struct bignum_pool_item *prev, *next;
} BN_POOL_ITEM;
/* A linked-list of bignums grouped in bundles */
typedef struct bignum_pool {
/* Linked-list admin */
BN_POOL_ITEM *head, *current, *tail;
/* Stack depth and allocation size */
unsigned used, size;
} BN_POOL;
static void BN_POOL_init(BN_POOL *);
static void BN_POOL_finish(BN_POOL *);
static BIGNUM *BN_POOL_get(BN_POOL *, int);
static void BN_POOL_release(BN_POOL *, unsigned int);
/************/
/* BN_STACK */
/************/
/* A wrapper to manage the "stack frames" */
typedef struct bignum_ctx_stack {
/* Array of indexes into the bignum stack */
unsigned int *indexes;
/* Number of stack frames, and the size of the allocated array */
unsigned int depth, size;
} BN_STACK;
static void BN_STACK_init(BN_STACK *);
static void BN_STACK_finish(BN_STACK *);
static int BN_STACK_push(BN_STACK *, unsigned int);
static unsigned int BN_STACK_pop(BN_STACK *);
/**********/
/* BN_CTX */
/**********/
/* The opaque BN_CTX type */
struct bignum_ctx {
/* The bignum bundles */
BN_POOL pool;
/* The "stack frames", if you will */
BN_STACK stack;
/* The number of bignums currently assigned */
unsigned int used;
/* Depth of stack overflow */
int err_stack;
/* Block "gets" until an "end" (compatibility behaviour) */
int too_many;
/* Flags. */
int flags;
};
/* Enable this to find BN_CTX bugs */
#ifdef BN_CTX_DEBUG
static const char *ctxdbg_cur = NULL;
static void ctxdbg(BN_CTX *ctx)
{
unsigned int bnidx = 0, fpidx = 0;
BN_POOL_ITEM *item = ctx->pool.head;
BN_STACK *stack = &ctx->stack;
fprintf(stderr, "(%16p): ", ctx);
while (bnidx < ctx->used) {
fprintf(stderr, "%03x ", item->vals[bnidx++ % BN_CTX_POOL_SIZE].dmax);
if (!(bnidx % BN_CTX_POOL_SIZE))
item = item->next;
}
fprintf(stderr, "\n");
bnidx = 0;
fprintf(stderr, " : ");
while (fpidx < stack->depth) {
while (bnidx++ < stack->indexes[fpidx])
fprintf(stderr, " ");
fprintf(stderr, "^^^ ");
bnidx++;
fpidx++;
}
fprintf(stderr, "\n");
}
# define CTXDBG_ENTRY(str, ctx) do { \
ctxdbg_cur = (str); \
fprintf(stderr,"Starting %s\n", ctxdbg_cur); \
ctxdbg(ctx); \
} while(0)
# define CTXDBG_EXIT(ctx) do { \
fprintf(stderr,"Ending %s\n", ctxdbg_cur); \
ctxdbg(ctx); \
} while(0)
# define CTXDBG_RET(ctx,ret)
#else
# define CTXDBG_ENTRY(str, ctx)
# define CTXDBG_EXIT(ctx)
# define CTXDBG_RET(ctx,ret)
#endif
BN_CTX *BN_CTX_new(void)
{
BN_CTX *ret;
if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {
BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);
return NULL;
}
/* Initialise the structure */
BN_POOL_init(&ret->pool);
BN_STACK_init(&ret->stack);
return ret;
}
BN_CTX *BN_CTX_secure_new(void)
{
BN_CTX *ret = BN_CTX_new();
if (ret != NULL)
ret->flags = BN_FLG_SECURE;
return ret;
}
void BN_CTX_free(BN_CTX *ctx)
{
if (ctx == NULL)
return;
#ifdef BN_CTX_DEBUG
{
BN_POOL_ITEM *pool = ctx->pool.head;
fprintf(stderr, "BN_CTX_free, stack-size=%d, pool-bignums=%d\n",
ctx->stack.size, ctx->pool.size);
fprintf(stderr, "dmaxs: ");
while (pool) {
unsigned loop = 0;
while (loop < BN_CTX_POOL_SIZE)
fprintf(stderr, "%02x ", pool->vals[loop++].dmax);
pool = pool->next;
}
fprintf(stderr, "\n");
}
#endif
BN_STACK_finish(&ctx->stack);
BN_POOL_finish(&ctx->pool);
OPENSSL_free(ctx);
}
void BN_CTX_start(BN_CTX *ctx)
{
CTXDBG_ENTRY("BN_CTX_start", ctx);
/* If we're already overflowing ... */
if (ctx->err_stack || ctx->too_many)
ctx->err_stack++;
/* (Try to) get a new frame pointer */
else if (!BN_STACK_push(&ctx->stack, ctx->used)) {
BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
ctx->err_stack++;
}
CTXDBG_EXIT(ctx);
}
void BN_CTX_end(BN_CTX *ctx)
{
if (ctx == NULL)
return;
CTXDBG_ENTRY("BN_CTX_end", ctx);
if (ctx->err_stack)
ctx->err_stack--;
else {
unsigned int fp = BN_STACK_pop(&ctx->stack);
/* Does this stack frame have anything to release? */
if (fp < ctx->used)
BN_POOL_release(&ctx->pool, ctx->used - fp);
ctx->used = fp;
/* Unjam "too_many" in case "get" had failed */
ctx->too_many = 0;
}
CTXDBG_EXIT(ctx);
}
BIGNUM *BN_CTX_get(BN_CTX *ctx)
{
BIGNUM *ret;
CTXDBG_ENTRY("BN_CTX_get", ctx);
if (ctx->err_stack || ctx->too_many)
return NULL;
if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {
/*
* Setting too_many prevents repeated "get" attempts from cluttering
* the error stack.
*/
ctx->too_many = 1;
BNerr(BN_F_BN_CTX_GET, BN_R_TOO_MANY_TEMPORARY_VARIABLES);
return NULL;
}
/* OK, make sure the returned bignum is "zero" */
BN_zero(ret);
/* clear BN_FLG_CONSTTIME if leaked from previous frames */
ret->flags &= (~BN_FLG_CONSTTIME);
ctx->used++;
CTXDBG_RET(ctx, ret);
return ret;
}
/************/
/* BN_STACK */
/************/
static void BN_STACK_init(BN_STACK *st)
{
st->indexes = NULL;
st->depth = st->size = 0;
}
static void BN_STACK_finish(BN_STACK *st)
{
OPENSSL_free(st->indexes);
st->indexes = NULL;
}
static int BN_STACK_push(BN_STACK *st, unsigned int idx)
{
if (st->depth == st->size) {
/* Need to expand */
unsigned int newsize =
st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES;
unsigned int *newitems;
if ((newitems = OPENSSL_malloc(sizeof(*newitems) * newsize)) == NULL) {
BNerr(BN_F_BN_STACK_PUSH, ERR_R_MALLOC_FAILURE);
return 0;
}
if (st->depth)
memcpy(newitems, st->indexes, sizeof(*newitems) * st->depth);
OPENSSL_free(st->indexes);
st->indexes = newitems;
st->size = newsize;
}
st->indexes[(st->depth)++] = idx;
return 1;
}
static unsigned int BN_STACK_pop(BN_STACK *st)
{
return st->indexes[--(st->depth)];
}
/***********/
/* BN_POOL */
/***********/
static void BN_POOL_init(BN_POOL *p)
{
p->head = p->current = p->tail = NULL;
p->used = p->size = 0;
}
static void BN_POOL_finish(BN_POOL *p)
{
unsigned int loop;
BIGNUM *bn;
while (p->head) {
for (loop = 0, bn = p->head->vals; loop++ < BN_CTX_POOL_SIZE; bn++)
if (bn->d)
BN_clear_free(bn);
p->current = p->head->next;
OPENSSL_free(p->head);
p->head = p->current;
}
}
static BIGNUM *BN_POOL_get(BN_POOL *p, int flag)
{
BIGNUM *bn;
unsigned int loop;
/* Full; allocate a new pool item and link it in. */
if (p->used == p->size) {
BN_POOL_ITEM *item;
if ((item = OPENSSL_malloc(sizeof(*item))) == NULL) {
BNerr(BN_F_BN_POOL_GET, ERR_R_MALLOC_FAILURE);
return NULL;
}
for (loop = 0, bn = item->vals; loop++ < BN_CTX_POOL_SIZE; bn++) {
bn_init(bn);
if ((flag & BN_FLG_SECURE) != 0)
BN_set_flags(bn, BN_FLG_SECURE);
}
item->prev = p->tail;
item->next = NULL;
if (p->head == NULL)
p->head = p->current = p->tail = item;
else {
p->tail->next = item;
p->tail = item;
p->current = item;
}
p->size += BN_CTX_POOL_SIZE;
p->used++;
/* Return the first bignum from the new pool */
return item->vals;
}
if (!p->used)
p->current = p->head;
else if ((p->used % BN_CTX_POOL_SIZE) == 0)
p->current = p->current->next;
return p->current->vals + ((p->used++) % BN_CTX_POOL_SIZE);
}
static void BN_POOL_release(BN_POOL *p, unsigned int num)
{
unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
p->used -= num;
while (num--) {
bn_check_top(p->current->vals + offset);
if (offset == 0) {
offset = BN_CTX_POOL_SIZE - 1;
p->current = p->current->prev;
} else
offset--;
}
}
================================================
FILE: cryptomini/bn/bn_div.c
================================================
/*
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include <assert.h>
#include <openssl/bn.h>
#include "internal/cryptlib.h"
#include "bn_local.h"
/* The old slow way */
#if 0
int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
BN_CTX *ctx)
{
int i, nm, nd;
int ret = 0;
BIGNUM *D;
bn_check_top(m);
bn_check_top(d);
if (BN_is_zero(d)) {
BNerr(BN_F_BN_DIV, BN_R_DIV_BY_ZERO);
return 0;
}
if (BN_ucmp(m, d) < 0) {
if (rem != NULL) {
if (BN_copy(rem, m) == NULL)
return 0;
}
if (dv != NULL)
BN_zero(dv);
return 1;
}
BN_CTX_start(ctx);
D = BN_CTX_get(ctx);
if (dv == NULL)
dv = BN_CTX_get(ctx);
if (rem == NULL)
rem = BN_CTX_get(ctx);
if (D == NULL || dv == NULL || rem == NULL)
goto end;
nd = BN_num_bits(d);
nm = BN_num_bits(m);
if (BN_copy(D, d) == NULL)
goto end;
if (BN_copy(rem, m) == NULL)
goto end;
/*
* The next 2 are needed so we can do a dv->d[0]|=1 later since
* BN_lshift1 will only work once there is a value :-)
*/
BN_zero(dv);
if (bn_wexpand(dv, 1) == NULL)
goto end;
dv->top = 1;
if (!BN_lshift(D, D, nm - nd))
goto end;
for (i = nm - nd; i >= 0; i--) {
if (!BN_lshift1(dv, dv))
goto end;
if (BN_ucmp(rem, D) >= 0) {
dv->d[0] |= 1;
if (!BN_usub(rem, rem, D))
goto end;
}
/* CAN IMPROVE (and have now :=) */
if (!BN_rshift1(D, D))
goto end;
}
rem->neg = BN_is_zero(rem) ? 0 : m->neg;
dv->neg = m->neg ^ d->neg;
ret = 1;
end:
BN_CTX_end(ctx);
return ret;
}
#else
# if defined(BN_DIV3W)
BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0);
# elif 0
/*
* This is #if-ed away, because it's a reference for assembly implementations,
* where it can and should be made constant-time. But if you want to test it,
* just replace 0 with 1.
*/
# if BN_BITS2 == 64 && defined(__SIZEOF_INT128__) && __SIZEOF_INT128__==16
# undef BN_ULLONG
# define BN_ULLONG __uint128_t
# define BN_LLONG
# endif
# ifdef BN_LLONG
# define BN_DIV3W
/*
* Interface is somewhat quirky, |m| is pointer to most significant limb,
* and less significant limb is referred at |m[-1]|. This means that caller
* is responsible for ensuring that |m[-1]| is valid. Second condition that
* has to be met is that |d0|'s most significant bit has to be set. Or in
* other words divisor has to be "bit-aligned to the left." bn_div_fixed_top
* does all this. The subroutine considers four limbs, two of which are
* "overlapping," hence the name...
*/
static BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0)
{
BN_ULLONG R = ((BN_ULLONG)m[0] << BN_BITS2) | m[-1];
BN_ULLONG D = ((BN_ULLONG)d0 << BN_BITS2) | d1;
BN_ULONG Q = 0, mask;
int i;
for (i = 0; i < BN_BITS2; i++) {
Q <<= 1;
if (R >= D) {
Q |= 1;
R -= D;
}
D >>= 1;
}
mask = 0 - (Q >> (BN_BITS2 - 1)); /* does it overflow? */
Q <<= 1;
Q |= (R >= D);
return (Q | mask) & BN_MASK2;
}
# endif
# endif
static int bn_left_align(BIGNUM *num)
{
BN_ULONG *d = num->d, n, m, rmask;
int top = num->top;
int rshift = BN_num_bits_word(d[top - 1]), lshift, i;
lshift = BN_BITS2 - rshift;
rshift %= BN_BITS2; /* say no to undefined behaviour */
rmask = (BN_ULONG)0 - rshift; /* rmask = 0 - (rshift != 0) */
rmask |= rmask >> 8;
for (i = 0, m = 0; i < top; i++) {
n = d[i];
d[i] = ((n << lshift) | m) & BN_MASK2;
m = (n >> rshift) & rmask;
}
return lshift;
}
# if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \
&& !defined(PEDANTIC) && !defined(BN_DIV3W)
# if defined(__GNUC__) && __GNUC__>=2
# if defined(__i386) || defined (__i386__)
/*-
* There were two reasons for implementing this template:
* - GNU C generates a call to a function (__udivdi3 to be exact)
* in reply to ((((BN_ULLONG)n0)<<BN_BITS2)|n1)/d0 (I fail to
* understand why...);
* - divl doesn't only calculate quotient, but also leaves
* remainder in %edx which we can definitely use here:-)
*/
# undef bn_div_words
# define bn_div_words(n0,n1,d0) \
({ asm volatile ( \
"divl %4" \
: "=a"(q), "=d"(rem) \
: "a"(n1), "d"(n0), "r"(d0) \
: "cc"); \
q; \
})
# define REMAINDER_IS_ALREADY_CALCULATED
# elif defined(__x86_64) && defined(SIXTY_FOUR_BIT_LONG)
/*
* Same story here, but it's 128-bit by 64-bit division. Wow!
*/
# undef bn_div_words
# define bn_div_words(n0,n1,d0) \
({ asm volatile ( \
"divq %4" \
: "=a"(q), "=d"(rem) \
: "a"(n1), "d"(n0), "r"(d0) \
: "cc"); \
q; \
})
# define REMAINDER_IS_ALREADY_CALCULATED
# endif /* __<cpu> */
# endif /* __GNUC__ */
# endif /* OPENSSL_NO_ASM */
/*-
* BN_div computes dv := num / divisor, rounding towards
* zero, and sets up rm such that dv*divisor + rm = num holds.
* Thus:
* dv->neg == num->neg ^ divisor->neg (unless the result is zero)
* rm->neg == num->neg (unless the remainder is zero)
* If 'dv' or 'rm' is NULL, the respective value is not returned.
*/
int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
BN_CTX *ctx)
{
int ret;
if (BN_is_zero(divisor)) {
BNerr(BN_F_BN_DIV, BN_R_DIV_BY_ZERO);
return 0;
}
/*
* Invalid zero-padding would have particularly bad consequences so don't
* just rely on bn_check_top() here (bn_check_top() works only for
* BN_DEBUG builds)
*/
if (divisor->d[divisor->top - 1] == 0) {
BNerr(BN_F_BN_DIV, BN_R_NOT_INITIALIZED);
return 0;
}
ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
if (ret) {
if (dv != NULL)
bn_correct_top(dv);
if (rm != NULL)
bn_correct_top(rm);
}
return ret;
}
/*
* It's argued that *length* of *significant* part of divisor is public.
* Even if it's private modulus that is. Again, *length* is assumed
* public, but not *value*. Former is likely to be pre-defined by
* algorithm with bit granularity, though below subroutine is invariant
* of limb length. Thanks to this assumption we can require that |divisor|
* may not be zero-padded, yet claim this subroutine "constant-time"(*).
* This is because zero-padded dividend, |num|, is tolerated, so that
* caller can pass dividend of public length(*), but with smaller amount
* of significant limbs. This naturally means that quotient, |dv|, would
* contain correspongly less significant limbs as well, and will be zero-
* padded accordingly. Returned remainder, |rm|, will have same bit length
* as divisor, also zero-padded if needed. These actually leave sign bits
* in ambiguous state. In sense that we try to avoid negative zeros, while
* zero-padded zeros would retain sign.
*
* (*) "Constant-time-ness" has two pre-conditions:
*
* - availability of constant-time bn_div_3_words;
* - dividend is at least as "wide" as divisor, limb-wise, zero-padded
* if so required, which shouldn't be a privacy problem, because
* divisor's length is considered public;
*/
int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
const BIGNUM *divisor, BN_CTX *ctx)
{
int norm_shift, i, j, loop;
BIGNUM *tmp, *snum, *sdiv, *res;
BN_ULONG *resp, *wnum, *wnumtop;
BN_ULONG d0, d1;
int num_n, div_n, num_neg;
assert(divisor->top > 0 && divisor->d[divisor->top - 1] != 0);
bn_check_top(num);
bn_check_top(divisor);
bn_check_top(dv);
bn_check_top(rm);
BN_CTX_start(ctx);
res = (dv == NULL) ? BN_CTX_get(ctx) : dv;
tmp = BN_CTX_get(ctx);
snum = BN_CTX_get(ctx);
sdiv = BN_CTX_get(ctx);
if (sdiv == NULL)
goto err;
/* First we normalise the numbers */
if (!BN_copy(sdiv, divisor))
goto err;
norm_shift = bn_left_align(sdiv);
sdiv->neg = 0;
/*
* Note that bn_lshift_fixed_top's output is always one limb longer
* than input, even when norm_shift is zero. This means that amount of
* inner loop iterations is invariant of dividend value, and that one
* doesn't need to compare dividend and divisor if they were originally
* of the same bit length.
*/
if (!(bn_lshift_fixed_top(snum, num, norm_shift)))
goto err;
div_n = sdiv->top;
num_n = snum->top;
if (num_n <= div_n) {
/* caller didn't pad dividend -> no constant-time guarantee... */
if (bn_wexpand(snum, div_n + 1) == NULL)
goto err;
memset(&(snum->d[num_n]), 0, (div_n - num_n + 1) * sizeof(BN_ULONG));
snum->top = num_n = div_n + 1;
}
loop = num_n - div_n;
/*
* Lets setup a 'window' into snum This is the part that corresponds to
* the current 'area' being divided
*/
wnum = &(snum->d[loop]);
wnumtop = &(snum->d[num_n - 1]);
/* Get the top 2 words of sdiv */
d0 = sdiv->d[div_n - 1];
d1 = (div_n == 1) ? 0 : sdiv->d[div_n - 2];
/* Setup quotient */
if (!bn_wexpand(res, loop))
goto err;
num_neg = num->neg;
res->neg = (num_neg ^ divisor->neg);
res->top = loop;
res->flags |= BN_FLG_FIXED_TOP;
resp = &(res->d[loop]);
/* space for temp */
if (!bn_wexpand(tmp, (div_n + 1)))
goto err;
for (i = 0; i < loop; i++, wnumtop--) {
BN_ULONG q, l0;
/*
* the first part of the loop uses the top two words of snum and sdiv
* to calculate a BN_ULONG q such that | wnum - sdiv * q | < sdiv
*/
# if defined(BN_DIV3W)
q = bn_div_3_words(wnumtop, d1, d0);
# else
BN_ULONG n0, n1, rem = 0;
n0 = wnumtop[0];
n1 = wnumtop[-1];
if (n0 == d0)
q = BN_MASK2;
else { /* n0 < d0 */
BN_ULONG n2 = (wnumtop == wnum) ? 0 : wnumtop[-2];
# ifdef BN_LLONG
BN_ULLONG t2;
# if defined(BN_LLONG) && defined(BN_DIV2W) && !defined(bn_div_words)
q = (BN_ULONG)(((((BN_ULLONG) n0) << BN_BITS2) | n1) / d0);
# else
q = bn_div_words(n0, n1, d0);
# endif
# ifndef REMAINDER_IS_ALREADY_CALCULATED
/*
* rem doesn't have to be BN_ULLONG. The least we
* know it's less that d0, isn't it?
*/
rem = (n1 - q * d0) & BN_MASK2;
# endif
t2 = (BN_ULLONG) d1 *q;
for (;;) {
if (t2 <= ((((BN_ULLONG) rem) << BN_BITS2) | n2))
break;
q--;
rem += d0;
if (rem < d0)
break; /* don't let rem overflow */
t2 -= d1;
}
# else /* !BN_LLONG */
BN_ULONG t2l, t2h;
q = bn_div_words(n0, n1, d0);
# ifndef REMAINDER_IS_ALREADY_CALCULATED
rem = (n1 - q * d0) & BN_MASK2;
# endif
# if defined(BN_UMULT_LOHI)
BN_UMULT_LOHI(t2l, t2h, d1, q);
# elif defined(BN_UMULT_HIGH)
t2l = d1 * q;
t2h = BN_UMULT_HIGH(d1, q);
# else
{
BN_ULONG ql, qh;
t2l = LBITS(d1);
t2h = HBITS(d1);
ql = LBITS(q);
qh = HBITS(q);
mul64(t2l, t2h, ql, qh); /* t2=(BN_ULLONG)d1*q; */
}
# endif
for (;;) {
if ((t2h < rem) || ((t2h == rem) && (t2l <= n2)))
break;
q--;
rem += d0;
if (rem < d0)
break; /* don't let rem overflow */
if (t2l < d1)
t2h--;
t2l -= d1;
}
# endif /* !BN_LLONG */
}
# endif /* !BN_DIV3W */
l0 = bn_mul_words(tmp->d, sdiv->d, div_n, q);
tmp->d[div_n] = l0;
wnum--;
/*
* ignore top values of the bignums just sub the two BN_ULONG arrays
* with bn_sub_words
*/
l0 = bn_sub_words(wnum, wnum, tmp->d, div_n + 1);
q -= l0;
/*
* Note: As we have considered only the leading two BN_ULONGs in
* the calculation of q, sdiv * q might be greater than wnum (but
* then (q-1) * sdiv is less or equal than wnum)
*/
for (l0 = 0 - l0, j = 0; j < div_n; j++)
tmp->d[j] = sdiv->d[j] & l0;
l0 = bn_add_words(wnum, wnum, tmp->d, div_n);
(*wnumtop) += l0;
assert((*wnumtop) == 0);
/* store part of the result */
*--resp = q;
}
/* snum holds remainder, it's as wide as divisor */
snum->neg = num_neg;
snum->top = div_n;
snum->flags |= BN_FLG_FIXED_TOP;
if (rm != NULL && bn_rshift_fixed_top(rm, snum, norm_shift) == 0)
goto err;
BN_CTX_end(ctx);
return 1;
err:
bn_check_top(rm);
BN_CTX_end(ctx);
return 0;
}
#endif
================================================
FILE: cryptomini/bn/bn_exp.c
================================================
/*
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include "internal/cryptlib.h"
#include "internal/constant_time.h"
#include "bn_local.h"
#include <stdlib.h>
#ifdef _WIN32
# include <malloc.h>
# ifndef alloca
# define alloca _alloca
# endif
#elif defined(__GNUC__)
# ifndef alloca
# define alloca(s) __builtin_alloca((s))
# endif
#elif defined(__sun)
# include <alloca.h>
#endif
#include "rsaz_exp.h"
#undef SPARC_T4_MONT
#if defined(OPENSSL_BN_ASM_MONT) && (defined(__sparc__) || defined(__sparc))
# include "sparc_arch.h"
extern unsigned int OPENSSL_sparcv9cap_P[];
# define SPARC_T4_MONT
#endif
/* maximum precomputation table size for *variable* sliding windows */
#define TABLE_SIZE 32
/* this one works - simple but works */
int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
{
int i, bits, ret = 0;
BIGNUM *v, *rr;
if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
|| BN_get_flags(a, BN_FLG_CONSTTIME) != 0) {
/* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
BNerr(BN_F_BN_EXP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
BN_CTX_start(ctx);
rr = ((r == a) || (r == p)) ? BN_CTX_get(ctx) : r;
v = BN_CTX_get(ctx);
if (rr == NULL || v == NULL)
goto err;
if (BN_copy(v, a) == NULL)
goto err;
bits = BN_num_bits(p);
if (BN_is_odd(p)) {
if (BN_copy(rr, a) == NULL)
goto err;
} else {
if (!BN_one(rr))
goto err;
}
for (i = 1; i < bits; i++) {
if (!BN_sqr(v, v, ctx))
goto err;
if (BN_is_bit_set(p, i)) {
if (!BN_mul(rr, rr, v, ctx))
goto err;
}
}
if (r != rr && BN_copy(r, rr) == NULL)
goto err;
ret = 1;
err:
BN_CTX_end(ctx);
bn_check_top(r);
return ret;
}
int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
BN_CTX *ctx)
{
int ret;
bn_check_top(a);
bn_check_top(p);
bn_check_top(m);
/*-
* For even modulus m = 2^k*m_odd, it might make sense to compute
* a^p mod m_odd and a^p mod 2^k separately (with Montgomery
* exponentiation for the odd part), using appropriate exponent
* reductions, and combine the results using the CRT.
*
* For now, we use Montgomery only if the modulus is odd; otherwise,
* exponentiation using the reciprocal-based quick remaindering
* algorithm is used.
*
* (Timing obtained with expspeed.c [computations a^p mod m
* where a, p, m are of the same length: 256, 512, 1024, 2048,
* 4096, 8192 bits], compared to the running time of the
* standard algorithm:
*
* BN_mod_exp_mont 33 .. 40 % [AMD K6-2, Linux, debug configuration]
* 55 .. 77 % [UltraSparc processor, but
* debug-solaris-sparcv8-gcc conf.]
*
* BN_mod_exp_recp 50 .. 70 % [AMD K6-2, Linux, debug configuration]
* 62 .. 118 % [UltraSparc, debug-solaris-sparcv8-gcc]
*
* On the Sparc, BN_mod_exp_recp was faster than BN_mod_exp_mont
* at 2048 and more bits, but at 512 and 1024 bits, it was
* slower even than the standard algorithm!
*
* "Real" timings [linux-elf, solaris-sparcv9-gcc configurations]
* should be obtained when the new Montgomery reduction code
* has been integrated into OpenSSL.)
*/
#define MONT_MUL_MOD
#define MONT_EXP_WORD
#define RECP_MUL_MOD
#ifdef MONT_MUL_MOD
if (BN_is_odd(m)) {
# ifdef MONT_EXP_WORD
if (a->top == 1 && !a->neg
&& (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)
&& (BN_get_flags(a, BN_FLG_CONSTTIME) == 0)
&& (BN_get_flags(m, BN_FLG_CONSTTIME) == 0)) {
BN_ULONG A = a->d[0];
ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
} else
# endif
ret = BN_mod_exp_mont(r, a, p, m, ctx, NULL);
} else
#endif
#ifdef RECP_MUL_MOD
{
ret = BN_mod_exp_recp(r, a, p, m, ctx);
}
#else
{
ret = BN_mod_exp_simple(r, a, p, m, ctx);
}
#endif
bn_check_top(r);
return ret;
}
int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx)
{
int i, j, bits, ret = 0, wstart, wend, window, wvalue;
int start = 1;
BIGNUM *aa;
/* Table of variables obtained from 'ctx' */
BIGNUM *val[TABLE_SIZE];
BN_RECP_CTX recp;
if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
|| BN_get_flags(a, BN_FLG_CONSTTIME) != 0
|| BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
/* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
BNerr(BN_F_BN_MOD_EXP_RECP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
bits = BN_num_bits(p);
if (bits == 0) {
/* x**0 mod 1, or x**0 mod -1 is still zero. */
if (BN_abs_is_word(m, 1)) {
ret = 1;
BN_zero(r);
} else {
ret = BN_one(r);
}
return ret;
}
BN_RECP_CTX_init(&recp);
BN_CTX_start(ctx);
aa = BN_CTX_get(ctx);
val[0] = BN_CTX_get(ctx);
if (val[0] == NULL)
goto err;
if (m->neg) {
/* ignore sign of 'm' */
if (!BN_copy(aa, m))
goto err;
aa->neg = 0;
if (BN_RECP_CTX_set(&recp, aa, ctx) <= 0)
goto err;
} else {
if (BN_RECP_CTX_set(&recp, m, ctx) <= 0)
goto err;
}
if (!BN_nnmod(val[0], a, m, ctx))
goto err; /* 1 */
if (BN_is_zero(val[0])) {
BN_zero(r);
ret = 1;
goto err;
}
window = BN_window_bits_for_exponent_size(bits);
if (window > 1) {
if (!BN_mod_mul_reciprocal(aa, val[0], val[0], &recp, ctx))
goto err; /* 2 */
j = 1 << (window - 1);
for (i = 1; i < j; i++) {
if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
!BN_mod_mul_reciprocal(val[i], val[i - 1], aa, &recp, ctx))
goto err;
}
}
start = 1; /* This is used to avoid multiplication etc
* when there is only the value '1' in the
* buffer. */
wvalue = 0; /* The 'value' of the window */
wstart = bits - 1; /* The top bit of the window */
wend = 0; /* The bottom bit of the window */
if (!BN_one(r))
goto err;
for (;;) {
if (BN_is_bit_set(p, wstart) == 0) {
if (!start)
if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx))
goto err;
if (wstart == 0)
break;
wstart--;
continue;
}
/*
* We now have wstart on a 'set' bit, we now need to work out how bit
* a window to do. To do this we need to scan forward until the last
* set bit before the end of the window
*/
j = wstart;
wvalue = 1;
wend = 0;
for (i = 1; i < window; i++) {
if (wstart - i < 0)
break;
if (BN_is_bit_set(p, wstart - i)) {
wvalue <<= (i - wend);
wvalue |= 1;
wend = i;
}
}
/* wend is the size of the current window */
j = wend + 1;
/* add the 'bytes above' */
if (!start)
for (i = 0; i < j; i++) {
if (!BN_mod_mul_reciprocal(r, r, r, &recp, ctx))
goto err;
}
/* wvalue will be an odd number < 2^window */
if (!BN_mod_mul_reciprocal(r, r, val[wvalue >> 1], &recp, ctx))
goto err;
/* move the 'window' down further */
wstart -= wend + 1;
wvalue = 0;
start = 0;
if (wstart < 0)
break;
}
ret = 1;
err:
BN_CTX_end(ctx);
BN_RECP_CTX_free(&recp);
bn_check_top(r);
return ret;
}
int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
{
int i, j, bits, ret = 0, wstart, wend, window, wvalue;
int start = 1;
BIGNUM *d, *r;
const BIGNUM *aa;
/* Table of variables obtained from 'ctx' */
BIGNUM *val[TABLE_SIZE];
BN_MONT_CTX *mont = NULL;
if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
|| BN_get_flags(a, BN_FLG_CONSTTIME) != 0
|| BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
return BN_mod_exp_mont_consttime(rr, a, p, m, ctx, in_mont);
}
bn_check_top(a);
bn_check_top(p);
bn_check_top(m);
if (!BN_is_odd(m)) {
BNerr(BN_F_BN_MOD_EXP_MONT, BN_R_CALLED_WITH_EVEN_MODULUS);
return 0;
}
bits = BN_num_bits(p);
if (bits == 0) {
/* x**0 mod 1, or x**0 mod -1 is still zero. */
if (BN_abs_is_word(m, 1)) {
ret = 1;
BN_zero(rr);
} else {
ret = BN_one(rr);
}
return ret;
}
BN_CTX_start(ctx);
d = BN_CTX_get(ctx);
r = BN_CTX_get(ctx);
val[0] = BN_CTX_get(ctx);
if (val[0] == NULL)
goto err;
/*
* If this is not done, things will break in the montgomery part
*/
if (in_mont != NULL)
mont = in_mont;
else {
if ((mont = BN_MONT_CTX_new()) == NULL)
goto err;
if (!BN_MONT_CTX_set(mont, m, ctx))
goto err;
}
if (a->neg || BN_ucmp(a, m) >= 0) {
if (!BN_nnmod(val[0], a, m, ctx))
goto err;
aa = val[0];
} else
aa = a;
if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx))
goto err; /* 1 */
window = BN_window_bits_for_exponent_size(bits);
if (window > 1) {
if (!bn_mul_mont_fixed_top(d, val[0], val[0], mont, ctx))
goto err; /* 2 */
j = 1 << (window - 1);
for (i = 1; i < j; i++) {
if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
!bn_mul_mont_fixed_top(val[i], val[i - 1], d, mont, ctx))
goto err;
}
}
start = 1; /* This is used to avoid multiplication etc
* when there is only the value '1' in the
* buffer. */
wvalue = 0; /* The 'value' of the window */
wstart = bits - 1; /* The top bit of the window */
wend = 0; /* The bottom bit of the window */
#if 1 /* by Shay Gueron's suggestion */
j = m->top; /* borrow j */
if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
if (bn_wexpand(r, j) == NULL)
goto err;
/* 2^(top*BN_BITS2) - m */
r->d[0] = (0 - m->d[0]) & BN_MASK2;
for (i = 1; i < j; i++)
r->d[i] = (~m->d[i]) & BN_MASK2;
r->top = j;
r->flags |= BN_FLG_FIXED_TOP;
} else
#endif
if (!bn_to_mont_fixed_top(r, BN_value_one(), mont, ctx))
goto err;
for (;;) {
if (BN_is_bit_set(p, wstart) == 0) {
if (!start) {
if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
goto err;
}
if (wstart == 0)
break;
wstart--;
continue;
}
/*
* We now have wstart on a 'set' bit, we now need to work out how bit
* a window to do. To do this we need to scan forward until the last
* set bit before the end of the window
*/
j = wstart;
wvalue = 1;
wend = 0;
for (i = 1; i < window; i++) {
if (wstart - i < 0)
break;
if (BN_is_bit_set(p, wstart - i)) {
wvalue <<= (i - wend);
wvalue |= 1;
wend = i;
}
}
/* wend is the size of the current window */
j = wend + 1;
/* add the 'bytes above' */
if (!start)
for (i = 0; i < j; i++) {
if (!bn_mul_mont_fixed_top(r, r, r, mont, ctx))
goto err;
}
/* wvalue will be an odd number < 2^window */
if (!bn_mul_mont_fixed_top(r, r, val[wvalue >> 1], mont, ctx))
goto err;
/* move the 'window' down further */
wstart -= wend + 1;
wvalue = 0;
start = 0;
if (wstart < 0)
break;
}
/*
* Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
* removes padding [if any] and makes return value suitable for public
* API consumer.
*/
#if defined(SPARC_T4_MONT)
if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
j = mont->N.top; /* borrow j */
val[0]->d[0] = 1; /* borrow val[0] */
for (i = 1; i < j; i++)
val[0]->d[i] = 0;
val[0]->top = j;
if (!BN_mod_mul_montgomery(rr, r, val[0], mont, ctx))
goto err;
} else
#endif
if (!BN_from_montgomery(rr, r, mont, ctx))
goto err;
ret = 1;
err:
if (in_mont == NULL)
BN_MONT_CTX_free(mont);
BN_CTX_end(ctx);
bn_check_top(rr);
return ret;
}
static BN_ULONG bn_get_bits(const BIGNUM *a, int bitpos)
{
BN_ULONG ret = 0;
int wordpos;
wordpos = bitpos / BN_BITS2;
bitpos %= BN_BITS2;
if (wordpos >= 0 && wordpos < a->top) {
ret = a->d[wordpos] & BN_MASK2;
if (bitpos) {
ret >>= bitpos;
if (++wordpos < a->top)
ret |= a->d[wordpos] << (BN_BITS2 - bitpos);
}
}
return ret & BN_MASK2;
}
/*
* BN_mod_exp_mont_consttime() stores the precomputed powers in a specific
* layout so that accessing any of these table values shows the same access
* pattern as far as cache lines are concerned. The following functions are
* used to transfer a BIGNUM from/to that table.
*/
static int MOD_EXP_CTIME_COPY_TO_PREBUF(const BIGNUM *b, int top,
unsigned char *buf, int idx,
int window)
{
int i, j;
int width = 1 << window;
BN_ULONG *table = (BN_ULONG *)buf;
if (top > b->top)
top = b->top; /* this works because 'buf' is explicitly
* zeroed */
for (i = 0, j = idx; i < top; i++, j += width) {
table[j] = b->d[i];
}
return 1;
}
static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
unsigned char *buf, int idx,
int window)
{
int i, j;
int width = 1 << window;
/*
* We declare table 'volatile' in order to discourage compiler
* from reordering loads from the table. Concern is that if
* reordered in specific manner loads might give away the
* information we are trying to conceal. Some would argue that
* compiler can reorder them anyway, but it can as well be
* argued that doing so would be violation of standard...
*/
volatile BN_ULONG *table = (volatile BN_ULONG *)buf;
if (bn_wexpand(b, top) == NULL)
return 0;
if (window <= 3) {
for (i = 0; i < top; i++, table += width) {
BN_ULONG acc = 0;
for (j = 0; j < width; j++) {
acc |= table[j] &
((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
}
b->d[i] = acc;
}
} else {
int xstride = 1 << (window - 2);
BN_ULONG y0, y1, y2, y3;
i = idx >> (window - 2); /* equivalent of idx / xstride */
idx &= xstride - 1; /* equivalent of idx % xstride */
y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1);
y1 = (BN_ULONG)0 - (constant_time_eq_int(i,1)&1);
y2 = (BN_ULONG)0 - (constant_time_eq_int(i,2)&1);
y3 = (BN_ULONG)0 - (constant_time_eq_int(i,3)&1);
for (i = 0; i < top; i++, table += width) {
BN_ULONG acc = 0;
for (j = 0; j < xstride; j++) {
acc |= ( (table[j + 0 * xstride] & y0) |
(table[j + 1 * xstride] & y1) |
(table[j + 2 * xstride] & y2) |
(table[j + 3 * xstride] & y3) )
& ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1));
}
b->d[i] = acc;
}
}
b->top = top;
b->flags |= BN_FLG_FIXED_TOP;
return 1;
}
/*
* Given a pointer value, compute the next address that is a cache line
* multiple.
*/
#define MOD_EXP_CTIME_ALIGN(x_) \
((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
/*
* This variant of BN_mod_exp_mont() uses fixed windows and the special
* precomputation memory layout to limit data-dependency to a minimum to
* protect secret exponents (cf. the hyper-threading timing attacks pointed
* out by Colin Percival,
* http://www.daemonology.net/hyperthreading-considered-harmful/)
*/
int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx,
BN_MONT_CTX *in_mont)
{
int i, bits, ret = 0, window, wvalue, wmask, window0;
int top;
BN_MONT_CTX *mont = NULL;
int numPowers;
unsigned char *powerbufFree = NULL;
int powerbufLen = 0;
unsigned char *powerbuf = NULL;
BIGNUM tmp, am;
#if defined(SPARC_T4_MONT)
unsigned int t4 = 0;
#endif
bn_check_top(a);
bn_check_top(p);
bn_check_top(m);
if (!BN_is_odd(m)) {
BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
return 0;
}
top = m->top;
/*
* Use all bits stored in |p|, rather than |BN_num_bits|, so we do not leak
* whether the top bits are zero.
*/
bits = p->top * BN_BITS2;
if (bits == 0) {
/* x**0 mod 1, or x**0 mod -1 is still zero. */
if (BN_abs_is_word(m, 1)) {
ret = 1;
BN_zero(rr);
} else {
ret = BN_one(rr);
}
return ret;
}
BN_CTX_start(ctx);
/*
* Allocate a montgomery context if it was not supplied by the caller. If
* this is not done, things will break in the montgomery part.
*/
if (in_mont != NULL)
mont = in_mont;
else {
if ((mont = BN_MONT_CTX_new()) == NULL)
goto err;
if (!BN_MONT_CTX_set(mont, m, ctx))
goto err;
}
if (a->neg || BN_ucmp(a, m) >= 0) {
BIGNUM *reduced = BN_CTX_get(ctx);
if (reduced == NULL
|| !BN_nnmod(reduced, a, m, ctx)) {
goto err;
}
a = reduced;
}
#ifdef RSAZ_ENABLED
/*
* If the size of the operands allow it, perform the optimized
* RSAZ exponentiation. For further information see
* crypto/bn/rsaz_exp.c and accompanying assembly modules.
*/
if ((16 == a->top) && (16 == p->top) && (BN_num_bits(m) == 1024)
&& rsaz_avx2_eligible()) {
if (NULL == bn_wexpand(rr, 16))
goto err;
RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d,
mont->n0[0]);
rr->top = 16;
rr->neg = 0;
bn_correct_top(rr);
ret = 1;
goto err;
} else if ((8 == a->top) && (8 == p->top) && (BN_num_bits(m) == 512)) {
if (NULL == bn_wexpand(rr, 8))
goto err;
RSAZ_512_mod_exp(rr->d, a->d, p->d, m->d, mont->n0[0], mont->RR.d);
rr->top = 8;
rr->neg = 0;
bn_correct_top(rr);
ret = 1;
goto err;
}
#endif
/* Get the window size to use with size of p. */
window = BN_window_bits_for_ctime_exponent_size(bits);
#if defined(SPARC_T4_MONT)
if (window >= 5 && (top & 15) == 0 && top <= 64 &&
(OPENSSL_sparcv9cap_P[1] & (CFR_MONTMUL | CFR_MONTSQR)) ==
(CFR_MONTMUL | CFR_MONTSQR) && (t4 = OPENSSL_sparcv9cap_P[0]))
window = 5;
else
#endif
#if defined(OPENSSL_BN_ASM_MONT5)
if (window >= 5) {
window = 5; /* ~5% improvement for RSA2048 sign, and even
* for RSA4096 */
/* reserve space for mont->N.d[] copy */
powerbufLen += top * sizeof(mont->N.d[0]);
}
#endif
(void)0;
/*
* Allocate a buffer large enough to hold all of the pre-computed powers
* of am, am itself and tmp.
*/
numPowers = 1 << window;
powerbufLen += sizeof(m->d[0]) * (top * numPowers +
((2 * top) >
numPowers ? (2 * top) : numPowers));
#ifdef alloca
if (powerbufLen < 3072)
powerbufFree =
alloca(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH);
else
#endif
if ((powerbufFree =
OPENSSL_malloc(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH))
== NULL)
goto err;
powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree);
memset(powerbuf, 0, powerbufLen);
#ifdef alloca
if (powerbufLen < 3072)
powerbufFree = NULL;
#endif
/* lay down tmp and am right after powers table */
tmp.d = (BN_ULONG *)(powerbuf + sizeof(m->d[0]) * top * numPowers);
am.d = tmp.d + top;
tmp.top = am.top = 0;
tmp.dmax = am.dmax = top;
tmp.neg = am.neg = 0;
tmp.flags = am.flags = BN_FLG_STATIC_DATA;
/* prepare a^0 in Montgomery domain */
#if 1 /* by Shay Gueron's suggestion */
if (m->d[top - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) {
/* 2^(top*BN_BITS2) - m */
tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
for (i = 1; i < top; i++)
tmp.d[i] = (~m->d[i]) & BN_MASK2;
tmp.top = top;
} else
#endif
if (!bn_to_mont_fixed_top(&tmp, BN_value_one(), mont, ctx))
goto err;
/* prepare a^1 in Montgomery domain */
if (!bn_to_mont_fixed_top(&am, a, mont, ctx))
goto err;
#if defined(SPARC_T4_MONT)
if (t4) {
typedef int (*bn_pwr5_mont_f) (BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
int bn_pwr5_mont_t4_8(BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
int bn_pwr5_mont_t4_16(BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
int bn_pwr5_mont_t4_24(BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
int bn_pwr5_mont_t4_32(BN_ULONG *tp, const BN_ULONG *np,
const BN_ULONG *n0, const void *table,
int power, int bits);
static const bn_pwr5_mont_f pwr5_funcs[4] = {
bn_pwr5_mont_t4_8, bn_pwr5_mont_t4_16,
bn_pwr5_mont_t4_24, bn_pwr5_mont_t4_32
};
bn_pwr5_mont_f pwr5_worker = pwr5_funcs[top / 16 - 1];
typedef int (*bn_mul_mont_f) (BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0);
int bn_mul_mont_t4_8(BN_ULONG *rp, const BN_ULONG *ap, const void *bp,
const BN_ULONG *np, const BN_ULONG *n0);
int bn_mul_mont_t4_16(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0);
int bn_mul_mont_t4_24(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0);
int bn_mul_mont_t4_32(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0);
static const bn_mul_mont_f mul_funcs[4] = {
bn_mul_mont_t4_8, bn_mul_mont_t4_16,
bn_mul_mont_t4_24, bn_mul_mont_t4_32
};
bn_mul_mont_f mul_worker = mul_funcs[top / 16 - 1];
void bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0, int num);
void bn_mul_mont_t4(BN_ULONG *rp, const BN_ULONG *ap,
const void *bp, const BN_ULONG *np,
const BN_ULONG *n0, int num);
void bn_mul_mont_gather5_t4(BN_ULONG *rp, const BN_ULONG *ap,
const void *table, const BN_ULONG *np,
const BN_ULONG *n0, int num, int power);
void bn_flip_n_scatter5_t4(const BN_ULONG *inp, size_t num,
void *table, size_t power);
void bn_gather5_t4(BN_ULONG *out, size_t num,
void *table, size_t power);
void bn_flip_t4(BN_ULONG *dst, BN_ULONG *src, size_t num);
BN_ULONG *np = mont->N.d, *n0 = mont->n0;
int stride = 5 * (6 - (top / 16 - 1)); /* multiple of 5, but less
* than 32 */
/*
* BN_to_montgomery can contaminate words above .top [in
* BN_DEBUG[_DEBUG] build]...
*/
for (i = am.top; i < top; i++)
am.d[i] = 0;
for (i = tmp.top; i < top; i++)
tmp.d[i] = 0;
bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 0);
bn_flip_n_scatter5_t4(am.d, top, powerbuf, 1);
if (!(*mul_worker) (tmp.d, am.d, am.d, np, n0) &&
!(*mul_worker) (tmp.d, am.d, am.d, np, n0))
bn_mul_mont_vis3(tmp.d, am.d, am.d, np, n0, top);
bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, 2);
for (i = 3; i < 32; i++) {
/* Calculate a^i = a^(i-1) * a */
if (!(*mul_worker) (tmp.d, tmp.d, am.d, np, n0) &&
!(*mul_worker) (tmp.d, tmp.d, am.d, np, n0))
bn_mul_mont_vis3(tmp.d, tmp.d, am.d, np, n0, top);
bn_flip_n_scatter5_t4(tmp.d, top, powerbuf, i);
}
/* switch to 64-bit domain */
np = alloca(top * sizeof(BN_ULONG));
top /= 2;
bn_flip_t4(np, mont->N.d, top);
/*
* The exponent may not have a whole number of fixed-size windows.
* To simplify the main loop, the initial window has between 1 and
* full-window-size bits such that what remains is always a whole
* number of windows
*/
window0 = (bits - 1) % 5 + 1;
wmask = (1 << window0) - 1;
bits -= window0;
wvalue = bn_get_bits(p, bits) & wmask;
bn_gather5_t4(tmp.d, top, powerbuf, wvalue);
/*
* Scan the exponent one window at a time starting from the most
* significant bits.
*/
while (bits > 0) {
if (bits < stride)
stride = bits;
bits -= stride;
wvalue = bn_get_bits(p, bits);
if ((*pwr5_worker) (tmp.d, np, n0, powerbuf, wvalue, stride))
continue;
/* retry once and fall back */
if ((*pwr5_worker) (tmp.d, np, n0, powerbuf, wvalue, stride))
continue;
bits += stride - 5;
wvalue >>= stride - 5;
wvalue &= 31;
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_t4(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_gather5_t4(tmp.d, tmp.d, powerbuf, np, n0, top,
wvalue);
}
bn_flip_t4(tmp.d, tmp.d, top);
top *= 2;
/* back to 32-bit domain */
tmp.top = top;
bn_correct_top(&tmp);
OPENSSL_cleanse(np, top * sizeof(BN_ULONG));
} else
#endif
#if defined(OPENSSL_BN_ASM_MONT5)
if (window == 5 && top > 1) {
/*
* This optimization uses ideas from http://eprint.iacr.org/2011/239,
* specifically optimization of cache-timing attack countermeasures
* and pre-computation optimization.
*/
/*
* Dedicated window==4 case improves 512-bit RSA sign by ~15%, but as
* 512-bit RSA is hardly relevant, we omit it to spare size...
*/
void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap,
const void *table, const BN_ULONG *np,
const BN_ULONG *n0, int num, int power);
void bn_scatter5(const BN_ULONG *inp, size_t num,
void *table, size_t power);
void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power);
void bn_power5(BN_ULONG *rp, const BN_ULONG *ap,
const void *table, const BN_ULONG *np,
const BN_ULONG *n0, int num, int power);
int bn_get_bits5(const BN_ULONG *ap, int off);
int bn_from_montgomery(BN_ULONG *rp, const BN_ULONG *ap,
const BN_ULONG *not_used, const BN_ULONG *np,
const BN_ULONG *n0, int num);
BN_ULONG *n0 = mont->n0, *np;
/*
* BN_to_montgomery can contaminate words above .top [in
* BN_DEBUG[_DEBUG] build]...
*/
for (i = am.top; i < top; i++)
am.d[i] = 0;
for (i = tmp.top; i < top; i++)
tmp.d[i] = 0;
/*
* copy mont->N.d[] to improve cache locality
*/
for (np = am.d + top, i = 0; i < top; i++)
np[i] = mont->N.d[i];
bn_scatter5(tmp.d, top, powerbuf, 0);
bn_scatter5(am.d, am.top, powerbuf, 1);
bn_mul_mont(tmp.d, am.d, am.d, np, n0, top);
bn_scatter5(tmp.d, top, powerbuf, 2);
# if 0
for (i = 3; i < 32; i++) {
/* Calculate a^i = a^(i-1) * a */
bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
bn_scatter5(tmp.d, top, powerbuf, i);
}
# else
/* same as above, but uses squaring for 1/2 of operations */
for (i = 4; i < 32; i *= 2) {
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_scatter5(tmp.d, top, powerbuf, i);
}
for (i = 3; i < 8; i += 2) {
int j;
bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
bn_scatter5(tmp.d, top, powerbuf, i);
for (j = 2 * i; j < 32; j *= 2) {
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_scatter5(tmp.d, top, powerbuf, j);
}
}
for (; i < 16; i += 2) {
bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
bn_scatter5(tmp.d, top, powerbuf, i);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_scatter5(tmp.d, top, powerbuf, 2 * i);
}
for (; i < 32; i += 2) {
bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1);
bn_scatter5(tmp.d, top, powerbuf, i);
}
# endif
/*
* The exponent may not have a whole number of fixed-size windows.
* To simplify the main loop, the initial window has between 1 and
* full-window-size bits such that what remains is always a whole
* number of windows
*/
window0 = (bits - 1) % 5 + 1;
wmask = (1 << window0) - 1;
bits -= window0;
wvalue = bn_get_bits(p, bits) & wmask;
bn_gather5(tmp.d, top, powerbuf, wvalue);
/*
* Scan the exponent one window at a time starting from the most
* significant bits.
*/
if (top & 7) {
while (bits > 0) {
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top);
bn_mul_mont_gather5(tmp.d, tmp.d, powerbuf, np, n0, top,
bn_get_bits5(p->d, bits -= 5));
}
} else {
while (bits > 0) {
bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top,
bn_get_bits5(p->d, bits -= 5));
}
}
ret = bn_from_montgomery(tmp.d, tmp.d, NULL, np, n0, top);
tmp.top = top;
bn_correct_top(&tmp);
if (ret) {
if (!BN_copy(rr, &tmp))
ret = 0;
goto err; /* non-zero ret means it's not error */
}
} else
#endif
{
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, window))
goto err;
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, window))
goto err;
/*
* If the window size is greater than 1, then calculate
* val[i=2..2^winsize-1]. Powers are computed as a*a^(i-1) (even
* powers could instead be computed as (a^(i/2))^2 to use the slight
* performance advantage of sqr over mul).
*/
if (window > 1) {
if (!bn_mul_mont_fixed_top(&tmp, &am, &am, mont, ctx))
goto err;
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2,
window))
goto err;
for (i = 3; i < numPowers; i++) {
/* Calculate a^i = a^(i-1) * a */
if (!bn_mul_mont_fixed_top(&tmp, &am, &tmp, mont, ctx))
goto err;
if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i,
window))
goto err;
}
}
/*
* The exponent may not have a whole number of fixed-size windows.
* To simplify the main loop, the initial window has between 1 and
* full-window-size bits such that what remains is always a whole
* number of windows
*/
window0 = (bits - 1) % window + 1;
wmask = (1 << window0) - 1;
bits -= window0;
wvalue = bn_get_bits(p, bits) & wmask;
if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
window))
goto err;
wmask = (1 << window) - 1;
/*
* Scan the exponent one window at a time starting from the most
* significant bits.
*/
while (bits > 0) {
/* Square the result window-size times */
for (i = 0; i < window; i++)
if (!bn_mul_mont_fixed_top(&tmp, &tmp, &tmp, mont, ctx))
goto err;
/*
* Get a window's worth of bits from the exponent
* This avoids calling BN_is_bit_set for each bit, which
* is not only slower but also makes each bit vulnerable to
* EM (and likely other) side-channel attacks like One&Done
* (for details see "One&Done: A Single-Decryption EM-Based
* Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam,
* H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and
* M. Prvulovic, in USENIX Security'18)
*/
bits -= window;
wvalue = bn_get_bits(p, bits) & wmask;
/*
* Fetch the appropriate pre-computed value from the pre-buf
*/
if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&am, top, powerbuf, wvalue,
window))
goto err;
/* Multiply the result into the intermediate result */
if (!bn_mul_mont_fixed_top(&tmp, &tmp, &am, mont, ctx))
goto err;
}
}
/*
* Done with zero-padded intermediate BIGNUMs. Final BN_from_montgomery
* removes padding [if any] and makes return value suitable for public
* API consumer.
*/
#if defined(SPARC_T4_MONT)
if (OPENSSL_sparcv9cap_P[0] & (SPARCV9_VIS3 | SPARCV9_PREFER_FPU)) {
am.d[0] = 1; /* borrow am */
for (i = 1; i < top; i++)
am.d[i] = 0;
if (!BN_mod_mul_montgomery(rr, &tmp, &am, mont, ctx))
goto err;
} else
#endif
if (!BN_from_montgomery(rr, &tmp, mont, ctx))
goto err;
ret = 1;
err:
if (in_mont == NULL)
BN_MONT_CTX_free(mont);
if (powerbuf != NULL) {
OPENSSL_cleanse(powerbuf, powerbufLen);
OPENSSL_free(powerbufFree);
}
BN_CTX_end(ctx);
return ret;
}
int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
{
BN_MONT_CTX *mont = NULL;
int b, bits, ret = 0;
int r_is_one;
BN_ULONG w, next_w;
BIGNUM *r, *t;
BIGNUM *swap_tmp;
#define BN_MOD_MUL_WORD(r, w, m) \
(BN_mul_word(r, (w)) && \
(/* BN_ucmp(r, (m)) < 0 ? 1 :*/ \
(BN_mod(t, r, m, ctx) && (swap_tmp = r, r = t, t = swap_tmp, 1))))
/*
* BN_MOD_MUL_WORD is only used with 'w' large, so the BN_ucmp test is
* probably more overhead than always using BN_mod (which uses BN_copy if
* a similar test returns true).
*/
/*
* We can use BN_mod and do not need BN_nnmod because our accumulator is
* never negative (the result of BN_mod does not depend on the sign of
* the modulus).
*/
#define BN_TO_MONTGOMERY_WORD(r, w, mont) \
(BN_set_word(r, (w)) && BN_to_montgomery(r, r, (mont), ctx))
if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
|| BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
/* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
BNerr(BN_F_BN_MOD_EXP_MONT_WORD, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
bn_check_top(p);
bn_check_top(m);
if (!BN_is_odd(m)) {
BNerr(BN_F_BN_MOD_EXP_MONT_WORD, BN_R_CALLED_WITH_EVEN_MODULUS);
return 0;
}
if (m->top == 1)
a %= m->d[0]; /* make sure that 'a' is reduced */
bits = BN_num_bits(p);
if (bits == 0) {
/* x**0 mod 1, or x**0 mod -1 is still zero. */
if (BN_abs_is_word(m, 1)) {
ret = 1;
BN_zero(rr);
} else {
ret = BN_one(rr);
}
return ret;
}
if (a == 0) {
BN_zero(rr);
ret = 1;
return ret;
}
BN_CTX_start(ctx);
r = BN_CTX_get(ctx);
t = BN_CTX_get(ctx);
if (t == NULL)
goto err;
if (in_mont != NULL)
mont = in_mont;
else {
if ((mont = BN_MONT_CTX_new()) == NULL)
goto err;
if (!BN_MONT_CTX_set(mont, m, ctx))
goto err;
}
r_is_one = 1; /* except for Montgomery factor */
/* bits-1 >= 0 */
/* The result is accumulated in the product r*w. */
w = a; /* bit 'bits-1' of 'p' is always set */
for (b = bits - 2; b >= 0; b--) {
/* First, square r*w. */
next_w = w * w;
if ((next_w / w) != w) { /* overflow */
if (r_is_one) {
if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
goto err;
r_is_one = 0;
} else {
if (!BN_MOD_MUL_WORD(r, w, m))
goto err;
}
next_w = 1;
}
w = next_w;
if (!r_is_one) {
if (!BN_mod_mul_montgomery(r, r, r, mont, ctx))
goto err;
}
/* Second, multiply r*w by 'a' if exponent bit is set. */
if (BN_is_bit_set(p, b)) {
next_w = w * a;
if ((next_w / a) != w) { /* overflow */
if (r_is_one) {
if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
goto err;
r_is_one = 0;
} else {
if (!BN_MOD_MUL_WORD(r, w, m))
goto err;
}
next_w = a;
}
w = next_w;
}
}
/* Finally, set r:=r*w. */
if (w != 1) {
if (r_is_one) {
if (!BN_TO_MONTGOMERY_WORD(r, w, mont))
goto err;
r_is_one = 0;
} else {
if (!BN_MOD_MUL_WORD(r, w, m))
goto err;
}
}
if (r_is_one) { /* can happen only if a == 1 */
if (!BN_one(rr))
goto err;
} else {
if (!BN_from_montgomery(rr, r, mont, ctx))
goto err;
}
ret = 1;
err:
if (in_mont == NULL)
BN_MONT_CTX_free(mont);
BN_CTX_end(ctx);
bn_check_top(rr);
return ret;
}
/* The old fallback, simple version :-) */
int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
const BIGNUM *m, BN_CTX *ctx)
{
int i, j, bits, ret = 0, wstart, wend, window, wvalue;
int start = 1;
BIGNUM *d;
/* Table of variables obtained from 'ctx' */
BIGNUM *val[TABLE_SIZE];
if (BN_get_flags(p, BN_FLG_CONSTTIME) != 0
|| BN_get_flags(a, BN_FLG_CONSTTIME) != 0
|| BN_get_flags(m, BN_FLG_CONSTTIME) != 0) {
/* BN_FLG_CONSTTIME only supported by BN_mod_exp_mont() */
BNerr(BN_F_BN_MOD_EXP_SIMPLE, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return 0;
}
bits = BN_num_bits(p);
if (bits == 0) {
/* x**0 mod 1, or x**0 mod -1 is still zero. */
if (BN_abs_is_word(m, 1)) {
ret = 1;
BN_zero(r);
} else {
ret = BN_one(r);
}
return ret;
}
BN_CTX_start(ctx);
d = BN_CTX_get(ctx);
val[0] = BN_CTX_get(ctx);
if (val[0] == NULL)
goto err;
if (!BN_nnmod(val[0], a, m, ctx))
goto err; /* 1 */
if (BN_is_zero(val[0])) {
BN_zero(r);
ret = 1;
goto err;
}
window = BN_window_bits_for_exponent_size(bits);
if (window > 1) {
if (!BN_mod_mul(d, val[0], val[0], m, ctx))
goto err; /* 2 */
j = 1 << (window - 1);
for (i = 1; i < j; i++) {
if (((val[i] = BN_CTX_get(ctx)) == NULL) ||
!BN_mod_mul(val[i], val[i - 1], d, m, ctx))
goto err;
}
}
start = 1; /* This is used to avoid multiplication etc
* when there is only the value '1' in the
* buffer. */
wvalue = 0;
gitextract_jxt2uhi3/
├── README.md
├── cryptomini/
│ ├── .vscode/
│ │ └── settings.json
│ ├── README.md
│ ├── aes/
│ │ ├── aes_cbc.c
│ │ ├── aes_core.c
│ │ └── aes_local.h
│ ├── bn/
│ │ ├── README.pod
│ │ ├── bn_add.c
│ │ ├── bn_asm.c
│ │ ├── bn_ctx.c
│ │ ├── bn_div.c
│ │ ├── bn_exp.c
│ │ ├── bn_gcd.c
│ │ ├── bn_intern.c
│ │ ├── bn_lib.c
│ │ ├── bn_local.h
│ │ ├── bn_mod.c
│ │ ├── bn_mont.c
│ │ ├── bn_mul.c
│ │ ├── bn_nist.c
│ │ ├── bn_rand.c
│ │ ├── bn_recp.c
│ │ ├── bn_shift.c
│ │ ├── bn_sqr.c
│ │ ├── bn_word.c
│ │ └── rsaz_exp.h
│ ├── camellia/
│ │ ├── camellia.c
│ │ ├── cmll_local.h
│ │ └── cmll_misc.c
│ ├── cryptlib.c
│ ├── e_os.h
│ ├── ec/
│ │ ├── ec_cvt.c
│ │ ├── ec_key.c
│ │ ├── ec_lib.c
│ │ ├── ec_local.h
│ │ ├── ec_mult.c
│ │ ├── ecdh_ossl.c
│ │ ├── ecp_mont.c
│ │ ├── ecp_nist.c
│ │ └── ecp_smpl.c
│ ├── include/
│ │ ├── crypto/
│ │ │ ├── __DECC_INCLUDE_EPILOGUE.H
│ │ │ ├── __DECC_INCLUDE_PROLOGUE.H
│ │ │ ├── aria.h
│ │ │ ├── asn1.h
│ │ │ ├── async.h
│ │ │ ├── bn.h
│ │ │ ├── bn_conf.h
│ │ │ ├── bn_conf.h.in
│ │ │ ├── bn_dh.h
│ │ │ ├── bn_srp.h
│ │ │ ├── chacha.h
│ │ │ ├── cryptlib.h
│ │ │ ├── ctype.h
│ │ │ ├── dso_conf.h
│ │ │ ├── dso_conf.h.in
│ │ │ ├── ec.h
│ │ │ ├── engine.h
│ │ │ ├── err.h
│ │ │ ├── evp.h
│ │ │ ├── lhash.h
│ │ │ ├── md32_common.h
│ │ │ ├── objects.h
│ │ │ ├── poly1305.h
│ │ │ ├── rand.h
│ │ │ ├── sha.h
│ │ │ ├── siphash.h
│ │ │ ├── sm2.h
│ │ │ ├── sm2err.h
│ │ │ ├── sm3.h
│ │ │ ├── sm4.h
│ │ │ ├── store.h
│ │ │ └── x509.h
│ │ ├── intercept/
│ │ │ └── intercept.h
│ │ ├── internal/
│ │ │ ├── __DECC_INCLUDE_EPILOGUE.H
│ │ │ ├── __DECC_INCLUDE_PROLOGUE.H
│ │ │ ├── bio.h
│ │ │ ├── comp.h
│ │ │ ├── conf.h
│ │ │ ├── constant_time.h
│ │ │ ├── cryptlib.h
│ │ │ ├── dane.h
│ │ │ ├── dso.h
│ │ │ ├── dsoerr.h
│ │ │ ├── err.h
│ │ │ ├── nelem.h
│ │ │ ├── numbers.h
│ │ │ ├── o_dir.h
│ │ │ ├── o_str.h
│ │ │ ├── refcount.h
│ │ │ ├── sockets.h
│ │ │ ├── sslconf.h
│ │ │ ├── thread_once.h
│ │ │ └── tsan_assist.h
│ │ └── openssl/
│ │ ├── __DECC_INCLUDE_EPILOGUE.H
│ │ ├── __DECC_INCLUDE_PROLOGUE.H
│ │ ├── aes.h
│ │ ├── asn1.h
│ │ ├── asn1_mac.h
│ │ ├── asn1err.h
│ │ ├── asn1t.h
│ │ ├── async.h
│ │ ├── asyncerr.h
│ │ ├── bio.h
│ │ ├── bioerr.h
│ │ ├── blowfish.h
│ │ ├── bn.h
│ │ ├── bnerr.h
│ │ ├── buffer.h
│ │ ├── buffererr.h
│ │ ├── camellia.h
│ │ ├── cast.h
│ │ ├── cmac.h
│ │ ├── cms.h
│ │ ├── cmserr.h
│ │ ├── comp.h
│ │ ├── comperr.h
│ │ ├── conf.h
│ │ ├── conf_api.h
│ │ ├── conferr.h
│ │ ├── crypto.h
│ │ ├── cryptoerr.h
│ │ ├── ct.h
│ │ ├── cterr.h
│ │ ├── des.h
│ │ ├── dh.h
│ │ ├── dherr.h
│ │ ├── dsa.h
│ │ ├── dsaerr.h
│ │ ├── dtls1.h
│ │ ├── e_os2.h
│ │ ├── ebcdic.h
│ │ ├── ec.h
│ │ ├── ecdh.h
│ │ ├── ecdsa.h
│ │ ├── ecerr.h
│ │ ├── engine.h
│ │ ├── engineerr.h
│ │ ├── err.h
│ │ ├── evp.h
│ │ ├── evperr.h
│ │ ├── hmac.h
│ │ ├── idea.h
│ │ ├── kdf.h
│ │ ├── kdferr.h
│ │ ├── lhash.h
│ │ ├── md2.h
│ │ ├── md4.h
│ │ ├── md5.h
│ │ ├── mdc2.h
│ │ ├── modes.h
│ │ ├── obj_mac.h
│ │ ├── objects.h
│ │ ├── objectserr.h
│ │ ├── ocsp.h
│ │ ├── ocsperr.h
│ │ ├── opensslconf.h
│ │ ├── opensslconf.h.in
│ │ ├── opensslv.h
│ │ ├── ossl_typ.h
│ │ ├── pem.h
│ │ ├── pem2.h
│ │ ├── pemerr.h
│ │ ├── pkcs12.h
│ │ ├── pkcs12err.h
│ │ ├── pkcs7.h
│ │ ├── pkcs7err.h
│ │ ├── rand.h
│ │ ├── rand_drbg.h
│ │ ├── randerr.h
│ │ ├── rc2.h
│ │ ├── rc4.h
│ │ ├── rc5.h
│ │ ├── ripemd.h
│ │ ├── rsa.h
│ │ ├── rsaerr.h
│ │ ├── safestack.h
│ │ ├── seed.h
│ │ ├── sha.h
│ │ ├── srp.h
│ │ ├── srtp.h
│ │ ├── ssl.h
│ │ ├── ssl2.h
│ │ ├── ssl3.h
│ │ ├── sslerr.h
│ │ ├── stack.h
│ │ ├── store.h
│ │ ├── storeerr.h
│ │ ├── symhacks.h
│ │ ├── tls1.h
│ │ ├── ts.h
│ │ ├── tserr.h
│ │ ├── txt_db.h
│ │ ├── ui.h
│ │ ├── uierr.h
│ │ ├── whrlpool.h
│ │ ├── x509.h
│ │ ├── x509_vfy.h
│ │ ├── x509err.h
│ │ ├── x509v3.h
│ │ └── x509v3err.h
│ ├── intercept/
│ │ ├── err.c
│ │ ├── intercept.c
│ │ └── rand.c
│ ├── makefile
│ ├── mem.c
│ ├── mem_clr.c
│ ├── mem_sec.c
│ ├── sha/
│ │ ├── sha1_one.c
│ │ ├── sha1dgst.c
│ │ ├── sha256.c
│ │ ├── sha512.c
│ │ └── sha_local.h
│ └── threads_none.c
├── ftpm-driver/
│ ├── .vscode/
│ │ └── settings.json
│ ├── Makefile
│ ├── ftpm-driver.mod
│ ├── ftpm-ioctl.c
│ ├── ftpm-sbi.c
│ ├── ftpm-sbi.h
│ ├── ftpm.c
│ ├── ftpm.h
│ ├── ftpm_user.h
│ ├── rtpm-controller.c
│ └── rtpm-driver.mod
├── ftpm-opensbi/
│ ├── .clang-format
│ ├── .gitignore
│ ├── .vscode/
│ │ └── settings.json
│ ├── CONTRIBUTORS.md
│ ├── COPYING.BSD
│ ├── Kconfig
│ ├── ThirdPartyNotices.md
│ ├── docs/
│ │ ├── contributing.md
│ │ ├── domain_support.md
│ │ ├── doxygen.cfg
│ │ ├── external/
│ │ │ └── coreboot.md
│ │ ├── firmware/
│ │ │ ├── fw.md
│ │ │ ├── fw_dynamic.md
│ │ │ ├── fw_jump.md
│ │ │ ├── fw_payload.md
│ │ │ ├── payload_linux.md
│ │ │ └── payload_uboot.md
│ │ ├── library_usage.md
│ │ ├── platform/
│ │ │ ├── andes-ae350.md
│ │ │ ├── fpga-ariane.md
│ │ │ ├── fpga-openpiton.md
│ │ │ ├── generic.md
│ │ │ ├── nuclei_ux600.md
│ │ │ ├── platform.md
│ │ │ ├── qemu_virt.md
│ │ │ ├── renesas-rzfive.md
│ │ │ ├── shakti_cclass.md
│ │ │ ├── sifive_fu540.md
│ │ │ ├── spike.md
│ │ │ └── thead-c9xx.md
│ │ ├── platform_guide.md
│ │ ├── platform_requirements.md
│ │ └── pmu_support.md
│ ├── firmware/
│ │ ├── Kconfig
│ │ ├── external_deps.mk
│ │ ├── fw_base.S
│ │ ├── fw_base.ldS
│ │ ├── fw_dynamic.S
│ │ ├── fw_dynamic.elf.ldS
│ │ ├── fw_jump.S
│ │ ├── fw_jump.elf.ldS
│ │ ├── fw_payload.S
│ │ ├── fw_payload.elf.ldS
│ │ ├── objects.mk
│ │ └── payloads/
│ │ ├── objects.mk
│ │ ├── test.elf.ldS
│ │ ├── test_head.S
│ │ └── test_main.c
│ ├── include/
│ │ ├── fatfs/
│ │ │ ├── diskio.h
│ │ │ ├── ff.h
│ │ │ └── ffconf.h
│ │ ├── ftpm/
│ │ │ ├── ACT.h
│ │ │ ├── ACT_SetTimeout_fp.h
│ │ │ ├── ACT_spt_fp.h
│ │ │ ├── ActivateCredential_fp.h
│ │ │ ├── AlgorithmCap_fp.h
│ │ │ ├── AlgorithmTests_fp.h
│ │ │ ├── Attest_spt_fp.h
│ │ │ ├── BaseTypes.h
│ │ │ ├── Bits_fp.h
│ │ │ ├── BnConvert.h
│ │ │ ├── BnConvert_fp.h
│ │ │ ├── BnMath_fp.h
│ │ │ ├── BnMemory_fp.h
│ │ │ ├── BnOssl.h
│ │ │ ├── BnSupport_Interface.h
│ │ │ ├── BnToOsslMath.h
│ │ │ ├── BnToOsslMath_fp.h
│ │ │ ├── BnToOsslSupport.h
│ │ │ ├── BnToOsslSym.h
│ │ │ ├── BnUtil_fp.h
│ │ │ ├── BnValues.h
│ │ │ ├── Capabilities.h
│ │ │ ├── CertifyCreation_fp.h
│ │ │ ├── CertifyX509_fp.h
│ │ │ ├── Certify_fp.h
│ │ │ ├── ChangeEPS_fp.h
│ │ │ ├── ChangePPS_fp.h
│ │ │ ├── ClearControl_fp.h
│ │ │ ├── Clear_fp.h
│ │ │ ├── ClockRateAdjust_fp.h
│ │ │ ├── ClockSet_fp.h
│ │ │ ├── CommandAttributeData.h
│ │ │ ├── CommandAttributes.h
│ │ │ ├── CommandAudit_fp.h
│ │ │ ├── CommandCodeAttributes_fp.h
│ │ │ ├── CommandDispatchData.h
│ │ │ ├── CommandDispatcher_fp.h
│ │ │ ├── Commands.h
│ │ │ ├── Commit_fp.h
│ │ │ ├── CompilerDependencies.h
│ │ │ ├── CompilerDependencies_gcc.h
│ │ │ ├── CompilerDependencies_msvc.h
│ │ │ ├── ContextLoad_fp.h
│ │ │ ├── ContextSave_fp.h
│ │ │ ├── Context_spt_fp.h
│ │ │ ├── CreateLoaded_fp.h
│ │ │ ├── CreatePrimary_fp.h
│ │ │ ├── Create_fp.h
│ │ │ ├── CryptCmac_fp.h
│ │ │ ├── CryptDes_fp.h
│ │ │ ├── CryptEcc.h
│ │ │ ├── CryptEccCrypt_fp.h
│ │ │ ├── CryptEccKeyExchange_fp.h
│ │ │ ├── CryptEccMain_fp.h
│ │ │ ├── CryptEccSignature_fp.h
│ │ │ ├── CryptHash.h
│ │ │ ├── CryptHash_fp.h
│ │ │ ├── CryptPrimeSieve_fp.h
│ │ │ ├── CryptPrime_fp.h
│ │ │ ├── CryptRand.h
│ │ │ ├── CryptRand_fp.h
│ │ │ ├── CryptRsa.h
│ │ │ ├── CryptRsa_fp.h
│ │ │ ├── CryptSelfTest_fp.h
│ │ │ ├── CryptSmac_fp.h
│ │ │ ├── CryptSym.h
│ │ │ ├── CryptSym_fp.h
│ │ │ ├── CryptTest.h
│ │ │ ├── CryptUtil_fp.h
│ │ │ ├── DA_fp.h
│ │ │ ├── DebugHelpers_fp.h
│ │ │ ├── DictionaryAttackLockReset_fp.h
│ │ │ ├── DictionaryAttackParameters_fp.h
│ │ │ ├── Duplicate_fp.h
│ │ │ ├── ECC_Decrypt_fp.h
│ │ │ ├── ECC_Encrypt_fp.h
│ │ │ ├── ECC_Parameters_fp.h
│ │ │ ├── ECDH_KeyGen_fp.h
│ │ │ ├── ECDH_ZGen_fp.h
│ │ │ ├── EC_Ephemeral_fp.h
│ │ │ ├── EccTestData.h
│ │ │ ├── EncryptDecrypt2_fp.h
│ │ │ ├── EncryptDecrypt_fp.h
│ │ │ ├── EncryptDecrypt_spt_fp.h
│ │ │ ├── Entity_fp.h
│ │ │ ├── EventSequenceComplete_fp.h
│ │ │ ├── EvictControl_fp.h
│ │ │ ├── ExecCommand_fp.h
│ │ │ ├── FlushContext_fp.h
│ │ │ ├── GetCapability_fp.h
│ │ │ ├── GetCommandAuditDigest_fp.h
│ │ │ ├── GetRandom_fp.h
│ │ │ ├── GetSessionAuditDigest_fp.h
│ │ │ ├── GetTestResult_fp.h
│ │ │ ├── GetTime_fp.h
│ │ │ ├── Global.h
│ │ │ ├── GpMacros.h
│ │ │ ├── HMAC_Start_fp.h
│ │ │ ├── HMAC_fp.h
│ │ │ ├── Handle_fp.h
│ │ │ ├── HashSequenceStart_fp.h
│ │ │ ├── HashTestData.h
│ │ │ ├── Hash_fp.h
│ │ │ ├── HierarchyChangeAuth_fp.h
│ │ │ ├── HierarchyControl_fp.h
│ │ │ ├── Hierarchy_fp.h
│ │ │ ├── Import_fp.h
│ │ │ ├── IncrementalSelfTest_fp.h
│ │ │ ├── InternalRoutines.h
│ │ │ ├── IoBuffers_fp.h
│ │ │ ├── KdfTestData.h
│ │ │ ├── LibSupport.h
│ │ │ ├── LoadExternal_fp.h
│ │ │ ├── Load_fp.h
│ │ │ ├── Locality_fp.h
│ │ │ ├── MAC_Start_fp.h
│ │ │ ├── MAC_fp.h
│ │ │ ├── MakeCredential_fp.h
│ │ │ ├── Manufacture_fp.h
│ │ │ ├── Marshal.h
│ │ │ ├── Marshal_fp.h
│ │ │ ├── MathLibraryInterface.h
│ │ │ ├── MathLibraryInterfaceTypes.h
│ │ │ ├── MathOnByteBuffers_fp.h
│ │ │ ├── Memory_fp.h
│ │ │ ├── MinMax.h
│ │ │ ├── NV.h
│ │ │ ├── NVDynamic_fp.h
│ │ │ ├── NVReserved_fp.h
│ │ │ ├── NV_Certify_fp.h
│ │ │ ├── NV_ChangeAuth_fp.h
│ │ │ ├── NV_DefineSpace2_fp.h
│ │ │ ├── NV_DefineSpace_fp.h
│ │ │ ├── NV_Extend_fp.h
│ │ │ ├── NV_GlobalWriteLock_fp.h
│ │ │ ├── NV_Increment_fp.h
│ │ │ ├── NV_ReadLock_fp.h
│ │ │ ├── NV_ReadPublic2_fp.h
│ │ │ ├── NV_ReadPublic_fp.h
│ │ │ ├── NV_Read_fp.h
│ │ │ ├── NV_SetBits_fp.h
│ │ │ ├── NV_UndefineSpaceSpecial_fp.h
│ │ │ ├── NV_UndefineSpace_fp.h
│ │ │ ├── NV_WriteLock_fp.h
│ │ │ ├── NV_Write_fp.h
│ │ │ ├── NV_spt_fp.h
│ │ │ ├── OIDs.h
│ │ │ ├── ObjectChangeAuth_fp.h
│ │ │ ├── Object_fp.h
│ │ │ ├── Object_spt_fp.h
│ │ │ ├── PCR_Allocate_fp.h
│ │ │ ├── PCR_Event_fp.h
│ │ │ ├── PCR_Extend_fp.h
│ │ │ ├── PCR_Read_fp.h
│ │ │ ├── PCR_Reset_fp.h
│ │ │ ├── PCR_SetAuthPolicy_fp.h
│ │ │ ├── PCR_SetAuthValue_fp.h
│ │ │ ├── PCR_fp.h
│ │ │ ├── PP_Commands_fp.h
│ │ │ ├── PP_fp.h
│ │ │ ├── PRNG_TestVectors.h
│ │ │ ├── Platform.h
│ │ │ ├── PlatformACT.h
│ │ │ ├── PlatformACT_fp.h
│ │ │ ├── PlatformClock.h
│ │ │ ├── PlatformData.h
│ │ │ ├── Platform_fp.h
│ │ │ ├── PolicyAuthValue_fp.h
│ │ │ ├── PolicyAuthorizeNV_fp.h
│ │ │ ├── PolicyAuthorize_fp.h
│ │ │ ├── PolicyCapability_fp.h
│ │ │ ├── PolicyCommandCode_fp.h
│ │ │ ├── PolicyCounterTimer_fp.h
│ │ │ ├── PolicyCpHash_fp.h
│ │ │ ├── PolicyDuplicationSelect_fp.h
│ │ │ ├── PolicyGetDigest_fp.h
│ │ │ ├── PolicyLocality_fp.h
│ │ │ ├── PolicyNV_fp.h
│ │ │ ├── PolicyNameHash_fp.h
│ │ │ ├── PolicyNvWritten_fp.h
│ │ │ ├── PolicyOR_fp.h
│ │ │ ├── PolicyPCR_fp.h
│ │ │ ├── PolicyParameters_fp.h
│ │ │ ├── PolicyPassword_fp.h
│ │ │ ├── PolicyPhysicalPresence_fp.h
│ │ │ ├── PolicyRestart_fp.h
│ │ │ ├── PolicySecret_fp.h
│ │ │ ├── PolicySigned_fp.h
│ │ │ ├── PolicyTemplate_fp.h
│ │ │ ├── PolicyTicket_fp.h
│ │ │ ├── Policy_spt_fp.h
│ │ │ ├── Power_fp.h
│ │ │ ├── PropertyCap_fp.h
│ │ │ ├── Quote_fp.h
│ │ │ ├── RSA_Decrypt_fp.h
│ │ │ ├── RSA_Encrypt_fp.h
│ │ │ ├── RTPM.h
│ │ │ ├── ReadClock_fp.h
│ │ │ ├── ReadPublic_fp.h
│ │ │ ├── ResponseCodeProcessing_fp.h
│ │ │ ├── Response_fp.h
│ │ │ ├── Rewrap_fp.h
│ │ │ ├── RsaKeyCache_fp.h
│ │ │ ├── RsaTestData.h
│ │ │ ├── SelfTest.h
│ │ │ ├── SelfTest_fp.h
│ │ │ ├── SequenceComplete_fp.h
│ │ │ ├── SequenceUpdate_fp.h
│ │ │ ├── SessionProcess_fp.h
│ │ │ ├── Session_fp.h
│ │ │ ├── SetAlgorithmSet_fp.h
│ │ │ ├── SetCapability_fp.h
│ │ │ ├── SetCommandCodeAuditStatus_fp.h
│ │ │ ├── SetPrimaryPolicy_fp.h
│ │ │ ├── Shutdown_fp.h
│ │ │ ├── Sign_fp.h
│ │ │ ├── Simulator_fp.h
│ │ │ ├── StartAuthSession_fp.h
│ │ │ ├── Startup_fp.h
│ │ │ ├── StirRandom_fp.h
│ │ │ ├── SymmetricTest.h
│ │ │ ├── SymmetricTestData.h
│ │ │ ├── TPMB.h
│ │ │ ├── TableMarshal.h
│ │ │ ├── TableMarshalDefines.h
│ │ │ ├── TableMarshalTypes.h
│ │ │ ├── TcpServerPosix_fp.h
│ │ │ ├── TcpServer_fp.h
│ │ │ ├── TestParms_fp.h
│ │ │ ├── Ticket_fp.h
│ │ │ ├── Time_fp.h
│ │ │ ├── Tpm.h
│ │ │ ├── TpmASN1.h
│ │ │ ├── TpmASN1_fp.h
│ │ │ ├── TpmAlgorithmDefines.h
│ │ │ ├── TpmBigNum.h
│ │ │ ├── TpmBuildSwitches.h
│ │ │ ├── TpmCalculatedAttributes.h
│ │ │ ├── TpmEcc_Signature_ECDAA_fp.h
│ │ │ ├── TpmEcc_Signature_ECDSA_fp.h
│ │ │ ├── TpmEcc_Signature_SM2_fp.h
│ │ │ ├── TpmEcc_Signature_Schnorr_fp.h
│ │ │ ├── TpmEcc_Signature_Util_fp.h
│ │ │ ├── TpmEcc_Util_fp.h
│ │ │ ├── TpmError.h
│ │ │ ├── TpmFail_fp.h
│ │ │ ├── TpmMath_Debug_fp.h
│ │ │ ├── TpmMath_Util_fp.h
│ │ │ ├── TpmProfile.h
│ │ │ ├── TpmProfile_CommandList.h
│ │ │ ├── TpmProfile_Common.h
│ │ │ ├── TpmProfile_ErrorCodes.h
│ │ │ ├── TpmProfile_Misc.h
│ │ │ ├── TpmSizeChecks_fp.h
│ │ │ ├── TpmTcpProtocol.h
│ │ │ ├── TpmToOsslHash.h
│ │ │ ├── TpmToOsslSupport_fp.h
│ │ │ ├── TpmToOsslSym.h
│ │ │ ├── TpmToTpmBigNumMath.h
│ │ │ ├── TpmTypes.h
│ │ │ ├── Unmarshal_fp.h
│ │ │ ├── Unseal_fp.h
│ │ │ ├── VendorInfo.h
│ │ │ ├── Vendor_TCG_Test_fp.h
│ │ │ ├── VerifyConfiguration.h
│ │ │ ├── VerifySignature_fp.h
│ │ │ ├── X509.h
│ │ │ ├── X509_ECC_fp.h
│ │ │ ├── X509_RSA_fp.h
│ │ │ ├── X509_spt_fp.h
│ │ │ ├── ZGen_2Phase_fp.h
│ │ │ ├── _TPM_Hash_Data_fp.h
│ │ │ ├── _TPM_Hash_End_fp.h
│ │ │ ├── _TPM_Hash_Start_fp.h
│ │ │ ├── _TPM_Init_fp.h
│ │ │ ├── endian_swap.h
│ │ │ ├── ftpm.h
│ │ │ ├── intercept.h
│ │ │ ├── mprv.h
│ │ │ ├── ntc2_fp.h
│ │ │ ├── ntc2lib.h
│ │ │ ├── pcrstruct.h
│ │ │ ├── platform_pcr_fp.h
│ │ │ ├── platform_public_interface.h
│ │ │ ├── platform_to_tpm_interface.h
│ │ │ ├── simulatorPrivate.h
│ │ │ ├── simulator_sysheaders.h
│ │ │ ├── tpm_public.h
│ │ │ ├── tpm_radix.h
│ │ │ ├── tpm_to_platform_interface.h
│ │ │ └── tpm_to_tpm_interface.h
│ │ ├── sbi/
│ │ │ ├── fw_dynamic.h
│ │ │ ├── riscv_asm.h
│ │ │ ├── riscv_atomic.h
│ │ │ ├── riscv_barrier.h
│ │ │ ├── riscv_elf.h
│ │ │ ├── riscv_encoding.h
│ │ │ ├── riscv_fp.h
│ │ │ ├── riscv_io.h
│ │ │ ├── riscv_locks.h
│ │ │ ├── sbi_bitmap.h
│ │ │ ├── sbi_bitops.h
│ │ │ ├── sbi_console.h
│ │ │ ├── sbi_const.h
│ │ │ ├── sbi_csr_detect.h
│ │ │ ├── sbi_domain.h
│ │ │ ├── sbi_ecall.h
│ │ │ ├── sbi_ecall_interface.h
│ │ │ ├── sbi_emulate_csr.h
│ │ │ ├── sbi_error.h
│ │ │ ├── sbi_fifo.h
│ │ │ ├── sbi_hart.h
│ │ │ ├── sbi_hartmask.h
│ │ │ ├── sbi_hfence.h
│ │ │ ├── sbi_hsm.h
│ │ │ ├── sbi_illegal_insn.h
│ │ │ ├── sbi_init.h
│ │ │ ├── sbi_ipi.h
│ │ │ ├── sbi_irqchip.h
│ │ │ ├── sbi_list.h
│ │ │ ├── sbi_math.h
│ │ │ ├── sbi_misaligned_ldst.h
│ │ │ ├── sbi_platform.h
│ │ │ ├── sbi_pmu.h
│ │ │ ├── sbi_scratch.h
│ │ │ ├── sbi_string.h
│ │ │ ├── sbi_system.h
│ │ │ ├── sbi_timer.h
│ │ │ ├── sbi_tlb.h
│ │ │ ├── sbi_trap.h
│ │ │ ├── sbi_types.h
│ │ │ ├── sbi_unpriv.h
│ │ │ └── sbi_version.h
│ │ └── sbi_utils/
│ │ ├── fdt/
│ │ │ ├── fdt_domain.h
│ │ │ ├── fdt_fixup.h
│ │ │ ├── fdt_helper.h
│ │ │ └── fdt_pmu.h
│ │ ├── gpio/
│ │ │ ├── fdt_gpio.h
│ │ │ └── gpio.h
│ │ ├── i2c/
│ │ │ ├── fdt_i2c.h
│ │ │ └── i2c.h
│ │ ├── ipi/
│ │ │ ├── aclint_mswi.h
│ │ │ ├── andes_plicsw.h
│ │ │ └── fdt_ipi.h
│ │ ├── irqchip/
│ │ │ ├── aplic.h
│ │ │ ├── fdt_irqchip.h
│ │ │ ├── fdt_irqchip_plic.h
│ │ │ ├── imsic.h
│ │ │ └── plic.h
│ │ ├── reset/
│ │ │ └── fdt_reset.h
│ │ ├── serial/
│ │ │ ├── cadence-uart.h
│ │ │ ├── fdt_serial.h
│ │ │ ├── gaisler-uart.h
│ │ │ ├── litex-uart.h
│ │ │ ├── renesas-scif.h
│ │ │ ├── semihosting.h
│ │ │ ├── shakti-uart.h
│ │ │ ├── sifive-uart.h
│ │ │ ├── uart8250.h
│ │ │ └── xlnx_uartlite.h
│ │ ├── sys/
│ │ │ ├── htif.h
│ │ │ └── sifive_test.h
│ │ └── timer/
│ │ ├── aclint_mtimer.h
│ │ ├── andes_plmt.h
│ │ └── fdt_timer.h
│ ├── lib/
│ │ ├── sbi/
│ │ │ ├── Kconfig
│ │ │ ├── objects.mk
│ │ │ ├── riscv_asm.c
│ │ │ ├── riscv_atomic.c
│ │ │ ├── riscv_hardfp.S
│ │ │ ├── riscv_locks.c
│ │ │ ├── sbi_bitmap.c
│ │ │ ├── sbi_bitops.c
│ │ │ ├── sbi_console.c
│ │ │ ├── sbi_domain.c
│ │ │ ├── sbi_ecall.c
│ │ │ ├── sbi_ecall_base.c
│ │ │ ├── sbi_ecall_exts.carray
│ │ │ ├── sbi_ecall_hsm.c
│ │ │ ├── sbi_ecall_ipi.c
│ │ │ ├── sbi_ecall_legacy.c
│ │ │ ├── sbi_ecall_pmu.c
│ │ │ ├── sbi_ecall_rfence.c
│ │ │ ├── sbi_ecall_srst.c
│ │ │ ├── sbi_ecall_time.c
│ │ │ ├── sbi_ecall_vendor.c
│ │ │ ├── sbi_emulate_csr.c
│ │ │ ├── sbi_expected_trap.S
│ │ │ ├── sbi_fifo.c
│ │ │ ├── sbi_hart.c
│ │ │ ├── sbi_hfence.S
│ │ │ ├── sbi_hsm.c
│ │ │ ├── sbi_illegal_insn.c
│ │ │ ├── sbi_init.c
│ │ │ ├── sbi_ipi.c
│ │ │ ├── sbi_irqchip.c
│ │ │ ├── sbi_math.c
│ │ │ ├── sbi_misaligned_ldst.c
│ │ │ ├── sbi_platform.c
│ │ │ ├── sbi_pmu.c
│ │ │ ├── sbi_scratch.c
│ │ │ ├── sbi_string.c
│ │ │ ├── sbi_system.c
│ │ │ ├── sbi_timer.c
│ │ │ ├── sbi_tlb.c
│ │ │ ├── sbi_trap.c
│ │ │ └── sbi_unpriv.c
│ │ └── utils/
│ │ ├── Kconfig
│ │ ├── fdt/
│ │ │ ├── Kconfig
│ │ │ ├── fdt_domain.c
│ │ │ ├── fdt_fixup.c
│ │ │ ├── fdt_helper.c
│ │ │ ├── fdt_pmu.c
│ │ │ └── objects.mk
│ │ ├── gpio/
│ │ │ ├── Kconfig
│ │ │ ├── fdt_gpio.c
│ │ │ ├── fdt_gpio_drivers.carray
│ │ │ ├── fdt_gpio_sifive.c
│ │ │ ├── gpio.c
│ │ │ └── objects.mk
│ │ ├── i2c/
│ │ │ ├── Kconfig
│ │ │ ├── fdt_i2c.c
│ │ │ ├── fdt_i2c_adapter_drivers.carray
│ │ │ ├── fdt_i2c_sifive.c
│ │ │ ├── i2c.c
│ │ │ └── objects.mk
│ │ ├── ipi/
│ │ │ ├── Kconfig
│ │ │ ├── aclint_mswi.c
│ │ │ ├── andes_plicsw.c
│ │ │ ├── fdt_ipi.c
│ │ │ ├── fdt_ipi_drivers.carray
│ │ │ ├── fdt_ipi_mswi.c
│ │ │ ├── fdt_ipi_plicsw.c
│ │ │ └── objects.mk
│ │ ├── irqchip/
│ │ │ ├── Kconfig
│ │ │ ├── aplic.c
│ │ │ ├── fdt_irqchip.c
│ │ │ ├── fdt_irqchip_aplic.c
│ │ │ ├── fdt_irqchip_drivers.carray
│ │ │ ├── fdt_irqchip_imsic.c
│ │ │ ├── fdt_irqchip_plic.c
│ │ │ ├── imsic.c
│ │ │ ├── objects.mk
│ │ │ └── plic.c
│ │ ├── libfdt/
│ │ │ ├── .clang-format
│ │ │ ├── Kconfig
│ │ │ ├── Makefile.libfdt
│ │ │ ├── TODO
│ │ │ ├── fdt.c
│ │ │ ├── fdt.h
│ │ │ ├── fdt_addresses.c
│ │ │ ├── fdt_check.c
│ │ │ ├── fdt_empty_tree.c
│ │ │ ├── fdt_overlay.c
│ │ │ ├── fdt_ro.c
│ │ │ ├── fdt_rw.c
│ │ │ ├── fdt_strerror.c
│ │ │ ├── fdt_sw.c
│ │ │ ├── fdt_wip.c
│ │ │ ├── libfdt.h
│ │ │ ├── libfdt_env.h
│ │ │ ├── libfdt_internal.h
│ │ │ ├── objects.mk
│ │ │ └── version.lds
│ │ ├── libquad/
│ │ │ ├── divdi3.c
│ │ │ ├── include/
│ │ │ │ ├── limits.h
│ │ │ │ └── sys/
│ │ │ │ ├── cdefs.h
│ │ │ │ └── types.h
│ │ │ ├── moddi3.c
│ │ │ ├── objects.mk
│ │ │ ├── qdivrem.c
│ │ │ ├── quad.h
│ │ │ ├── udivdi3.c
│ │ │ └── umoddi3.c
│ │ ├── reset/
│ │ │ ├── Kconfig
│ │ │ ├── fdt_reset.c
│ │ │ ├── fdt_reset_atcwdt200.c
│ │ │ ├── fdt_reset_drivers.carray
│ │ │ ├── fdt_reset_gpio.c
│ │ │ ├── fdt_reset_htif.c
│ │ │ ├── fdt_reset_sifive_test.c
│ │ │ ├── fdt_reset_sunxi_wdt.c
│ │ │ ├── fdt_reset_thead.c
│ │ │ ├── fdt_reset_thead.h
│ │ │ ├── fdt_reset_thead_asm.S
│ │ │ └── objects.mk
│ │ ├── serial/
│ │ │ ├── Kconfig
│ │ │ ├── cadence-uart.c
│ │ │ ├── fdt_serial.c
│ │ │ ├── fdt_serial_cadence.c
│ │ │ ├── fdt_serial_drivers.carray
│ │ │ ├── fdt_serial_gaisler.c
│ │ │ ├── fdt_serial_htif.c
│ │ │ ├── fdt_serial_litex.c
│ │ │ ├── fdt_serial_renesas_scif.c
│ │ │ ├── fdt_serial_shakti.c
│ │ │ ├── fdt_serial_sifive.c
│ │ │ ├── fdt_serial_uart8250.c
│ │ │ ├── fdt_serial_xlnx_uartlite.c
│ │ │ ├── gaisler-uart.c
│ │ │ ├── litex-uart.c
│ │ │ ├── objects.mk
│ │ │ ├── renesas_scif.c
│ │ │ ├── semihosting.c
│ │ │ ├── shakti-uart.c
│ │ │ ├── sifive-uart.c
│ │ │ ├── uart8250.c
│ │ │ └── xlnx-uartlite.c
│ │ ├── sys/
│ │ │ ├── Kconfig
│ │ │ ├── htif.c
│ │ │ ├── objects.mk
│ │ │ └── sifive_test.c
│ │ └── timer/
│ │ ├── Kconfig
│ │ ├── aclint_mtimer.c
│ │ ├── andes_plmt.c
│ │ ├── fdt_timer.c
│ │ ├── fdt_timer_drivers.carray
│ │ ├── fdt_timer_mtimer.c
│ │ ├── fdt_timer_plmt.c
│ │ └── objects.mk
│ ├── platform/
│ │ ├── fpga/
│ │ │ ├── ariane/
│ │ │ │ ├── Kconfig
│ │ │ │ ├── configs/
│ │ │ │ │ └── defconfig
│ │ │ │ ├── objects.mk
│ │ │ │ └── platform.c
│ │ │ └── openpiton/
│ │ │ ├── Kconfig
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── objects.mk
│ │ │ └── platform.c
│ │ ├── generic/
│ │ │ ├── Kconfig
│ │ │ ├── allwinner/
│ │ │ │ ├── objects.mk
│ │ │ │ └── sun20i-d1.c
│ │ │ ├── andes/
│ │ │ │ ├── ae350.c
│ │ │ │ └── objects.mk
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── include/
│ │ │ │ ├── platform_override.h
│ │ │ │ └── thead_c9xx.h
│ │ │ ├── objects.mk
│ │ │ ├── platform.c
│ │ │ ├── platform_override_modules.carray
│ │ │ ├── renesas/
│ │ │ │ └── rzfive/
│ │ │ │ ├── objects.mk
│ │ │ │ └── rzfive.c
│ │ │ └── sifive/
│ │ │ ├── fu540.c
│ │ │ ├── fu740.c
│ │ │ └── objects.mk
│ │ ├── kendryte/
│ │ │ └── k210/
│ │ │ ├── Kconfig
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── k210.dts
│ │ │ ├── objects.mk
│ │ │ ├── platform.c
│ │ │ └── platform.h
│ │ ├── nuclei/
│ │ │ └── ux600/
│ │ │ ├── Kconfig
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── objects.mk
│ │ │ └── platform.c
│ │ ├── template/
│ │ │ ├── Kconfig
│ │ │ ├── configs/
│ │ │ │ └── defconfig
│ │ │ ├── objects.mk
│ │ │ └── platform.c
│ │ └── vivado-risc-v/
│ │ ├── Kconfig
│ │ ├── configs/
│ │ │ └── defconfig
│ │ ├── fatfs/
│ │ │ ├── diskio.c
│ │ │ ├── ffsystem.c
│ │ │ └── ffunicode.c
│ │ ├── objects.mk
│ │ └── platform.c
│ ├── scripts/
│ │ ├── Kconfiglib/
│ │ │ ├── LICENSE.txt
│ │ │ ├── allnoconfig.py
│ │ │ ├── allyesconfig.py
│ │ │ ├── defconfig.py
│ │ │ ├── genconfig.py
│ │ │ ├── kconfiglib.py
│ │ │ ├── menuconfig.py
│ │ │ ├── oldconfig.py
│ │ │ ├── olddefconfig.py
│ │ │ ├── savedefconfig.py
│ │ │ └── setconfig.py
│ │ ├── carray.sh
│ │ ├── create-binary-archive.sh
│ │ └── d2c.sh
│ └── src/
│ ├── ACTCommands.c
│ ├── ACT_spt.c
│ ├── AlgorithmCap.c
│ ├── AlgorithmTests.c
│ ├── AsymmetricCommands.c
│ ├── Attest_spt.c
│ ├── AttestationCommands.c
│ ├── AuditCommands.c
│ ├── Bits.c
│ ├── BnConvert.c
│ ├── BnEccConstants.c
│ ├── BnMath.c
│ ├── BnMemory.c
│ ├── BnToOsslMath.c
│ ├── BnUtil.c
│ ├── Cancel.c
│ ├── CapabilityCommands.c
│ ├── Clock.c
│ ├── ClockCommands.c
│ ├── CommandAudit.c
│ ├── CommandCodeAttributes.c
│ ├── CommandDispatcher.c
│ ├── ContextCommands.c
│ ├── Context_spt.c
│ ├── CryptCmac.c
│ ├── CryptDes.c
│ ├── CryptEccCrypt.c
│ ├── CryptEccData.c
│ ├── CryptEccKeyExchange.c
│ ├── CryptEccMain.c
│ ├── CryptEccSignature.c
│ ├── CryptHash.c
│ ├── CryptPrime.c
│ ├── CryptPrimeSieve.c
│ ├── CryptRand.c
│ ├── CryptRsa.c
│ ├── CryptSelfTest.c
│ ├── CryptSmac.c
│ ├── CryptSym.c
│ ├── CryptUtil.c
│ ├── DA.c
│ ├── DebugHelpers.c
│ ├── DictionaryCommands.c
│ ├── DuplicationCommands.c
│ ├── EACommands.c
│ ├── EccConstantData.inl
│ ├── EncryptDecrypt_spt.c
│ ├── Entity.c
│ ├── Entropy.c
│ ├── EphemeralCommands.c
│ ├── ExecCommand.c
│ ├── ExtraData.c
│ ├── Global.c
│ ├── Handle.c
│ ├── HashCommands.c
│ ├── Hierarchy.c
│ ├── HierarchyCommands.c
│ ├── IntegrityCommands.c
│ ├── IoBuffers.c
│ ├── LICENSE
│ ├── Locality.c
│ ├── LocalityPlat.c
│ ├── ManagementCommands.c
│ ├── Manufacture.c
│ ├── Marshal.c
│ ├── MathOnByteBuffers.c
│ ├── Memory.c
│ ├── NVCommands.c
│ ├── NVDynamic.c
│ ├── NVMem.c
│ ├── NVMem.c.bak
│ ├── NVReserved.c
│ ├── NV_spt.c
│ ├── Object.c
│ ├── ObjectCommands.c
│ ├── Object_spt.c
│ ├── PCR.c
│ ├── PP.c
│ ├── PPPlat.c
│ ├── PlatformACT.c
│ ├── PlatformData.c
│ ├── PlatformPCR.c
│ ├── Policy_spt.c
│ ├── Power.c
│ ├── PowerPlat.c
│ ├── PrimeData.c
│ ├── PropertyCap.c
│ ├── RandomCommands.c
│ ├── Response.c
│ ├── ResponseCodeProcessing.c
│ ├── RsaKeyCache.c
│ ├── RunCommand.c
│ ├── Session.c
│ ├── SessionCommands.c
│ ├── SessionProcess.c
│ ├── SigningCommands.c
│ ├── StartupCommands.c
│ ├── SymmetricCommands.c
│ ├── TPMCmdp.c
│ ├── TableDrivenMarshal.c
│ ├── TableMarshalData.c
│ ├── TestingCommands.c
│ ├── Ticket.c
│ ├── Time.c
│ ├── TpmAsn1.c
│ ├── TpmBigNumThunks.c
│ ├── TpmEcc_Signature_ECDAA.c
│ ├── TpmEcc_Signature_ECDSA.c
│ ├── TpmEcc_Signature_SM2.c
│ ├── TpmEcc_Signature_Schnorr.c
│ ├── TpmEcc_Signature_Util.c
│ ├── TpmEcc_Util.c
│ ├── TpmFail.c
│ ├── TpmMath_Debug.c
│ ├── TpmMath_Util.c
│ ├── TpmSizeChecks.c
│ ├── TpmToOsslSupport.c
│ ├── Unique.c
│ ├── Unmarshal.c
│ ├── VendorInfo.c
│ ├── Vendor_TCG_Test.c
│ ├── X509_ECC.c
│ ├── X509_RSA.c
│ ├── X509_spt.c
│ ├── ftpm-sbi-opensbi.c
│ ├── ftpm.c
│ ├── intercept.c
│ ├── makefile.mac
│ ├── makefile.mak
│ ├── makefile11
│ ├── mprv.S
│ ├── ntc2.c
│ └── ntc2lib.c
└── ibmtss-ftpm/
├── .gitignore
├── CommandAttributeData.c
├── CommandAttributeData12.c
├── Commands.c
├── Commands12.c
├── Makefile.am
├── Unmarshal.c
├── Unmarshal12.c
├── activatecredential.c
├── applink.c
├── certify.c
├── certifycreation.c
├── certifyx509.c
├── changeeps.c
├── changepps.c
├── clear.c
├── clearcontrol.c
├── clockrateadjust.c
├── clockset.c
├── commit.c
├── contextload.c
├── contextsave.c
├── create.c
├── createek.c
├── createekcert.c
├── createloaded.c
├── createprimary.c
├── cryptoutils.c
├── dictionaryattacklockreset.c
├── dictionaryattackparameters.c
├── duplicate.c
├── eccdecrypt.c
├── eccencrypt.c
├── eccparameters.c
├── ecephemeral.c
├── efilib.c
├── ekutils.c
├── encryptdecrypt.c
├── eventextend.c
├── eventlib.c
├── eventsequencecomplete.c
├── evictcontrol.c
├── flushcontext.c
├── getcapability.c
├── getcommandauditdigest.c
├── getcryptolibrary.c
├── getrandom.c
├── getsessionauditdigest.c
├── gettestresult.c
├── gettime.c
├── hash.c
├── hashsequencestart.c
├── hierarchychangeauth.c
├── hierarchycontrol.c
├── hmac.c
├── hmacstart.c
├── imaextend.c
├── imalib.c
├── import.c
├── importpem.c
├── load.c
├── loadexternal.c
├── makecredential.c
├── makefile-common
├── makefile-common12
├── makefile-common20
├── makefile.mac
├── makefile.mak
├── makefile.min
├── makefile.nofile
├── makefiletpm12
├── makefiletpm20
├── makefiletpmc
├── ntc2getconfig.c
├── ntc2lib.c
├── ntc2lockconfig.c
├── ntc2preconfig.c
├── nvcertify.c
├── nvchangeauth.c
├── nvdefinespace.c
├── nvextend.c
├── nvglobalwritelock.c
├── nvincrement.c
├── nvread.c
├── nvreadlock.c
├── nvreadpublic.c
├── nvsetbits.c
├── nvundefinespace.c
├── nvundefinespacespecial.c
├── nvwrite.c
├── nvwritelock.c
├── objectchangeauth.c
├── objecttemplates.c
├── pcrallocate.c
├── pcrevent.c
├── pcrextend.c
├── pcrread.c
├── pcrreset.c
├── policyauthorize.c
├── policyauthorizenv.c
├── policyauthvalue.c
├── policycapability.c
├── policycommandcode.c
├── policycountertimer.c
├── policycphash.c
├── policyduplicationselect.c
├── policygetdigest.c
├── policymaker.c
├── policymakerpcr.c
├── policynamehash.c
├── policynv.c
├── policynvwritten.c
├── policyor.c
├── policyparameters.c
├── policypassword.c
├── policypcr.c
├── policyrestart.c
├── policysecret.c
├── policysigned.c
├── policytemplate.c
├── policyticket.c
├── powerup.c
├── printattr.c
├── publicname.c
├── quote.c
├── readclock.c
├── readpublic.c
├── returncode.c
├── rewrap.c
├── rsadecrypt.c
├── rsaencrypt.c
├── sequencecomplete.c
├── sequenceupdate.c
├── setcommandcodeauditstatus.c
├── setprimarypolicy.c
├── shutdown.c
├── sign.c
├── signapp.c
├── startauthsession.c
├── startup.c
├── stirrandom.c
├── timepacket.c
├── tpm2pem.c
├── tpmcmd.c
├── tpmproxy.c
├── tpmpublic2eccpoint.c
├── tss.c
├── tss12.c
├── tss20.c
├── tssauth.c
├── tssauth12.c
├── tssauth20.c
├── tssccattributes.c
├── tssccattributes12.c
├── tsscrypto.c
├── tsscryptoh.c
├── tssdev.c
├── tssdevskiboot.c
├── tssfile.c
├── tssftpm.c
├── tssmarshal.c
├── tssmarshal12.c
├── tssntc.c
├── tssprint.c
├── tssprintcmd.c
├── tssproperties.c
├── tssresponsecode.c
├── tsssocket.c
├── tsstbsi.c
├── tsstransmit.c
├── tssutils.c
├── tssutilsverbose.c
├── unseal.c
├── verifysignature.c
├── writeapp.c
└── zgen2phase.c
Showing preview only (602K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (7904 symbols across 757 files)
FILE: cryptomini/aes/aes_cbc.c
function CRYPTO_cbc128_encrypt (line 22) | void CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
function CRYPTO_cbc128_decrypt (line 74) | void CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
function AES_cbc_encrypt (line 173) | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
FILE: cryptomini/aes/aes_core.c
type uni (line 47) | typedef union {
function XtimeWord (line 57) | static void XtimeWord(u32 *w)
function XtimeLong (line 70) | static void XtimeLong(u64 *w)
function SubWord (line 129) | static void SubWord(u32 *w)
function SubLong (line 220) | static void SubLong(u64 *w)
function InvSubLong (line 314) | static void InvSubLong(u64 *w)
function ShiftRows (line 409) | static void ShiftRows(u64 *state)
function InvShiftRows (line 428) | static void InvShiftRows(u64 *state)
function MixColumns (line 447) | static void MixColumns(u64 *state)
function InvMixColumns (line 475) | static void InvMixColumns(u64 *state)
function AddRoundKey (line 511) | static void AddRoundKey(u64 *state, const u64 *w)
function Cipher (line 517) | static void Cipher(const unsigned char *in, unsigned char *out,
function InvCipher (line 543) | static void InvCipher(const unsigned char *in, unsigned char *out,
function RotWord (line 570) | static void RotWord(u32 *x)
function KeyExpansion (line 583) | static void KeyExpansion(const unsigned char *key, u64 *w,
function AES_set_encrypt_key (line 615) | int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
function AES_set_decrypt_key (line 641) | int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
function AES_encrypt (line 651) | void AES_encrypt(const unsigned char *in, unsigned char *out,
function AES_decrypt (line 666) | void AES_decrypt(const unsigned char *in, unsigned char *out,
function AES_set_encrypt_key (line 1262) | int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
function AES_set_decrypt_key (line 1364) | int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
function AES_encrypt (line 1417) | void AES_encrypt(const unsigned char *in, unsigned char *out,
function AES_decrypt (line 1608) | void AES_decrypt(const unsigned char *in, unsigned char *out,
function AES_set_encrypt_key (line 1841) | int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
function AES_set_decrypt_key (line 1942) | int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
FILE: cryptomini/aes/aes_local.h
type u64 (line 27) | typedef unsigned long long u64;
type u32 (line 29) | typedef unsigned long u32;
type u32 (line 31) | typedef unsigned int u32;
type u16 (line 33) | typedef unsigned short u16;
type u8 (line 34) | typedef unsigned char u8;
FILE: cryptomini/bn/bn_add.c
function BN_add (line 14) | int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
function BN_sub (line 45) | int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
function BN_uadd (line 76) | int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
function BN_usub (line 125) | int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
FILE: cryptomini/bn/bn_asm.c
function BN_ULONG (line 17) | BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
function BN_ULONG (line 47) | BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULON...
function bn_sqr_words (line 75) | void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n)
function BN_ULONG (line 103) | BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
function BN_ULONG (line 136) | BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULON...
function bn_sqr_words (line 168) | void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n)
function BN_ULONG (line 198) | BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
function BN_ULONG (line 207) | BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
function BN_ULONG (line 272) | BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
function BN_ULONG (line 313) | BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
function BN_ULONG (line 371) | BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
function bn_mul_comba8 (line 581) | void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
function bn_mul_comba4 (line 684) | void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
function bn_sqr_comba8 (line 723) | void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
function bn_sqr_comba4 (line 798) | void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
function bn_mul_mont (line 847) | int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
function bn_mul_mont (line 942) | int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
function bn_sqr_comba4 (line 955) | void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
function bn_sqr_comba8 (line 961) | void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
function bn_mul_comba4 (line 967) | void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
function bn_mul_comba8 (line 975) | void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
function bn_mul_mont (line 990) | int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
function bn_mul_mont (line 1031) | int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
FILE: cryptomini/bn/bn_ctx.c
type BN_POOL_ITEM (line 36) | typedef struct bignum_pool_item {
type BN_POOL (line 43) | typedef struct bignum_pool {
type BN_STACK (line 59) | typedef struct bignum_ctx_stack {
type bignum_ctx (line 75) | struct bignum_ctx {
function ctxdbg (line 93) | static void ctxdbg(BN_CTX *ctx)
function BN_CTX (line 134) | BN_CTX *BN_CTX_new(void)
function BN_CTX (line 148) | BN_CTX *BN_CTX_secure_new(void)
function BN_CTX_free (line 157) | void BN_CTX_free(BN_CTX *ctx)
function BN_CTX_start (line 181) | void BN_CTX_start(BN_CTX *ctx)
function BN_CTX_end (line 195) | void BN_CTX_end(BN_CTX *ctx)
function BIGNUM (line 214) | BIGNUM *BN_CTX_get(BN_CTX *ctx)
function BN_STACK_init (line 243) | static void BN_STACK_init(BN_STACK *st)
function BN_STACK_finish (line 249) | static void BN_STACK_finish(BN_STACK *st)
function BN_STACK_push (line 256) | static int BN_STACK_push(BN_STACK *st, unsigned int idx)
function BN_STACK_pop (line 278) | static unsigned int BN_STACK_pop(BN_STACK *st)
function BN_POOL_init (line 287) | static void BN_POOL_init(BN_POOL *p)
function BN_POOL_finish (line 293) | static void BN_POOL_finish(BN_POOL *p)
function BIGNUM (line 309) | static BIGNUM *BN_POOL_get(BN_POOL *p, int flag)
function BN_POOL_release (line 350) | static void BN_POOL_release(BN_POOL *p, unsigned int num)
FILE: cryptomini/bn/bn_div.c
function BN_div (line 17) | int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
function BN_ULONG (line 115) | static BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0)
function bn_left_align (line 141) | static int bn_left_align(BIGNUM *num)
function BN_div (line 209) | int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divi...
function bn_div_fixed_top (line 264) | int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
FILE: cryptomini/bn/bn_exp.c
function BN_exp (line 41) | int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
function BN_mod_exp (line 89) | int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM...
function BN_mod_exp_recp (line 161) | int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
function BN_mod_exp_mont (line 297) | int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
function BN_ULONG (line 473) | static BN_ULONG bn_get_bits(const BIGNUM *a, int bitpos)
function MOD_EXP_CTIME_COPY_TO_PREBUF (line 499) | static int MOD_EXP_CTIME_COPY_TO_PREBUF(const BIGNUM *b, int top,
function MOD_EXP_CTIME_COPY_FROM_PREBUF (line 517) | static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
function BN_mod_exp_mont_consttime (line 593) | int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
function BN_mod_exp_mont_word (line 1130) | int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
function BN_mod_exp_simple (line 1278) | int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
FILE: cryptomini/bn/bn_gcd.c
function ossl_inline (line 20) | static ossl_inline
function BIGNUM (line 196) | BIGNUM *int_bn_mod_inverse(BIGNUM *in,
function BIGNUM (line 513) | BIGNUM *BN_mod_inverse(BIGNUM *in,
function BN_gcd (line 547) | int BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx)
FILE: cryptomini/bn/bn_intern.c
function bn_get_top (line 141) | int bn_get_top(const BIGNUM *a)
function bn_get_dmax (line 146) | int bn_get_dmax(const BIGNUM *a)
function bn_set_all_zero (line 151) | void bn_set_all_zero(BIGNUM *a)
function bn_copy_words (line 159) | int bn_copy_words(BN_ULONG *out, const BIGNUM *in, int size)
function BN_ULONG (line 170) | BN_ULONG *bn_get_words(const BIGNUM *a)
function bn_set_static_words (line 175) | void bn_set_static_words(BIGNUM *a, const BN_ULONG *words, int size)
function bn_set_words (line 188) | int bn_set_words(BIGNUM *a, const BN_ULONG *words, int num_words)
FILE: cryptomini/bn/bn_lib.c
function BN_set_params (line 38) | void BN_set_params(int mult, int high, int low, int mont)
function BN_get_params (line 66) | int BN_get_params(int which)
function BIGNUM (line 81) | const BIGNUM *BN_value_one(void)
function BN_num_bits_word (line 99) | int BN_num_bits_word(BN_ULONG l)
function ossl_inline (line 151) | static ossl_inline
function BN_num_bits (line 177) | int BN_num_bits(const BIGNUM *a)
function bn_free_d (line 201) | static void bn_free_d(BIGNUM *a, int clear)
function BN_clear_free (line 212) | void BN_clear_free(BIGNUM *a)
function BN_free (line 224) | void BN_free(BIGNUM *a)
function bn_init (line 234) | void bn_init(BIGNUM *a)
function BIGNUM (line 242) | BIGNUM *BN_new(void)
function BIGNUM (line 255) | BIGNUM *BN_secure_new(void)
function BN_ULONG (line 265) | static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
function BIGNUM (line 301) | BIGNUM *bn_expand2(BIGNUM *b, int words)
function BIGNUM (line 316) | BIGNUM *BN_dup(const BIGNUM *a)
function BIGNUM (line 335) | BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
function BN_swap (line 364) | void BN_swap(BIGNUM *a, BIGNUM *b)
function BN_clear (line 397) | void BN_clear(BIGNUM *a)
function BN_ULONG (line 409) | BN_ULONG BN_get_word(const BIGNUM *a)
function BN_set_word (line 419) | int BN_set_word(BIGNUM *a, BN_ULONG w)
function BIGNUM (line 432) | BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
type endianess_t (line 477) | typedef enum {big, little} endianess_t;
function bn2binpad (line 480) | static
function BN_bn2binpad (line 530) | int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen)
function BN_bn2bin (line 537) | int BN_bn2bin(const BIGNUM *a, unsigned char *to)
function BIGNUM (line 542) | BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret)
function BN_bn2lebinpad (line 589) | int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen)
function BN_ucmp (line 596) | int BN_ucmp(const BIGNUM *a, const BIGNUM *b)
function BN_cmp (line 618) | int BN_cmp(const BIGNUM *a, const BIGNUM *b)
function BN_set_bit (line 665) | int BN_set_bit(BIGNUM *a, int n)
function BN_clear_bit (line 688) | int BN_clear_bit(BIGNUM *a, int n)
function BN_is_bit_set (line 706) | int BN_is_bit_set(const BIGNUM *a, int n)
function BN_mask_bits (line 720) | int BN_mask_bits(BIGNUM *a, int n)
function BN_set_negative (line 742) | void BN_set_negative(BIGNUM *a, int b)
function bn_cmp_words (line 750) | int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n)
function bn_cmp_part_words (line 780) | int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl)
function BN_consttime_swap (line 807) | void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, BIGNUM *b, int nwo...
function BN_security_bits (line 868) | int BN_security_bits(int L, int N)
function BN_zero_ex (line 891) | void BN_zero_ex(BIGNUM *a)
function BN_abs_is_word (line 898) | int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
function BN_is_zero (line 903) | int BN_is_zero(const BIGNUM *a)
function BN_is_one (line 908) | int BN_is_one(const BIGNUM *a)
function BN_is_word (line 913) | int BN_is_word(const BIGNUM *a, const BN_ULONG w)
function BN_is_odd (line 918) | int BN_is_odd(const BIGNUM *a)
function BN_is_negative (line 923) | int BN_is_negative(const BIGNUM *a)
function BN_to_montgomery (line 928) | int BN_to_montgomery(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
function BN_with_flags (line 934) | void BN_with_flags(BIGNUM *dest, const BIGNUM *b, int flags)
function BN_GENCB (line 945) | BN_GENCB *BN_GENCB_new(void)
function BN_GENCB_free (line 957) | void BN_GENCB_free(BN_GENCB *cb)
function BN_set_flags (line 964) | void BN_set_flags(BIGNUM *b, int n)
function BN_get_flags (line 969) | int BN_get_flags(const BIGNUM *b, int n)
function BN_GENCB_set_old (line 975) | void BN_GENCB_set_old(BN_GENCB *gencb, void (*callback) (int, int, void *),
function BN_GENCB_set (line 985) | void BN_GENCB_set(BN_GENCB *gencb, int (*callback) (int, int, BN_GENCB *),
function BIGNUM (line 999) | BIGNUM *bn_wexpand(BIGNUM *a, int words)
function bn_correct_top (line 1004) | void bn_correct_top(BIGNUM *a)
FILE: cryptomini/bn/bn_local.h
type bignum_st (line 218) | struct bignum_st {
type bn_mont_ctx_st (line 229) | struct bn_mont_ctx_st {
type bn_recp_ctx_st (line 246) | struct bn_recp_ctx_st {
type bn_gencb_st (line 255) | struct bn_gencb_st {
function ossl_inline (line 657) | static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
FILE: cryptomini/bn/bn_mod.c
function BN_nnmod (line 13) | int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
function BN_mod_add (line 28) | int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM...
function bn_mod_add_fixed_top (line 48) | int bn_mod_add_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
function BN_mod_add_quick (line 95) | int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
function BN_mod_sub (line 106) | int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM...
function bn_mod_sub_fixed_top (line 128) | int bn_mod_sub_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
function BN_mod_sub_quick (line 182) | int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
function BN_mod_mul (line 193) | int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM...
function BN_mod_sqr (line 222) | int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx)
function BN_mod_lshift1 (line 230) | int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *...
function BN_mod_lshift1_quick (line 242) | int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m)
function BN_mod_lshift (line 252) | int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,
function BN_mod_lshift_quick (line 279) | int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m)
FILE: cryptomini/bn/bn_mont.c
function BN_mod_mul_montgomery (line 26) | int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
function bn_mul_mont_fixed_top (line 37) | int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
function bn_from_montgomery_word (line 88) | static int bn_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *...
function BN_from_montgomery (line 162) | int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
function bn_from_mont_fixed_top (line 174) | int bn_from_mont_fixed_top(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
function bn_to_mont_fixed_top (line 222) | int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
function BN_MONT_CTX (line 228) | BN_MONT_CTX *BN_MONT_CTX_new(void)
function BN_MONT_CTX_init (line 242) | void BN_MONT_CTX_init(BN_MONT_CTX *ctx)
function BN_MONT_CTX_free (line 252) | void BN_MONT_CTX_free(BN_MONT_CTX *mont)
function BN_MONT_CTX_set (line 263) | int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
function BN_MONT_CTX (line 411) | BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from)
function BN_MONT_CTX (line 428) | BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *...
FILE: cryptomini/bn/bn_mul.c
function BN_ULONG (line 27) | BN_ULONG bn_sub_part_words(BN_ULONG *r,
function bn_mul_recursive (line 175) | void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
function bn_mul_part_recursive (line 322) | void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n,
function bn_mul_low_recursive (line 477) | void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
function BN_mul (line 497) | int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
function bn_mul_fixed_top (line 507) | int bn_mul_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX...
function bn_mul_normal (line 622) | void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
function bn_mul_low_normal (line 664) | void bn_mul_low_normal(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
FILE: cryptomini/bn/bn_nist.c
function BIGNUM (line 227) | const BIGNUM *BN_get0_nist_prime_192(void)
function BIGNUM (line 232) | const BIGNUM *BN_get0_nist_prime_224(void)
function BIGNUM (line 237) | const BIGNUM *BN_get0_nist_prime_256(void)
function BIGNUM (line 242) | const BIGNUM *BN_get0_nist_prime_384(void)
function BIGNUM (line 247) | const BIGNUM *BN_get0_nist_prime_521(void)
function nist_cp_bn_0 (line 252) | static void nist_cp_bn_0(BN_ULONG *dst, const BN_ULONG *src, int top, in...
function nist_cp_bn (line 265) | static void nist_cp_bn(BN_ULONG *dst, const BN_ULONG *src, int top)
function BN_nist_mod_192 (line 318) | int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
type BN_ULONG (line 445) | typedef BN_ULONG (*bn_addsub_f) (BN_ULONG *, const BN_ULONG *,
function BN_nist_mod_224 (line 459) | int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
function BN_nist_mod_256 (line 640) | int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
function BN_nist_mod_384 (line 886) | int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
function BN_nist_mod_521 (line 1155) | int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
FILE: cryptomini/bn/bn_rand.c
type BNRAND_FLAG (line 17) | typedef enum bnrand_flag_e {
function bnrand (line 21) | static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int ...
function BN_rand (line 97) | int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
function BN_bntest_rand (line 102) | int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
function BN_priv_rand (line 107) | int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom)
function bnrand_range (line 113) | static int bnrand_range(BNRAND_FLAG flag, BIGNUM *r, const BIGNUM *range)
function BN_rand_range (line 177) | int BN_rand_range(BIGNUM *r, const BIGNUM *range)
function BN_priv_rand_range (line 182) | int BN_priv_rand_range(BIGNUM *r, const BIGNUM *range)
function BN_pseudo_rand (line 187) | int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom)
function BN_pseudo_rand_range (line 192) | int BN_pseudo_rand_range(BIGNUM *r, const BIGNUM *range)
function BN_generate_dsa_nonce (line 205) | int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range,
FILE: cryptomini/bn/bn_recp.c
function BN_RECP_CTX_init (line 13) | void BN_RECP_CTX_init(BN_RECP_CTX *recp)
function BN_RECP_CTX (line 20) | BN_RECP_CTX *BN_RECP_CTX_new(void)
function BN_RECP_CTX_free (line 35) | void BN_RECP_CTX_free(BN_RECP_CTX *recp)
function BN_RECP_CTX_set (line 45) | int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
function BN_mod_mul_reciprocal (line 55) | int BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,
function BN_div_recp (line 84) | int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
function BN_reciprocal (line 174) | int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx)
FILE: cryptomini/bn/bn_shift.c
function BN_lshift1 (line 14) | int BN_lshift1(BIGNUM *r, const BIGNUM *a)
function BN_rshift1 (line 45) | int BN_rshift1(BIGNUM *r, const BIGNUM *a)
function BN_lshift (line 81) | int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
function bn_lshift_fixed_top (line 104) | int bn_lshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n)
function BN_rshift (line 150) | int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
function bn_rshift_fixed_top (line 173) | int bn_rshift_fixed_top(BIGNUM *r, const BIGNUM *a, int n)
FILE: cryptomini/bn/bn_sqr.c
function BN_sqr (line 17) | int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
function bn_sqr_fixed_top (line 27) | int bn_sqr_fixed_top(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
function bn_sqr_normal (line 109) | void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp)
function bn_sqr_recursive (line 156) | void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t)
FILE: cryptomini/bn/bn_word.c
function BN_ULONG (line 13) | BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w)
function BN_ULONG (line 61) | BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w)
function BN_add_word (line 98) | int BN_add_word(BIGNUM *a, BN_ULONG w)
function BN_sub_word (line 134) | int BN_sub_word(BIGNUM *a, BN_ULONG w)
function BN_mul_word (line 181) | int BN_mul_word(BIGNUM *a, BN_ULONG w)
FILE: cryptomini/camellia/camellia.c
function Camellia_Ekeygen (line 280) | int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k)
function Camellia_EncryptBlock_Rounds (line 397) | void Camellia_EncryptBlock_Rounds(int grandRounds, const u8 plaintext[],
function Camellia_EncryptBlock (line 443) | void Camellia_EncryptBlock(int keyBitLength, const u8 plaintext[],
function Camellia_DecryptBlock_Rounds (line 450) | void Camellia_DecryptBlock_Rounds(int grandRounds, const u8 ciphertext[],
function Camellia_DecryptBlock (line 496) | void Camellia_DecryptBlock(int keyBitLength, const u8 plaintext[],
FILE: cryptomini/camellia/cmll_local.h
type u32 (line 28) | typedef unsigned int u32;
type u8 (line 29) | typedef unsigned char u8;
FILE: cryptomini/camellia/cmll_misc.c
function Camellia_set_key (line 14) | int Camellia_set_key(const unsigned char *userKey, const int bits,
function Camellia_encrypt (line 25) | void Camellia_encrypt(const unsigned char *in, unsigned char *out,
function Camellia_decrypt (line 31) | void Camellia_decrypt(const unsigned char *in, unsigned char *out,
FILE: cryptomini/cryptlib.c
type WCHAR (line 33) | typedef WCHAR variant_char;
function variant_char (line 35) | static variant_char *ossl_getenv(const char *name)
type variant_char (line 48) | typedef char variant_char;
function todigit (line 54) | static int todigit(variant_char c)
function ossl_strtouint64 (line 65) | static uint64_t ossl_strtouint64(const variant_char *str)
function variant_char (line 82) | static variant_char *ossl_strchr(const variant_char *str, char srch)
type IA32CAP (line 95) | typedef uint64_t IA32CAP;
function OPENSSL_cpuid_setup (line 97) | void OPENSSL_cpuid_setup(void)
function OPENSSL_cpuid_setup (line 165) | void OPENSSL_cpuid_setup(void)
function OPENSSL_isservice (line 187) | int OPENSSL_isservice(void)
function OPENSSL_isservice (line 193) | int OPENSSL_isservice(void)
function OPENSSL_isservice (line 255) | int OPENSSL_isservice(void)
function OPENSSL_showfatal (line 261) | void OPENSSL_showfatal(const char *fmta, ...)
function OPENSSL_showfatal (line 399) | void OPENSSL_showfatal(const char *fmta, ...)
function OPENSSL_isservice (line 410) | int OPENSSL_isservice(void)
function OPENSSL_die (line 416) | void OPENSSL_die(const char *message, const char *file, int line)
function CRYPTO_memcmp (line 443) | int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len)
function OPENSSL_rdtsc (line 459) | uint32_t OPENSSL_rdtsc(void)
function OPENSSL_instrument_bus (line 464) | size_t OPENSSL_instrument_bus(unsigned int *out, size_t cnt)
function OPENSSL_instrument_bus2 (line 469) | size_t OPENSSL_instrument_bus2(unsigned int *out, size_t cnt, size_t max)
FILE: cryptomini/e_os.h
function _strlen31 (line 170) | static __inline unsigned int _strlen31(const char *str)
type hostent (line 341) | struct hostent
type hostent (line 342) | struct hostent
type servent (line 343) | struct servent
FILE: cryptomini/ec/ec_cvt.c
function EC_GROUP (line 14) | EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
function EC_GROUP (line 63) | EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,
FILE: cryptomini/ec/ec_key.c
function EC_KEY_up_ref (line 165) | int EC_KEY_up_ref(EC_KEY *r)
function ENGINE (line 177) | ENGINE *EC_KEY_get0_engine(const EC_KEY *eckey)
function EC_KEY_generate_key (line 182) | int EC_KEY_generate_key(EC_KEY *eckey)
function ossl_ec_key_gen (line 194) | int ossl_ec_key_gen(EC_KEY *eckey)
function ec_key_simple_generate_key (line 199) | int ec_key_simple_generate_key(EC_KEY *eckey)
function ec_key_simple_generate_public_key (line 250) | int ec_key_simple_generate_public_key(EC_KEY *eckey)
function EC_KEY_check_key (line 256) | int EC_KEY_check_key(const EC_KEY *eckey)
function ec_key_simple_check_key (line 271) | int ec_key_simple_check_key(const EC_KEY *eckey)
function EC_KEY_set_public_key_affine_coordinates (line 338) | int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,
function EC_GROUP (line 399) | const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key)
function EC_KEY_set_group (line 404) | int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group)
function BIGNUM (line 413) | const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key)
function EC_KEY_set_private_key (line 418) | int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key)
function EC_POINT (line 502) | const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key)
function EC_KEY_set_public_key (line 507) | int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub_key)
function EC_KEY_get_enc_flags (line 517) | unsigned int EC_KEY_get_enc_flags(const EC_KEY *key)
function EC_KEY_set_enc_flags (line 522) | void EC_KEY_set_enc_flags(EC_KEY *key, unsigned int flags)
function point_conversion_form_t (line 527) | point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key)
function EC_KEY_set_conv_form (line 532) | void EC_KEY_set_conv_form(EC_KEY *key, point_conversion_form_t cform)
function EC_KEY_set_asn1_flag (line 539) | void EC_KEY_set_asn1_flag(EC_KEY *key, int flag)
function EC_KEY_precompute_mult (line 545) | int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx)
function EC_KEY_get_flags (line 552) | int EC_KEY_get_flags(const EC_KEY *key)
function EC_KEY_set_flags (line 557) | void EC_KEY_set_flags(EC_KEY *key, int flags)
function EC_KEY_clear_flags (line 562) | void EC_KEY_clear_flags(EC_KEY *key, int flags)
function EC_KEY_decoded_from_explicit_params (line 567) | int EC_KEY_decoded_from_explicit_params(const EC_KEY *key)
function EC_KEY_priv2oct (line 605) | size_t EC_KEY_priv2oct(const EC_KEY *eckey,
function ec_key_simple_priv2oct (line 618) | size_t ec_key_simple_priv2oct(const EC_KEY *eckey,
function EC_KEY_oct2priv (line 641) | int EC_KEY_oct2priv(EC_KEY *eckey, const unsigned char *buf, size_t len)
function ec_key_simple_oct2priv (line 652) | int ec_key_simple_oct2priv(EC_KEY *eckey, const unsigned char *buf, size...
function EC_KEY_priv2buf (line 668) | size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf)
function EC_KEY_can_sign (line 689) | int EC_KEY_can_sign(const EC_KEY *eckey)
FILE: cryptomini/ec/ec_lib.c
function EC_GROUP (line 20) | EC_GROUP *EC_GROUP_new(const EC_METHOD *meth)
function EC_pre_comp_free (line 61) | void EC_pre_comp_free(EC_GROUP *group)
function EC_GROUP_free (line 94) | void EC_GROUP_free(EC_GROUP *group)
function EC_GROUP_clear_free (line 111) | void EC_GROUP_clear_free(EC_GROUP *group)
function EC_GROUP_copy (line 130) | int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src)
function EC_GROUP (line 234) | EC_GROUP *EC_GROUP_dup(const EC_GROUP *a)
function EC_METHOD (line 257) | const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group)
function EC_METHOD_get_field_type (line 262) | int EC_METHOD_get_field_type(const EC_METHOD *meth)
function ec_guess_cofactor (line 282) | static int ec_guess_cofactor(EC_GROUP *group) {
function EC_GROUP_set_generator (line 330) | int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,
function EC_POINT (line 400) | const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group)
function BN_MONT_CTX (line 405) | BN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group)
function EC_GROUP_get_order (line 410) | int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
function BIGNUM (line 420) | const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group)
function EC_GROUP_order_bits (line 425) | int EC_GROUP_order_bits(const EC_GROUP *group)
function EC_GROUP_get_cofactor (line 430) | int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
function BIGNUM (line 442) | const BIGNUM *EC_GROUP_get0_cofactor(const EC_GROUP *group)
function EC_GROUP_set_curve_name (line 447) | void EC_GROUP_set_curve_name(EC_GROUP *group, int nid)
function EC_GROUP_get_curve_name (line 452) | int EC_GROUP_get_curve_name(const EC_GROUP *group)
function EC_GROUP_set_asn1_flag (line 457) | void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag)
function EC_GROUP_get_asn1_flag (line 462) | int EC_GROUP_get_asn1_flag(const EC_GROUP *group)
function EC_GROUP_set_point_conversion_form (line 467) | void EC_GROUP_set_point_conversion_form(EC_GROUP *group,
function point_conversion_form_t (line 473) | point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP
function EC_GROUP_set_seed (line 479) | size_t EC_GROUP_set_seed(EC_GROUP *group, const unsigned char *p, size_t...
function EC_GROUP_get_seed_len (line 503) | size_t EC_GROUP_get_seed_len(const EC_GROUP *group)
function EC_GROUP_set_curve (line 508) | int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
function EC_GROUP_get_curve (line 518) | int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGN...
function EC_GROUP_set_curve_GFp (line 529) | int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNU...
function EC_GROUP_get_curve_GFp (line 535) | int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
function EC_GROUP_set_curve_GF2m (line 542) | int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGN...
function EC_GROUP_get_curve_GF2m (line 548) | int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,
function EC_GROUP_get_degree (line 556) | int EC_GROUP_get_degree(const EC_GROUP *group)
function EC_GROUP_check_discriminant (line 565) | int EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
function EC_GROUP_cmp (line 575) | int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx)
function EC_POINT (line 650) | EC_POINT *EC_POINT_new(const EC_GROUP *group)
function EC_POINT_free (line 680) | void EC_POINT_free(EC_POINT *point)
function EC_POINT_clear_free (line 690) | void EC_POINT_clear_free(EC_POINT *point)
function EC_POINT_copy (line 702) | int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src)
function EC_POINT (line 720) | EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group)
function EC_METHOD (line 739) | const EC_METHOD *EC_POINT_method_of(const EC_POINT *point)
function EC_POINT_set_to_infinity (line 744) | int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
function EC_POINT_set_Jprojective_coordinates_GFp (line 758) | int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
function EC_POINT_get_Jprojective_coordinates_GFp (line 777) | int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
function EC_POINT_set_affine_coordinates (line 796) | int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *point,
function EC_POINT_set_affine_coordinates_GFp (line 820) | int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group,
function EC_POINT_set_affine_coordinates_GF2m (line 828) | int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group,
function EC_POINT_get_affine_coordinates (line 837) | int EC_POINT_get_affine_coordinates(const EC_GROUP *group,
function EC_POINT_get_affine_coordinates_GFp (line 858) | int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
function EC_POINT_get_affine_coordinates_GF2m (line 866) | int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
function EC_POINT_add (line 875) | int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
function EC_POINT_dbl (line 890) | int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
function EC_POINT_invert (line 904) | int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx)
function EC_POINT_is_at_infinity (line 917) | int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
function EC_POINT_is_on_curve (line 938) | int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
function EC_POINT_cmp (line 952) | int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POIN...
function EC_POINT_make_affine (line 966) | int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX ...
function EC_POINTs_make_affine (line 979) | int EC_POINTs_make_affine(const EC_GROUP *group, size_t num,
function EC_POINTs_mul (line 1003) | int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
function EC_POINT_mul (line 1041) | int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_sca...
function EC_GROUP_precompute_mult (line 1057) | int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
function EC_GROUP_have_precompute_mult (line 1069) | int EC_GROUP_have_precompute_mult(const EC_GROUP *group)
function ec_precompute_mont_data (line 1086) | static int ec_precompute_mont_data(EC_GROUP *group)
function ec_group_simple_order_bits (line 1125) | int ec_group_simple_order_bits(const EC_GROUP *group)
function ec_field_inverse_mod_ord (line 1132) | static int ec_field_inverse_mod_ord(const EC_GROUP *group, BIGNUM *r,
function ec_group_do_inverse_ord (line 1185) | int ec_group_do_inverse_ord(const EC_GROUP *group, BIGNUM *res,
function ec_point_blind_coordinates (line 1204) | int ec_point_blind_coordinates(const EC_GROUP *group, EC_POINT *p, BN_CT...
FILE: cryptomini/ec/ec_local.h
type ec_method_st (line 39) | struct ec_method_st {
type NISTP224_PRE_COMP (line 200) | typedef struct nistp224_pre_comp_st NISTP224_PRE_COMP;
type NISTP256_PRE_COMP (line 201) | typedef struct nistp256_pre_comp_st NISTP256_PRE_COMP;
type NISTP521_PRE_COMP (line 202) | typedef struct nistp521_pre_comp_st NISTP521_PRE_COMP;
type NISTZ256_PRE_COMP (line 203) | typedef struct nistz256_pre_comp_st NISTZ256_PRE_COMP;
type EC_PRE_COMP (line 204) | typedef struct ec_pre_comp_st EC_PRE_COMP;
type ec_group_st (line 206) | struct ec_group_st {
type ec_key_st (line 280) | struct ec_key_st {
type ec_point_st (line 295) | struct ec_point_st {
function ossl_inline (line 311) | static ossl_inline int ec_point_is_compat(const EC_POINT *point,
type ec_key_method_st (line 604) | struct ec_key_method_st {
type ECDSA_SIG_st (line 639) | struct ECDSA_SIG_st {
function ossl_inline (line 704) | static ossl_inline int ec_point_ladder_pre(const EC_GROUP *group,
function ossl_inline (line 718) | static ossl_inline int ec_point_ladder_step(const EC_GROUP *group,
function ossl_inline (line 733) | static ossl_inline int ec_point_ladder_post(const EC_GROUP *group,
FILE: cryptomini/ec/ec_mult.c
type ec_pre_comp_st (line 31) | struct ec_pre_comp_st {
function EC_PRE_COMP (line 45) | static EC_PRE_COMP *ec_pre_comp_new(const EC_GROUP *group)
function EC_PRE_COMP (line 72) | EC_PRE_COMP *EC_ec_pre_comp_dup(EC_PRE_COMP *pre)
function EC_ec_pre_comp_free (line 80) | void EC_ec_pre_comp_free(EC_PRE_COMP *pre)
function ec_scalar_mul_ladder (line 139) | int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POINT *r,
function ec_wNAF_mul (line 403) | int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
function ec_wNAF_precompute_mult (line 821) | int ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
function ec_wNAF_have_precompute_mult (line 973) | int ec_wNAF_have_precompute_mult(const EC_GROUP *group)
FILE: cryptomini/ec/ecdh_ossl.c
function ossl_ecdh_compute_key (line 22) | int ossl_ecdh_compute_key(unsigned char **psec, size_t *pseclen,
function ecdh_simple_compute_key (line 38) | int ecdh_simple_compute_key(unsigned char **pout, size_t *poutlen,
FILE: cryptomini/ec/ecp_mont.c
function EC_METHOD (line 15) | const EC_METHOD *EC_GFp_mont_method(void)
function ec_GFp_mont_group_init (line 76) | int ec_GFp_mont_group_init(EC_GROUP *group)
function ec_GFp_mont_group_finish (line 86) | void ec_GFp_mont_group_finish(EC_GROUP *group)
function ec_GFp_mont_group_clear_finish (line 95) | void ec_GFp_mont_group_clear_finish(EC_GROUP *group)
function ec_GFp_mont_group_copy (line 104) | int ec_GFp_mont_group_copy(EC_GROUP *dest, const EC_GROUP *src)
function ec_GFp_mont_group_set_curve (line 135) | int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p,
function ec_GFp_mont_field_mul (line 188) | int ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM...
function ec_GFp_mont_field_sqr (line 199) | int ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM...
function ec_GFp_mont_field_inv (line 215) | int ec_GFp_mont_field_inv(const EC_GROUP *group, BIGNUM *r, const BIGNUM...
function ec_GFp_mont_field_encode (line 258) | int ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r,
function ec_GFp_mont_field_decode (line 269) | int ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r,
function ec_GFp_mont_field_set_to_one (line 280) | int ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r,
FILE: cryptomini/ec/ecp_nist.c
function EC_METHOD (line 17) | const EC_METHOD *EC_GFp_nist_method(void)
function ec_GFp_nist_group_copy (line 78) | int ec_GFp_nist_group_copy(EC_GROUP *dest, const EC_GROUP *src)
function ec_GFp_nist_group_set_curve (line 85) | int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p,
function ec_GFp_nist_field_mul (line 120) | int ec_GFp_nist_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM...
function ec_GFp_nist_field_sqr (line 145) | int ec_GFp_nist_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM...
FILE: cryptomini/ec/ecp_smpl.c
function EC_METHOD (line 16) | const EC_METHOD *EC_GFp_simple_method(void)
function ec_GFp_simple_group_init (line 91) | int ec_GFp_simple_group_init(EC_GROUP *group)
function ec_GFp_simple_group_finish (line 106) | void ec_GFp_simple_group_finish(EC_GROUP *group)
function ec_GFp_simple_group_clear_finish (line 113) | void ec_GFp_simple_group_clear_finish(EC_GROUP *group)
function ec_GFp_simple_group_copy (line 120) | int ec_GFp_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src)
function ec_GFp_simple_group_set_curve (line 134) | int ec_GFp_simple_group_set_curve(EC_GROUP *group,
function ec_GFp_simple_group_get_curve (line 193) | int ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGN...
function ec_GFp_simple_group_get_degree (line 238) | int ec_GFp_simple_group_get_degree(const EC_GROUP *group)
function ec_GFp_simple_group_check_discriminant (line 243) | int ec_GFp_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX...
function ec_GFp_simple_point_init (line 315) | int ec_GFp_simple_point_init(EC_POINT *point)
function ec_GFp_simple_point_finish (line 331) | void ec_GFp_simple_point_finish(EC_POINT *point)
function ec_GFp_simple_point_clear_finish (line 338) | void ec_GFp_simple_point_clear_finish(EC_POINT *point)
function ec_GFp_simple_point_copy (line 346) | int ec_GFp_simple_point_copy(EC_POINT *dest, const EC_POINT *src)
function ec_GFp_simple_point_set_to_infinity (line 360) | int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *group,
function ec_GFp_simple_set_Jprojective_coordinates_GFp (line 368) | int ec_GFp_simple_set_Jprojective_coordinates_GFp(const EC_GROUP *group,
function ec_GFp_simple_get_Jprojective_coordinates_GFp (line 428) | int ec_GFp_simple_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
function ec_GFp_simple_point_set_affine_coordinates (line 477) | int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *group,
function ec_GFp_simple_point_get_affine_coordinates (line 495) | int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group,
function ec_GFp_simple_add (line 609) | int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT...
function ec_GFp_simple_dbl (line 794) | int ec_GFp_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT...
function ec_GFp_simple_invert (line 936) | int ec_GFp_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX ...
function ec_GFp_simple_is_at_infinity (line 945) | int ec_GFp_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *...
function ec_GFp_simple_is_on_curve (line 950) | int ec_GFp_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point,
function ec_GFp_simple_cmp (line 1053) | int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
function ec_GFp_simple_make_affine (line 1161) | int ec_GFp_simple_make_affine(const EC_GROUP *group, EC_POINT *point,
function ec_GFp_simple_points_make_affine (line 1200) | int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num,
function ec_GFp_simple_field_mul (line 1359) | int ec_GFp_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGN...
function ec_GFp_simple_field_sqr (line 1365) | int ec_GFp_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGN...
function ec_GFp_simple_field_inv (line 1377) | int ec_GFp_simple_field_inv(const EC_GROUP *group, BIGNUM *r, const BIGN...
function ec_GFp_simple_blind_coordinates (line 1423) | int ec_GFp_simple_blind_coordinates(const EC_GROUP *group, EC_POINT *p,
function ec_GFp_simple_ladder_pre (line 1486) | int ec_GFp_simple_ladder_pre(const EC_GROUP *group,
function ec_GFp_simple_ladder_step (line 1556) | int ec_GFp_simple_ladder_step(const EC_GROUP *group,
function ec_GFp_simple_ladder_post (line 1644) | int ec_GFp_simple_ladder_post(const EC_GROUP *group,
FILE: cryptomini/include/crypto/aria.h
type ARIA_u128 (line 28) | typedef union {
type aria_key_st (line 35) | struct aria_key_st {
type ARIA_KEY (line 39) | typedef struct aria_key_st ARIA_KEY;
FILE: cryptomini/include/crypto/asn1.h
type evp_pkey_asn1_method_st (line 14) | struct evp_pkey_asn1_method_st {
type asn1_object_st (line 95) | struct asn1_object_st {
type asn1_pctx_st (line 105) | struct asn1_pctx_st {
FILE: cryptomini/include/crypto/cryptlib.h
type thread_local_inits_st (line 14) | struct thread_local_inits_st {
FILE: cryptomini/include/crypto/evp.h
type evp_pkey_ctx_st (line 19) | struct evp_pkey_ctx_st {
type evp_pkey_method_st (line 43) | struct evp_pkey_method_st {
type evp_md_st (line 115) | struct evp_md_st {
type evp_cipher_st (line 131) | struct evp_cipher_st {
type ECX_KEY (line 384) | typedef struct {
type evp_pkey_st (line 395) | struct evp_pkey_st {
FILE: cryptomini/include/crypto/md32_common.h
function HASH_UPDATE (line 128) | int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
function HASH_TRANSFORM (line 186) | void HASH_TRANSFORM(HASH_CTX *c, const unsigned char *data)
function HASH_FINAL (line 191) | int HASH_FINAL(unsigned char *md, HASH_CTX *c)
FILE: cryptomini/include/crypto/poly1305.h
type POLY1305 (line 16) | typedef struct poly1305_context POLY1305;
FILE: cryptomini/include/crypto/rand.h
type RAND_POOL (line 34) | typedef struct rand_pool_st RAND_POOL;
FILE: cryptomini/include/crypto/siphash.h
type SIPHASH (line 17) | typedef struct siphash_st SIPHASH;
FILE: cryptomini/include/crypto/sm3.h
type SM3_CTX (line 26) | typedef struct SM3state_st {
FILE: cryptomini/include/crypto/sm4.h
type SM4_KEY (line 27) | typedef struct SM4_KEY_st {
FILE: cryptomini/include/crypto/x509.h
type X509_name_entry_st (line 25) | struct X509_name_entry_st {
type X509_name_st (line 33) | struct X509_name_st {
type x509_sig_info_st (line 44) | struct x509_sig_info_st {
type X509_req_info_st (line 57) | struct X509_req_info_st {
type X509_req_st (line 70) | struct X509_req_st {
type X509_crl_info_st (line 78) | struct X509_crl_info_st {
type X509_crl_st (line 89) | struct X509_crl_st {
type x509_revoked_st (line 116) | struct x509_revoked_st {
type x509_cert_aux_st (line 138) | struct x509_cert_aux_st {
type x509_cinf_st (line 146) | struct x509_cinf_st {
type x509_st (line 160) | struct x509_st {
type x509_store_ctx_st (line 195) | struct x509_store_ctx_st { /* X509_STORE_CTX */
type pkcs8_priv_key_info_st (line 262) | struct pkcs8_priv_key_info_st {
type X509_sig_st (line 269) | struct X509_sig_st {
type x509_object_st (line 274) | struct x509_object_st {
FILE: cryptomini/include/internal/bio.h
type bio_method_st (line 12) | struct bio_method_st {
FILE: cryptomini/include/internal/conf.h
type ossl_init_settings_st (line 20) | struct ossl_init_settings_st {
FILE: cryptomini/include/internal/constant_time.h
function constant_time_msb (line 99) | static ossl_inline unsigned int constant_time_msb(unsigned int a)
function ossl_inline (line 105) | static ossl_inline uint32_t constant_time_msb_32(uint32_t a)
function ossl_inline (line 110) | static ossl_inline uint64_t constant_time_msb_64(uint64_t a)
function ossl_inline (line 115) | static ossl_inline size_t constant_time_msb_s(size_t a)
function constant_time_lt (line 120) | static ossl_inline unsigned int constant_time_lt(unsigned int a,
function ossl_inline (line 126) | static ossl_inline size_t constant_time_lt_s(size_t a, size_t b)
function constant_time_lt_8 (line 131) | static ossl_inline unsigned char constant_time_lt_8(unsigned int a,
function ossl_inline (line 137) | static ossl_inline uint64_t constant_time_lt_64(uint64_t a, uint64_t b)
function constant_time_ge (line 142) | static ossl_inline unsigned int constant_time_ge(unsigned int a,
function ossl_inline (line 148) | static ossl_inline size_t constant_time_ge_s(size_t a, size_t b)
function constant_time_ge_8 (line 153) | static ossl_inline unsigned char constant_time_ge_8(unsigned int a,
function constant_time_ge_8_s (line 159) | static ossl_inline unsigned char constant_time_ge_8_s(size_t a, size_t b)
function constant_time_is_zero (line 164) | static ossl_inline unsigned int constant_time_is_zero(unsigned int a)
function ossl_inline (line 169) | static ossl_inline size_t constant_time_is_zero_s(size_t a)
function constant_time_is_zero_8 (line 174) | static ossl_inline unsigned char constant_time_is_zero_8(unsigned int a)
function ossl_inline (line 179) | static ossl_inline uint32_t constant_time_is_zero_32(uint32_t a)
function constant_time_eq (line 184) | static ossl_inline unsigned int constant_time_eq(unsigned int a,
function ossl_inline (line 190) | static ossl_inline size_t constant_time_eq_s(size_t a, size_t b)
function constant_time_eq_8 (line 195) | static ossl_inline unsigned char constant_time_eq_8(unsigned int a,
function constant_time_eq_8_s (line 201) | static ossl_inline unsigned char constant_time_eq_8_s(size_t a, size_t b)
function constant_time_eq_int (line 206) | static ossl_inline unsigned int constant_time_eq_int(int a, int b)
function constant_time_eq_int_8 (line 211) | static ossl_inline unsigned char constant_time_eq_int_8(int a, int b)
function value_barrier (line 223) | static ossl_inline unsigned int value_barrier(unsigned int a)
function ossl_inline (line 235) | static ossl_inline uint32_t value_barrier_32(uint32_t a)
function ossl_inline (line 247) | static ossl_inline uint64_t value_barrier_64(uint64_t a)
function ossl_inline (line 259) | static ossl_inline size_t value_barrier_s(size_t a)
function constant_time_select (line 270) | static ossl_inline unsigned int constant_time_select(unsigned int mask,
function ossl_inline (line 277) | static ossl_inline size_t constant_time_select_s(size_t mask,
function constant_time_select_8 (line 284) | static ossl_inline unsigned char constant_time_select_8(unsigned char mask,
function ossl_inline (line 291) | static ossl_inline int constant_time_select_int(unsigned int mask, int a,
function ossl_inline (line 297) | static ossl_inline int constant_time_select_int_s(size_t mask, int a, in...
function ossl_inline (line 303) | static ossl_inline uint32_t constant_time_select_32(uint32_t mask, uint3...
function ossl_inline (line 309) | static ossl_inline uint64_t constant_time_select_64(uint64_t mask, uint6...
function ossl_inline (line 325) | static ossl_inline void constant_time_cond_swap_32(uint32_t mask, uint32...
function ossl_inline (line 345) | static ossl_inline void constant_time_cond_swap_64(uint64_t mask, uint64...
function ossl_inline (line 360) | static ossl_inline void constant_time_lookup(void *out,
FILE: cryptomini/include/internal/cryptlib.h
function ossl_assert_int (line 31) | int ossl_assert_int(int expr, const char *exprstr,
type EX_CALLBACK (line 45) | typedef struct ex_callback_st EX_CALLBACK;
type app_mem_info_st (line 49) | struct app_mem_info_st
type MEM (line 51) | typedef struct mem_st MEM;
FILE: cryptomini/include/internal/dane.h
type danetls_record (line 42) | typedef struct danetls_record_st {
function dane_ctx_st (line 51) | DEFINE_STACK_OF(danetls_record)
type ssl_dane_st (line 66) | struct ssl_dane_st {
FILE: cryptomini/include/internal/dso.h
type DSO (line 56) | typedef struct dso_st DSO;
type DSO_METHOD (line 57) | typedef struct dso_meth_st DSO_METHOD;
FILE: cryptomini/include/internal/o_dir.h
type OPENSSL_DIR_CTX (line 42) | typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX;
FILE: cryptomini/include/internal/refcount.h
type CRYPTO_REF_COUNT (line 30) | typedef _Atomic int CRYPTO_REF_COUNT;
function CRYPTO_UP_REF (line 32) | static inline int CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock)
function CRYPTO_DOWN_REF (line 48) | static inline int CRYPTO_DOWN_REF(_Atomic int *val, int *ret, void *lock)
type CRYPTO_REF_COUNT (line 60) | typedef int CRYPTO_REF_COUNT;
function CRYPTO_UP_REF (line 62) | static __inline__ int CRYPTO_UP_REF(int *val, int *ret, void *lock)
function CRYPTO_DOWN_REF (line 68) | static __inline__ int CRYPTO_DOWN_REF(int *val, int *ret, void *lock)
type CRYPTO_REF_COUNT (line 80) | typedef volatile int CRYPTO_REF_COUNT;
function CRYPTO_UP_REF (line 88) | static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, void *lock)
function CRYPTO_DOWN_REF (line 94) | static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *l...
function CRYPTO_UP_REF (line 114) | static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, void *lock)
function CRYPTO_DOWN_REF (line 120) | static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *l...
type CRYPTO_REF_COUNT (line 129) | typedef int CRYPTO_REF_COUNT;
FILE: cryptomini/include/internal/sockets.h
type servent (line 45) | struct servent
FILE: cryptomini/include/internal/sslconf.h
type SSL_CONF_CMD (line 13) | typedef struct ssl_conf_cmd_st SSL_CONF_CMD;
FILE: cryptomini/include/openssl/aes.h
type aes_key_st (line 31) | struct aes_key_st {
type AES_KEY (line 39) | typedef struct aes_key_st AES_KEY;
FILE: cryptomini/include/openssl/asn1.h
type X509_algor_st (line 118) | struct X509_algor_st
type asn1_string_st (line 146) | struct asn1_string_st {
type ASN1_ENCODING (line 164) | typedef struct ASN1_ENCODING_st {
type ASN1_STRING_TABLE (line 186) | typedef struct asn1_string_table_st {
type ASN1_TEMPLATE (line 210) | typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
type ASN1_TLC (line 211) | typedef struct ASN1_TLC_st ASN1_TLC;
type ASN1_VALUE (line 213) | typedef struct ASN1_VALUE_st ASN1_VALUE;
type ASN1_ITEM (line 318) | typedef const ASN1_ITEM ASN1_ITEM_EXP;
type ASN1_ITEM (line 339) | typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
function DEFINE_STACK_OF (line 438) | DEFINE_STACK_OF(ASN1_INTEGER)
type BIT_STRING_BITNAME (line 483) | typedef struct BIT_STRING_BITNAME_st {
type tm (line 634) | struct tm
FILE: cryptomini/include/openssl/asn1t.h
type ASN1_TEMPLATE_st (line 468) | struct ASN1_TEMPLATE_st {
type ASN1_ADB_TABLE (line 481) | typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
type ASN1_ADB (line 482) | typedef struct ASN1_ADB_st ASN1_ADB;
type ASN1_ADB_st (line 484) | struct ASN1_ADB_st {
type ASN1_ADB_TABLE_st (line 494) | struct ASN1_ADB_TABLE_st {
type ASN1_ITEM_st (line 580) | struct ASN1_ITEM_st {
type ASN1_TLC_st (line 650) | struct ASN1_TLC_st {
type ASN1_EXTERN_FUNCS (line 682) | typedef struct ASN1_EXTERN_FUNCS_st {
type ASN1_PRIMITIVE_FUNCS (line 692) | typedef struct ASN1_PRIMITIVE_FUNCS_st {
type ASN1_AUX (line 719) | typedef struct ASN1_AUX_st {
type ASN1_PRINT_ARG (line 729) | typedef struct ASN1_PRINT_ARG_st {
type ASN1_STREAM_ARG (line 736) | typedef struct ASN1_STREAM_ARG_st {
FILE: cryptomini/include/openssl/async.h
type ASYNC_JOB (line 32) | typedef struct async_job_st ASYNC_JOB;
type ASYNC_WAIT_CTX (line 33) | typedef struct async_wait_ctx_st ASYNC_WAIT_CTX;
FILE: cryptomini/include/openssl/bio.h
type BIO_ADDR (line 174) | typedef union bio_addr_st BIO_ADDR;
type BIO_ADDRINFO (line 175) | typedef struct bio_addrinfo_st BIO_ADDRINFO;
type BIO_METHOD (line 250) | typedef struct bio_method_st BIO_METHOD;
type BIO_info_cb (line 256) | typedef BIO_info_cb bio_info_cb;
type bio_dgram_sctp_sndinfo (line 266) | struct bio_dgram_sctp_sndinfo {
type bio_dgram_sctp_rcvinfo (line 273) | struct bio_dgram_sctp_rcvinfo {
type bio_dgram_sctp_prinfo (line 283) | struct bio_dgram_sctp_prinfo {
type BIO_hostserv_priorities (line 663) | enum BIO_hostserv_priorities {
type BIO_hostserv_priorities (line 667) | enum BIO_hostserv_priorities
type BIO_lookup_type (line 668) | enum BIO_lookup_type {
type BIO_lookup_type (line 672) | enum BIO_lookup_type
function DEPRECATEDIN_1_1_0 (line 686) | DEPRECATEDIN_1_1_0(struct hostent *BIO_gethostbyname(const char *name))
type BIO_sock_info_type (line 695) | enum BIO_sock_info_type {
type BIO_sock_info_type (line 699) | enum BIO_sock_info_type
FILE: cryptomini/include/openssl/blowfish.h
type BF_KEY (line 34) | typedef struct bf_key_st {
FILE: cryptomini/include/openssl/buffer.h
type buf_mem_st (line 38) | struct buf_mem_st {
FILE: cryptomini/include/openssl/camellia.h
type camellia_key_st (line 38) | struct camellia_key_st {
type CAMELLIA_KEY (line 45) | typedef struct camellia_key_st CAMELLIA_KEY;
FILE: cryptomini/include/openssl/cast.h
type CAST_KEY (line 28) | typedef struct cast_key_st {
FILE: cryptomini/include/openssl/cmac.h
type CMAC_CTX (line 22) | typedef struct CMAC_CTX_st CMAC_CTX;
FILE: cryptomini/include/openssl/cms.h
type CMS_ContentInfo (line 23) | typedef struct CMS_ContentInfo_st CMS_ContentInfo;
type CMS_SignerInfo (line 24) | typedef struct CMS_SignerInfo_st CMS_SignerInfo;
type CMS_CertificateChoices (line 25) | typedef struct CMS_CertificateChoices CMS_CertificateChoices;
type CMS_RevocationInfoChoice (line 26) | typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
type CMS_RecipientInfo (line 27) | typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
type CMS_ReceiptRequest (line 28) | typedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;
type CMS_Receipt (line 29) | typedef struct CMS_Receipt_st CMS_Receipt;
type CMS_RecipientEncryptedKey (line 30) | typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
type CMS_OtherKeyAttribute (line 31) | typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
FILE: cryptomini/include/openssl/conf.h
type CONF_VALUE (line 24) | typedef struct {
type conf_st (line 33) | struct conf_st
type conf_method_st (line 34) | struct conf_method_st
type CONF_METHOD (line 35) | typedef struct conf_method_st CONF_METHOD;
type conf_method_st (line 37) | struct conf_method_st {
type CONF_IMODULE (line 52) | typedef struct conf_imodule_st CONF_IMODULE;
type CONF_MODULE (line 53) | typedef struct conf_module_st CONF_MODULE;
type conf_st (line 103) | struct conf_st {
FILE: cryptomini/include/openssl/crypto.h
type CRYPTO_dynlock (line 61) | typedef struct {
type CRYPTO_RWLOCK (line 67) | typedef void CRYPTO_RWLOCK;
type crypto_ex_data_st (line 86) | struct crypto_ex_data_st {
type CRYPTO_THREADID (line 229) | typedef struct crypto_threadid_st {
type tm (line 341) | struct tm
type tm (line 341) | struct tm
type tm (line 342) | struct tm
type tm (line 344) | struct tm
type tm (line 344) | struct tm
type DWORD (line 408) | typedef DWORD CRYPTO_THREAD_LOCAL;
type DWORD (line 409) | typedef DWORD CRYPTO_THREAD_ID;
type LONG (line 411) | typedef LONG CRYPTO_ONCE;
type pthread_once_t (line 416) | typedef pthread_once_t CRYPTO_ONCE;
type pthread_key_t (line 417) | typedef pthread_key_t CRYPTO_THREAD_LOCAL;
type pthread_t (line 418) | typedef pthread_t CRYPTO_THREAD_ID;
type CRYPTO_ONCE (line 425) | typedef unsigned int CRYPTO_ONCE;
type CRYPTO_THREAD_LOCAL (line 426) | typedef unsigned int CRYPTO_THREAD_LOCAL;
type CRYPTO_THREAD_ID (line 427) | typedef unsigned int CRYPTO_THREAD_ID;
FILE: cryptomini/include/openssl/ct.h
type ct_log_entry_type_t (line 31) | typedef enum {
type sct_version_t (line 37) | typedef enum {
type sct_source_t (line 42) | typedef enum {
type sct_validation_status_t (line 49) | typedef enum {
FILE: cryptomini/include/openssl/des.h
type DES_LONG (line 21) | typedef unsigned int DES_LONG;
type DES_key_schedule (line 35) | typedef struct DES_ks {
FILE: cryptomini/include/openssl/dsa.h
type DSA_SIG (line 65) | typedef struct DSA_SIG_st DSA_SIG;
FILE: cryptomini/include/openssl/e_os2.h
type INT8 (line 232) | typedef INT8 int8_t;
type UINT8 (line 233) | typedef UINT8 uint8_t;
type INT16 (line 234) | typedef INT16 int16_t;
type UINT16 (line 235) | typedef UINT16 uint16_t;
type INT32 (line 236) | typedef INT32 int32_t;
type UINT32 (line 237) | typedef UINT32 uint32_t;
type INT64 (line 238) | typedef INT64 int64_t;
type UINT64 (line 239) | typedef UINT64 uint64_t;
type __int64 (line 255) | typedef __int64 int64_t;
FILE: cryptomini/include/openssl/ec.h
type point_conversion_form_t (line 33) | typedef enum {
type EC_METHOD (line 44) | typedef struct ec_method_st EC_METHOD;
type EC_GROUP (line 45) | typedef struct ec_group_st EC_GROUP;
type EC_POINT (line 46) | typedef struct ec_point_st EC_POINT;
type ECPKPARAMETERS (line 47) | typedef struct ecpk_parameters_st ECPKPARAMETERS;
type ECPARAMETERS (line 48) | typedef struct ec_parameters_st ECPARAMETERS;
type EC_builtin_curve (line 404) | typedef struct {
type ECDSA_SIG (line 1130) | typedef struct ECDSA_SIG_st ECDSA_SIG;
FILE: cryptomini/include/openssl/engine.h
type ENGINE_CMD_DEFN (line 251) | typedef struct ENGINE_CMD_DEFN_st {
type EVP_PKEY (line 266) | typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
type dynamic_MEM_fns (line 662) | typedef struct st_dynamic_MEM_fns {
type dynamic_fns (line 672) | typedef struct st_dynamic_fns {
FILE: cryptomini/include/openssl/err.h
type ERR_STATE (line 43) | typedef struct err_state_st {
type ERR_STRING_DATA (line 213) | typedef struct ERR_string_data_st {
FILE: cryptomini/include/openssl/evp.h
type EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM (line 366) | typedef struct {
type EVP_CIPHER_INFO (line 396) | typedef struct evp_cipher_info_st {
type rsa_st (line 1015) | struct rsa_st
type rsa_st (line 1016) | struct rsa_st
type rsa_st (line 1017) | struct rsa_st
type rsa_st (line 1018) | struct rsa_st
type dsa_st (line 1021) | struct dsa_st
type dsa_st (line 1022) | struct dsa_st
type dsa_st (line 1023) | struct dsa_st
type dsa_st (line 1024) | struct dsa_st
type dh_st (line 1027) | struct dh_st
type dh_st (line 1028) | struct dh_st
type dh_st (line 1029) | struct dh_st
type dh_st (line 1030) | struct dh_st
type ec_key_st (line 1033) | struct ec_key_st
type ec_key_st (line 1034) | struct ec_key_st
type ec_key_st (line 1035) | struct ec_key_st
type ec_key_st (line 1036) | struct ec_key_st
FILE: cryptomini/include/openssl/idea.h
type IDEA_INT (line 20) | typedef unsigned int IDEA_INT;
type IDEA_KEY_SCHEDULE (line 28) | typedef struct idea_key_st {
FILE: cryptomini/include/openssl/lhash.h
type OPENSSL_LH_NODE (line 24) | typedef struct lhash_node_st OPENSSL_LH_NODE;
type OPENSSL_LHASH (line 29) | typedef struct lhash_st OPENSSL_LHASH;
FILE: cryptomini/include/openssl/md2.h
type MD2_INT (line 21) | typedef unsigned char MD2_INT;
type MD2_CTX (line 26) | typedef struct MD2state_st {
FILE: cryptomini/include/openssl/md4.h
type MD4_CTX (line 33) | typedef struct MD4state_st {
FILE: cryptomini/include/openssl/md5.h
type MD5_CTX (line 33) | typedef struct MD5state_st {
FILE: cryptomini/include/openssl/mdc2.h
type MDC2_CTX (line 25) | typedef struct mdc2_ctx_st {
FILE: cryptomini/include/openssl/modes.h
type GCM128_CONTEXT (line 103) | typedef struct gcm128_context GCM128_CONTEXT;
type CCM128_CONTEXT (line 128) | typedef struct ccm128_context CCM128_CONTEXT;
type XTS128_CONTEXT (line 149) | typedef struct xts128_context XTS128_CONTEXT;
type OCB128_CONTEXT (line 173) | typedef struct ocb128_context OCB128_CONTEXT;
FILE: cryptomini/include/openssl/objects.h
type OBJ_NAME (line 35) | typedef struct obj_name_st {
FILE: cryptomini/include/openssl/ocsp.h
type OCSP_CERTID (line 71) | typedef struct ocsp_cert_id_st OCSP_CERTID;
type ocsp_one_request_st (line 75) | struct ocsp_one_request_st
type ocsp_req_info_st (line 79) | struct ocsp_req_info_st
type OCSP_SIGNATURE (line 80) | typedef struct ocsp_signature_st OCSP_SIGNATURE;
type OCSP_REQUEST (line 81) | typedef struct ocsp_request_st OCSP_REQUEST;
type OCSP_RESPBYTES (line 90) | typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES;
type ocsp_revoked_info_st (line 97) | struct ocsp_revoked_info_st
type OCSP_CERTSTATUS (line 103) | typedef struct ocsp_cert_status_st OCSP_CERTSTATUS;
type OCSP_SINGLERESP (line 104) | typedef struct ocsp_single_response_st OCSP_SINGLERESP;
type ocsp_response_data_st (line 108) | struct ocsp_response_data_st
type OCSP_BASICRESP (line 110) | typedef struct ocsp_basic_response_st OCSP_BASICRESP;
type OCSP_CRLID (line 112) | typedef struct ocsp_crl_id_st OCSP_CRLID;
type OCSP_SERVICELOC (line 113) | typedef struct ocsp_service_locator_st OCSP_SERVICELOC;
FILE: cryptomini/include/openssl/ossl_typ.h
type ASN1_INTEGER (line 40) | typedef struct asn1_string_st ASN1_INTEGER;
type ASN1_ENUMERATED (line 41) | typedef struct asn1_string_st ASN1_ENUMERATED;
type ASN1_BIT_STRING (line 42) | typedef struct asn1_string_st ASN1_BIT_STRING;
type ASN1_OCTET_STRING (line 43) | typedef struct asn1_string_st ASN1_OCTET_STRING;
type ASN1_PRINTABLESTRING (line 44) | typedef struct asn1_string_st ASN1_PRINTABLESTRING;
type ASN1_T61STRING (line 45) | typedef struct asn1_string_st ASN1_T61STRING;
type ASN1_IA5STRING (line 46) | typedef struct asn1_string_st ASN1_IA5STRING;
type ASN1_GENERALSTRING (line 47) | typedef struct asn1_string_st ASN1_GENERALSTRING;
type ASN1_UNIVERSALSTRING (line 48) | typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
type ASN1_BMPSTRING (line 49) | typedef struct asn1_string_st ASN1_BMPSTRING;
type ASN1_UTCTIME (line 50) | typedef struct asn1_string_st ASN1_UTCTIME;
type ASN1_TIME (line 51) | typedef struct asn1_string_st ASN1_TIME;
type ASN1_GENERALIZEDTIME (line 52) | typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
type ASN1_VISIBLESTRING (line 53) | typedef struct asn1_string_st ASN1_VISIBLESTRING;
type ASN1_UTF8STRING (line 54) | typedef struct asn1_string_st ASN1_UTF8STRING;
type ASN1_STRING (line 55) | typedef struct asn1_string_st ASN1_STRING;
type ASN1_BOOLEAN (line 56) | typedef int ASN1_BOOLEAN;
type ASN1_NULL (line 57) | typedef int ASN1_NULL;
type ASN1_OBJECT (line 60) | typedef struct asn1_object_st ASN1_OBJECT;
type ASN1_ITEM (line 62) | typedef struct ASN1_ITEM_st ASN1_ITEM;
type ASN1_PCTX (line 63) | typedef struct asn1_pctx_st ASN1_PCTX;
type ASN1_SCTX (line 64) | typedef struct asn1_sctx_st ASN1_SCTX;
type dane_st (line 78) | struct dane_st
type BIO (line 79) | typedef struct bio_st BIO;
type BIGNUM (line 80) | typedef struct bignum_st BIGNUM;
type BN_CTX (line 81) | typedef struct bignum_ctx BN_CTX;
type BN_BLINDING (line 82) | typedef struct bn_blinding_st BN_BLINDING;
type BN_MONT_CTX (line 83) | typedef struct bn_mont_ctx_st BN_MONT_CTX;
type BN_RECP_CTX (line 84) | typedef struct bn_recp_ctx_st BN_RECP_CTX;
type BN_GENCB (line 85) | typedef struct bn_gencb_st BN_GENCB;
type BUF_MEM (line 87) | typedef struct buf_mem_st BUF_MEM;
type EVP_CIPHER (line 89) | typedef struct evp_cipher_st EVP_CIPHER;
type EVP_CIPHER_CTX (line 90) | typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
type EVP_MD (line 91) | typedef struct evp_md_st EVP_MD;
type EVP_MD_CTX (line 92) | typedef struct evp_md_ctx_st EVP_MD_CTX;
type EVP_PKEY (line 93) | typedef struct evp_pkey_st EVP_PKEY;
type EVP_PKEY_ASN1_METHOD (line 95) | typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
type EVP_PKEY_METHOD (line 97) | typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
type EVP_PKEY_CTX (line 98) | typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
type EVP_ENCODE_CTX (line 100) | typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
type HMAC_CTX (line 102) | typedef struct hmac_ctx_st HMAC_CTX;
type DH (line 104) | typedef struct dh_st DH;
type DH_METHOD (line 105) | typedef struct dh_method DH_METHOD;
type DSA (line 107) | typedef struct dsa_st DSA;
type DSA_METHOD (line 108) | typedef struct dsa_method DSA_METHOD;
type RSA (line 110) | typedef struct rsa_st RSA;
type RSA_METHOD (line 111) | typedef struct rsa_meth_st RSA_METHOD;
type RSA_PSS_PARAMS (line 112) | typedef struct rsa_pss_params_st RSA_PSS_PARAMS;
type EC_KEY (line 114) | typedef struct ec_key_st EC_KEY;
type EC_KEY_METHOD (line 115) | typedef struct ec_key_method_st EC_KEY_METHOD;
type RAND_METHOD (line 117) | typedef struct rand_meth_st RAND_METHOD;
type RAND_DRBG (line 118) | typedef struct rand_drbg_st RAND_DRBG;
type SSL_DANE (line 120) | typedef struct ssl_dane_st SSL_DANE;
type X509 (line 121) | typedef struct x509_st X509;
type X509_ALGOR (line 122) | typedef struct X509_algor_st X509_ALGOR;
type X509_CRL (line 123) | typedef struct X509_crl_st X509_CRL;
type X509_CRL_METHOD (line 124) | typedef struct x509_crl_method_st X509_CRL_METHOD;
type X509_REVOKED (line 125) | typedef struct x509_revoked_st X509_REVOKED;
type X509_NAME (line 126) | typedef struct X509_name_st X509_NAME;
type X509_PUBKEY (line 127) | typedef struct X509_pubkey_st X509_PUBKEY;
type X509_STORE (line 128) | typedef struct x509_store_st X509_STORE;
type X509_STORE_CTX (line 129) | typedef struct x509_store_ctx_st X509_STORE_CTX;
type X509_OBJECT (line 131) | typedef struct x509_object_st X509_OBJECT;
type X509_LOOKUP (line 132) | typedef struct x509_lookup_st X509_LOOKUP;
type X509_LOOKUP_METHOD (line 133) | typedef struct x509_lookup_method_st X509_LOOKUP_METHOD;
type X509_VERIFY_PARAM (line 134) | typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
type X509_SIG_INFO (line 136) | typedef struct x509_sig_info_st X509_SIG_INFO;
type PKCS8_PRIV_KEY_INFO (line 138) | typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
type X509V3_CTX (line 140) | typedef struct v3_ext_ctx X509V3_CTX;
type CONF (line 141) | typedef struct conf_st CONF;
type OPENSSL_INIT_SETTINGS (line 142) | typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS;
type UI (line 144) | typedef struct ui_st UI;
type UI_METHOD (line 145) | typedef struct ui_method_st UI_METHOD;
type ENGINE (line 147) | typedef struct engine_st ENGINE;
type SSL (line 148) | typedef struct ssl_st SSL;
type SSL_CTX (line 149) | typedef struct ssl_ctx_st SSL_CTX;
type COMP_CTX (line 151) | typedef struct comp_ctx_st COMP_CTX;
type COMP_METHOD (line 152) | typedef struct comp_method_st COMP_METHOD;
type X509_POLICY_NODE (line 154) | typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
type X509_POLICY_LEVEL (line 155) | typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
type X509_POLICY_TREE (line 156) | typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
type X509_POLICY_CACHE (line 157) | typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
type AUTHORITY_KEYID (line 159) | typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
type DIST_POINT (line 160) | typedef struct DIST_POINT_st DIST_POINT;
type ISSUING_DIST_POINT (line 161) | typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
type NAME_CONSTRAINTS (line 162) | typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
type CRYPTO_EX_DATA (line 164) | typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
type OCSP_REQ_CTX (line 166) | typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
type OCSP_RESPONSE (line 167) | typedef struct ocsp_response_st OCSP_RESPONSE;
type OCSP_RESPID (line 168) | typedef struct ocsp_responder_id_st OCSP_RESPID;
type SCT (line 170) | typedef struct sct_st SCT;
type SCT_CTX (line 171) | typedef struct sct_ctx_st SCT_CTX;
type CTLOG (line 172) | typedef struct ctlog_st CTLOG;
type CTLOG_STORE (line 173) | typedef struct ctlog_store_st CTLOG_STORE;
type CT_POLICY_EVAL_CTX (line 174) | typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
type OSSL_STORE_INFO (line 176) | typedef struct ossl_store_info_st OSSL_STORE_INFO;
type OSSL_STORE_SEARCH (line 177) | typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
type intmax_t (line 181) | typedef intmax_t ossl_intmax_t;
type uintmax_t (line 182) | typedef uintmax_t ossl_uintmax_t;
type ossl_intmax_t (line 190) | typedef long ossl_intmax_t;
type ossl_uintmax_t (line 191) | typedef unsigned long ossl_uintmax_t;
FILE: cryptomini/include/openssl/pkcs12.h
type PKCS12_MAC_DATA (line 43) | typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA;
type PKCS12 (line 45) | typedef struct PKCS12_st PKCS12;
type PKCS12_SAFEBAG (line 47) | typedef struct PKCS12_SAFEBAG_st PKCS12_SAFEBAG;
type pkcs12_bag_st (line 51) | struct pkcs12_bag_st
FILE: cryptomini/include/openssl/pkcs7.h
type PKCS7_ISSUER_AND_SERIAL (line 32) | typedef struct pkcs7_issuer_and_serial_st {
type PKCS7_SIGNER_INFO (line 37) | typedef struct pkcs7_signer_info_st {
type pkcs7_recip_info_st (line 51) | struct pkcs7_recip_info_st {
type pkcs7_signed_st (line 61) | struct pkcs7_signed_st {
type PKCS7_ENC_CONTENT (line 74) | typedef struct pkcs7_enc_content_st {
type PKCS7_ENVELOPE (line 81) | typedef struct pkcs7_enveloped_st {
type PKCS7_SIGN_ENVELOPE (line 87) | typedef struct pkcs7_signedandenveloped_st {
type PKCS7_DIGEST (line 97) | typedef struct pkcs7_digest_st {
type PKCS7_ENCRYPT (line 104) | typedef struct pkcs7_encrypted_st {
type PKCS7 (line 109) | typedef struct pkcs7_st {
FILE: cryptomini/include/openssl/rand.h
type rand_meth_st (line 22) | struct rand_meth_st {
FILE: cryptomini/include/openssl/rc2.h
type RC2_INT (line 20) | typedef unsigned int RC2_INT;
type RC2_KEY (line 28) | typedef struct rc2_key_st {
FILE: cryptomini/include/openssl/rc4.h
type RC4_KEY (line 21) | typedef struct rc4_key_st {
FILE: cryptomini/include/openssl/rc5.h
type RC5_32_KEY (line 36) | typedef struct rc5_key_st {
FILE: cryptomini/include/openssl/ripemd.h
type RIPEMD160_CTX (line 28) | typedef struct RIPEMD160state_st {
FILE: cryptomini/include/openssl/rsa.h
type rsa_pss_params_st (line 283) | struct rsa_pss_params_st {
type rsa_oaep_params_st (line 294) | struct rsa_oaep_params_st {
FILE: cryptomini/include/openssl/seed.h
type SEED_KEY_SCHEDULE (line 60) | typedef struct seed_key_st {
FILE: cryptomini/include/openssl/sha.h
type SHA_CTX (line 34) | typedef struct SHAstate_st {
type SHA256_CTX (line 51) | typedef struct SHA256state_st {
type SHA512_CTX (line 95) | typedef struct SHA512state_st {
FILE: cryptomini/include/openssl/srp.h
type SRP_gN_cache (line 30) | typedef struct SRP_gN_cache_st {
type SRP_user_pwd_st (line 38) | struct SRP_user_pwd_st {
type SRP_VBASE_st (line 54) | struct SRP_VBASE_st {
type SRP_gN (line 66) | typedef struct SRP_gN_st {
FILE: cryptomini/include/openssl/ssl.h
type ssl_st (line 209) | struct ssl_st
type TLS_SESSION_TICKET_EXT (line 210) | typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT;
type SSL_METHOD (line 211) | typedef struct ssl_method_st SSL_METHOD;
type SSL_CIPHER (line 212) | typedef struct ssl_cipher_st SSL_CIPHER;
type SSL_SESSION (line 213) | typedef struct ssl_session_st SSL_SESSION;
type TLS_SIGALGS (line 214) | typedef struct tls_sigalgs_st TLS_SIGALGS;
type SSL_CONF_CTX (line 215) | typedef struct ssl_conf_ctx_st SSL_CONF_CTX;
type SSL_COMP (line 216) | typedef struct ssl_comp_st SSL_COMP;
type SRTP_PROTECTION_PROFILE (line 222) | typedef struct srtp_protection_profile_st {
type ssl_st (line 710) | struct ssl_st
type ssl_st (line 712) | struct ssl_st
type ssl_ctx_st (line 715) | struct ssl_ctx_st
type ssl_ctx_st (line 718) | struct ssl_ctx_st
type ssl_st (line 721) | struct ssl_st
type ssl_st (line 726) | struct ssl_st
type OSSL_HANDSHAKE_STATE (line 991) | typedef enum {
type evp_pkey_st (line 1970) | struct evp_pkey_st
FILE: cryptomini/include/openssl/stack.h
type OPENSSL_STACK (line 17) | typedef struct stack_st OPENSSL_STACK;
FILE: cryptomini/include/openssl/store.h
type OSSL_STORE_CTX (line 31) | typedef struct ossl_store_ctx_st OSSL_STORE_CTX;
type OSSL_STORE_INFO (line 38) | typedef OSSL_STORE_INFO *(*OSSL_STORE_post_process_info_fn)(OSSL_STORE_I...
type OSSL_STORE_LOADER (line 212) | typedef struct ossl_store_loader_st OSSL_STORE_LOADER;
type OSSL_STORE_LOADER_CTX (line 217) | typedef struct ossl_store_loader_ctx_st OSSL_STORE_LOADER_CTX;
type OSSL_STORE_LOADER_CTX (line 218) | typedef OSSL_STORE_LOADER_CTX *(*OSSL_STORE_open_fn)(const OSSL_STORE_LO...
type OSSL_STORE_INFO (line 236) | typedef OSSL_STORE_INFO *(*OSSL_STORE_load_fn)(OSSL_STORE_LOADER_CTX *ctx,
FILE: cryptomini/include/openssl/tls1.h
type tls_session_ticket_ext_st (line 1229) | struct tls_session_ticket_ext_st {
FILE: cryptomini/include/openssl/ts.h
type TS_MSG_IMPRINT (line 33) | typedef struct TS_msg_imprint_st TS_MSG_IMPRINT;
type TS_REQ (line 34) | typedef struct TS_req_st TS_REQ;
type TS_ACCURACY (line 35) | typedef struct TS_accuracy_st TS_ACCURACY;
type TS_TST_INFO (line 36) | typedef struct TS_tst_info_st TS_TST_INFO;
type TS_STATUS_INFO (line 57) | typedef struct TS_status_info_st TS_STATUS_INFO;
type ESS_ISSUER_SERIAL (line 58) | typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL;
type ESS_CERT_ID (line 59) | typedef struct ESS_cert_id ESS_CERT_ID;
type ESS_SIGNING_CERT (line 60) | typedef struct ESS_signing_cert ESS_SIGNING_CERT;
type ESS_cert_id_v2_st (line 64) | struct ESS_cert_id_v2_st
type ESS_SIGNING_CERT_V2 (line 65) | typedef struct ESS_signing_cert_v2_st ESS_SIGNING_CERT_V2;
type TS_resp_st (line 69) | struct TS_resp_st
type TS_resp_ctx (line 302) | struct TS_resp_ctx
type ASN1_INTEGER (line 305) | typedef ASN1_INTEGER *(*TS_serial_cb) (struct TS_resp_ctx *, void *);
type TS_resp_ctx (line 312) | struct TS_resp_ctx
type TS_resp_ctx (line 320) | struct TS_resp_ctx
type TS_RESP_CTX (line 323) | typedef struct TS_resp_ctx TS_RESP_CTX;
type TS_VERIFY_CTX (line 464) | typedef struct TS_verify_ctx TS_VERIFY_CTX;
FILE: cryptomini/include/openssl/txt_db.h
type OPENSSL_STRING (line 30) | typedef OPENSSL_STRING *OPENSSL_PSTRING;
type TXT_DB (line 33) | typedef struct txt_db_st {
FILE: cryptomini/include/openssl/ui.h
type UI_STRING (line 279) | typedef struct ui_string_st UI_STRING;
type UI_string_types (line 332) | enum UI_string_types
FILE: cryptomini/include/openssl/whrlpool.h
type WHIRLPOOL_CTX (line 26) | typedef struct {
FILE: cryptomini/include/openssl/x509.h
type X509_algor_st (line 59) | struct X509_algor_st {
type X509_ALGORS (line 64) | typedef STACK_OF(X509_ALGOR) X509_ALGORS;
type X509_VAL (line 66) | typedef struct X509_val_st {
type X509_SIG (line 71) | typedef struct X509_sig_st X509_SIG;
type X509_NAME_ENTRY (line 73) | typedef struct X509_name_entry_st X509_NAME_ENTRY;
type X509_EXTENSION (line 81) | typedef struct X509_extension_st X509_EXTENSION;
type X509_EXTENSIONS (line 83) | typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;
type x509_attributes_st (line 87) | struct x509_attributes_st
type X509_req_info_st (line 91) | struct X509_req_info_st
type X509_REQ (line 93) | typedef struct X509_req_st X509_REQ;
type X509_CERT_AUX (line 95) | typedef struct x509_cert_aux_st X509_CERT_AUX;
type X509_CINF (line 97) | typedef struct x509_cinf_st X509_CINF;
type x509_trust_st (line 103) | struct x509_trust_st {
type X509_crl_info_st (line 226) | struct X509_crl_info_st
type private_key_st (line 230) | struct private_key_st {
type X509_INFO (line 245) | typedef struct X509_info_st {
type Netscape_spkac_st (line 260) | struct Netscape_spkac_st {
type NETSCAPE_SPKI (line 265) | typedef struct Netscape_spki_st {
type NETSCAPE_CERT_SEQUENCE (line 272) | typedef struct Netscape_certificate_sequence {
type PBEPARAM (line 286) | typedef struct PBEPARAM_st {
type PBE2PARAM (line 293) | typedef struct PBE2PARAM_st {
type PBKDF2PARAM (line 298) | typedef struct PBKDF2PARAM_st {
type SCRYPT_PARAMS (line 307) | typedef struct SCRYPT_PARAMS_st {
FILE: cryptomini/include/openssl/x509_vfy.h
type X509_LOOKUP_TYPE (line 47) | typedef enum {
FILE: cryptomini/include/openssl/x509v3.h
type v3_ext_method (line 23) | struct v3_ext_method
type v3_ext_ctx (line 24) | struct v3_ext_ctx
type v3_ext_method (line 33) | struct v3_ext_method
type v3_ext_method (line 35) | struct v3_ext_method
type v3_ext_ctx (line 36) | struct v3_ext_ctx
type v3_ext_method (line 38) | struct v3_ext_method
type v3_ext_method (line 40) | struct v3_ext_method
type v3_ext_ctx (line 41) | struct v3_ext_ctx
type v3_ext_method (line 42) | struct v3_ext_method
type v3_ext_method (line 44) | struct v3_ext_method
type v3_ext_ctx (line 45) | struct v3_ext_ctx
type v3_ext_method (line 49) | struct v3_ext_method {
type X509V3_CONF_METHOD (line 71) | typedef struct X509V3_CONF_METHOD_st {
type v3_ext_ctx (line 79) | struct v3_ext_ctx {
type X509V3_EXT_METHOD (line 92) | typedef struct v3_ext_method X509V3_EXT_METHOD;
type BIT_STRING_BITNAME (line 101) | typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
type BASIC_CONSTRAINTS (line 103) | typedef struct BASIC_CONSTRAINTS_st {
type PKEY_USAGE_PERIOD (line 108) | typedef struct PKEY_USAGE_PERIOD_st {
type OTHERNAME (line 113) | typedef struct otherName_st {
type EDIPARTYNAME (line 118) | typedef struct EDIPartyName_st {
type GENERAL_NAME (line 123) | typedef struct GENERAL_NAME_st {
type ACCESS_DESCRIPTION (line 155) | typedef struct ACCESS_DESCRIPTION_st {
type AUTHORITY_INFO_ACCESS (line 160) | typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
type EXTENDED_KEY_USAGE (line 162) | typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
type TLS_FEATURE (line 164) | typedef STACK_OF(ASN1_INTEGER) TLS_FEATURE;
function DEFINE_STACK_OF (line 168) | DEFINE_STACK_OF(GENERAL_NAMES)
type DIST_POINT_st (line 196) | struct DIST_POINT_st {
type CRL_DIST_POINTS (line 203) | typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
function AUTHORITY_KEYID_st (line 205) | DEFINE_STACK_OF(DIST_POINT)
type SXNETID (line 215) | typedef struct SXNET_ID_st {
type SXNET_st (line 222) | struct SXNET_st {
type NOTICEREF (line 227) | typedef struct NOTICEREF_st {
type USERNOTICE (line 232) | typedef struct USERNOTICE_st {
type POLICYQUALINFO (line 237) | typedef struct POLICYQUALINFO_st {
type POLICYINFO_st (line 248) | struct POLICYINFO_st {
type CERTIFICATEPOLICIES (line 253) | typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
type POLICY_MAPPING_st (line 257) | struct POLICY_MAPPING_st {
type GENERAL_SUBTREE (line 266) | typedef struct GENERAL_SUBTREE_st {
function NAME_CONSTRAINTS_st (line 272) | DEFINE_STACK_OF(GENERAL_SUBTREE)
type POLICY_CONSTRAINTS (line 279) | typedef struct POLICY_CONSTRAINTS_st {
type PROXY_POLICY (line 285) | typedef struct PROXY_POLICY_st {
type PROXY_CERT_INFO_EXTENSION (line 290) | typedef struct PROXY_CERT_INFO_EXTENSION_st {
function DECLARE_ASN1_FUNCTIONS (line 295) | DECLARE_ASN1_FUNCTIONS(PROXY_POLICY)
type X509_PURPOSE (line 403) | typedef struct x509_purpose_st {
function DECLARE_ASN1_FUNCTIONS (line 497) | DECLARE_ASN1_FUNCTIONS(OTHERNAME)
function DECLARE_ASN1_FUNCTIONS (line 758) | DECLARE_ASN1_FUNCTIONS(ASRange)
type IPAddressOrRange (line 770) | typedef struct IPAddressOrRange_st {
type IPAddressOrRanges (line 778) | typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;
type IPAddressChoice (line 784) | typedef struct IPAddressChoice_st {
type IPAddressFamily (line 792) | typedef struct IPAddressFamily_st {
type IPAddrBlocks (line 797) | typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
type NamingAuthority_st (line 875) | struct NamingAuthority_st
type PROFESSION_INFO (line 876) | typedef struct ProfessionInfo_st PROFESSION_INFO;
type ADMISSIONS (line 877) | typedef struct Admissions_st ADMISSIONS;
type ADMISSION_SYNTAX (line 878) | typedef struct AdmissionSyntax_st ADMISSION_SYNTAX;
FILE: cryptomini/intercept/err.c
function ERR_put_error (line 3) | void ERR_put_error(int lib, int func, int reason, const char *file, int ...
function ERR_set_mark (line 8) | int ERR_set_mark(void) {
function ERR_pop_to_mark (line 12) | int ERR_pop_to_mark(void) {
FILE: cryptomini/intercept/rand.c
function rdtsc (line 8) | inline uint64_t rdtsc()
function platform_random (line 15) | uint64_t platform_random(){
function RAND_bytes (line 63) | int RAND_bytes(unsigned char *buf, int num)
function RAND_priv_bytes (line 80) | int RAND_priv_bytes(unsigned char *buf, int num)
FILE: cryptomini/mem.c
function CRYPTO_set_mem_functions (line 61) | int CRYPTO_set_mem_functions(
function CRYPTO_set_mem_debug (line 77) | int CRYPTO_set_mem_debug(int flag)
function CRYPTO_get_mem_functions (line 85) | void CRYPTO_get_mem_functions(
function CRYPTO_get_alloc_counts (line 99) | void CRYPTO_get_alloc_counts(int *mcount, int *rcount, int *fcount)
function parseit (line 118) | static void parseit(void)
function shouldfail (line 146) | static int shouldfail(void)
function ossl_malloc_setup_failures (line 182) | void ossl_malloc_setup_failures(void)
function CRYPTO_free (line 296) | void CRYPTO_free(void *str, const char *file, int line)
function CRYPTO_clear_free (line 317) | void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)
FILE: cryptomini/mem_clr.c
function OPENSSL_cleanse (line 22) | void OPENSSL_cleanse(void *ptr, size_t len)
FILE: cryptomini/mem_sec.c
function CRYPTO_secure_malloc_init (line 75) | int CRYPTO_secure_malloc_init(size_t size, int minsize)
function CRYPTO_secure_malloc_done (line 98) | int CRYPTO_secure_malloc_done(void)
function CRYPTO_secure_malloc_initialized (line 112) | int CRYPTO_secure_malloc_initialized(void)
function CRYPTO_secure_free (line 151) | void CRYPTO_secure_free(void *ptr, const char *file, int line)
function CRYPTO_secure_clear_free (line 173) | void CRYPTO_secure_clear_free(void *ptr, size_t num,
function CRYPTO_secure_allocated (line 200) | int CRYPTO_secure_allocated(const void *ptr)
function CRYPTO_secure_used (line 216) | size_t CRYPTO_secure_used(void)
function CRYPTO_secure_actual_size (line 225) | size_t CRYPTO_secure_actual_size(void *ptr)
type SH_LIST (line 275) | typedef struct sh_list_st
type SH (line 281) | typedef struct sh_st
function sh_getlist (line 297) | static size_t sh_getlist(char *ptr)
function sh_testbit (line 312) | static int sh_testbit(char *ptr, int list, unsigned char *table)
function sh_clearbit (line 323) | static void sh_clearbit(char *ptr, int list, unsigned char *table)
function sh_setbit (line 335) | static void sh_setbit(char *ptr, int list, unsigned char *table)
function sh_add_to_list (line 347) | static void sh_add_to_list(char **list, char *ptr)
function sh_remove_from_list (line 367) | static void sh_remove_from_list(char *ptr)
function sh_init (line 383) | static int sh_init(size_t size, int minsize)
function sh_done (line 507) | static void sh_done(void)
function sh_allocated (line 517) | static int sh_allocated(const char *ptr)
function sh_free (line 601) | static void sh_free(void *ptr)
function sh_actual_size (line 642) | static size_t sh_actual_size(char *ptr)
FILE: cryptomini/sha/sha256.c
function SHA224_Init (line 19) | int SHA224_Init(SHA256_CTX *c)
function SHA256_Init (line 34) | int SHA256_Init(SHA256_CTX *c)
function SHA224_Update (line 77) | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len)
function SHA224_Final (line 82) | int SHA224_Final(unsigned char *md, SHA256_CTX *c)
function sha256_block_data_order (line 168) | static void sha256_block_data_order(SHA256_CTX *ctx, const void *in,
function sha256_block_data_order (line 246) | static void sha256_block_data_order(SHA256_CTX *ctx, const void *in,
FILE: cryptomini/sha/sha512.c
function sha512_224_init (line 63) | int sha512_224_init(SHA512_CTX *c)
function sha512_256_init (line 81) | int sha512_256_init(SHA512_CTX *c)
function SHA384_Init (line 99) | int SHA384_Init(SHA512_CTX *c)
function SHA512_Init (line 117) | int SHA512_Init(SHA512_CTX *c)
function SHA512_Final (line 140) | int SHA512_Final(unsigned char *md, SHA512_CTX *c)
function SHA384_Final (line 259) | int SHA384_Final(unsigned char *md, SHA512_CTX *c)
function SHA512_Update (line 264) | int SHA512_Update(SHA512_CTX *c, const void *_data, size_t len)
function SHA384_Update (line 312) | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len)
function SHA512_Transform (line 317) | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data)
function sha512_block_data_order (line 501) | static void sha512_block_data_order(SHA512_CTX *ctx, const void *in,
function sha512_block_data_order (line 563) | static void sha512_block_data_order(SHA512_CTX *ctx, const void *in,
function sha512_block_data_order (line 644) | static void sha512_block_data_order(SHA512_CTX *ctx, const void *in,
FILE: cryptomini/sha/sha_local.h
function HASH_INIT (line 53) | int HASH_INIT(SHA_CTX *c)
function HASH_BLOCK_DATA_ORDER (line 136) | static void HASH_BLOCK_DATA_ORDER(SHA_CTX *c, const void *p, size_t num)
function HASH_BLOCK_DATA_ORDER (line 370) | static void HASH_BLOCK_DATA_ORDER(SHA_CTX *c, const void *p, size_t num)
FILE: cryptomini/threads_none.c
function CRYPTO_RWLOCK (line 20) | CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void)
function CRYPTO_THREAD_read_lock (line 34) | int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock)
function CRYPTO_THREAD_write_lock (line 41) | int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock)
function CRYPTO_THREAD_unlock (line 48) | int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock)
function CRYPTO_THREAD_lock_free (line 55) | void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock) {
function CRYPTO_THREAD_run_once (line 65) | int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
function CRYPTO_THREAD_init_local (line 80) | int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(v...
function CRYPTO_THREAD_set_local (line 102) | int CRYPTO_THREAD_set_local(CRYPTO_THREAD_LOCAL *key, void *val)
function CRYPTO_THREAD_cleanup_local (line 112) | int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key)
function CRYPTO_THREAD_ID (line 118) | CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void)
function CRYPTO_THREAD_compare_id (line 123) | int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b)
function CRYPTO_atomic_add (line 128) | int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
function openssl_init_fork_handlers (line 136) | int openssl_init_fork_handlers(void)
function openssl_get_fork_id (line 141) | int openssl_get_fork_id(void)
FILE: ftpm-driver/ftpm-ioctl.c
type ftpm_cmd (line 19) | struct ftpm_cmd {
function ftpm_run_command (line 24) | int ftpm_run_command(struct tss_ftpm_context* cnx)
function ftpm_ioctl (line 34) | long ftpm_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
FILE: ftpm-driver/ftpm-sbi.c
function sbi_sm_ftpm_run_command (line 6) | struct sbiret sbi_sm_ftpm_run_command(struct tss_ftpm_context *cnx) {
FILE: ftpm-driver/ftpm-sbi.h
type sbiret (line 8) | struct sbiret
type tss_ftpm_context (line 8) | struct tss_ftpm_context
FILE: ftpm-driver/ftpm.c
type file_operations (line 21) | struct file_operations
type miscdevice (line 27) | struct miscdevice
function ftpm_dev_init (line 35) | static int __init ftpm_dev_init(void)
function ftpm_dev_exit (line 54) | static void __exit ftpm_dev_exit(void)
FILE: ftpm-driver/ftpm.h
type file (line 61) | struct file
FILE: ftpm-driver/ftpm_user.h
type tss_ftpm_context (line 12) | struct tss_ftpm_context {
FILE: ftpm-driver/rtpm-controller.c
function main (line 18) | int main(int argc, char **argv) {
FILE: ftpm-opensbi/firmware/payloads/test_main.c
function sbi_ecall_console_puts (line 32) | static inline void sbi_ecall_console_puts(const char *str)
function test_main (line 43) | void test_main(unsigned long a0, unsigned long a1)
FILE: ftpm-opensbi/include/fatfs/diskio.h
type BYTE (line 15) | typedef BYTE DSTATUS;
type DRESULT (line 18) | typedef enum {
FILE: ftpm-opensbi/include/fatfs/ff.h
type QWORD (line 42) | typedef unsigned __int64 QWORD;
type UINT (line 50) | typedef unsigned int UINT;
type BYTE (line 51) | typedef unsigned char BYTE;
type WORD (line 52) | typedef uint16_t WORD;
type DWORD (line 53) | typedef uint32_t DWORD;
type QWORD (line 54) | typedef uint64_t QWORD;
type WORD (line 55) | typedef WORD WCHAR;
type UINT (line 59) | typedef unsigned int UINT;
type BYTE (line 60) | typedef unsigned char BYTE;
type WORD (line 61) | typedef unsigned short WORD;
type DWORD (line 62) | typedef unsigned long DWORD;
type WORD (line 63) | typedef WORD WCHAR;
type QWORD (line 73) | typedef QWORD FSIZE_t;
type QWORD (line 75) | typedef QWORD LBA_t;
type DWORD (line 77) | typedef DWORD LBA_t;
type DWORD (line 83) | typedef DWORD FSIZE_t;
type DWORD (line 84) | typedef DWORD LBA_t;
type WCHAR (line 92) | typedef WCHAR TCHAR;
type TCHAR (line 96) | typedef char TCHAR;
type DWORD (line 100) | typedef DWORD TCHAR;
type TCHAR (line 106) | typedef char TCHAR;
type PARTITION (line 116) | typedef struct {
type FATFS (line 133) | typedef struct {
type FFOBJID (line 181) | typedef struct {
type FIL (line 204) | typedef struct {
type DIR (line 227) | typedef struct {
type FILINFO (line 246) | typedef struct {
type MKFS_PARM (line 263) | typedef struct {
type FRESULT (line 275) | typedef enum {
FILE: ftpm-opensbi/include/ftpm/ACT.h
type ACT_STATE (line 251) | typedef struct ACT_STATE
FILE: ftpm-opensbi/include/ftpm/ACT_SetTimeout_fp.h
type ACT_SetTimeout_In (line 65) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ActivateCredential_fp.h
type ActivateCredential_In (line 67) | typedef struct {
type ActivateCredential_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/BaseTypes.h
type UINT8 (line 74) | typedef uint8_t UINT8;
type BYTE (line 75) | typedef uint8_t BYTE;
type INT8 (line 76) | typedef int8_t INT8;
type BOOL (line 77) | typedef int BOOL;
type UINT16 (line 78) | typedef uint16_t UINT16;
type INT16 (line 79) | typedef int16_t INT16;
type UINT32 (line 80) | typedef uint32_t UINT32;
type INT32 (line 81) | typedef int32_t INT32;
type UINT64 (line 82) | typedef uint64_t UINT64;
type INT64 (line 83) | typedef int64_t INT64;
FILE: ftpm-opensbi/include/ftpm/BnToOsslMath.h
type bignum_st (line 86) | struct bignum_st
type OSSL_CURVE_DATA (line 124) | typedef struct
type OSSL_CURVE_DATA (line 133) | typedef OSSL_CURVE_DATA bigCurveData;
function TPM_INLINE (line 135) | TPM_INLINE const TPMBN_ECC_CURVE_CONSTANTS* AccessCurveConstants(
FILE: ftpm-opensbi/include/ftpm/BnValues.h
type bignum_t (line 103) | typedef BN_STRUCT_DEF(bnroot, 1) bignum_t;
type bignum_t (line 106) | typedef bignum_t* bigNum;
type bignum_t (line 107) | typedef const bignum_t* bigConst;
type bn_point_t (line 204) | typedef struct _bn_point_t
type bn_point_t (line 211) | typedef bn_point_t* bigPoint;
type bn_point_t (line 212) | typedef const bn_point_t* pointConst;
type constant_point_t (line 214) | typedef struct constant_point_t
type bn_fullpoint_t (line 235) | typedef BN_POINT_BUF(fullpoint, MAX_ECC_KEY_BITS) bn_fullpoint_t;
type TPMBN_ECC_CURVE_CONSTANTS (line 269) | typedef struct
function TPM_INLINE (line 287) | TPM_INLINE bigConst BnCurveGetPrime(const TPMBN_ECC_CURVE_CONSTANTS* C)
function TPM_INLINE (line 291) | TPM_INLINE bigConst BnCurveGetOrder(const TPMBN_ECC_CURVE_CONSTANTS* C)
function TPM_INLINE (line 295) | TPM_INLINE bigConst BnCurveGetCofactor(const TPMBN_ECC_CURVE_CONSTANTS* C)
function TPM_INLINE (line 299) | TPM_INLINE bigConst BnCurveGet_a(const TPMBN_ECC_CURVE_CONSTANTS* C)
function TPM_INLINE (line 303) | TPM_INLINE bigConst BnCurveGet_b(const TPMBN_ECC_CURVE_CONSTANTS* C)
function TPM_INLINE (line 307) | TPM_INLINE pointConst BnCurveGetG(const TPMBN_ECC_CURVE_CONSTANTS* C)
function TPM_INLINE (line 311) | TPM_INLINE bigConst BnCurveGetGx(const TPMBN_ECC_CURVE_CONSTANTS* C)
function TPM_INLINE (line 315) | TPM_INLINE bigConst BnCurveGetGy(const TPMBN_ECC_CURVE_CONSTANTS* C)
function TPM_INLINE (line 319) | TPM_INLINE TPM_ECC_CURVE BnCurveGetCurveId(const TPMBN_ECC_CURVE_CONSTAN...
FILE: ftpm-opensbi/include/ftpm/CertifyCreation_fp.h
type CertifyCreation_In (line 67) | typedef struct {
type CertifyCreation_Out (line 83) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/CertifyX509_fp.h
type CertifyX509_In (line 67) | typedef struct {
type CertifyX509_Out (line 81) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Certify_fp.h
type Certify_In (line 67) | typedef struct {
type Certify_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ChangeEPS_fp.h
type ChangeEPS_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ChangePPS_fp.h
type ChangePPS_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ClearControl_fp.h
type ClearControl_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Clear_fp.h
type Clear_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ClockRateAdjust_fp.h
type ClockRateAdjust_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ClockSet_fp.h
type ClockSet_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/CommandAttributes.h
type UINT16 (line 71) | typedef UINT16 COMMAND_ATTRIBUTES;
FILE: ftpm-opensbi/include/ftpm/CommandDispatchData.h
type TPM_RC (line 399) | typedef TPM_RC (Startup_Entry)(
type Startup_COMMAND_DESCRIPTOR_t (line 402) | typedef const struct {
type TPM_RC (line 425) | typedef TPM_RC (Shutdown_Entry)(
type Shutdown_COMMAND_DESCRIPTOR_t (line 428) | typedef const struct {
type TPM_RC (line 451) | typedef TPM_RC (SelfTest_Entry)(
type SelfTest_COMMAND_DESCRIPTOR_t (line 454) | typedef const struct {
type TPM_RC (line 477) | typedef TPM_RC (IncrementalSelfTest_Entry)(
type IncrementalSelfTest_COMMAND_DESCRIPTOR_t (line 481) | typedef const struct {
type TPM_RC (line 505) | typedef TPM_RC (GetTestResult_Entry)(
type GetTestResult_COMMAND_DESCRIPTOR_t (line 508) | typedef const struct {
type TPM_RC (line 533) | typedef TPM_RC (StartAuthSession_Entry)(
type StartAuthSession_COMMAND_DESCRIPTOR_t (line 537) | typedef const struct {
type TPM_RC (line 575) | typedef TPM_RC (PolicyRestart_Entry)(
type PolicyRestart_COMMAND_DESCRIPTOR_t (line 578) | typedef const struct {
type TPM_RC (line 601) | typedef TPM_RC (Create_Entry)(
type Create_COMMAND_DESCRIPTOR_t (line 605) | typedef const struct {
type TPM_RC (line 645) | typedef TPM_RC (Load_Entry)(
type Load_COMMAND_DESCRIPTOR_t (line 649) | typedef const struct {
type TPM_RC (line 679) | typedef TPM_RC (LoadExternal_Entry)(
type LoadExternal_COMMAND_DESCRIPTOR_t (line 683) | typedef const struct {
type TPM_RC (line 713) | typedef TPM_RC (ReadPublic_Entry)(
type ReadPublic_COMMAND_DESCRIPTOR_t (line 717) | typedef const struct {
type TPM_RC (line 745) | typedef TPM_RC (ActivateCredential_Entry)(
type ActivateCredential_COMMAND_DESCRIPTOR_t (line 749) | typedef const struct {
type TPM_RC (line 779) | typedef TPM_RC (MakeCredential_Entry)(
type MakeCredential_COMMAND_DESCRIPTOR_t (line 783) | typedef const struct {
type TPM_RC (line 813) | typedef TPM_RC (Unseal_Entry)(
type Unseal_COMMAND_DESCRIPTOR_t (line 817) | typedef const struct {
type TPM_RC (line 841) | typedef TPM_RC (ObjectChangeAuth_Entry)(
type ObjectChangeAuth_COMMAND_DESCRIPTOR_t (line 845) | typedef const struct {
type TPM_RC (line 873) | typedef TPM_RC (CreateLoaded_Entry)(
type CreateLoaded_COMMAND_DESCRIPTOR_t (line 877) | typedef const struct {
type TPM_RC (line 911) | typedef TPM_RC (Duplicate_Entry)(
type Duplicate_COMMAND_DESCRIPTOR_t (line 915) | typedef const struct {
type TPM_RC (line 949) | typedef TPM_RC (Rewrap_Entry)(
type Rewrap_COMMAND_DESCRIPTOR_t (line 953) | typedef const struct {
type TPM_RC (line 987) | typedef TPM_RC (Import_Entry)(
type Import_COMMAND_DESCRIPTOR_t (line 991) | typedef const struct {
type TPM_RC (line 1025) | typedef TPM_RC (RSA_Encrypt_Entry)(
type RSA_Encrypt_COMMAND_DESCRIPTOR_t (line 1029) | typedef const struct {
type TPM_RC (line 1059) | typedef TPM_RC (RSA_Decrypt_Entry)(
type RSA_Decrypt_COMMAND_DESCRIPTOR_t (line 1063) | typedef const struct {
type TPM_RC (line 1093) | typedef TPM_RC (ECDH_KeyGen_Entry)(
type ECDH_KeyGen_COMMAND_DESCRIPTOR_t (line 1097) | typedef const struct {
type TPM_RC (line 1123) | typedef TPM_RC (ECDH_ZGen_Entry)(
type ECDH_ZGen_COMMAND_DESCRIPTOR_t (line 1127) | typedef const struct {
type TPM_RC (line 1156) | typedef TPM_RC (ECC_Encrypt_Entry)(
type ECC_Encrypt_COMMAND_DESCRIPTOR_t (line 1161) | typedef const struct {
type TPM_RC (line 1198) | typedef TPM_RC (ECC_Decrypt_Entry)(
type ECC_Decrypt_COMMAND_DESCRIPTOR_t (line 1203) | typedef const struct {
type TPM_RC (line 1238) | typedef TPM_RC (ECC_Parameters_Entry)(
type ECC_Parameters_COMMAND_DESCRIPTOR_t (line 1242) | typedef const struct {
type TPM_RC (line 1266) | typedef TPM_RC (ZGen_2Phase_Entry)(
type ZGen_2Phase_COMMAND_DESCRIPTOR_t (line 1270) | typedef const struct {
type TPM_RC (line 1304) | typedef TPM_RC (EncryptDecrypt_Entry)(
type EncryptDecrypt_COMMAND_DESCRIPTOR_t (line 1308) | typedef const struct {
type TPM_RC (line 1342) | typedef TPM_RC (EncryptDecrypt2_Entry)(
type EncryptDecrypt2_COMMAND_DESCRIPTOR_t (line 1346) | typedef const struct {
type TPM_RC (line 1380) | typedef TPM_RC (Hash_Entry)(
type Hash_COMMAND_DESCRIPTOR_t (line 1384) | typedef const struct {
type TPM_RC (line 1414) | typedef TPM_RC (HMAC_Entry)(
type HMAC_COMMAND_DESCRIPTOR_t (line 1418) | typedef const struct {
type TPM_RC (line 1446) | typedef TPM_RC (MAC_Entry)(
type MAC_COMMAND_DESCRIPTOR_t (line 1450) | typedef const struct {
type TPM_RC (line 1478) | typedef TPM_RC (GetRandom_Entry)(
type GetRandom_COMMAND_DESCRIPTOR_t (line 1482) | typedef const struct {
type TPM_RC (line 1506) | typedef TPM_RC (StirRandom_Entry)(
type StirRandom_COMMAND_DESCRIPTOR_t (line 1509) | typedef const struct {
type TPM_RC (line 1532) | typedef TPM_RC (HMAC_Start_Entry)(
type HMAC_Start_COMMAND_DESCRIPTOR_t (line 1536) | typedef const struct {
type TPM_RC (line 1564) | typedef TPM_RC (MAC_Start_Entry)(
type MAC_Start_COMMAND_DESCRIPTOR_t (line 1568) | typedef const struct {
type TPM_RC (line 1596) | typedef TPM_RC (HashSequenceStart_Entry)(
type HashSequenceStart_COMMAND_DESCRIPTOR_t (line 1600) | typedef const struct {
type TPM_RC (line 1626) | typedef TPM_RC (SequenceUpdate_Entry)(
type SequenceUpdate_COMMAND_DESCRIPTOR_t (line 1629) | typedef const struct {
type TPM_RC (line 1654) | typedef TPM_RC (SequenceComplete_Entry)(
type SequenceComplete_COMMAND_DESCRIPTOR_t (line 1658) | typedef const struct {
type TPM_RC (line 1688) | typedef TPM_RC (EventSequenceComplete_Entry)(
type EventSequenceComplete_COMMAND_DESCRIPTOR_t (line 1692) | typedef const struct {
type TPM_RC (line 1720) | typedef TPM_RC (Certify_Entry)(
type Certify_COMMAND_DESCRIPTOR_t (line 1724) | typedef const struct {
type TPM_RC (line 1756) | typedef TPM_RC (CertifyCreation_Entry)(
type CertifyCreation_COMMAND_DESCRIPTOR_t (line 1760) | typedef const struct {
type TPM_RC (line 1796) | typedef TPM_RC (Quote_Entry)(
type Quote_COMMAND_DESCRIPTOR_t (line 1800) | typedef const struct {
type TPM_RC (line 1832) | typedef TPM_RC (GetSessionAuditDigest_Entry)(
type GetSessionAuditDigest_COMMAND_DESCRIPTOR_t (line 1836) | typedef const struct {
type TPM_RC (line 1870) | typedef TPM_RC (GetCommandAuditDigest_Entry)(
type GetCommandAuditDigest_COMMAND_DESCRIPTOR_t (line 1874) | typedef const struct {
type TPM_RC (line 1906) | typedef TPM_RC (GetTime_Entry)(
type GetTime_COMMAND_DESCRIPTOR_t (line 1910) | typedef const struct {
type TPM_RC (line 1942) | typedef TPM_RC (CertifyX509_Entry)(
type CertifyX509_COMMAND_DESCRIPTOR_t (line 1946) | typedef const struct {
type TPM_RC (line 1982) | typedef TPM_RC (Commit_Entry)(
type Commit_COMMAND_DESCRIPTOR_t (line 1986) | typedef const struct {
type TPM_RC (line 2022) | typedef TPM_RC (EC_Ephemeral_Entry)(
type EC_Ephemeral_COMMAND_DESCRIPTOR_t (line 2026) | typedef const struct {
type TPM_RC (line 2052) | typedef TPM_RC (VerifySignature_Entry)(
type VerifySignature_COMMAND_DESCRIPTOR_t (line 2056) | typedef const struct {
type TPM_RC (line 2084) | typedef TPM_RC (Sign_Entry)(
type Sign_COMMAND_DESCRIPTOR_t (line 2088) | typedef const struct {
type TPM_RC (line 2118) | typedef TPM_RC (SetCommandCodeAuditStatus_Entry)(
type SetCommandCodeAuditStatus_COMMAND_DESCRIPTOR_t (line 2121) | typedef const struct {
type TPM_RC (line 2150) | typedef TPM_RC (PCR_Extend_Entry)(
type PCR_Extend_COMMAND_DESCRIPTOR_t (line 2153) | typedef const struct {
type TPM_RC (line 2178) | typedef TPM_RC (PCR_Event_Entry)(
type PCR_Event_COMMAND_DESCRIPTOR_t (line 2182) | typedef const struct {
type TPM_RC (line 2208) | typedef TPM_RC (PCR_Read_Entry)(
type PCR_Read_COMMAND_DESCRIPTOR_t (line 2212) | typedef const struct {
type TPM_RC (line 2240) | typedef TPM_RC (PCR_Allocate_Entry)(
type PCR_Allocate_COMMAND_DESCRIPTOR_t (line 2244) | typedef const struct {
type TPM_RC (line 2276) | typedef TPM_RC (PCR_SetAuthPolicy_Entry)(
type PCR_SetAuthPolicy_COMMAND_DESCRIPTOR_t (line 2279) | typedef const struct {
type TPM_RC (line 2308) | typedef TPM_RC (PCR_SetAuthValue_Entry)(
type PCR_SetAuthValue_COMMAND_DESCRIPTOR_t (line 2311) | typedef const struct {
type TPM_RC (line 2336) | typedef TPM_RC (PCR_Reset_Entry)(
type PCR_Reset_COMMAND_DESCRIPTOR_t (line 2339) | typedef const struct {
type TPM_RC (line 2362) | typedef TPM_RC (PolicySigned_Entry)(
type PolicySigned_COMMAND_DESCRIPTOR_t (line 2366) | typedef const struct {
type TPM_RC (line 2404) | typedef TPM_RC (PolicySecret_Entry)(
type PolicySecret_COMMAND_DESCRIPTOR_t (line 2408) | typedef const struct {
type TPM_RC (line 2444) | typedef TPM_RC (PolicyTicket_Entry)(
type PolicyTicket_COMMAND_DESCRIPTOR_t (line 2447) | typedef const struct {
type TPM_RC (line 2480) | typedef TPM_RC (PolicyOR_Entry)(
type PolicyOR_COMMAND_DESCRIPTOR_t (line 2483) | typedef const struct {
type TPM_RC (line 2508) | typedef TPM_RC (PolicyPCR_Entry)(
type PolicyPCR_COMMAND_DESCRIPTOR_t (line 2511) | typedef const struct {
type TPM_RC (line 2538) | typedef TPM_RC (PolicyLocality_Entry)(
type PolicyLocality_COMMAND_DESCRIPTOR_t (line 2541) | typedef const struct {
type TPM_RC (line 2566) | typedef TPM_RC (PolicyNV_Entry)(
type PolicyNV_COMMAND_DESCRIPTOR_t (line 2569) | typedef const struct {
type TPM_RC (line 2602) | typedef TPM_RC (PolicyCounterTimer_Entry)(
type PolicyCounterTimer_COMMAND_DESCRIPTOR_t (line 2605) | typedef const struct {
type TPM_RC (line 2634) | typedef TPM_RC (PolicyCommandCode_Entry)(
type PolicyCommandCode_COMMAND_DESCRIPTOR_t (line 2637) | typedef const struct {
type TPM_RC (line 2662) | typedef TPM_RC (PolicyPhysicalPresence_Entry)(
type PolicyPhysicalPresence_COMMAND_DESCRIPTOR_t (line 2665) | typedef const struct {
type TPM_RC (line 2688) | typedef TPM_RC (PolicyCpHash_Entry)(
type PolicyCpHash_COMMAND_DESCRIPTOR_t (line 2691) | typedef const struct {
type TPM_RC (line 2716) | typedef TPM_RC (PolicyNameHash_Entry)(
type PolicyNameHash_COMMAND_DESCRIPTOR_t (line 2719) | typedef const struct {
type TPM_RC (line 2744) | typedef TPM_RC (PolicyDuplicationSelect_Entry)(
type PolicyDuplicationSelect_COMMAND_DESCRIPTOR_t (line 2747) | typedef const struct {
type TPM_RC (line 2776) | typedef TPM_RC (PolicyAuthorize_Entry)(
type PolicyAuthorize_COMMAND_DESCRIPTOR_t (line 2779) | typedef const struct {
type TPM_RC (line 2810) | typedef TPM_RC (PolicyAuthValue_Entry)(
type PolicyAuthValue_COMMAND_DESCRIPTOR_t (line 2813) | typedef const struct {
type TPM_RC (line 2836) | typedef TPM_RC (PolicyPassword_Entry)(
type PolicyPassword_COMMAND_DESCRIPTOR_t (line 2839) | typedef const struct {
type TPM_RC (line 2862) | typedef TPM_RC (PolicyGetDigest_Entry)(
type PolicyGetDigest_COMMAND_DESCRIPTOR_t (line 2866) | typedef const struct {
type TPM_RC (line 2890) | typedef TPM_RC (PolicyNvWritten_Entry)(
type PolicyNvWritten_COMMAND_DESCRIPTOR_t (line 2893) | typedef const struct {
type TPM_RC (line 2918) | typedef TPM_RC (PolicyTemplate_Entry)(
type PolicyTemplate_COMMAND_DESCRIPTOR_t (line 2921) | typedef const struct {
type TPM_RC (line 2946) | typedef TPM_RC (PolicyAuthorizeNV_Entry)(
type PolicyAuthorizeNV_COMMAND_DESCRIPTOR_t (line 2949) | typedef const struct {
type TPM_RC (line 2978) | typedef TPM_RC (PolicyCapability_Entry)(
type PolicyCapability_COMMAND_DESCRIPTOR_t (line 2982) | typedef const struct
type TPM_RC (line 3020) | typedef TPM_RC (PolicyParameters_Entry)(
type PolicyParameters_COMMAND_DESCRIPTOR_t (line 3025) | typedef const struct
type TPM_RC (line 3054) | typedef TPM_RC (CreatePrimary_Entry)(
type CreatePrimary_COMMAND_DESCRIPTOR_t (line 3058) | typedef const struct {
type TPM_RC (line 3100) | typedef TPM_RC (HierarchyControl_Entry)(
type HierarchyControl_COMMAND_DESCRIPTOR_t (line 3103) | typedef const struct {
type TPM_RC (line 3130) | typedef TPM_RC (SetPrimaryPolicy_Entry)(
type SetPrimaryPolicy_COMMAND_DESCRIPTOR_t (line 3133) | typedef const struct {
type TPM_RC (line 3160) | typedef TPM_RC (ChangePPS_Entry)(
type ChangePPS_COMMAND_DESCRIPTOR_t (line 3163) | typedef const struct {
type TPM_RC (line 3186) | typedef TPM_RC (ChangeEPS_Entry)(
type ChangeEPS_COMMAND_DESCRIPTOR_t (line 3189) | typedef const struct {
type TPM_RC (line 3212) | typedef TPM_RC (Clear_Entry)(
type Clear_COMMAND_DESCRIPTOR_t (line 3215) | typedef const struct {
type TPM_RC (line 3238) | typedef TPM_RC (ClearControl_Entry)(
type ClearControl_COMMAND_DESCRIPTOR_t (line 3241) | typedef const struct {
type TPM_RC (line 3266) | typedef TPM_RC (HierarchyChangeAuth_Entry)(
type HierarchyChangeAuth_COMMAND_DESCRIPTOR_t (line 3269) | typedef const struct {
type TPM_RC (line 3294) | typedef TPM_RC (DictionaryAttackLockReset_Entry)(
type DictionaryAttackLockReset_COMMAND_DESCRIPTOR_t (line 3297) | typedef const struct {
type TPM_RC (line 3320) | typedef TPM_RC (DictionaryAttackParameters_Entry)(
type DictionaryAttackParameters_COMMAND_DESCRIPTOR_t (line 3323) | typedef const struct {
type TPM_RC (line 3352) | typedef TPM_RC (PP_Commands_Entry)(
type PP_Commands_COMMAND_DESCRIPTOR_t (line 3355) | typedef const struct {
type TPM_RC (line 3382) | typedef TPM_RC (SetAlgorithmSet_Entry)(
type SetAlgorithmSet_COMMAND_DESCRIPTOR_t (line 3385) | typedef const struct {
type TPM_RC (line 3410) | typedef TPM_RC (FieldUpgradeStart_Entry)(
type FieldUpgradeStart_COMMAND_DESCRIPTOR_t (line 3413) | typedef const struct {
type TPM_RC (line 3442) | typedef TPM_RC (FieldUpgradeData_Entry)(
type FieldUpgradeData_COMMAND_DESCRIPTOR_t (line 3446) | typedef const struct {
type TPM_RC (line 3472) | typedef TPM_RC (FirmwareRead_Entry)(
type FirmwareRead_COMMAND_DESCRIPTOR_t (line 3476) | typedef const struct {
type TPM_RC (line 3500) | typedef TPM_RC (ContextSave_Entry)(
type ContextSave_COMMAND_DESCRIPTOR_t (line 3504) | typedef const struct {
type TPM_RC (line 3528) | typedef TPM_RC (ContextLoad_Entry)(
type ContextLoad_COMMAND_DESCRIPTOR_t (line 3532) | typedef const struct {
type TPM_RC (line 3556) | typedef TPM_RC (FlushContext_Entry)(
type FlushContext_COMMAND_DESCRIPTOR_t (line 3559) | typedef const struct {
type TPM_RC (line 3582) | typedef TPM_RC (EvictControl_Entry)(
type EvictControl_COMMAND_DESCRIPTOR_t (line 3585) | typedef const struct {
type TPM_RC (line 3612) | typedef TPM_RC (ReadClock_Entry)(
type ReadClock_COMMAND_DESCRIPTOR_t (line 3615) | typedef const struct {
type TPM_RC (line 3638) | typedef TPM_RC (ClockSet_Entry)(
type ClockSet_COMMAND_DESCRIPTOR_t (line 3641) | typedef const struct {
type TPM_RC (line 3666) | typedef TPM_RC (ClockRateAdjust_Entry)(
type ClockRateAdjust_COMMAND_DESCRIPTOR_t (line 3669) | typedef const struct {
type TPM_RC (line 3694) | typedef TPM_RC (GetCapability_Entry)(
type GetCapability_COMMAND_DESCRIPTOR_t (line 3698) | typedef const struct {
type TPM_RC (line 3728) | typedef TPM_RC (TestParms_Entry)(
type TestParms_COMMAND_DESCRIPTOR_t (line 3731) | typedef const struct {
type TPM_RC (line 3754) | typedef TPM_RC (NV_DefineSpace_Entry)(
type NV_DefineSpace_COMMAND_DESCRIPTOR_t (line 3757) | typedef const struct {
type TPM_RC (line 3784) | typedef TPM_RC (NV_UndefineSpace_Entry)(
type NV_UndefineSpace_COMMAND_DESCRIPTOR_t (line 3787) | typedef const struct {
type TPM_RC (line 3812) | typedef TPM_RC (NV_UndefineSpaceSpecial_Entry)(
type NV_UndefineSpaceSpecial_COMMAND_DESCRIPTOR_t (line 3815) | typedef const struct {
type TPM_RC (line 3840) | typedef TPM_RC (NV_ReadPublic_Entry)(
type NV_ReadPublic_COMMAND_DESCRIPTOR_t (line 3844) | typedef const struct {
type TPM_RC (line 3870) | typedef TPM_RC (NV_Write_Entry)(
type NV_Write_COMMAND_DESCRIPTOR_t (line 3873) | typedef const struct {
type TPM_RC (line 3902) | typedef TPM_RC (NV_Increment_Entry)(
type NV_Increment_COMMAND_DESCRIPTOR_t (line 3905) | typedef const struct {
type TPM_RC (line 3930) | typedef TPM_RC (NV_Extend_Entry)(
type NV_Extend_COMMAND_DESCRIPTOR_t (line 3933) | typedef const struct {
type TPM_RC (line 3960) | typedef TPM_RC (NV_SetBits_Entry)(
type NV_SetBits_COMMAND_DESCRIPTOR_t (line 3963) | typedef const struct {
type TPM_RC (line 3990) | typedef TPM_RC (NV_WriteLock_Entry)(
type NV_WriteLock_COMMAND_DESCRIPTOR_t (line 3993) | typedef const struct {
type TPM_RC (line 4018) | typedef TPM_RC (NV_GlobalWriteLock_Entry)(
type NV_GlobalWriteLock_COMMAND_DESCRIPTOR_t (line 4021) | typedef const struct {
type TPM_RC (line 4044) | typedef TPM_RC (NV_Read_Entry)(
type NV_Read_COMMAND_DESCRIPTOR_t (line 4048) | typedef const struct {
type TPM_RC (line 4078) | typedef TPM_RC (NV_ReadLock_Entry)(
type NV_ReadLock_COMMAND_DESCRIPTOR_t (line 4081) | typedef const struct {
type TPM_RC (line 4106) | typedef TPM_RC (NV_ChangeAuth_Entry)(
type NV_ChangeAuth_COMMAND_DESCRIPTOR_t (line 4109) | typedef const struct {
type TPM_RC (line 4134) | typedef TPM_RC (NV_Certify_Entry)(
type NV_Certify_COMMAND_DESCRIPTOR_t (line 4138) | typedef const struct {
type TPM_RC (line 4178) | typedef TPM_RC (NV_DefineSpace2_Entry)(
type NV_DefineSpace2_COMMAND_DESCRIPTOR_t (line 4182) | typedef const struct
type TPM_RC (line 4214) | typedef TPM_RC (NV_ReadPublic2_Entry)(
type NV_ReadPublic2_COMMAND_DESCRIPTOR_t (line 4220) | typedef const struct
type TPM_RC (line 4251) | typedef TPM_RC (SetCapability_Entry)(
type SetCapability_COMMAND_DESCRIPTOR_t (line 4255) | typedef const struct
type TPM_RC (line 4284) | typedef TPM_RC (AC_GetCapability_Entry)(
type AC_GetCapability_COMMAND_DESCRIPTOR_t (line 4288) | typedef const struct {
type TPM_RC (line 4319) | typedef TPM_RC (AC_Send_Entry)(
type AC_Send_COMMAND_DESCRIPTOR_t (line 4323) | typedef const struct {
type TPM_RC (line 4354) | typedef TPM_RC (Policy_AC_SendSelect_Entry)(
type Policy_AC_SendSelect_COMMAND_DESCRIPTOR_t (line 4357) | typedef const struct {
type TPM_RC (line 4389) | typedef TPM_RC (ACT_SetTimeout_Entry)(
type ACT_SetTimeout_COMMAND_DESCRIPTOR_t (line 4392) | typedef const struct {
type TPM_RC (line 4418) | typedef TPM_RC (Vendor_TCG_Test_Entry)(
type Vendor_TCG_Test_COMMAND_DESCRIPTOR_t (line 4422) | typedef const struct {
type TPM_RC (line 4447) | typedef TPM_RC (NTC2_PreConfig_Entry) (
type NTC2_PreConfig_COMMAND_DESCRIPTOR_t (line 4451) | typedef const struct {
type TPM_RC (line 4472) | typedef TPM_RC (NTC2_LockPreConfig_Entry) ();
type NTC2_LockPreConfig_COMMAND_DESCRIPTOR_t (line 4474) | typedef const struct {
type TPM_RC (line 4494) | typedef TPM_RC (NTC2_GetConfig_Entry) (
type NTC2_GetConfig_COMMAND_DESCRIPTOR_t (line 4497) | typedef const struct {
FILE: ftpm-opensbi/include/ftpm/Commit_fp.h
type Commit_In (line 67) | typedef struct {
type Commit_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/CompilerDependencies.h
type SOCKET (line 100) | typedef int SOCKET;
FILE: ftpm-opensbi/include/ftpm/ContextLoad_fp.h
type ContextLoad_In (line 67) | typedef struct {
type ContextLoad_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ContextSave_fp.h
type ContextSave_In (line 67) | typedef struct {
type ContextSave_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/CreateLoaded_fp.h
type CreateLoaded_In (line 67) | typedef struct {
type CreateLoaded_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/CreatePrimary_fp.h
type CreatePrimary_In (line 67) | typedef struct {
type CreatePrimary_Out (line 81) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Create_fp.h
type Create_In (line 67) | typedef struct {
type Create_Out (line 81) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/CryptEcc.h
type TPM_ECC_CURVE_METADATA (line 108) | typedef struct TPM_ECC_CURVE_METADATA
FILE: ftpm-opensbi/include/ftpm/CryptHash.h
type UINT16 (line 82) | typedef UINT16(* SMAC_END_METHOD)(
type SMAC_METHODS (line 87) | typedef struct sequenceMethods {
type tpmCmacState_t (line 95) | typedef struct tpmCmacState {
type SMAC_STATES (line 103) | typedef union SMAC_STATES {
type SMAC_STATE (line 110) | typedef struct SMAC_STATE {
type ANY_HASH_STATE (line 169) | typedef union
type ANY_HASH_STATE (line 184) | typedef ANY_HASH_STATE *PANY_HASH_STATE;
type ANY_HASH_STATE (line 185) | typedef const ANY_HASH_STATE *PCANY_HASH_STATE;
type ANY_HASH_STATE (line 195) | typedef ANY_HASH_STATE ALIGNED_HASH_STATE;
type HASH_START_METHOD_DEF (line 219) | typedef HASH_START_METHOD_DEF;
type HASH_DATA_METHOD_DEF (line 220) | typedef HASH_DATA_METHOD_DEF;
type HASH_END_METHOD_DEF (line 221) | typedef HASH_END_METHOD_DEF;
type HASH_STATE_COPY_METHOD_DEF (line 222) | typedef HASH_STATE_COPY_METHOD_DEF;
type HASH_STATE_EXPORT_METHOD_DEF (line 223) | typedef HASH_STATE_EXPORT_METHOD_DEF;
type HASH_STATE_IMPORT_METHOD_DEF (line 224) | typedef HASH_STATE_IMPORT_METHOD_DEF;
type HASH_METHODS (line 225) | typedef struct _HASH_METHODS
type HASH_DEF (line 261) | typedef const struct
type BYTE (line 295) | typedef BYTE HASH_STATE_TYPE;
type HASH_STATE (line 312) | typedef struct _HASH_STATE
type HASH_STATE (line 319) | typedef const HASH_STATE *PCHASH_STATE;
type HMAC_STATE (line 330) | typedef struct hmacState
type EXPORT_HASH_STATE (line 337) | typedef struct
type EXPORT_HASH_STATE (line 341) | typedef const EXPORT_HASH_STATE *PCEXPORT_HASH_STATE;
FILE: ftpm-opensbi/include/ftpm/CryptRand.h
type DRBG_KEY (line 113) | typedef union
type DRBG_IV (line 119) | typedef union
type DRBG_SEED (line 125) | typedef union
type DRBG_STATE (line 158) | typedef struct
type KDF_STATE (line 168) | typedef struct KDF_STATE
type RAND_STATE (line 185) | typedef union
FILE: ftpm-opensbi/include/ftpm/CryptRsa.h
type privateExponent (line 85) | typedef struct privateExponent
FILE: ftpm-opensbi/include/ftpm/CryptSym.h
type tpmCryptKeySchedule_t (line 94) | typedef union tpmCryptKeySchedule_t
FILE: ftpm-opensbi/include/ftpm/CryptTest.h
type BYTE (line 71) | typedef BYTE ALGORITHM_VECTOR[ALGORITHM_VECTOR_BYTES];
type CRYPTO_SELF_TEST_STATE (line 82) | typedef struct
FILE: ftpm-opensbi/include/ftpm/DictionaryAttackLockReset_fp.h
type DictionaryAttackLockReset_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/DictionaryAttackParameters_fp.h
type DictionaryAttackParameters_In (line 68) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Duplicate_fp.h
type Duplicate_In (line 67) | typedef struct {
type Duplicate_Out (line 74) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ECC_Decrypt_fp.h
type ECC_Decrypt_In (line 66) | typedef struct {
type ECC_Decrypt_Out (line 80) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ECC_Encrypt_fp.h
type ECC_Encrypt_In (line 65) | typedef struct {
type ECC_Encrypt_Out (line 75) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ECC_Parameters_fp.h
type ECC_Parameters_In (line 67) | typedef struct {
type ECC_Parameters_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ECDH_KeyGen_fp.h
type ECDH_KeyGen_In (line 67) | typedef struct {
type ECDH_KeyGen_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ECDH_ZGen_fp.h
type ECDH_ZGen_In (line 67) | typedef struct {
type ECDH_ZGen_Out (line 75) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/EC_Ephemeral_fp.h
type EC_Ephemeral_In (line 67) | typedef struct {
type EC_Ephemeral_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/EncryptDecrypt2_fp.h
type EncryptDecrypt2_In (line 67) | typedef struct {
type EncryptDecrypt2_Out (line 81) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/EncryptDecrypt_fp.h
type EncryptDecrypt_In (line 67) | typedef struct {
type EncryptDecrypt_Out (line 81) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/EventSequenceComplete_fp.h
type EventSequenceComplete_In (line 67) | typedef struct {
type EventSequenceComplete_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/EvictControl_fp.h
type EvictControl_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/FlushContext_fp.h
type FlushContext_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/GetCapability_fp.h
type GetCapability_In (line 67) | typedef struct {
type GetCapability_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/GetCommandAuditDigest_fp.h
type GetCommandAuditDigest_In (line 67) | typedef struct {
type GetCommandAuditDigest_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/GetRandom_fp.h
type GetRandom_In (line 67) | typedef struct {
type GetRandom_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/GetSessionAuditDigest_fp.h
type GetSessionAuditDigest_In (line 67) | typedef struct {
type GetSessionAuditDigest_Out (line 81) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/GetTestResult_fp.h
type GetTestResult_Out (line 67) | typedef struct{
FILE: ftpm-opensbi/include/ftpm/GetTime_fp.h
type GetTime_In (line 67) | typedef struct {
type GetTime_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Global.h
type BYTE (line 115) | typedef BYTE AUTH_VALUE[sizeof(TPMU_HA)];
type BYTE (line 118) | typedef BYTE TIME_INFO[sizeof(TPMS_TIME_INFO)];
type BYTE (line 121) | typedef BYTE NAME[sizeof(TPMU_NAME)];
type UINT64 (line 135) | typedef UINT64 CLOCK_NONCE;
type UINT32 (line 137) | typedef UINT32 CLOCK_NONCE;
type OBJECT_ATTRIBUTES (line 154) | typedef struct
type OBJECT (line 215) | typedef struct OBJECT
type HASH_OBJECT (line 247) | typedef struct HASH_OBJECT
type BYTE (line 263) | typedef BYTE HASH_OBJECT_BUFFER[sizeof(HASH_OBJECT)];
type ANY_OBJECT (line 268) | typedef union ANY_OBJECT
type BYTE (line 274) | typedef BYTE ANY_OBJECT_BUFFER[sizeof(ANY_OBJECT)];
type UINT32 (line 279) | typedef UINT32 AUTH_ROLE;
type SESSION_ATTRIBUTES (line 295) | typedef struct SESSION_ATTRIBUTES
type SESSION (line 360) | typedef struct SESSION
type BYTE (line 411) | typedef BYTE SESSION_BUF[sizeof(SESSION)];
type PCR_SAVE (line 424) | typedef struct PCR_SAVE
type PCR_POLICY (line 439) | typedef struct PCR_POLICY
type PCR_AUTHVALUE (line 450) | typedef struct PCR_AUTH_VALUE
type STARTUP_TYPE (line 458) | typedef enum
type NV_INDEX (line 475) | typedef struct NV_INDEX
type UINT32 (line 487) | typedef UINT32 NV_REF;
type BYTE (line 489) | typedef BYTE* NV_RAM_REF;
type PIN_DATA (line 499) | typedef struct
type PIN_DATA (line 505) | typedef struct
type NV_PIN (line 512) | typedef union
type BYTE (line 648) | typedef BYTE UPDATE_TYPE;
type PERSISTENT_DATA (line 719) | typedef struct
type ORDERLY_DATA (line 880) | typedef struct orderly_data
type STATE_CLEAR_DATA (line 951) | typedef struct state_clear_data
type STATE_RESET_DATA (line 1001) | typedef struct state_reset_data
type UINT16 (line 1130) | typedef UINT16 COMMAND_INDEX;
type COMMAND_FLAGS (line 1133) | typedef struct _COMMAND_FLAGS_
type COMMAND (line 1151) | typedef struct COMMAND
type SESSION_SLOT (line 1349) | typedef struct
FILE: ftpm-opensbi/include/ftpm/HMAC_Start_fp.h
type HMAC_Start_In (line 67) | typedef struct {
type HMAC_Start_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/HMAC_fp.h
type HMAC_In (line 67) | typedef struct {
type HMAC_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/HashSequenceStart_fp.h
type HashSequenceStart_In (line 67) | typedef struct {
type HashSequenceStart_Out (line 75) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Hash_fp.h
type Hash_In (line 67) | typedef struct {
type Hash_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/HierarchyChangeAuth_fp.h
type HierarchyChangeAuth_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/HierarchyControl_fp.h
type HierarchyControl_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Import_fp.h
type Import_In (line 67) | typedef struct {
type Import_Out (line 83) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/IncrementalSelfTest_fp.h
type IncrementalSelfTest_In (line 67) | typedef struct{
type IncrementalSelfTest_Out (line 71) | typedef struct{
FILE: ftpm-opensbi/include/ftpm/LoadExternal_fp.h
type LoadExternal_In (line 67) | typedef struct {
type LoadExternal_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Load_fp.h
type Load_In (line 67) | typedef struct {
type Load_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/MAC_Start_fp.h
type MAC_Start_In (line 67) | typedef struct {
type MAC_Start_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/MAC_fp.h
type MAC_In (line 67) | typedef struct {
type MAC_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/MakeCredential_fp.h
type MakeCredential_In (line 67) | typedef struct {
type MakeCredential_Out (line 78) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/MathLibraryInterfaceTypes.h
type Crypt_Int (line 84) | typedef CRYPT_INT_BUF(one, 1) Crypt_Int;
type Crypt_Point (line 85) | typedef CRYPT_POINT_BUF(pointone, 1) Crypt_Point;
type Crypt_EccCurve (line 86) | typedef CRYPT_CURVE_BUF(curvebuft, MAX_ECC_KEY_BITS) Crypt_EccCurve;
FILE: ftpm-opensbi/include/ftpm/NV.h
type NV_ENTRY_HEADER (line 103) | typedef struct {
type NV_RAM_HEADER (line 113) | typedef struct {
type UINT32 (line 122) | typedef UINT32 NV_LIST_TERMINATOR[3];
FILE: ftpm-opensbi/include/ftpm/NV_Certify_fp.h
type NV_Certify_In (line 67) | typedef struct {
type NV_Certify_Out (line 86) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_ChangeAuth_fp.h
type NV_ChangeAuth_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_DefineSpace2_fp.h
type NV_DefineSpace2_In (line 66) | typedef struct
FILE: ftpm-opensbi/include/ftpm/NV_DefineSpace_fp.h
type NV_DefineSpace_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_Extend_fp.h
type NV_Extend_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_GlobalWriteLock_fp.h
type NV_GlobalWriteLock_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_Increment_fp.h
type NV_Increment_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_ReadLock_fp.h
type NV_ReadLock_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_ReadPublic2_fp.h
type NV_ReadPublic2_In (line 64) | typedef struct
type NV_ReadPublic2_Out (line 69) | typedef struct
FILE: ftpm-opensbi/include/ftpm/NV_ReadPublic_fp.h
type NV_ReadPublic_In (line 67) | typedef struct {
type NV_ReadPublic_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_Read_fp.h
type NV_Read_In (line 67) | typedef struct {
type NV_Read_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_SetBits_fp.h
type NV_SetBits_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_UndefineSpaceSpecial_fp.h
type NV_UndefineSpaceSpecial_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_UndefineSpace_fp.h
type NV_UndefineSpace_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_WriteLock_fp.h
type NV_WriteLock_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/NV_Write_fp.h
type NV_Write_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ObjectChangeAuth_fp.h
type ObjectChangeAuth_In (line 67) | typedef struct {
type ObjectChangeAuth_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PCR_Allocate_fp.h
type PCR_Allocate_In (line 67) | typedef struct {
type PCR_Allocate_Out (line 75) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PCR_Event_fp.h
type PCR_Event_In (line 67) | typedef struct {
type PCR_Event_Out (line 75) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PCR_Extend_fp.h
type PCR_Extend_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PCR_Read_fp.h
type PCR_Read_In (line 67) | typedef struct {
type PCR_Read_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PCR_Reset_fp.h
type PCR_Reset_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PCR_SetAuthPolicy_fp.h
type PCR_SetAuthPolicy_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PCR_SetAuthValue_fp.h
type PCR_SetAuthValue_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PP_Commands_fp.h
type PP_Commands_In (line 65) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PlatformACT.h
type ACT_DATA (line 70) | typedef struct ACT_DATA
FILE: ftpm-opensbi/include/ftpm/PlatformData.h
type clock64_t (line 79) | typedef uint64_t clock64_t;
FILE: ftpm-opensbi/include/ftpm/PolicyAuthValue_fp.h
type PolicyAuthValue_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyAuthorizeNV_fp.h
type PolicyAuthorizeNV_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyAuthorize_fp.h
type PolicyAuthorize_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyCapability_fp.h
type PolicyCapability_In (line 66) | typedef struct
FILE: ftpm-opensbi/include/ftpm/PolicyCommandCode_fp.h
type PolicyCommandCode_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyCounterTimer_fp.h
type PolicyCounterTimer_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyCpHash_fp.h
type PolicyCpHash_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyDuplicationSelect_fp.h
type PolicyDuplicationSelect_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyGetDigest_fp.h
type PolicyGetDigest_In (line 67) | typedef struct {
type PolicyGetDigest_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyLocality_fp.h
type PolicyLocality_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyNV_fp.h
type PolicyNV_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyNameHash_fp.h
type PolicyNameHash_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyNvWritten_fp.h
type PolicyNvWritten_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyOR_fp.h
type PolicyOR_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyPCR_fp.h
type PolicyPCR_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyParameters_fp.h
type PolicyParameters_In (line 66) | typedef struct
FILE: ftpm-opensbi/include/ftpm/PolicyPassword_fp.h
type PolicyPassword_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyPhysicalPresence_fp.h
type PolicyPhysicalPresence_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyRestart_fp.h
type PolicyRestart_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicySecret_fp.h
type PolicySecret_In (line 67) | typedef struct {
type PolicySecret_Out (line 83) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicySigned_fp.h
type PolicySigned_In (line 67) | typedef struct {
type PolicySigned_Out (line 85) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyTemplate_fp.h
type PolicyTemplate_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/PolicyTicket_fp.h
type PolicyTicket_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Quote_fp.h
type Quote_In (line 67) | typedef struct {
type Quote_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/RSA_Decrypt_fp.h
type RSA_Decrypt_In (line 67) | typedef struct {
type RSA_Decrypt_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/RSA_Encrypt_fp.h
type RSA_Encrypt_In (line 67) | typedef struct {
type RSA_Encrypt_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/RTPM.h
type rtpm_cmd (line 5) | struct rtpm_cmd {
type rtpm_cmd (line 11) | struct rtpm_cmd
FILE: ftpm-opensbi/include/ftpm/ReadClock_fp.h
type ReadClock_Out (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ReadPublic_fp.h
type ReadPublic_In (line 67) | typedef struct {
type ReadPublic_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Rewrap_fp.h
type Rewrap_In (line 67) | typedef struct {
type Rewrap_Out (line 81) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/RsaTestData.h
type TPM2B_RSA_TEST_KEY (line 69) | typedef struct
type TPM2B_RSA_TEST_KEY (line 74) | typedef TPM2B_RSA_TEST_KEY TPM2B_RSA_TEST_VALUE;
type TPM2B_RSA_TEST_PRIME (line 75) | typedef struct
FILE: ftpm-opensbi/include/ftpm/SelfTest.h
type UINT32 (line 79) | typedef UINT32 SYM_INDEX;
type BYTE (line 92) | typedef BYTE SYM_MODES;
type UINT16 (line 94) | typedef UINT16 SYM_MODES;
type UINT32 (line 96) | typedef UINT32 SYM_MODES;
type SYMMETRIC_TEST_VECTOR (line 101) | typedef struct SYMMETRIC_TEST_VECTOR
FILE: ftpm-opensbi/include/ftpm/SelfTest_fp.h
type SelfTest_In (line 67) | typedef struct{
FILE: ftpm-opensbi/include/ftpm/SequenceComplete_fp.h
type SequenceComplete_In (line 67) | typedef struct {
type SequenceComplete_Out (line 78) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/SequenceUpdate_fp.h
type SequenceUpdate_In (line 68) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/SetAlgorithmSet_fp.h
type SetAlgorithmSet_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/SetCapability_fp.h
type SetCapability_In (line 67) | typedef struct
FILE: ftpm-opensbi/include/ftpm/SetCommandCodeAuditStatus_fp.h
type SetCommandCodeAuditStatus_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/SetPrimaryPolicy_fp.h
type SetPrimaryPolicy_In (line 65) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Shutdown_fp.h
type Shutdown_In (line 67) | typedef struct{
FILE: ftpm-opensbi/include/ftpm/Sign_fp.h
type Sign_In (line 67) | typedef struct {
type Sign_Out (line 79) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/StartAuthSession_fp.h
type StartAuthSession_In (line 67) | typedef struct {
type StartAuthSession_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Startup_fp.h
type Startup_In (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/StirRandom_fp.h
type StirRandom_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/TPMB.h
type UINT16 (line 72) | typedef UINT16 NUMBYTES;
type TPM2B (line 75) | typedef struct
type TPM2B (line 80) | typedef const TPM2B* PC2B;
FILE: ftpm-opensbi/include/ftpm/TableMarshal.h
type integerModifier (line 112) | typedef struct integerModifier
type valuesModifier (line 120) | typedef struct valuesModifier
type tableModifier (line 129) | typedef struct tableModifier
type minMaxModifier (line 139) | typedef struct minMaxModifier
type attributesModifier (line 149) | typedef struct attributesModifier
type tpm2bsModifier (line 159) | typedef struct tpm2bsModifier
type listModifier (line 168) | typedef struct listModifier
FILE: ftpm-opensbi/include/ftpm/TableMarshalTypes.h
type UINT16 (line 70) | typedef UINT16 marshalIndex_t;
type simpleStructureEntry_t (line 86) | typedef struct simpleStructureEntry_t {
type UintMarshal_mst (line 94) | typedef const struct UintMarshal_mst
type UnionMarshal_mst (line 100) | typedef struct UnionMarshal_mst
type NullUnionMarshal_mst (line 111) | typedef struct NullUnionMarshal_mst
type MarshalHeader_mst (line 116) | typedef struct MarshalHeader_mst
type ArrayMarshal_mst (line 123) | typedef const struct ArrayMarshal_mst // used in a structure
type StructMarshal_mst (line 129) | typedef const struct StructMarshal_mst
type ValuesMarshal_mst (line 136) | typedef const struct ValuesMarshal_mst
type TableMarshal_mst (line 146) | typedef const struct TableMarshal_mst
type MinMaxMarshal_mst (line 155) | typedef const struct MinMaxMarshal_mst
type Tpm2bMarshal_mst (line 163) | typedef const struct Tpm2bMarshal_mst
type Tpm2bsMarshal_mst (line 169) | typedef const struct Tpm2bsMarshal_mst
type ListMarshal_mst (line 177) | typedef const struct ListMarshal_mst
type AttributesMarshal_mst (line 187) | typedef const struct AttributesMarshal_mst
type CompositeMarshal_mst (line 194) | typedef const struct CompositeMarshal_mst
type TPM_ECC_CURVE_mst (line 201) | typedef const struct TPM_ECC_CURVE_mst {
type TPM_CLOCK_ADJUST_mst (line 208) | typedef const struct TPM_CLOCK_ADJUST_mst {
type TPM_EO_mst (line 215) | typedef const struct TPM_EO_mst {
type TPM_SU_mst (line 222) | typedef const struct TPM_SU_mst {
type TPM_SE_mst (line 230) | typedef const struct TPM_SE_mst {
type TPM_CAP_mst (line 238) | typedef const struct TPM_CAP_mst {
type TPMI_YES_NO_mst (line 247) | typedef const struct TPMI_YES_NO_mst {
type TPMI_DH_OBJECT_mst (line 255) | typedef const struct TPMI_DH_OBJECT_mst {
type TPMI_DH_PARENT_mst (line 264) | typedef const struct TPMI_DH_PARENT_mst {
type TPMI_DH_PERSISTENT_mst (line 273) | typedef const struct TPMI_DH_PERSISTENT_mst {
type TPMI_DH_ENTITY_mst (line 280) | typedef const struct TPMI_DH_ENTITY_mst {
type TPMI_DH_PCR_mst (line 289) | typedef const struct TPMI_DH_PCR_mst {
type TPMI_SH_AUTH_SESSION_mst (line 296) | typedef const struct TPMI_SH_AUTH_SESSION_mst {
type TPMI_SH_HMAC_mst (line 305) | typedef const struct TPMI_SH_HMAC_mst {
type TPMI_SH_POLICY_mst (line 312) | typedef const struct TPMI_SH_POLICY_mst {
type TPMI_DH_CONTEXT_mst (line 319) | typedef const struct TPMI_DH_CONTEXT_mst {
type TPMI_DH_SAVED_mst (line 328) | typedef const struct TPMI_DH_SAVED_mst {
type TPMI_RH_HIERARCHY_mst (line 337) | typedef const struct TPMI_RH_HIERARCHY_mst {
type TPMI_RH_ENABLES_mst (line 346) | typedef const struct TPMI_RH_ENABLES_mst {
type TPMI_RH_HIERARCHY_AUTH_mst (line 354) | typedef const struct TPMI_RH_HIERARCHY_AUTH_mst {
type TPMI_RH_HIERARCHY_POLICY_mst (line 362) | typedef const struct TPMI_RH_HIERARCHY_POLICY_mst {
type TPMI_RH_BASE_HIERARCHY_mst (line 371) | typedef const struct TPMI_RH_BASE_HIERARCHY_mst {
type TPMI_RH_PLATFORM_mst (line 379) | typedef const struct TPMI_RH_PLATFORM_mst {
type TPMI_RH_OWNER_mst (line 387) | typedef const struct TPMI_RH_OWNER_mst {
type TPMI_RH_ENDORSEMENT_mst (line 395) | typedef const struct TPMI_RH_ENDORSEMENT_mst {
type TPMI_RH_PROVISION_mst (line 403) | typedef const struct TPMI_RH_PROVISION_mst {
type TPMI_RH_CLEAR_mst (line 411) | typedef const struct TPMI_RH_CLEAR_mst {
type TPMI_RH_NV_AUTH_mst (line 419) | typedef const struct TPMI_RH_NV_AUTH_mst {
type TPMI_RH_LOCKOUT_mst (line 428) | typedef const struct TPMI_RH_LOCKOUT_mst {
type TPMI_RH_NV_INDEX_mst (line 436) | typedef const struct TPMI_RH_NV_INDEX_mst {
type TPMI_RH_AC_mst (line 443) | typedef const struct TPMI_RH_AC_mst {
type TPMI_RH_ACT_mst (line 450) | typedef const struct TPMI_RH_ACT_mst {
type TPMI_ALG_HASH_mst (line 457) | typedef const struct TPMI_ALG_HASH_mst {
type TPMI_ALG_ASYM_mst (line 464) | typedef const struct TPMI_ALG_ASYM_mst {
type TPMI_ALG_SYM_mst (line 471) | typedef const struct TPMI_ALG_SYM_mst {
type TPMI_ALG_SYM_OBJECT_mst (line 478) | typedef const struct TPMI_ALG_SYM_OBJECT_mst {
type TPMI_ALG_SYM_MODE_mst (line 485) | typedef const struct TPMI_ALG_SYM_MODE_mst {
type TPMI_ALG_KDF_mst (line 492) | typedef const struct TPMI_ALG_KDF_mst {
type TPMI_ALG_SIG_SCHEME_mst (line 499) | typedef const struct TPMI_ALG_SIG_SCHEME_mst {
type TPMI_ECC_KEY_EXCHANGE_mst (line 506) | typedef const struct TPMI_ECC_KEY_EXCHANGE_mst {
type TPMI_ST_COMMAND_TAG_mst (line 513) | typedef const struct TPMI_ST_COMMAND_TAG_mst {
type TPMI_ALG_MAC_SCHEME_mst (line 521) | typedef const struct TPMI_ALG_MAC_SCHEME_mst {
type TPMI_ALG_CIPHER_MODE_mst (line 528) | typedef const struct TPMI_ALG_CIPHER_MODE_mst {
type TPMS_EMPTY_mst (line 535) | typedef const struct TPMS_EMPTY_mst
type TPMS_ALGORITHM_DESCRIPTION_mst (line 542) | typedef const struct TPMS_ALGORITHM_DESCRIPTION_mst
type TPMU_HA_mst (line 549) | typedef struct TPMU_HA_mst
type TPMT_HA_mst (line 558) | typedef const struct TPMT_HA_mst
type TPMS_PCR_SELECT_mst (line 565) | typedef const struct TPMS_PCR_SELECT_mst
type TPMS_PCR_SELECTION_mst (line 572) | typedef const struct TPMS_PCR_SELECTION_mst
type TPMT_TK_CREATION_mst (line 579) | typedef const struct TPMT_TK_CREATION_mst
type TPMT_TK_VERIFIED_mst (line 586) | typedef const struct TPMT_TK_VERIFIED_mst
type TPMT_TK_AUTH_mst (line 593) | typedef const struct TPMT_TK_AUTH_mst
type TPMT_TK_HASHCHECK_mst (line 600) | typedef const struct TPMT_TK_HASHCHECK_mst
type TPMS_ALG_PROPERTY_mst (line 607) | typedef const struct TPMS_ALG_PROPERTY_mst
type TPMS_TAGGED_PROPERTY_mst (line 614) | typedef const struct TPMS_TAGGED_PROPERTY_mst
type TPMS_TAGGED_PCR_SELECT_mst (line 621) | typedef const struct TPMS_TAGGED_PCR_SELECT_mst
type TPMS_TAGGED_POLICY_mst (line 628) | typedef const struct TPMS_TAGGED_POLICY_mst
type TPMS_ACT_DATA_mst (line 635) | typedef const struct TPMS_ACT_DATA_mst
type TPMU_CAPABILITIES_mst (line 642) | typedef struct TPMU_CAPABILITIES_mst
type TPMS_CAPABILITY_DATA_mst (line 651) | typedef const struct TPMS_CAPABILITY_DATA_mst
type TPMS_CLOCK_INFO_mst (line 658) | typedef const struct TPMS_CLOCK_INFO_mst
type TPMS_TIME_INFO_mst (line 665) | typedef const struct TPMS_TIME_INFO_mst
type TPMS_TIME_ATTEST_INFO_mst (line 672) | typedef const struct TPMS_TIME_ATTEST_INFO_mst
type TPMS_CERTIFY_INFO_mst (line 679) | typedef const struct TPMS_CERTIFY_INFO_mst
type TPMS_QUOTE_INFO_mst (line 686) | typedef const struct TPMS_QUOTE_INFO_mst
type TPMS_COMMAND_AUDIT_INFO_mst (line 693) | typedef const struct TPMS_COMMAND_AUDIT_INFO_mst
type TPMS_SESSION_AUDIT_INFO_mst (line 700) | typedef const struct TPMS_SESSION_AUDIT_INFO_mst
type TPMS_CREATION_INFO_mst (line 707) | typedef const struct TPMS_CREATION_INFO_mst
type TPMS_NV_CERTIFY_INFO_mst (line 714) | typedef const struct TPMS_NV_CERTIFY_INFO_mst
type TPMS_NV_DIGEST_CERTIFY_INFO_mst (line 721) | typedef const struct TPMS_NV_DIGEST_CERTIFY_INFO_mst
type TPMI_ST_ATTEST_mst (line 728) | typedef const struct TPMI_ST_ATTEST_mst {
type TPMU_ATTEST_mst (line 737) | typedef struct TPMU_ATTEST_mst
type TPMS_ATTEST_mst (line 746) | typedef const struct TPMS_ATTEST_mst
type TPMS_AUTH_COMMAND_mst (line 753) | typedef const struct TPMS_AUTH_COMMAND_mst
type TPMS_AUTH_RESPONSE_mst (line 760) | typedef const struct TPMS_AUTH_RESPONSE_mst
type TPMI_AES_KEY_BITS_mst (line 767) | typedef const struct TPMI_AES_KEY_BITS_mst {
type TPMI_SM4_KEY_BITS_mst (line 775) | typedef const struct TPMI_SM4_KEY_BITS_mst {
type TPMI_CAMELLIA_KEY_BITS_mst (line 783) | typedef const struct TPMI_CAMELLIA_KEY_BITS_mst {
type TPMU_SYM_KEY_BITS_mst (line 791) | typedef struct TPMU_SYM_KEY_BITS_mst
type TPMU_SYM_MODE_mst (line 800) | typedef struct TPMU_SYM_MODE_mst
type TPMT_SYM_DEF_mst (line 809) | typedef const struct TPMT_SYM_DEF_mst
type TPMT_SYM_DEF_OBJECT_mst (line 816) | typedef const struct TPMT_SYM_DEF_OBJECT_mst
type TPMS_SYMCIPHER_PARMS_mst (line 823) | typedef const struct TPMS_SYMCIPHER_PARMS_mst
type TPMS_DERIVE_mst (line 830) | typedef const struct TPMS_DERIVE_mst
type TPMS_SENSITIVE_CREATE_mst (line 837) | typedef const struct TPMS_SENSITIVE_CREATE_mst
type TPMS_SCHEME_HASH_mst (line 844) | typedef const struct TPMS_SCHEME_HASH_mst
type TPMS_SCHEME_ECDAA_mst (line 851) | typedef const struct TPMS_SCHEME_ECDAA_mst
type TPMI_ALG_KEYEDHASH_SCHEME_mst (line 858) | typedef const struct TPMI_ALG_KEYEDHASH_SCHEME_mst {
type TPMS_SCHEME_XOR_mst (line 865) | typedef const struct TPMS_SCHEME_XOR_mst
type TPMU_SCHEME_KEYEDHASH_mst (line 872) | typedef struct TPMU_SCHEME_KEYEDHASH_mst
type TPMT_KEYEDHASH_SCHEME_mst (line 881) | typedef const struct TPMT_KEYEDHASH_SCHEME_mst
type TPMU_SIG_SCHEME_mst (line 888) | typedef struct TPMU_SIG_SCHEME_mst
type TPMT_SIG_SCHEME_mst (line 897) | typedef const struct TPMT_SIG_SCHEME_mst
type TPMU_KDF_SCHEME_mst (line 904) | typedef struct TPMU_KDF_SCHEME_mst
type TPMT_KDF_SCHEME_mst (line 913) | typedef const struct TPMT_KDF_SCHEME_mst
type TPMI_ALG_ASYM_SCHEME_mst (line 920) | typedef const struct TPMI_ALG_ASYM_SCHEME_mst {
type TPMU_ASYM_SCHEME_mst (line 927) | typedef struct TPMU_ASYM_SCHEME_mst
type TPMI_ALG_RSA_SCHEME_mst (line 936) | typedef const struct TPMI_ALG_RSA_SCHEME_mst {
type TPMT_RSA_SCHEME_mst (line 943) | typedef const struct TPMT_RSA_SCHEME_mst
type TPMI_ALG_RSA_DECRYPT_mst (line 950) | typedef const struct TPMI_ALG_RSA_DECRYPT_mst {
type TPMT_RSA_DECRYPT_mst (line 957) | typedef const struct TPMT_RSA_DECRYPT_mst
type TPMI_RSA_KEY_BITS_mst (line 964) | typedef const struct TPMI_RSA_KEY_BITS_mst {
type TPMS_ECC_POINT_mst (line 972) | typedef const struct TPMS_ECC_POINT_mst
type TPMI_ALG_ECC_SCHEME_mst (line 979) | typedef const struct TPMI_ALG_ECC_SCHEME_mst {
type TPMI_ECC_CURVE_mst (line 986) | typedef const struct TPMI_ECC_CURVE_mst {
type TPMT_ECC_SCHEME_mst (line 993) | typedef const struct TPMT_ECC_SCHEME_mst
type TPMS_ALGORITHM_DETAIL_ECC_mst (line 1000) | typedef const struct TPMS_ALGORITHM_DETAIL_ECC_mst
type TPMS_SIGNATURE_RSA_mst (line 1007) | typedef const struct TPMS_SIGNATURE_RSA_mst
type TPMS_SIGNATURE_ECC_mst (line 1014) | typedef const struct TPMS_SIGNATURE_ECC_mst
type TPMU_SIGNATURE_mst (line 1021) | typedef struct TPMU_SIGNATURE_mst
type TPMT_SIGNATURE_mst (line 1030) | typedef const struct TPMT_SIGNATURE_mst
type TPMU_ENCRYPTED_SECRET_mst (line 1037) | typedef struct TPMU_ENCRYPTED_SECRET_mst
type TPMI_ALG_PUBLIC_mst (line 1046) | typedef const struct TPMI_ALG_PUBLIC_mst {
type TPMU_PUBLIC_ID_mst (line 1053) | typedef struct TPMU_PUBLIC_ID_mst
type TPMS_KEYEDHASH_PARMS_mst (line 1062) | typedef const struct TPMS_KEYEDHASH_PARMS_mst
type TPMS_RSA_PARMS_mst (line 1069) | typedef const struct TPMS_RSA_PARMS_mst
type TPMS_ECC_PARMS_mst (line 1076) | typedef const struct TPMS_ECC_PARMS_mst
type TPMU_PUBLIC_PARMS_mst (line 1083) | typedef struct TPMU_PUBLIC_PARMS_mst
type TPMT_PUBLIC_PARMS_mst (line 1092) | typedef const struct TPMT_PUBLIC_PARMS_mst
type TPMT_PUBLIC_mst (line 1099) | typedef const struct TPMT_PUBLIC_mst
type TPMU_SENSITIVE_COMPOSITE_mst (line 1106) | typedef struct TPMU_SENSITIVE_COMPOSITE_mst
type TPMT_SENSITIVE_mst (line 1115) | typedef const struct TPMT_SENSITIVE_mst
type TPMS_NV_PIN_COUNTER_PARAMETERS_mst (line 1122) | typedef const struct TPMS_NV_PIN_COUNTER_PARAMETERS_mst
type TPMS_NV_PUBLIC_mst (line 1129) | typedef const struct TPMS_NV_PUBLIC_mst
type TPMS_CONTEXT_DATA_mst (line 1136) | typedef const struct TPMS_CONTEXT_DATA_mst
type TPMS_CONTEXT_mst (line 1143) | typedef const struct TPMS_CONTEXT_mst
type TPMS_CREATION_DATA_mst (line 1150) | typedef const struct TPMS_CREATION_DATA_mst
type TPM_AT_mst (line 1157) | typedef const struct TPM_AT_mst {
type TPMS_AC_OUTPUT_mst (line 1165) | typedef const struct TPMS_AC_OUTPUT_mst
type Type02_mst (line 1172) | typedef const struct Type02_mst {
type Type03_mst (line 1179) | typedef const struct Type03_mst {
type Type04_mst (line 1186) | typedef const struct Type04_mst {
type Type06_mst (line 1193) | typedef const struct Type06_mst {
type Type08_mst (line 1200) | typedef const struct Type08_mst {
type Type10_mst (line 1207) | typedef const struct Type10_mst {
type Type11_mst (line 1215) | typedef const struct Type11_mst {
type Type12_mst (line 1223) | typedef const struct Type12_mst {
type Type13_mst (line 1231) | typedef const struct Type13_mst {
type Type15_mst (line 1239) | typedef const struct Type15_mst {
type Type17_mst (line 1246) | typedef const struct Type17_mst {
type Type18_mst (line 1253) | typedef const struct Type18_mst {
type Type19_mst (line 1260) | typedef const struct Type19_mst {
type Type20_mst (line 1267) | typedef const struct Type20_mst {
type Type22_mst (line 1274) | typedef const struct Type22_mst {
type Type23_mst (line 1281) | typedef const struct Type23_mst {
type Type24_mst (line 1288) | typedef const struct Type24_mst {
type Type25_mst (line 1295) | typedef const struct Type25_mst {
type Type26_mst (line 1302) | typedef const struct Type26_mst {
type Type27_mst (line 1309) | typedef const struct Type27_mst {
type Type29_mst (line 1316) | typedef const struct Type29_mst {
type Type30_mst (line 1323) | typedef const struct Type30_mst {
type Type33_mst (line 1330) | typedef const struct Type33_mst {
type Type34_mst (line 1337) | typedef const struct Type34_mst {
type Type35_mst (line 1344) | typedef const struct Type35_mst {
type Type38_mst (line 1351) | typedef const struct Type38_mst {
type Type41_mst (line 1358) | typedef const struct Type41_mst {
type Type42_mst (line 1365) | typedef const struct Type42_mst {
type Type44_mst (line 1372) | typedef const struct Type44_mst {
type MarshalData_st (line 1381) | typedef const struct MarshalData_st {
FILE: ftpm-opensbi/include/ftpm/TestParms_fp.h
type TestParms_In (line 67) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/TpmASN1.h
type ASN1UnmarshalContext (line 136) | typedef struct ASN1UnmarshalContext
type ASN1MarshalContext (line 146) | typedef struct ASN1MarshalContext
FILE: ftpm-opensbi/include/ftpm/TpmAlgorithmDefines.h
type TPM2B_MAX_HASH_BLOCK (line 397) | typedef TPM2B_MAX_HASH_BLOCK TPM2B_HASH_BLOCK;
FILE: ftpm-opensbi/include/ftpm/TpmTcpProtocol.h
type TpmEndPointInfo (line 107) | enum TpmEndPointInfo
type _IN_BUFFER (line 121) | typedef struct in_buffer
type _OUT_BUFFER (line 127) | typedef struct out_buffer
FILE: ftpm-opensbi/include/ftpm/TpmToOsslHash.h
type SM3_CTX (line 83) | typedef struct SM3state_st
type BYTE (line 120) | typedef BYTE* PBYTE;
type BYTE (line 121) | typedef const BYTE* PCBYTE;
FILE: ftpm-opensbi/include/ftpm/TpmToOsslSym.h
type SM4_KEY (line 88) | typedef struct SM4_KEY_st
type tpmCryptKeySchedule_t (line 177) | typedef union tpmCryptKeySchedule_t tpmCryptKeySchedule_t;
FILE: ftpm-opensbi/include/ftpm/TpmTypes.h
type UINT16 (line 76) | typedef UINT16 TPM_ALG_ID;
type UINT16 (line 168) | typedef UINT16 TPM_ECC_CURVE;
type UINT32 (line 181) | typedef UINT32 TPM_CC;
type UINT32 (line 319) | typedef UINT32 TPM_ALGORITHM_ID;
type UINT32 (line 321) | typedef UINT32 TPM_MODIFIER_INDICATOR;
type UINT32 (line 323) | typedef UINT32 TPM_AUTHORIZATION_SIZE;
type UINT32 (line 325) | typedef UINT32 TPM_PARAMETER_SIZE;
type UINT16 (line 327) | typedef UINT16 TPM_KEY_SIZE;
type UINT16 (line 329) | typedef UINT16 TPM_KEY_BITS;
type UINT32 (line 334) | typedef UINT32 TPM_CONSTANTS32;
type UINT32 (line 340) | typedef UINT32 TPM_RC;
type INT8 (line 500) | typedef INT8 TPM_CLOCK_ADJUST;
type UINT16 (line 511) | typedef UINT16 TPM_EO;
type UINT16 (line 527) | typedef UINT16 TPM_ST;
type UINT16 (line 549) | typedef UINT16 TPM_SU;
type UINT8 (line 555) | typedef UINT8 TPM_SE;
type UINT32 (line 562) | typedef UINT32 TPM_CAP;
type UINT32 (line 580) | typedef UINT32 TPM_PT;
type UINT32 (line 655) | typedef UINT32 TPM_PT_PCR;
type UINT32 (line 676) | typedef UINT32 TPM_PS;
type UINT32 (line 696) | typedef UINT32 TPM_HANDLE;
type UINT8 (line 700) | typedef UINT8 TPM_HT;
type TPM_HANDLE (line 716) | typedef TPM_HANDLE TPM_RH;
type TPM_HANDLE (line 748) | typedef TPM_HANDLE TPM_HC;
type TPMA_ALGORITHM (line 813) | typedef struct TPMA_ALGORITHM{
type UINT32 (line 832) | typedef UINT32 TPMA_ALGORITHM;
type TPMA_OBJECT (line 863) | typedef struct TPMA_OBJECT { // Table 2:31
type UINT32 (line 900) | typedef UINT32 TPMA_OBJECT;
type TPMA_SESSION (line 943) | typedef struct TPMA_SESSION { // Table 2:32
type UINT8 (line 960) | typedef UINT8 TPMA_SESSION;
type TPMA_LOCALITY (line 987) | typedef struct TPMA_LOCALITY { // Table 2:33
type UINT8 (line 1003) | typedef UINT8 TPMA_LOCALITY;
type TPMA_PERMANENT (line 1033) | typedef struct TPMA_PERMANENT { // Table 2:34
type UINT32 (line 1053) | typedef UINT32 TPMA_PERMANENT;
type TPMA_STARTUP_CLEAR (line 1084) | typedef struct TPMA_STARTUP_CLEAR { // Table 2:35
type UINT32 (line 1098) | typedef UINT32 TPMA_STARTUP_CLEAR;
type TPMA_MEMORY (line 1121) | typedef struct TPMA_MEMORY { // Table 2:36
type UINT32 (line 1133) | typedef UINT32 TPMA_MEMORY;
type TPMA_CC (line 1153) | typedef struct TPMA_CC { // Table 2:37
type UINT32 (line 1172) | typedef UINT32 TPMA_CC;
type TPMA_MODES (line 1202) | typedef struct TPMA_MODES { // Table 2:38
type UINT32 (line 1210) | typedef UINT32 TPMA_MODES;
type TPMA_X509_KEY_USAGE (line 1230) | typedef struct TPMA_X509_KEY_USAGE { // Table 2:39
type UINT32 (line 1254) | typedef UINT32 TPMA_X509_KEY_USAGE;
type TPMA_ACT (line 1287) | typedef struct TPMA_ACT { // Table 2:40
type UINT32 (line 1297) | typedef UINT32 TPMA_ACT;
type BYTE (line 1308) | typedef BYTE TPMI_YES_NO;
type TPM_HANDLE (line 1310) | typedef TPM_HANDLE TPMI_DH_OBJECT;
type TPM_HANDLE (line 1312) | typedef TPM_HANDLE TPMI_DH_PARENT;
type TPM_HANDLE (line 1314) | typedef TPM_HANDLE TPMI_DH_PERSISTENT;
type TPM_HANDLE (line 1316) | typedef TPM_HANDLE TPMI_DH_ENTITY;
type TPM_HANDLE (line 1318) | typedef TPM_HANDLE TPMI_DH_PCR;
type TPM_HANDLE (line 1320) | typedef TPM_HANDLE TPMI_SH_AUTH_SESSION;
type TPM_HANDLE (line 1322) | typedef TPM_HANDLE TPMI_SH_HMAC;
type TPM_HANDLE (line 1324) | typedef TPM_HANDLE TPMI_SH_POLICY;
type TPM_HANDLE (line 1326) | typedef TPM_HANDLE TPMI_DH_CONTEXT;
type TPM_HANDLE (line 1328) | typedef TPM_HANDLE TPMI_DH_SAVED;
type TPM_HANDLE (line 1330) | typedef TPM_HANDLE TPMI_RH_HIERARCHY;
type TPM_HANDLE (line 1332) | typedef TPM_HANDLE TPMI_RH_ENABLES;
type TPM_HANDLE (line 1334) | typedef TPM_HANDLE TPMI_RH_HIERARCHY_AUTH;
type TPM_HANDLE (line 1336) | typedef TPM_HANDLE TPMI_RH_HIERARCHY_POLICY;
type TPM_HANDLE (line 1338) | typedef TPM_HANDLE TPMI_RH_PLATFORM;
type TPM_HANDLE (line 1340) | typedef TPM_HANDLE TPMI_RH_OWNER;
type TPM_HANDLE (line 1342) | typedef TPM_HANDLE TPMI_RH_ENDORSEMENT;
type TPM_HANDLE (line 1344) | typedef TPM_HANDLE TPMI_RH_PROVISION;
type TPM_HANDLE (line 1346) | typedef TPM_HANDLE TPMI_RH_CLEAR;
type TPM_HANDLE (line 1348) | typedef TPM_HANDLE TPMI_RH_NV_AUTH;
type TPM_HANDLE (line 1350) | typedef TPM_HANDLE TPMI_RH_LOCKOUT;
type TPM_HANDLE (line 1352) | typedef TPM_HANDLE TPMI_RH_NV_INDEX;
type TPM_HANDLE (line 1354) | typedef TPM_HANDLE TPMI_RH_NV_DEFINED_INDEX;
type TPM_HANDLE (line 1355) | typedef TPM_HANDLE TPMI_RH_NV_LEGACY_INDEX;
type TPM_HANDLE (line 1356) | typedef TPM_HANDLE TPMI_RH_NV_EXP_INDEX;
type TPM_HANDLE (line 1359) | typedef TPM_HANDLE TPMI_RH_AC;
type TPM_HANDLE (line 1361) | typedef TPM_HANDLE TPMI_RH_ACT;
type TPM_ALG_ID (line 1363) | typedef TPM_ALG_ID TPMI_ALG_HASH;
type TPM_ALG_ID (line 1365) | typedef TPM_ALG_ID TPMI_ALG_ASYM;
type TPM_ALG_ID (line 1367) | typedef TPM_ALG_ID TPMI_ALG_SYM;
type TPM_ALG_ID (line 1369) | typedef TPM_ALG_ID TPMI_ALG_SYM_OBJECT;
type TPM_ALG_ID (line 1371) | typedef TPM_ALG_ID TPMI_ALG_SYM_MODE;
type TPM_ALG_ID (line 1373) | typedef TPM_ALG_ID TPMI_ALG_KDF;
type TPM_ALG_ID (line 1375) | typedef TPM_ALG_ID TPMI_ALG_SIG_SCHEME;
type TPM_ALG_ID (line 1377) | typedef TPM_ALG_ID TPMI_ECC_KEY_EXCHANGE;
type TPM_ST (line 1379) | typedef TPM_ST TPMI_ST_COMMAND_TAG;
type TPM_ALG_ID (line 1381) | typedef TPM_ALG_ID TPMI_ALG_MAC_SCHEME;
type TPM_ALG_ID (line 1383) | typedef TPM_ALG_ID TPMI_ALG_CIPHER_MODE;
type BYTE (line 1385) | typedef BYTE TPMS_EMPTY;
type TPMS_ALGORITHM_DESCRIPTION (line 1387) | typedef struct {
type TPMU_HA (line 1392) | typedef union {
type TPMT_HA (line 1419) | typedef struct {
type TPM2B_DIGEST (line 1424) | typedef union {
type TPM2B_DATA (line 1432) | typedef union {
type TPM2B_DIGEST (line 1440) | typedef TPM2B_DIGEST TPM2B_NONCE;
type TPM2B_DIGEST (line 1442) | typedef TPM2B_DIGEST TPM2B_AUTH;
type TPM2B_DIGEST (line 1444) | typedef TPM2B_DIGEST TPM2B_OPERAND;
type TPM2B_EVENT (line 1446) | typedef union {
type TPM2B_MAX_BUFFER (line 1454) | typedef union {
type TPM2B_MAX_NV_BUFFER (line 1462) | typedef union {
type TPM2B_TIMEOUT (line 1470) | typedef union {
type TPM2B_IV (line 1478) | typedef union {
type TPMU_NAME (line 1486) | typedef union {
type TPM2B_NAME (line 1491) | typedef union {
type TPMS_PCR_SELECT (line 1499) | typedef struct {
type TPMS_PCR_SELECTION (line 1504) | typedef struct {
type TPMT_TK_CREATION (line 1510) | typedef struct {
type TPMT_TK_VERIFIED (line 1516) | typedef struct {
type TPMT_TK_AUTH (line 1522) | typedef struct {
type TPMT_TK_HASHCHECK (line 1528) | typedef struct {
type TPMS_ALG_PROPERTY (line 1534) | typedef struct {
type TPMS_TAGGED_PROPERTY (line 1539) | typedef struct {
type TPMS_TAGGED_PCR_SELECT (line 1544) | typedef struct {
type TPMS_TAGGED_POLICY (line 1550) | typedef struct {
type TPMS_ACT_DATA (line 1555) | typedef struct {
type TPML_CC (line 1561) | typedef struct {
type TPML_CCA (line 1566) | typedef struct {
type TPML_ALG (line 1571) | typedef struct {
type TPML_HANDLE (line 1576) | typedef struct {
type TPML_DIGEST (line 1581) | typedef struct {
type TPML_DIGEST_VALUES (line 1586) | typedef struct {
type TPML_PCR_SELECTION (line 1591) | typedef struct {
type TPML_ALG_PROPERTY (line 1596) | typedef struct {
type TPML_TAGGED_TPM_PROPERTY (line 1601) | typedef struct {
type TPML_TAGGED_PCR_PROPERTY (line 1606) | typedef struct {
type TPML_ECC_CURVE (line 1611) | typedef struct {
type TPML_TAGGED_POLICY (line 1616) | typedef struct {
type TPML_ACT_DATA (line 1621) | typedef struct {
type TPMU_CAPABILITIES (line 1626) | typedef union {
type TPMU_SET_CAPABILITIES (line 1642) | typedef struct {
type TPMS_CAPABILITY_DATA (line 1646) | typedef struct {
type TPMS_SET_CAPABILITY_DATA (line 1651) | typedef struct {
type TPM2B_SET_CAPABILITY_DATA (line 1656) | typedef struct {
type TPMS_CLOCK_INFO (line 1661) | typedef struct {
type TPMS_TIME_INFO (line 1668) | typedef struct {
type TPMS_TIME_ATTEST_INFO (line 1673) | typedef struct {
type TPMS_CERTIFY_INFO (line 1678) | typedef struct {
type TPMS_QUOTE_INFO (line 1683) | typedef struct {
type TPMS_COMMAND_AUDIT_INFO (line 1688) | typedef struct {
type TPMS_SESSION_AUDIT_INFO (line 1695) | typedef struct {
type TPMS_CREATION_INFO (line 1700) | typedef struct {
type TPMS_NV_CERTIFY_INFO (line 1705) | typedef struct {
type TPMS_NV_DIGEST_CERTIFY_INFO (line 1711) | typedef struct {
type TPM_ST (line 1716) | typedef TPM_ST TPMI_ST_ATTEST;
type TPMU_ATTEST (line 1718) | typedef union {
type TPMS_ATTEST (line 1729) | typedef struct {
type TPM2B_ATTEST (line 1739) | typedef union {
type TPMS_AUTH_COMMAND (line 1747) | typedef struct {
type TPMS_AUTH_RESPONSE (line 1754) | typedef struct {
type TPM_KEY_BITS (line 1760) | typedef TPM_KEY_BITS TPMI_TDES_KEY_BITS;
type TPM_KEY_BITS (line 1762) | typedef TPM_KEY_BITS TPMI_AES_KEY_BITS;
type TPM_KEY_BITS (line 1764) | typedef TPM_KEY_BITS TPMI_SM4_KEY_BITS;
type TPM_KEY_BITS (line 1766) | typedef TPM_KEY_BITS TPMI_CAMELLIA_KEY_BITS;
type TPMU_SYM_KEY_BITS (line 1768) | typedef union {
type TPMU_SYM_MODE (line 1787) | typedef union {
type TPMT_SYM_DEF (line 1803) | typedef struct {
type TPMT_SYM_DEF_OBJECT (line 1809) | typedef struct {
type TPM2B_SYM_KEY (line 1815) | typedef union {
type TPMS_SYMCIPHER_PARMS (line 1823) | typedef struct {
type TPM2B_LABEL (line 1827) | typedef union {
type TPMS_DERIVE (line 1835) | typedef struct {
type TPM2B_DERIVE (line 1840) | typedef union {
type TPMU_SENSITIVE_CREATE (line 1848) | typedef union {
type TPM2B_SENSITIVE_DATA (line 1853) | typedef union {
type TPMS_SENSITIVE_CREATE (line 1861) | typedef struct {
type TPM2B_SENSITIVE_CREATE (line 1866) | typedef struct {
type TPMS_SCHEME_HASH (line 1871) | typedef struct {
type TPMS_SCHEME_ECDAA (line 1875) | typedef struct {
type TPM_ALG_ID (line 1880) | typedef TPM_ALG_ID TPMI_ALG_KEYEDHASH_SCHEME;
type TPMS_SCHEME_HASH (line 1882) | typedef TPMS_SCHEME_HASH TPMS_SCHEME_HMAC;
type TPMS_SCHEME_XOR (line 1884) | typedef struct {
type TPMU_SCHEME_KEYEDHASH (line 1889) | typedef union {
type TPMT_KEYEDHASH_SCHEME (line 1898) | typedef struct {
type TPMS_SCHEME_HASH (line 1903) | typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_RSASSA;
type TPMS_SCHEME_HASH (line 1904) | typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_RSAPSS;
type TPMS_SCHEME_HASH (line 1906) | typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_ECDSA;
type TPMS_SCHEME_HASH (line 1907) | typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_SM2;
type TPMS_SCHEME_HASH (line 1908) | typedef TPMS_SCHEME_HASH TPMS_SIG_SCHEME_ECSCHNORR;
type TPMS_SCHEME_ECDAA (line 1909) | typedef TPMS_SCHEME_ECDAA TPMS_SIG_SCHEME_ECDAA;
type TPMU_SIG_SCHEME (line 1911) | typedef union {
type TPMT_SIG_SCHEME (line 1936) | typedef struct {
type TPMS_SCHEME_HASH (line 1941) | typedef TPMS_SCHEME_HASH TPMS_ENC_SCHEME_OAEP;
type TPMS_EMPTY (line 1942) | typedef TPMS_EMPTY TPMS_ENC_SCHEME_RSAES;
type TPMS_SCHEME_HASH (line 1944) | typedef TPMS_SCHEME_HASH TPMS_KEY_SCHEME_ECDH;
type TPMS_SCHEME_HASH (line 1945) | typedef TPMS_SCHEME_HASH TPMS_KEY_SCHEME_ECMQV;
type TPMS_SCHEME_HASH (line 1947) | typedef TPMS_SCHEME_HASH TPMS_KDF_SCHEME_MGF1;
type TPMS_SCHEME_HASH (line 1948) | typedef TPMS_SCHEME_HASH TPMS_KDF_SCHEME_KDF1_SP800_56A;
type TPMS_SCHEME_HASH (line 1949) | typedef TPMS_SCHEME_HASH TPMS_KDF_SCHEME_KDF2;
type TPMS_SCHEME_HASH (line 1950) | typedef TPMS_SCHEME_HASH TPMS_KDF_SCHEME_KDF1_SP800_108;
type TPMU_KDF_SCHEME (line 1952) | typedef union {
type TPMT_KDF_SCHEME (line 1968) | typedef struct {
type TPM_ALG_ID (line 1973) | typedef TPM_ALG_ID TPMI_ALG_ASYM_SCHEME;
type TPMU_ASYM_SCHEME (line 1975) | typedef union {
type TPMT_ASYM_SCHEME (line 2009) | typedef struct {
type TPM_ALG_ID (line 2014) | typedef TPM_ALG_ID TPMI_ALG_RSA_SCHEME;
type TPMT_RSA_SCHEME (line 2016) | typedef struct {
type TPM_ALG_ID (line 2021) | typedef TPM_ALG_ID TPMI_ALG_RSA_DECRYPT;
type TPMT_RSA_DECRYPT (line 2023) | typedef struct {
type TPM2B_PUBLIC_KEY_RSA (line 2028) | typedef union {
type TPM_KEY_BITS (line 2036) | typedef TPM_KEY_BITS TPMI_RSA_KEY_BITS;
type TPM2B_PRIVATE_KEY_RSA (line 2038) | typedef union {
type TPM2B_ECC_PARAMETER (line 2046) | typedef union {
type TPMS_ECC_POINT (line 2054) | typedef struct {
type TPM2B_ECC_POINT (line 2059) | typedef struct {
type TPM_ALG_ID (line 2064) | typedef TPM_ALG_ID TPMI_ALG_ECC_SCHEME;
type TPM_ECC_CURVE (line 2066) | typedef TPM_ECC_CURVE TPMI_ECC_CURVE;
type TPMT_ECC_SCHEME (line 2068) | typedef struct {
type TPMS_ALGORITHM_DETAIL_ECC (line 2073) | typedef struct {
type TPMS_SIGNATURE_RSA (line 2087) | typedef struct {
type TPMS_SIGNATURE_RSA (line 2092) | typedef TPMS_SIGNATURE_RSA TPMS_SIGNATURE_RSASSA;
type TPMS_SIGNATURE_RSA (line 2093) | typedef TPMS_SIGNATURE_RSA TPMS_SIGNATURE_RSAPSS;
type TPMS_SIGNATURE_ECC (line 2095) | typedef struct {
type TPMS_SIGNATURE_ECC (line 2101) | typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECDAA;
type TPMS_SIGNATURE_ECC (line 2102) | typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECDSA;
type TPMS_SIGNATURE_ECC (line 2103) | typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_SM2;
type TPMS_SIGNATURE_ECC (line 2104) | typedef TPMS_SIGNATURE_ECC TPMS_SIGNATURE_ECSCHNORR;
type TPMU_SIGNATURE (line 2106) | typedef union {
type TPMT_SIGNATURE (line 2131) | typedef struct {
type TPMU_ENCRYPTED_SECRET (line 2136) | typedef union {
type TPM2B_ENCRYPTED_SECRET (line 2151) | typedef union {
type TPM_ALG_ID (line 2159) | typedef TPM_ALG_ID TPMI_ALG_PUBLIC;
type TPMU_PUBLIC_ID (line 2161) | typedef union {
type TPMS_KEYEDHASH_PARMS (line 2177) | typedef struct {
type TPMS_ASYM_PARMS (line 2181) | typedef struct {
type TPMS_RSA_PARMS (line 2186) | typedef struct {
type TPMS_ECC_PARMS (line 2193) | typedef struct {
type TPMU_PUBLIC_PARMS (line 2200) | typedef union {
type TPMT_PUBLIC_PARMS (line 2216) | typedef struct {
type TPMT_PUBLIC (line 2221) | typedef struct {
type TPM2B_PUBLIC (line 2230) | typedef struct {
type TPM2B_TEMPLATE (line 2235) | typedef union {
type TPM2B_PRIVATE_VENDOR_SPECIFIC (line 2243) | typedef union {
type TPMU_SENSITIVE_COMPOSITE (line 2251) | typedef union {
type TPMT_SENSITIVE (line 2267) | typedef struct {
type TPM2B_SENSITIVE (line 2274) | typedef struct {
type _PRIVATE (line 2279) | typedef struct {
type TPM2B_PRIVATE (line 2285) | typedef union {
type TPMS_ID_OBJECT (line 2293) | typedef struct {
type TPM2B_ID_OBJECT (line 2298) | typedef union {
type TPM_NV_INDEX (line 2314) | typedef struct TPM_NV_INDEX { // Table 2:205
type UINT32 (line 2322) | typedef UINT32 TPM_NV_INDEX;
type UINT32 (line 2334) | typedef UINT32 TPM_NT;
type TPMS_NV_PIN_COUNTER_PARAMETERS (line 2343) | typedef struct {
type TPMA_NV (line 2356) | typedef struct TPMA_NV { // Table 2:208
type UINT32 (line 2398) | typedef UINT32 TPMA_NV;
type TPMA_NV_EXP (line 2458) | typedef struct
type UINT64 (line 2533) | typedef UINT64 TPMA_NV_EXP;
type TPMS_NV_PUBLIC (line 2609) | typedef struct {
type TPM2B_NV_PUBLIC (line 2617) | typedef struct {
type TPMS_NV_PUBLIC_EXP_ATTR (line 2621) | typedef struct
type TPMU_NV_PUBLIC_2 (line 2629) | typedef union
type TPMT_NV_PUBLIC_2 (line 2635) | typedef struct
type TPM2B_NV_PUBLIC_2 (line 2640) | typedef struct
type TPM2B_CONTEXT_SENSITIVE (line 2646) | typedef union {
type TPMS_CONTEXT_DATA (line 2654) | typedef struct {
type TPM2B_CONTEXT_DATA (line 2659) | typedef union {
type TPMS_CONTEXT (line 2667) | typedef struct {
type TPMS_CREATION_DATA (line 2674) | typedef struct {
type TPM2B_CREATION_DATA (line 2684) | typedef struct {
type UINT32 (line 2690) | typedef UINT32 TPM_AT;
type UINT32 (line 2698) | typedef UINT32 TPM_AE;
type TPMS_AC_OUTPUT (line 2702) | typedef struct { // Table 2:222
type TPML_AC_CAPABILITIES (line 2708) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Unseal_fp.h
type Unseal_In (line 67) | typedef struct {
type Unseal_Out (line 73) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/Vendor_TCG_Test_fp.h
type Vendor_TCG_Test_In (line 65) | typedef struct {
type Vendor_TCG_Test_Out (line 69) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/VerifySignature_fp.h
type VerifySignature_In (line 67) | typedef struct {
type VerifySignature_Out (line 77) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/X509.h
type stringRef (line 91) | typedef struct stringRef
type x509KeyUsageUnion (line 97) | typedef union x509KeyUsageUnion {
FILE: ftpm-opensbi/include/ftpm/ZGen_2Phase_fp.h
type ZGen_2Phase_In (line 67) | typedef struct {
type ZGen_2Phase_Out (line 81) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/ftpm.h
type tss_ftpm_context (line 7) | struct tss_ftpm_context {
type sbi_ecall_extension (line 14) | struct sbi_ecall_extension
type tss_ftpm_context (line 29) | struct tss_ftpm_context
FILE: ftpm-opensbi/include/ftpm/intercept.h
type timespec (line 18) | struct timespec
FILE: ftpm-opensbi/include/ftpm/mprv.h
type mprv_block (line 4) | typedef struct { size_t words[8]; } mprv_block;
function copy_from_sm (line 27) | static inline int copy_from_sm(uintptr_t dst, void *src_buf, size_t len)
function copy_to_sm (line 66) | static inline int copy_to_sm(void *dst_buf, uintptr_t src, size_t len)
FILE: ftpm-opensbi/include/ftpm/ntc2lib.h
type NTC2_CFG_STRUCT (line 48) | typedef struct tdNTC2_CFG_STRUCT {
type NTC2_PreConfig_In (line 70) | typedef struct {
type NTC2_GetConfig_Out (line 74) | typedef struct {
FILE: ftpm-opensbi/include/ftpm/pcrstruct.h
type PCR (line 74) | typedef struct
type PCR_Attributes (line 105) | typedef struct
FILE: ftpm-opensbi/include/ftpm/tpm_radix.h
type crypt_uword_t (line 109) | typedef uint64_t crypt_uword_t;
type crypt_word_t (line 110) | typedef int64_t crypt_word_t;
type crypt_uword_t (line 115) | typedef uint32_t crypt_uword_t;
type crypt_word_t (line 116) | typedef int32_t crypt_word_t;
FILE: ftpm-opensbi/include/ftpm/tpm_to_platform_interface.h
type _plat__ClockAdjustStep (line 128) | typedef enum _plat__ClockAdjustStep
FILE: ftpm-opensbi/include/sbi/fw_dynamic.h
type fw_dynamic_info (line 49) | struct fw_dynamic_info {
type fw_dynamic_info (line 83) | struct fw_dynamic_info
type fw_dynamic_info (line 88) | struct fw_dynamic_info
type fw_dynamic_info (line 93) | struct fw_dynamic_info
type fw_dynamic_info (line 98) | struct fw_dynamic_info
type fw_dynamic_info (line 103) | struct fw_dynamic_info
type fw_dynamic_info (line 108) | struct fw_dynamic_info
FILE: ftpm-opensbi/include/sbi/riscv_atomic.h
type atomic_t (line 13) | typedef struct {
FILE: ftpm-opensbi/include/sbi/riscv_io.h
function __raw_writeb (line 16) | static inline void __raw_writeb(u8 val, volatile void *addr)
function __raw_writew (line 21) | static inline void __raw_writew(u16 val, volatile void *addr)
function __raw_writel (line 26) | static inline void __raw_writel(u32 val, volatile void *addr)
function __raw_writeq (line 32) | static inline void __raw_writeq(u64 val, volatile void *addr)
function u8 (line 38) | static inline u8 __raw_readb(const volatile void *addr)
function u16 (line 46) | static inline u16 __raw_readw(const volatile void *addr)
function u32 (line 54) | static inline u32 __raw_readl(const volatile void *addr)
function u64 (line 63) | static inline u64 __raw_readq(const volatile void *addr)
FILE: ftpm-opensbi/include/sbi/sbi_bitmap.h
function bitmap_estimate_size (line 28) | static inline unsigned long bitmap_estimate_size(int nbits)
function bitmap_set (line 40) | static inline void bitmap_set(unsigned long *bmap, int start, int len)
function bitmap_clear (line 47) | static inline void bitmap_clear(unsigned long *bmap, int start, int len)
function bitmap_zero (line 54) | static inline void bitmap_zero(unsigned long *dst, int nbits)
function bitmap_zero_except (line 65) | static inline void bitmap_zero_except(unsigned long *dst,
function bitmap_fill (line 79) | static inline void bitmap_fill(unsigned long *dst, int nbits)
function bitmap_copy (line 89) | static inline void bitmap_copy(unsigned long *dst,
function bitmap_and (line 101) | static inline void bitmap_and(unsigned long *dst, const unsigned long *s...
function bitmap_or (line 110) | static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
function bitmap_xor (line 119) | static inline void bitmap_xor(unsigned long *dst, const unsigned long *s...
FILE: ftpm-opensbi/include/sbi/sbi_bitops.h
function sbi_ffs (line 45) | static inline int sbi_ffs(unsigned long word)
function sbi_fls (line 90) | static inline unsigned long sbi_fls(unsigned long word)
function __set_bit (line 166) | static inline void __set_bit(int nr, volatile unsigned long *addr)
function __clear_bit (line 181) | static inline void __clear_bit(int nr, volatile unsigned long *addr)
function __change_bit (line 196) | static inline void __change_bit(int nr, volatile unsigned long *addr)
function __test_and_set_bit (line 211) | static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
function __test_and_clear_bit (line 228) | static inline int __test_and_clear_bit(int nr, volatile unsigned long *a...
function __test_bit (line 245) | static inline int __test_bit(int nr, const volatile unsigned long *addr)
FILE: ftpm-opensbi/include/sbi/sbi_console.h
type sbi_console_device (line 15) | struct sbi_console_device {
FILE: ftpm-opensbi/include/sbi/sbi_domain.h
type sbi_scratch (line 16) | struct sbi_scratch
type sbi_domain_access (line 19) | enum sbi_domain_access {
type sbi_domain_memregion (line 27) | struct sbi_domain_memregion {
type sbi_domain (line 53) | struct sbi_domain {
type sbi_domain (line 84) | struct sbi_domain
type sbi_domain (line 87) | struct sbi_domain
type sbi_domain (line 98) | struct sbi_domain
type sbi_domain (line 118) | struct sbi_domain
type sbi_domain (line 127) | struct sbi_domain
type sbi_domain_memregion (line 142) | struct sbi_domain_memregion
type sbi_domain (line 153) | struct sbi_domain
type sbi_domain (line 158) | struct sbi_domain
type sbi_domain (line 170) | struct sbi_domain
type sbi_hartmask (line 171) | struct sbi_hartmask
type sbi_domain_memregion (line 181) | struct sbi_domain_memregion
type sbi_scratch (line 198) | struct sbi_scratch
type sbi_scratch (line 201) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_ecall.h
type sbi_trap_regs (line 20) | struct sbi_trap_regs
type sbi_trap_info (line 21) | struct sbi_trap_info
type sbi_ecall_extension (line 23) | struct sbi_ecall_extension {
type sbi_ecall_extension (line 42) | struct sbi_ecall_extension
type sbi_ecall_extension (line 44) | struct sbi_ecall_extension
type sbi_ecall_extension (line 46) | struct sbi_ecall_extension
type sbi_trap_regs (line 48) | struct sbi_trap_regs
FILE: ftpm-opensbi/include/sbi/sbi_ecall_interface.h
type sbi_pmu_hw_generic_events_t (line 104) | enum sbi_pmu_hw_generic_events_t {
type sbi_pmu_hw_cache_id (line 127) | enum sbi_pmu_hw_cache_id {
type sbi_pmu_hw_cache_op_id (line 139) | enum sbi_pmu_hw_cache_op_id {
type sbi_pmu_hw_cache_op_result_id (line 147) | enum sbi_pmu_hw_cache_op_result_id {
type sbi_pmu_fw_event_code_id (line 159) | enum sbi_pmu_fw_event_code_id {
type sbi_pmu_event_type_id (line 188) | enum sbi_pmu_event_type_id {
type sbi_pmu_ctr_type (line 197) | enum sbi_pmu_ctr_type {
FILE: ftpm-opensbi/include/sbi/sbi_emulate_csr.h
type sbi_trap_regs (line 15) | struct sbi_trap_regs
type sbi_trap_regs (line 17) | struct sbi_trap_regs
type sbi_trap_regs (line 20) | struct sbi_trap_regs
FILE: ftpm-opensbi/include/sbi/sbi_fifo.h
type sbi_fifo (line 17) | struct sbi_fifo {
type sbi_fifo_inplace_update_types (line 26) | enum sbi_fifo_inplace_update_types {
type sbi_fifo (line 32) | struct sbi_fifo
type sbi_fifo (line 33) | struct sbi_fifo
type sbi_fifo (line 34) | struct sbi_fifo
type sbi_fifo (line 36) | struct sbi_fifo
type sbi_fifo (line 37) | struct sbi_fifo
type sbi_fifo (line 38) | struct sbi_fifo
type sbi_fifo (line 40) | struct sbi_fifo
FILE: ftpm-opensbi/include/sbi/sbi_hart.h
type sbi_hart_priv_versions (line 16) | enum sbi_hart_priv_versions {
type sbi_hart_extensions (line 28) | enum sbi_hart_extensions {
type sbi_hart_features (line 44) | struct sbi_hart_features {
type sbi_scratch (line 55) | struct sbi_scratch
type sbi_scratch (line 57) | struct sbi_scratch
type sbi_scratch (line 58) | struct sbi_scratch
function ulong (line 61) | static inline ulong sbi_hart_expected_trap_addr(void)
type sbi_scratch (line 66) | struct sbi_scratch
type sbi_scratch (line 67) | struct sbi_scratch
type sbi_scratch (line 69) | struct sbi_scratch
type sbi_scratch (line 70) | struct sbi_scratch
type sbi_scratch (line 71) | struct sbi_scratch
type sbi_scratch (line 72) | struct sbi_scratch
type sbi_scratch (line 73) | struct sbi_scratch
type sbi_scratch (line 74) | struct sbi_scratch
type sbi_scratch (line 75) | struct sbi_scratch
type sbi_scratch (line 77) | struct sbi_scratch
type sbi_hart_extensions (line 78) | enum sbi_hart_extensions
type sbi_scratch (line 80) | struct sbi_scratch
type sbi_hart_extensions (line 81) | enum sbi_hart_extensions
type sbi_scratch (line 82) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_hartmask.h
type sbi_hartmask (line 25) | struct sbi_hartmask {
function sbi_hartmask_set_hart (line 48) | static inline void sbi_hartmask_set_hart(u32 h, struct sbi_hartmask *m)
function sbi_hartmask_clear_hart (line 59) | static inline void sbi_hartmask_clear_hart(u32 h, struct sbi_hartmask *m)
function sbi_hartmask_test_hart (line 70) | static inline int sbi_hartmask_test_hart(u32 h, const struct sbi_hartmas...
function sbi_hartmask_set_all (line 81) | static inline void sbi_hartmask_set_all(struct sbi_hartmask *dstp)
function sbi_hartmask_clear_all (line 90) | static inline void sbi_hartmask_clear_all(struct sbi_hartmask *dstp)
function sbi_hartmask_and (line 101) | static inline void sbi_hartmask_and(struct sbi_hartmask *dstp,
function sbi_hartmask_or (line 115) | static inline void sbi_hartmask_or(struct sbi_hartmask *dstp,
function sbi_hartmask_xor (line 129) | static inline void sbi_hartmask_xor(struct sbi_hartmask *dstp,
FILE: ftpm-opensbi/include/sbi/sbi_hsm.h
type sbi_hsm_device (line 16) | struct sbi_hsm_device {
type sbi_domain (line 50) | struct sbi_domain
type sbi_scratch (line 51) | struct sbi_scratch
type sbi_hsm_device (line 53) | struct sbi_hsm_device
type sbi_hsm_device (line 55) | struct sbi_hsm_device
type sbi_scratch (line 57) | struct sbi_scratch
type sbi_scratch (line 58) | struct sbi_scratch
type sbi_scratch (line 60) | struct sbi_scratch
type sbi_domain (line 61) | struct sbi_domain
type sbi_scratch (line 63) | struct sbi_scratch
type sbi_scratch (line 64) | struct sbi_scratch
type sbi_scratch (line 65) | struct sbi_scratch
type sbi_scratch (line 66) | struct sbi_scratch
type sbi_domain (line 68) | struct sbi_domain
type sbi_domain (line 69) | struct sbi_domain
type sbi_scratch (line 71) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_illegal_insn.h
type sbi_trap_regs (line 15) | struct sbi_trap_regs
type sbi_trap_regs (line 17) | struct sbi_trap_regs
FILE: ftpm-opensbi/include/sbi/sbi_init.h
type sbi_scratch (line 15) | struct sbi_scratch
type sbi_scratch (line 17) | struct sbi_scratch
type sbi_scratch (line 21) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_ipi.h
type sbi_ipi_device (line 22) | struct sbi_ipi_device {
type sbi_scratch (line 33) | struct sbi_scratch
type sbi_ipi_event_ops (line 36) | struct sbi_ipi_event_ops {
type sbi_ipi_event_ops (line 66) | struct sbi_ipi_event_ops
type sbi_ipi_device (line 80) | struct sbi_ipi_device
type sbi_ipi_device (line 82) | struct sbi_ipi_device
type sbi_scratch (line 84) | struct sbi_scratch
type sbi_scratch (line 86) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_irqchip.h
type sbi_scratch (line 15) | struct sbi_scratch
type sbi_trap_regs (line 16) | struct sbi_trap_regs
type sbi_trap_regs (line 26) | struct sbi_trap_regs
type sbi_trap_regs (line 36) | struct sbi_trap_regs
type sbi_scratch (line 39) | struct sbi_scratch
type sbi_scratch (line 42) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_list.h
type sbi_dlist (line 22) | struct sbi_dlist {
function __sbi_list_add (line 36) | static inline void __sbi_list_add(struct sbi_dlist *new,
function sbi_list_empty (line 52) | static inline bool sbi_list_empty(struct sbi_dlist *head)
function sbi_list_add (line 63) | static inline void sbi_list_add(struct sbi_dlist *new, struct sbi_dlist ...
function sbi_list_add_tail (line 74) | static inline void sbi_list_add_tail(struct sbi_dlist *new,
function __sbi_list_del (line 80) | static inline void __sbi_list_del(struct sbi_dlist *prev,
function __sbi_list_del_entry (line 87) | static inline void __sbi_list_del_entry(struct sbi_dlist *entry)
function sbi_list_del (line 96) | static inline void sbi_list_del(struct sbi_dlist *entry)
function sbi_list_del_init (line 107) | static inline void sbi_list_del_init(struct sbi_dlist *entry)
FILE: ftpm-opensbi/include/sbi/sbi_misaligned_ldst.h
type sbi_trap_regs (line 15) | struct sbi_trap_regs
type sbi_trap_regs (line 18) | struct sbi_trap_regs
type sbi_trap_regs (line 21) | struct sbi_trap_regs
FILE: ftpm-opensbi/include/sbi/sbi_platform.h
type sbi_domain_memregion (line 48) | struct sbi_domain_memregion
type sbi_trap_info (line 49) | struct sbi_trap_info
type sbi_trap_regs (line 50) | struct sbi_trap_regs
type sbi_hart_features (line 51) | struct sbi_hart_features
type sbi_platform_features (line 54) | enum sbi_platform_features {
type sbi_platform_operations (line 67) | struct sbi_platform_operations {
type sbi_platform (line 139) | struct sbi_platform {
type sbi_platform (line 187) | struct sbi_platform
type sbi_platform (line 192) | struct sbi_platform
type sbi_platform (line 197) | struct sbi_platform
type sbi_platform (line 202) | struct sbi_platform
type sbi_platform (line 207) | struct sbi_platform
type sbi_platform (line 212) | struct sbi_platform
type sbi_platform (line 217) | struct sbi_platform
type sbi_platform (line 222) | struct sbi_platform
type sbi_platform (line 227) | struct sbi_platform
type sbi_platform (line 254) | struct sbi_platform
type sbi_platform (line 265) | struct sbi_platform
type sbi_platform (line 275) | struct sbi_platform
function sbi_platform_get_features (line 289) | static inline unsigned long sbi_platform_get_features(
function u64 (line 306) | static inline u64 sbi_platform_tlbr_flush_limit(const struct sbi_platfor...
function u32 (line 320) | static inline u32 sbi_platform_hart_count(const struct sbi_platform *plat)
function u32 (line 334) | static inline u32 sbi_platform_hart_stack_size(const struct sbi_platform...
function sbi_platform_hart_invalid (line 349) | static inline bool sbi_platform_hart_invalid(const struct sbi_platform *...
function sbi_platform_nascent_init (line 369) | static inline int sbi_platform_nascent_init(const struct sbi_platform *p...
function sbi_platform_early_init (line 384) | static inline int sbi_platform_early_init(const struct sbi_platform *plat,
function sbi_platform_final_init (line 400) | static inline int sbi_platform_final_init(const struct sbi_platform *plat,
function sbi_platform_early_exit (line 413) | static inline void sbi_platform_early_exit(const struct sbi_platform *plat)
function sbi_platform_final_exit (line 424) | static inline void sbi_platform_final_exit(const struct sbi_platform *plat)
function sbi_platform_misa_extension (line 438) | static inline int sbi_platform_misa_extension(const struct sbi_platform ...
function sbi_platform_misa_xlen (line 453) | static inline int sbi_platform_misa_xlen(const struct sbi_platform *plat)
function sbi_platform_extensions_init (line 467) | static inline int sbi_platform_extensions_init(
function sbi_platform_domains_init (line 483) | static inline int sbi_platform_domains_init(const struct sbi_platform *p...
function sbi_platform_pmu_init (line 497) | static inline int sbi_platform_pmu_init(const struct sbi_platform *plat)
function sbi_platform_pmu_xlate_to_mhpmevent (line 514) | static inline uint64_t sbi_platform_pmu_xlate_to_mhpmevent(const struct ...
function sbi_platform_console_init (line 530) | static inline int sbi_platform_console_init(const struct sbi_platform *p...
function sbi_platform_irqchip_init (line 545) | static inline int sbi_platform_irqchip_init(const struct sbi_platform *p...
function sbi_platform_irqchip_exit (line 558) | static inline void sbi_platform_irqchip_exit(const struct sbi_platform *...
function sbi_platform_ipi_init (line 572) | static inline int sbi_platform_ipi_init(const struct sbi_platform *plat,
function sbi_platform_ipi_exit (line 585) | static inline void sbi_platform_ipi_exit(const struct sbi_platform *plat)
function sbi_platform_timer_init (line 599) | static inline int sbi_platform_timer_init(const struct sbi_platform *plat,
function sbi_platform_timer_exit (line 612) | static inline void sbi_platform_timer_exit(const struct sbi_platform *plat)
function sbi_platform_vendor_ext_check (line 626) | static inline int sbi_platform_vendor_ext_check(const struct sbi_platfor...
function sbi_platform_vendor_ext_provider (line 647) | static inline int sbi_platform_vendor_ext_provider(
FILE: ftpm-opensbi/include/sbi/sbi_pmu.h
type sbi_scratch (line 15) | struct sbi_scratch
type sbi_pmu_device (line 27) | struct sbi_pmu_device {
type sbi_pmu_device (line 84) | struct sbi_pmu_device
type sbi_pmu_device (line 87) | struct sbi_pmu_device
type sbi_scratch (line 90) | struct sbi_scratch
type sbi_scratch (line 93) | struct sbi_scratch
type sbi_pmu_fw_event_code_id (line 133) | enum sbi_pmu_fw_event_code_id
FILE: ftpm-opensbi/include/sbi/sbi_scratch.h
type sbi_scratch (line 51) | struct sbi_scratch {
type sbi_scratch (line 81) | struct sbi_scratch
type sbi_scratch (line 86) | struct sbi_scratch
type sbi_scratch (line 91) | struct sbi_scratch
type sbi_scratch (line 96) | struct sbi_scratch
type sbi_scratch (line 101) | struct sbi_scratch
type sbi_scratch (line 106) | struct sbi_scratch
type sbi_scratch (line 111) | struct sbi_scratch
type sbi_scratch (line 116) | struct sbi_scratch
type sbi_scratch (line 121) | struct sbi_scratch
type sbi_scratch (line 126) | struct sbi_scratch
type sbi_scratch (line 131) | struct sbi_scratch
type sbi_scratch_options (line 137) | enum sbi_scratch_options {
type sbi_scratch (line 153) | struct sbi_scratch
type sbi_scratch (line 174) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_system.h
type sbi_system_reset_device (line 17) | struct sbi_system_reset_device {
type sbi_system_reset_device (line 31) | struct sbi_system_reset_device
type sbi_dlist (line 32) | struct sbi_dlist
type sbi_system_reset_device (line 37) | struct sbi_system_reset_device
type sbi_system_reset_device (line 40) | struct sbi_system_reset_device
FILE: ftpm-opensbi/include/sbi/sbi_timer.h
type sbi_timer_device (line 16) | struct sbi_timer_device {
type sbi_scratch (line 33) | struct sbi_scratch
function sbi_timer_mdelay (line 40) | static inline void sbi_timer_mdelay(ulong msecs)
function sbi_timer_udelay (line 46) | static inline void sbi_timer_udelay(ulong usecs)
type sbi_timer_device (line 91) | struct sbi_timer_device
type sbi_timer_device (line 94) | struct sbi_timer_device
type sbi_scratch (line 97) | struct sbi_scratch
type sbi_scratch (line 100) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_tlb.h
type sbi_scratch (line 25) | struct sbi_scratch
type sbi_tlb_info (line 27) | struct sbi_tlb_info {
type sbi_tlb_info (line 36) | struct sbi_tlb_info
type sbi_tlb_info (line 37) | struct sbi_tlb_info
type sbi_tlb_info (line 38) | struct sbi_tlb_info
type sbi_tlb_info (line 39) | struct sbi_tlb_info
type sbi_tlb_info (line 40) | struct sbi_tlb_info
type sbi_tlb_info (line 41) | struct sbi_tlb_info
type sbi_tlb_info (line 42) | struct sbi_tlb_info
type sbi_tlb_info (line 56) | struct sbi_tlb_info
type sbi_scratch (line 58) | struct sbi_scratch
FILE: ftpm-opensbi/include/sbi/sbi_trap.h
type sbi_trap_regs (line 122) | struct sbi_trap_regs {
type sbi_trap_info (line 196) | struct sbi_trap_info {
function sbi_regs_gva (line 211) | static inline unsigned long sbi_regs_gva(const struct sbi_trap_regs *regs)
type sbi_trap_regs (line 227) | struct sbi_trap_regs
type sbi_trap_info (line 228) | struct sbi_trap_info
type sbi_trap_regs (line 230) | struct sbi_trap_regs
type sbi_trap_regs (line 230) | struct sbi_trap_regs
type sbi_trap_regs (line 232) | struct sbi_trap_regs
FILE: ftpm-opensbi/include/sbi/sbi_types.h
type s8 (line 17) | typedef char s8;
type u8 (line 18) | typedef unsigned char u8;
type s16 (line 21) | typedef short s16;
type u16 (line 22) | typedef unsigned short u16;
type s32 (line 26) | typedef int s32;
type u32 (line 27) | typedef unsigned int u32;
type s64 (line 32) | typedef long s64;
type u64 (line 33) | typedef unsigned long u64;
type s64 (line 38) | typedef long long s64;
type u64 (line 39) | typedef unsigned long long u64;
type ulong (line 48) | typedef unsigned long ulong;
type virtual_addr_t (line 52) | typedef unsigned long virtual_addr_t;
type virtual_size_t (line 53) | typedef unsigned long virtual_size_t;
type physical_addr_t (line 54) | typedef unsigned long physical_addr_t;
type physical_size_t (line 55) | typedef unsigned long physical_size_t;
FILE: ftpm-opensbi/include/sbi/sbi_unpriv.h
type sbi_scratch (line 15) | struct sbi_scratch
type sbi_trap_info (line 16) | struct sbi_trap_info
FILE: ftpm-opensbi/include/sbi_utils/fdt/fdt_domain.h
type sbi_domain (line 18) | struct sbi_domain
function fdt_domain_fixup (line 77) | static inline void fdt_domain_fixup(void *fdt) { }
function fdt_domains_populate (line 78) | static inline int fdt_domains_populate(void *fdt) { return 0; }
FILE: ftpm-opensbi/include/sbi_utils/fdt/fdt_helper.h
type fdt_match (line 16) | struct fdt_match {
type fdt_phandle_args (line 22) | struct fdt_phandle_args {
type platform_uart_data (line 28) | struct platform_uart_data {
type fdt_match (line 37) | struct fdt_match
type fdt_match (line 38) | struct fdt_match
type fdt_match (line 41) | struct fdt_match
type fdt_match (line 42) | struct fdt_match
type fdt_phandle_args (line 46) | struct fdt_phandle_args
type platform_uart_data (line 60) | struct platform_uart_data
type platform_uart_data (line 63) | struct platform_uart_data
type platform_uart_data (line 66) | struct platform_uart_data
type platform_uart_data (line 69) | struct platform_uart_data
type platform_uart_data (line 72) | struct platform_uart_data
type platform_uart_data (line 74) | struct platform_uart_data
type platform_uart_data (line 78) | struct platform_uart_data
type aplic_data (line 80) | struct aplic_data
type aplic_data (line 82) | struct aplic_data
type imsic_data (line 84) | struct imsic_data
type imsic_data (line 88) | struct imsic_data
type plic_data (line 90) | struct plic_data
type plic_data (line 92) | struct plic_data
type plic_data (line 94) | struct plic_data
FILE: ftpm-opensbi/include/sbi_utils/fdt/fdt_pmu.h
function fdt_pmu_fixup (line 50) | static inline void fdt_pmu_fixup(void *fdt) { }
function fdt_pmu_setup (line 51) | static inline int fdt_pmu_setup(void *fdt) { return 0; }
function fdt_pmu_get_select_value (line 52) | static inline uint64_t fdt_pmu_get_select_value(uint32_t event_idx) { re...
FILE: ftpm-opensbi/include/sbi_utils/gpio/fdt_gpio.h
type fdt_phandle_args (line 15) | struct fdt_phandle_args
type fdt_gpio (line 18) | struct fdt_gpio {
type gpio_pin (line 29) | struct gpio_pin
type gpio_chip (line 32) | struct gpio_chip
type fdt_phandle_args (line 33) | struct fdt_phandle_args
type gpio_pin (line 34) | struct gpio_pin
FILE: ftpm-opensbi/include/sbi_utils/gpio/gpio.h
type gpio_pin (line 20) | struct gpio_pin {
type gpio_chip (line 41) | struct gpio_chip {
type gpio_chip (line 78) | struct gpio_chip
type sbi_dlist (line 78) | struct sbi_dlist
type gpio_chip (line 84) | struct gpio_chip
type gpio_chip (line 87) | struct gpio_chip
type gpio_chip (line 90) | struct gpio_chip
type gpio_pin (line 93) | struct gpio_pin
type gpio_pin (line 96) | struct gpio_pin
type gpio_pin (line 99) | struct gpio_pin
type gpio_pin (line 102) | struct gpio_pin
type gpio_pin (line 105) | struct gpio_pin
FILE: ftpm-opensbi/include/sbi_utils/i2c/fdt_i2c.h
type fdt_i2c_adapter (line 16) | struct fdt_i2c_adapter {
type i2c_adapter (line 24) | struct i2c_adapter
FILE: ftpm-opensbi/include/sbi_utils/i2c/i2c.h
type i2c_adapter (line 17) | struct i2c_adapter {
type i2c_adapter (line 44) | struct i2c_adapter
type sbi_dlist (line 44) | struct sbi_dlist
type i2c_adapter (line 50) | struct i2c_adapter
type i2c_adapter (line 53) | struct i2c_adapter
type i2c_adapter (line 56) | struct i2c_adapter
type i2c_adapter (line 59) | struct i2c_adapter
type i2c_adapter (line 63) | struct i2c_adapter
function i2c_adapter_reg_write (line 66) | static inline int i2c_adapter_reg_write(struct i2c_adapter *ia, uint8_t ...
function i2c_adapter_reg_read (line 72) | static inline int i2c_adapter_reg_read(struct i2c_adapter *ia, uint8_t a...
FILE: ftpm-opensbi/include/sbi_utils/ipi/aclint_mswi.h
type aclint_mswi_data (line 21) | struct aclint_mswi_data {
type aclint_mswi_data (line 31) | struct aclint_mswi_data
FILE: ftpm-opensbi/include/sbi_utils/ipi/andes_plicsw.h
type plicsw_data (line 34) | struct plicsw_data {
type plicsw_data (line 44) | struct plicsw_data
FILE: ftpm-opensbi/include/sbi_utils/ipi/fdt_ipi.h
type fdt_ipi (line 17) | struct fdt_ipi {
function fdt_ipi_exit (line 30) | static inline void fdt_ipi_exit(void) { }
function fdt_ipi_init (line 31) | static inline int fdt_ipi_init(bool cold_boot) { return 0; }
FILE: ftpm-opensbi/include/sbi_utils/irqchip/aplic.h
type aplic_msicfg_data (line 18) | struct aplic_msicfg_data {
type aplic_delegate_data (line 26) | struct aplic_delegate_data {
type aplic_data (line 32) | struct aplic_data {
type aplic_data (line 45) | struct aplic_data
FILE: ftpm-opensbi/include/sbi_utils/irqchip/fdt_irqchip.h
type fdt_irqchip (line 17) | struct fdt_irqchip {
function fdt_irqchip_exit (line 30) | static inline void fdt_irqchip_exit(void) { }
function fdt_irqchip_init (line 32) | static inline int fdt_irqchip_init(bool cold_boot) { return 0; }
FILE: ftpm-opensbi/include/sbi_utils/irqchip/imsic.h
type imsic_regs (line 21) | struct imsic_regs {
type imsic_data (line 26) | struct imsic_data {
type imsic_data (line 38) | struct imsic_data
type imsic_data (line 40) | struct imsic_data
type imsic_data (line 48) | struct imsic_data
type imsic_data (line 50) | struct imsic_data
function imsic_local_irqchip_init (line 54) | static inline void imsic_local_irqchip_init(void) { }
function imsic_data_check (line 56) | static inline int imsic_data_check(struct imsic_data *imsic) { return 0; }
FILE: ftpm-opensbi/include/sbi_utils/irqchip/plic.h
type plic_data (line 15) | struct plic_data {
type plic_data (line 21) | struct plic_data
type plic_data (line 23) | struct plic_data
type plic_data (line 26) | struct plic_data
type plic_data (line 29) | struct plic_data
type plic_data (line 32) | struct plic_data
type plic_data (line 35) | struct plic_data
type plic_data (line 38) | struct plic_data
FILE: ftpm-opensbi/include/sbi_utils/reset/fdt_reset.h
type fdt_reset (line 15) | struct fdt_reset {
type fdt_reset (line 25) | struct fdt_reset
function fdt_reset_driver_init (line 36) | static inline int fdt_reset_driver_init(void *fdt, struct fdt_reset *drv)
function fdt_reset_init (line 40) | static inline void fdt_reset_init(void) { }
FILE: ftpm-opensbi/include/sbi_utils/serial/fdt_serial.h
type fdt_serial (line 17) | struct fdt_serial {
function fdt_serial_init (line 26) | static inline int fdt_serial_init(void) { return 0; }
FILE: ftpm-opensbi/include/sbi_utils/serial/semihosting.h
type semihosting_open_mode (line 31) | enum semihosting_open_mode {
function semihosting_init (line 43) | static inline int semihosting_init(void) { return SBI_ENODEV; }
function semihosting_enabled (line 44) | static inline int semihosting_enabled(void) { return 0; }
FILE: ftpm-opensbi/include/sbi_utils/timer/aclint_mtimer.h
type aclint_mtimer_data (line 27) | struct aclint_mtimer_data {
type aclint_mtimer_data (line 45) | struct aclint_mtimer_data
type aclint_mtimer_data (line 47) | struct aclint_mtimer_data
type aclint_mtimer_data (line 48) | struct aclint_mtimer_data
type aclint_mtimer_data (line 52) | struct aclint_mtimer_data
type aclint_mtimer_data (line 53) | struct aclint_mtimer_data
FILE: ftpm-opensbi/include/sbi_utils/timer/andes_plmt.h
type plmt_data (line 18) | struct plmt_data {
type plmt_data (line 26) | struct plmt_data
FILE: ftpm-opensbi/include/sbi_utils/timer/fdt_timer.h
type fdt_timer (line 17) | struct fdt_timer {
function fdt_timer_exit (line 30) | static inline void fdt_timer_exit(void) { }
function fdt_timer_init (line 31) | static inline int fdt_timer_init(bool cold_boot) { return 0; }
FILE: ftpm-opensbi/lib/sbi/riscv_asm.c
function misa_extension_imp (line 17) | int misa_extension_imp(char ext)
function misa_xlen (line 32) | int misa_xlen(void)
function misa_string (line 53) | void misa_string(int xlen, char *out, unsigned int out_sz)
function csr_read_num (line 94) | unsigned long csr_read_num(int csr_num)
function csr_write_num (line 168) | void csr_write_num(int csr_num, unsigned long val)
function ctz (line 234) | static unsigned long ctz(unsigned long x)
function pmp_set (line 249) | int pmp_set(unsigned int n, unsigned long prot, unsigned long addr,
function pmp_get (line 299) | int pmp_get(unsigned int n, unsigned long *prot_out, unsigned long *addr...
FILE: ftpm-opensbi/lib/sbi/riscv_atomic.c
function atomic_read (line 15) | long atomic_read(atomic_t *atom)
function atomic_write (line 22) | void atomic_write(atomic_t *atom, long value)
function atomic_add_return (line 28) | long atomic_add_return(atomic_t *at
Copy disabled (too large)
Download .json
Condensed preview — 1163 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (13,888K chars).
[
{
"path": "README.md",
"chars": 1663,
"preview": "# RfTPM: A Firmware TPM Implementation for RISC-V\n\nRfTPM is the first firmware TPM (fTPM) architecture designed for RISC"
},
{
"path": "cryptomini/.vscode/settings.json",
"chars": 64,
"preview": "{\n \"files.associations\": {\n \"intercept.h\": \"c\"\n }\n}"
},
{
"path": "cryptomini/README.md",
"chars": 50,
"preview": "# CRYPTOMINI\n\npruned libcrypto for vTPM on RISC-V\n"
},
{
"path": "cryptomini/aes/aes_cbc.c",
"chars": 5620,
"preview": "/*\n * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the Apache License 2.0 "
},
{
"path": "cryptomini/aes/aes_core.c",
"chars": 81580,
"preview": "/*\n * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/aes/aes_local.h",
"chars": 1381,
"preview": "/*\n * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/README.pod",
"chars": 9571,
"preview": "=pod\n\n=head1 NAME\n\nbn_mul_words, bn_mul_add_words, bn_sqr_words, bn_div_words,\nbn_add_words, bn_sub_words, bn_mul_comba4"
},
{
"path": "cryptomini/bn/bn_add.c",
"chars": 3422,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_asm.c",
"chars": 27545,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_ctx.c",
"chars": 9802,
"preview": "/*\n * Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_div.c",
"chars": 14041,
"preview": "/*\n * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_exp.c",
"chars": 45375,
"preview": "/*\n * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_gcd.c",
"chars": 19009,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_intern.c",
"chars": 5602,
"preview": "/*\n * Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_lib.c",
"chars": 23201,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_local.h",
"chars": 25178,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_mod.c",
"chars": 7917,
"preview": "/*\n * Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_mont.c",
"chars": 12422,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_mul.c",
"chars": 19140,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_nist.c",
"chars": 38171,
"preview": "/*\n * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_rand.c",
"chars": 7484,
"preview": "/*\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_recp.c",
"chars": 4616,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_shift.c",
"chars": 4823,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_sqr.c",
"chars": 5502,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/bn_word.c",
"chars": 4509,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/bn/rsaz_exp.h",
"chars": 1410,
"preview": "/*\n * Copyright 2013-2018 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2012, Intel Corporation. Al"
},
{
"path": "cryptomini/camellia/camellia.c",
"chars": 25521,
"preview": "/*\n * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/camellia/cmll_local.h",
"chars": 1883,
"preview": "/*\n * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/camellia/cmll_misc.c",
"chars": 1123,
"preview": "/*\n * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/cryptlib.c",
"chars": 13173,
"preview": "/*\n * Copyright 1998-2019 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/e_os.h",
"chars": 11055,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/ec/ec_cvt.c",
"chars": 2703,
"preview": "/*\n * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/ec/ec_key.c",
"chars": 19684,
"preview": "/*\n * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/ec/ec_lib.c",
"chars": 34089,
"preview": "/*\n * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/ec/ec_local.h",
"chars": 35006,
"preview": "/*\n * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/ec/ec_mult.c",
"chars": 31318,
"preview": "/*\n * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/ec/ecdh_ossl.c",
"chars": 3337,
"preview": "/*\n * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/ec/ecp_mont.c",
"chars": 7995,
"preview": "/*\n * Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/ec/ecp_nist.c",
"chars": 4904,
"preview": "/*\n * Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/ec/ecp_smpl.c",
"chars": 49221,
"preview": "/*\n * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/crypto/__DECC_INCLUDE_EPILOGUE.H",
"chars": 556,
"preview": "/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/crypto/__DECC_INCLUDE_PROLOGUE.H",
"chars": 627,
"preview": "/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/crypto/aria.h",
"chars": 1503,
"preview": "/*\n * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2017, Oracle and/or its aff"
},
{
"path": "cryptomini/include/crypto/asn1.h",
"chars": 4933,
"preview": "/*\n * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/async.h",
"chars": 448,
"preview": "/*\n * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/bn.h",
"chars": 3466,
"preview": "/*\n * Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/bn_conf.h",
"chars": 815,
"preview": "/* WARNING: do not edit! */\n/* Generated by Makefile from include/crypto/bn_conf.h.in */\n/*\n * Copyright 2016 The OpenSS"
},
{
"path": "cryptomini/include/crypto/bn_conf.h.in",
"chars": 883,
"preview": "{- join(\"\\n\",map { \"/* $_ */\" } @autowarntext) -}\n/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved."
},
{
"path": "cryptomini/include/crypto/bn_dh.h",
"chars": 836,
"preview": "/*\n * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/bn_srp.h",
"chars": 729,
"preview": "/*\n * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/chacha.h",
"chars": 1655,
"preview": "/*\n * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/cryptlib.h",
"chars": 1065,
"preview": "/*\n * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/ctype.h",
"chars": 3267,
"preview": "/*\n * Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/dso_conf.h",
"chars": 541,
"preview": "/* WARNING: do not edit! */\n/* Generated by Makefile from include/crypto/dso_conf.h.in */\n/*\n * Copyright 2016-2019 The "
},
{
"path": "cryptomini/include/crypto/dso_conf.h.in",
"chars": 1291,
"preview": "{- join(\"\\n\",map { \"/* $_ */\" } @autowarntext) -}\n/*\n * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Rese"
},
{
"path": "cryptomini/include/crypto/ec.h",
"chars": 1873,
"preview": "/*\n * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/crypto/engine.h",
"chars": 672,
"preview": "/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/crypto/err.h",
"chars": 559,
"preview": "/*\n * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/evp.h",
"chars": 17285,
"preview": "/*\n * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/lhash.h",
"chars": 447,
"preview": "/*\n * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/crypto/md32_common.h",
"chars": 8091,
"preview": "/*\n * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/objects.h",
"chars": 387,
"preview": "/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/crypto/poly1305.h",
"chars": 725,
"preview": "/*\n * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/rand.h",
"chars": 4965,
"preview": "/*\n * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/sha.h",
"chars": 571,
"preview": "/*\n * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2018, Oracle and/or its affiliat"
},
{
"path": "cryptomini/include/crypto/siphash.h",
"chars": 907,
"preview": "/*\n * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/sm2.h",
"chars": 2469,
"preview": "/*\n * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright 2017 Ribose Inc. All Rights Res"
},
{
"path": "cryptomini/include/crypto/sm2err.h",
"chars": 2541,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/crypto/sm3.h",
"chars": 1011,
"preview": "/*\n * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright 2017 Ribose Inc. All Rights Reserved"
},
{
"path": "cryptomini/include/crypto/sm4.h",
"chars": 946,
"preview": "/*\n * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright 2017 Ribose Inc. All Rights Reserved"
},
{
"path": "cryptomini/include/crypto/store.h",
"chars": 914,
"preview": "/*\n * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/crypto/x509.h",
"chars": 9688,
"preview": "/*\n * Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/intercept/intercept.h",
"chars": 224,
"preview": "\n#include <stdio.h>\n\n// #define malloc sbi_malloc\n// #define free sbi_free\n// #define memset sbi_memset\n\n// void *s"
},
{
"path": "cryptomini/include/internal/__DECC_INCLUDE_EPILOGUE.H",
"chars": 556,
"preview": "/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/internal/__DECC_INCLUDE_PROLOGUE.H",
"chars": 627,
"preview": "/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/internal/bio.h",
"chars": 1117,
"preview": "/*\n * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/comp.h",
"chars": 390,
"preview": "/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/internal/conf.h",
"chars": 798,
"preview": "/*\n * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/constant_time.h",
"chars": 12205,
"preview": "/*\n * Copyright 2014-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/cryptlib.h",
"chars": 2982,
"preview": "/*\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/dane.h",
"chars": 3572,
"preview": "/*\n * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/dso.h",
"chars": 7138,
"preview": "/*\n * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/dsoerr.h",
"chars": 3861,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/internal/err.h",
"chars": 428,
"preview": "/*\n * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/internal/nelem.h",
"chars": 451,
"preview": "/*\n * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/internal/numbers.h",
"chars": 1920,
"preview": "/*\n * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/o_dir.h",
"chars": 2227,
"preview": "/*\n * Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/o_str.h",
"chars": 519,
"preview": "/*\n * Copyright 2003-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/refcount.h",
"chars": 4393,
"preview": "/*\n * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/sockets.h",
"chars": 4427,
"preview": "/*\n * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/sslconf.h",
"chars": 691,
"preview": "/*\n * Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (the \"Li"
},
{
"path": "cryptomini/include/internal/thread_once.h",
"chars": 5157,
"preview": "/*\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/internal/tsan_assist.h",
"chars": 6738,
"preview": "/*\n * Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/__DECC_INCLUDE_EPILOGUE.H",
"chars": 726,
"preview": "/*\n * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/__DECC_INCLUDE_PROLOGUE.H",
"chars": 798,
"preview": "/*\n * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/aes.h",
"chars": 3349,
"preview": "/*\n * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/asn1.h",
"chars": 33627,
"preview": "/*\n * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/asn1_mac.h",
"chars": 395,
"preview": "/*\n * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/asn1err.h",
"chars": 14687,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/asn1t.h",
"chars": 32940,
"preview": "/*\n * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/async.h",
"chars": 2398,
"preview": "/*\n * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/asyncerr.h",
"chars": 1326,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/bio.h",
"chars": 34907,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/bioerr.h",
"chars": 6400,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/blowfish.h",
"chars": 1847,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/bn.h",
"chars": 22135,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/openssl/bnerr.h",
"chars": 4907,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/buffer.h",
"chars": 1600,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/buffererr.h",
"chars": 820,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/camellia.h",
"chars": 3179,
"preview": "/*\n * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/cast.h",
"chars": 1674,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/cmac.h",
"chars": 1064,
"preview": "/*\n * Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/cms.h",
"chars": 16379,
"preview": "/*\n * Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/cmserr.h",
"chars": 11160,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/comp.h",
"chars": 1328,
"preview": "/*\n * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/comperr.h",
"chars": 1212,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/conf.h",
"chars": 5601,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/conf_api.h",
"chars": 1300,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/conferr.h",
"chars": 3429,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/crypto.h",
"chars": 17244,
"preview": "/*\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/openssl/cryptoerr.h",
"chars": 2261,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/ct.h",
"chars": 15872,
"preview": "/*\n * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/cterr.h",
"chars": 3470,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/des.h",
"chars": 7627,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/dh.h",
"chars": 13403,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/dherr.h",
"chars": 3974,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/dsa.h",
"chars": 10051,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/dsaerr.h",
"chars": 2972,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/dtls1.h",
"chars": 1578,
"preview": "/*\n * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/e_os2.h",
"chars": 8920,
"preview": "/*\n * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ebcdic.h",
"chars": 924,
"preview": "/*\n * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ec.h",
"chars": 63684,
"preview": "/*\n * Copyright 2002-2021 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/openssl/ecdh.h",
"chars": 358,
"preview": "/*\n * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ecdsa.h",
"chars": 358,
"preview": "/*\n * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ecerr.h",
"chars": 15821,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/engine.h",
"chars": 34726,
"preview": "/*\n * Copyright 2000-2022 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/openssl/engineerr.h",
"chars": 5447,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/err.h",
"chars": 11269,
"preview": "/*\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/evp.h",
"chars": 76828,
"preview": "/*\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/evperr.h",
"chars": 11453,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/hmac.h",
"chars": 1591,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/idea.h",
"chars": 2099,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/kdf.h",
"chars": 4326,
"preview": "/*\n * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/kdferr.h",
"chars": 2122,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/lhash.h",
"chars": 9271,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/md2.h",
"chars": 1054,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/md4.h",
"chars": 1322,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/md5.h",
"chars": 1320,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/mdc2.h",
"chars": 1053,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/modes.h",
"chars": 10478,
"preview": "/*\n * Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/obj_mac.h",
"chars": 217522,
"preview": "/*\n * WARNING: do not edit!\n * Generated by crypto/objects/objects.pl\n *\n * Copyright 2000-2022 The OpenSSL Project Auth"
},
{
"path": "cryptomini/include/openssl/objects.h",
"chars": 6633,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/objectserr.h",
"chars": 1316,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/ocsp.h",
"chars": 15305,
"preview": "/*\n * Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ocsperr.h",
"chars": 3356,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/opensslconf.h",
"chars": 5472,
"preview": "/*\n * WARNING: do not edit!\n * Generated by Makefile from include/openssl/opensslconf.h.in\n *\n * Copyright 2016-2020 The"
},
{
"path": "cryptomini/include/openssl/opensslconf.h.in",
"chars": 4251,
"preview": "/*\n * {- join(\"\\n * \", @autowarntext) -}\n *\n * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n"
},
{
"path": "cryptomini/include/openssl/opensslv.h",
"chars": 4101,
"preview": "/*\n * Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ossl_typ.h",
"chars": 6266,
"preview": "/*\n * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/pem.h",
"chars": 15468,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/pem2.h",
"chars": 415,
"preview": "/*\n * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/pemerr.h",
"chars": 5222,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/pkcs12.h",
"chars": 9871,
"preview": "/*\n * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/pkcs12err.h",
"chars": 3749,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/pkcs7.h",
"chars": 11590,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/pkcs7err.h",
"chars": 5110,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/rand.h",
"chars": 2213,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/rand_drbg.h",
"chars": 4763,
"preview": "/*\n * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/randerr.h",
"chars": 4633,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/rc2.h",
"chars": 1534,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/rc4.h",
"chars": 825,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/rc5.h",
"chars": 1988,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ripemd.h",
"chars": 1243,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/rsa.h",
"chars": 22202,
"preview": "/*\n * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/rsaerr.h",
"chars": 9075,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/safestack.h",
"chars": 8139,
"preview": "/*\n * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/seed.h",
"chars": 3479,
"preview": "/*\n * Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/sha.h",
"chars": 3831,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/srp.h",
"chars": 3827,
"preview": "/*\n * Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2004, EdelKey Project. All "
},
{
"path": "cryptomini/include/openssl/srtp.h",
"chars": 1316,
"preview": "/*\n * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ssl.h",
"chars": 111252,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/openssl/ssl2.h",
"chars": 542,
"preview": "/*\n * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ssl3.h",
"chars": 14705,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/openssl/sslerr.h",
"chars": 46862,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/stack.h",
"chars": 3095,
"preview": "/*\n * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/store.h",
"chars": 11199,
"preview": "/*\n * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/storeerr.h",
"chars": 4399,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/symhacks.h",
"chars": 1311,
"preview": "/*\n * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/tls1.h",
"chars": 72490,
"preview": "/*\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/openssl/ts.h",
"chars": 22429,
"preview": "/*\n * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/tserr.h",
"chars": 6746,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/txt_db.h",
"chars": 1666,
"preview": "/*\n * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/ui.h",
"chars": 16052,
"preview": "/*\n * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/uierr.h",
"chars": 2737,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/whrlpool.h",
"chars": 1377,
"preview": "/*\n * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/x509.h",
"chars": 43326,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n * Copyright (c) 2002, Oracle and/or its aff"
},
{
"path": "cryptomini/include/openssl/x509_vfy.h",
"chars": 32451,
"preview": "/*\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/x509err.h",
"chars": 6803,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.\n *"
},
{
"path": "cryptomini/include/openssl/x509v3.h",
"chars": 33439,
"preview": "/*\n * Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved.\n *\n * Licensed under the OpenSSL license (th"
},
{
"path": "cryptomini/include/openssl/x509v3err.h",
"chars": 8901,
"preview": "/*\n * Generated by util/mkerr.pl DO NOT EDIT\n * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.\n *"
}
]
// ... and 963 more files (download for full content)
About this extraction
This page contains the full source code of the wchuanmu/RfTPM GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 1163 files (12.5 MB), approximately 3.3M tokens, and a symbol index with 7904 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.