ms-tpm-20-ref 在linux下编译

news2025/1/12 15:48:24

1、代码地址,  GitHub - microsoft/ms-tpm-20-ref: Reference implementation of the TCG Trusted Platform Module 2.0 specification.Reference implementation of the TCG Trusted Platform Module 2.0 specification. - GitHub - microsoft/ms-tpm-20-ref: Reference implementation of the TCG Trusted Platform Module 2.0 specification.https://github.com/microsoft/ms-tpm-20-ref

2、解压后编译

(1)  cd到TPMCmd目录下面, cd xxxx/ms-tpm-20-ref/ms-tpm-20-ref-main/TPMCmd

 (2) ./bootstrap

./bootstrap 一般做了什么呢 ? :

        ./bootstrap 是一个常见的在 Unix 或 Linux 系统中用于初始化项目的脚本。具体做了什么取决于脚本的内容,但一般来说,它可能会做以下几件事:

1. 检查系统环境:检查是否安装了必要的软件和库,如果没有,可能会提示用户安装。

2. 配置项目:设置项目的环境变量,生成配置文件等。

3. 构建项目:编译源代码,生成可执行文件。

4. 安装依赖:如果项目有依赖其他库或者项目,./bootstrap 可能会自动下载并安装这些依赖。

这只是一般情况,具体的 ./bootstrap 脚本可能会根据项目的需要做更多的事情。如果你想了解一个具体的 ./bootstrap 脚本做了什么,你可以打开它看看脚本的内容。

(3)./configure

 如果需要去掉warn当error ,打开Makefile文件 ,找到 EXTRA_CFLAGS 去掉 -Werror

如果需要添加其它main函数:

1、首先把TPMCmds.c中的main函数改个名比如main333

2、把 其它main函数拷贝到 TPMCmds.c中 或者 CryptRsa.c中 ,比如:

int
main(
    int              argc,
    char* argv[]
)
{
    int		i;
    int		irc;

    printf("C:begin genRsaKey\n");
    UINT32               e = 0;
    TPMT_PUBLIC  publicArea;
    TPMT_SENSITIVE sensitive;
    RAND_STATE rand;

    printf("C:keyLengthInBitssxxxx  \n");

    unsigned char c[] = { 0xBC, 0xEF, 0x25, 0xFD, 0xD9, 0xB2, 0xDF, 0x0C, 0xEE, 0x50, 0x1C, 0x5D, 0xBD, 0xB4, 0x6B, 0x66, 0x1F, 0xBB, 0xB6, 0xD8, 0x3F, 0x4B, 0xF3, 0x2B, 0xD7, 0x06, 0x65, 0x9A, 0xE0, 0x96, 0xBD, 0xA5, 0xC7, 0xBC, 0x17, 0xBF, 0x2E, 0x9B, 0x2D, 0x8E, 0x29, 0xF8, 0x99, 0x13, 0x77, 0xAC, 0xD0, 0x4B };


    memset(rand.drbg.seed.bytes, 0,48);

    memcpy(rand.drbg.seed.bytes, c, 48);


    rand.drbg.magic = DRBG_MAGIC;
    rand.drbg.reseedCounter = 0x0000000000000064;


    publicArea.parameters.rsaDetail.exponent = 0;
    publicArea.parameters.rsaDetail.keyBits = 2048;
    publicArea.type = 1;
    publicArea.nameAlg = 11;

    publicArea.objectAttributes = 0x000300b2;
    publicArea.authPolicy.t.size = 32;
    

    TPMS_RSA_PARMS rsaParms = publicArea.parameters.rsaDetail;
    rsaParms.keyBits = 0x800;
    rsaParms.exponent = 0;
    rsaParms.symmetric.algorithm = 0x06;
    TPMU_SYM_KEY_BITS keyBits = rsaParms.symmetric.keyBits;
    keyBits.aes = 0x80;
    keyBits.camellia = 0x80;
    keyBits.sym = 0x80;
    keyBits.xor = 0x80;
  
    TPMU_SYM_MODE mode =  rsaParms.symmetric.mode;
    mode.aes = 0x43;
    mode.camellia = 0x43;
    mode.sym = 0x43;

    rsaParms.scheme.scheme = 0x10;
    rsaParms.scheme.details.rsapss.hashAlg = 0;

    sensitive.sensitiveType = 1;
    sensitive.authValue.t.size = 32;
    sensitive.seedValue.t.size = 0;
    sensitive.sensitive.rsa.t.size = 0;


    TPM_RC ret = CryptRsaGenerateKey(
        &publicArea,
        &sensitive,
        &rand
      
    );

    printf("C:CryptRsaGenerateKey = %d \n", ret);
    return ret;
}

(4)make

  make 完成后会生成 xxx.a文件:

Platform/src/libplatform.a

tpm/src/libtpm.a

Platform/src/libplatform.a

(5)

make完成后能看到 生成libtpm.a 的指令:

ar cru tpm/src/libtpm.a tpm/src/X509/tpm_src_libtpm_a-TpmASN1.o tpm/src/X509/tpm_src_libtpm_a-X509_ECC.o tpm/src/X509/tpm_src_libtpm_a-X509_RSA.o tpm/src/X509/tpm_src_libtpm_a-X509_spt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECC_Decrypt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECC_Encrypt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECC_Parameters.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECDH_KeyGen.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ECDH_ZGen.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-EC_Ephemeral.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-RSA_Decrypt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-RSA_Encrypt.o tpm/src/command/Asymmetric/tpm_src_libtpm_a-ZGen_2Phase.o tpm/src/command/AttachedComponent/tpm_src_libtpm_a-AC_GetCapability.o tpm/src/command/AttachedComponent/tpm_src_libtpm_a-AC_Send.o tpm/src/command/AttachedComponent/tpm_src_libtpm_a-AC_spt.o tpm/src/command/AttachedComponent/tpm_src_libtpm_a-Policy_AC_SendSelect.o tpm/src/command/Attestation/tpm_src_libtpm_a-Attest_spt.o tpm/src/command/Attestation/tpm_src_libtpm_a-Certify.o tpm/src/command/Attestation/tpm_src_libtpm_a-CertifyCreation.o tpm/src/command/Attestation/tpm_src_libtpm_a-CertifyX509.o tpm/src/command/Attestation/tpm_src_libtpm_a-GetCommandAuditDigest.o tpm/src/command/Attestation/tpm_src_libtpm_a-GetSessionAuditDigest.o tpm/src/command/Attestation/tpm_src_libtpm_a-GetTime.o tpm/src/command/Attestation/tpm_src_libtpm_a-Quote.o tpm/src/command/Capability/tpm_src_libtpm_a-GetCapability.o tpm/src/command/Capability/tpm_src_libtpm_a-TestParms.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ACT_SetTimeout.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ACT_spt.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ClockRateAdjust.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ClockSet.o tpm/src/command/ClockTimer/tpm_src_libtpm_a-ReadClock.o tpm/src/command/CommandAudit/tpm_src_libtpm_a-SetCommandCodeAuditStatus.o tpm/src/command/Context/tpm_src_libtpm_a-ContextLoad.o tpm/src/command/Context/tpm_src_libtpm_a-ContextSave.o tpm/src/command/Context/tpm_src_libtpm_a-Context_spt.o tpm/src/command/Context/tpm_src_libtpm_a-EvictControl.o tpm/src/command/Context/tpm_src_libtpm_a-FlushContext.o tpm/src/command/DA/tpm_src_libtpm_a-DictionaryAttackLockReset.o tpm/src/command/DA/tpm_src_libtpm_a-DictionaryAttackParameters.o tpm/src/command/Duplication/tpm_src_libtpm_a-Duplicate.o tpm/src/command/Duplication/tpm_src_libtpm_a-Import.o tpm/src/command/Duplication/tpm_src_libtpm_a-Rewrap.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyAuthValue.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyAuthorize.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyAuthorizeNV.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyCommandCode.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyCounterTimer.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyCpHash.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyDuplicationSelect.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyGetDigest.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyLocality.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyNV.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyNameHash.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyNvWritten.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyOR.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyPCR.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyPassword.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyPhysicalPresence.o tpm/src/command/EA/tpm_src_libtpm_a-PolicySecret.o tpm/src/command/EA/tpm_src_libtpm_a-PolicySigned.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyTemplate.o tpm/src/command/EA/tpm_src_libtpm_a-PolicyTicket.o tpm/src/command/EA/tpm_src_libtpm_a-Policy_spt.o tpm/src/command/Ecdaa/tpm_src_libtpm_a-Commit.o tpm/src/command/FieldUpgrade/tpm_src_libtpm_a-FieldUpgradeData.o tpm/src/command/FieldUpgrade/tpm_src_libtpm_a-FieldUpgradeStart.o tpm/src/command/FieldUpgrade/tpm_src_libtpm_a-FirmwareRead.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-EventSequenceComplete.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-HMAC_Start.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-HashSequenceStart.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-MAC_Start.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-SequenceComplete.o tpm/src/command/HashHMAC/tpm_src_libtpm_a-SequenceUpdate.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-ChangeEPS.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-ChangePPS.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-Clear.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-ClearControl.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-CreatePrimary.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-HierarchyChangeAuth.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-HierarchyControl.o tpm/src/command/Hierarchy/tpm_src_libtpm_a-SetPrimaryPolicy.o tpm/src/command/Misc/tpm_src_libtpm_a-PP_Commands.o tpm/src/command/Misc/tpm_src_libtpm_a-SetAlgorithmSet.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Certify.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_ChangeAuth.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_DefineSpace.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Extend.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_GlobalWriteLock.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Increment.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Read.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_ReadLock.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_ReadPublic.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_SetBits.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_UndefineSpace.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_UndefineSpaceSpecial.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_Write.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_WriteLock.o tpm/src/command/NVStorage/tpm_src_libtpm_a-NV_spt.o tpm/src/command/Object/tpm_src_libtpm_a-ActivateCredential.o tpm/src/command/Object/tpm_src_libtpm_a-Create.o tpm/src/command/Object/tpm_src_libtpm_a-CreateLoaded.o tpm/src/command/Object/tpm_src_libtpm_a-Load.o tpm/src/command/Object/tpm_src_libtpm_a-LoadExternal.o tpm/src/command/Object/tpm_src_libtpm_a-MakeCredential.o tpm/src/command/Object/tpm_src_libtpm_a-ObjectChangeAuth.o tpm/src/command/Object/tpm_src_libtpm_a-Object_spt.o tpm/src/command/Object/tpm_src_libtpm_a-ReadPublic.o tpm/src/command/Object/tpm_src_libtpm_a-Unseal.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Allocate.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Event.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Extend.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Read.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_Reset.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_SetAuthPolicy.o tpm/src/command/PCR/tpm_src_libtpm_a-PCR_SetAuthValue.o tpm/src/command/Random/tpm_src_libtpm_a-GetRandom.o tpm/src/command/Random/tpm_src_libtpm_a-StirRandom.o tpm/src/command/Session/tpm_src_libtpm_a-PolicyRestart.o tpm/src/command/Session/tpm_src_libtpm_a-StartAuthSession.o tpm/src/command/Signature/tpm_src_libtpm_a-Sign.o tpm/src/command/Signature/tpm_src_libtpm_a-VerifySignature.o tpm/src/command/Startup/tpm_src_libtpm_a-Shutdown.o tpm/src/command/Startup/tpm_src_libtpm_a-Startup.o tpm/src/command/Symmetric/tpm_src_libtpm_a-EncryptDecrypt.o tpm/src/command/Symmetric/tpm_src_libtpm_a-EncryptDecrypt2.o tpm/src/command/Symmetric/tpm_src_libtpm_a-EncryptDecrypt_spt.o tpm/src/command/Symmetric/tpm_src_libtpm_a-HMAC.o tpm/src/command/Symmetric/tpm_src_libtpm_a-Hash.o tpm/src/command/Symmetric/tpm_src_libtpm_a-MAC.o tpm/src/command/Testing/tpm_src_libtpm_a-GetTestResult.o tpm/src/command/Testing/tpm_src_libtpm_a-IncrementalSelfTest.o tpm/src/command/Testing/tpm_src_libtpm_a-SelfTest.o tpm/src/command/Vendor/tpm_src_libtpm_a-Vendor_TCG_Test.o tpm/src/crypt/tpm_src_libtpm_a-AlgorithmTests.o tpm/src/crypt/tpm_src_libtpm_a-BnConvert.o tpm/src/crypt/tpm_src_libtpm_a-BnMath.o tpm/src/crypt/tpm_src_libtpm_a-BnMemory.o tpm/src/crypt/tpm_src_libtpm_a-CryptCmac.o tpm/src/crypt/tpm_src_libtpm_a-CryptDes.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccCrypt.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccData.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccKeyExchange.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccMain.o tpm/src/crypt/tpm_src_libtpm_a-CryptEccSignature.o tpm/src/crypt/tpm_src_libtpm_a-CryptHash.o tpm/src/crypt/tpm_src_libtpm_a-CryptPrime.o tpm/src/crypt/tpm_src_libtpm_a-CryptPrimeSieve.o tpm/src/crypt/tpm_src_libtpm_a-CryptRand.o tpm/src/crypt/tpm_src_libtpm_a-CryptRsa.o tpm/src/crypt/tpm_src_libtpm_a-CryptSelfTest.o tpm/src/crypt/tpm_src_libtpm_a-CryptSmac.o tpm/src/crypt/tpm_src_libtpm_a-CryptSym.o tpm/src/crypt/tpm_src_libtpm_a-CryptUtil.o tpm/src/crypt/tpm_src_libtpm_a-PrimeData.o tpm/src/crypt/tpm_src_libtpm_a-RsaKeyCache.o tpm/src/crypt/tpm_src_libtpm_a-Ticket.o tpm/src/crypt/ltc/tpm_src_libtpm_a-TpmToLtcDesSupport.o tpm/src/crypt/ltc/tpm_src_libtpm_a-TpmToLtcMath.o tpm/src/crypt/ltc/tpm_src_libtpm_a-TpmToLtcSupport.o tpm/src/crypt/ossl/tpm_src_libtpm_a-TpmToOsslDesSupport.o tpm/src/crypt/ossl/tpm_src_libtpm_a-TpmToOsslMath.o tpm/src/crypt/ossl/tpm_src_libtpm_a-TpmToOsslSupport.o tpm/src/crypt/wolf/tpm_src_libtpm_a-TpmToWolfDesSupport.o tpm/src/crypt/wolf/tpm_src_libtpm_a-TpmToWolfMath.o tpm/src/crypt/wolf/tpm_src_libtpm_a-TpmToWolfSupport.o tpm/src/events/tpm_src_libtpm_a-_TPM_Hash_Data.o tpm/src/events/tpm_src_libtpm_a-_TPM_Hash_End.o tpm/src/events/tpm_src_libtpm_a-_TPM_Hash_Start.o tpm/src/events/tpm_src_libtpm_a-_TPM_Init.o tpm/src/main/tpm_src_libtpm_a-CommandDispatcher.o tpm/src/main/tpm_src_libtpm_a-ExecCommand.o tpm/src/main/tpm_src_libtpm_a-SessionProcess.o tpm/src/subsystem/tpm_src_libtpm_a-CommandAudit.o tpm/src/subsystem/tpm_src_libtpm_a-DA.o tpm/src/subsystem/tpm_src_libtpm_a-Hierarchy.o tpm/src/subsystem/tpm_src_libtpm_a-NvDynamic.o tpm/src/subsystem/tpm_src_libtpm_a-NvReserved.o tpm/src/subsystem/tpm_src_libtpm_a-Object.o tpm/src/subsystem/tpm_src_libtpm_a-PCR.o tpm/src/subsystem/tpm_src_libtpm_a-PP.o tpm/src/subsystem/tpm_src_libtpm_a-Session.o tpm/src/subsystem/tpm_src_libtpm_a-Time.o tpm/src/support/tpm_src_libtpm_a-AlgorithmCap.o tpm/src/support/tpm_src_libtpm_a-Bits.o tpm/src/support/tpm_src_libtpm_a-CommandCodeAttributes.o tpm/src/support/tpm_src_libtpm_a-Entity.o tpm/src/support/tpm_src_libtpm_a-Global.o tpm/src/support/tpm_src_libtpm_a-Handle.o tpm/src/support/tpm_src_libtpm_a-IoBuffers.o tpm/src/support/tpm_src_libtpm_a-Locality.o tpm/src/support/tpm_src_libtpm_a-Manufacture.o tpm/src/support/tpm_src_libtpm_a-Marshal.o tpm/src/support/tpm_src_libtpm_a-MathOnByteBuffers.o tpm/src/support/tpm_src_libtpm_a-Memory.o tpm/src/support/tpm_src_libtpm_a-Power.o tpm/src/support/tpm_src_libtpm_a-PropertyCap.o tpm/src/support/tpm_src_libtpm_a-Response.o tpm/src/support/tpm_src_libtpm_a-ResponseCodeProcessing.o tpm/src/support/tpm_src_libtpm_a-TableDrivenMarshal.o tpm/src/support/tpm_src_libtpm_a-TableMarshalData.o tpm/src/support/tpm_src_libtpm_a-TpmFail.o tpm/src/support/tpm_src_libtpm_a-TpmSizeChecks.o   


5.1 如果需要把tpm模块编译成 可执行文件则:

ar指令前面改成: gcc  -fPIC -L Platform/src/ -L tpm/src/ -o tpm/src/libtpmExeMS

后面添加:   -lcrypto -lplatform -ltpm   (注意不能在前面加,否则会报符号找不到)

5.2 如果需要编译成 动态库.so文件则:

ar指令前面改成:gcc  -fPIC -L Platform/src/ -L tpm/src/  -shared  -o tpm/src/libtpm2.so 

后面添加:  -lcrypto -lplatform -ltpm (注意不能在前面加,否则会报符号找不到)

5.3  make后会把Simulator模块编译成可执行文件

gcc -std=gnu11  -Wall -Wformat-security -fstack-protector-all -fPIC -Wno-error=empty-body -Wno-error=parentheses -Wno-error=pointer-to-int-cast -Wno-error=missing-braces -Wno-error=unused-result -I ./Platform/include -I ./Platform/include/prototypes -I ./tpm/include -I ./tpm/include/prototypes -I ./Simulator/include -I ./Simulator/include/prototypes  -pthread -g -O2   -o Simulator/src/tpm2-simulator Simulator/src/Simulator_src_tpm2_simulator-TPMCmdp.o Simulator/src/Simulator_src_tpm2_simulator-TPMCmds.o Simulator/src/Simulator_src_tpm2_simulator-TcpServer.o  Platform/src/libplatform.a tpm/src/libtpm.a Platform/src/libplatform.a -lcrypto

其中,

输出为:Simulator/src/tpm2-simulator

输入为;

Simulator 目录下的3个.o文件

3个静态库.a和openssl库crypto

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/915463.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

企业/公司电脑图纸加密软件系统——「天锐绿盾加密软件」

天锐绿盾是一款企业级透明加密软件,旨在保护企业或设计院的图纸文件和电子文档,防止信息泄露和数据安全问题。 ​ 天锐绿盾采用了核心驱动层的透明加密 技术,可以在操作系统层自动对所有需要加密的文档进行加密和解密,用户在使用加…

交换机的基本原理与配置(二)

目录 2. 以太网交换机 2.1 交换机设备简介 2.2交换机的工作原理 2.3交换机接口的双工模式 2. 以太网交换机 下面通过交换机设备简介,交换机的工作原理及交换机接口模式来了解以太网交换机。 2.1 交换机设备简介 交换机的品牌众多,像Cisco公司&#xf…

自动设置服务器全教程

亲爱的爬虫探险家!在网络爬虫的世界里,自动设置代理服务器是一个非常有用的技巧。今天,作为一家代理服务器供应商,我将为你呈上一份轻松实用的教程,帮助你轻松搞定爬虫自动设置代理服务器。 一、为什么需要自动设置代…

华为OD-第K长的连续字母字符串长度

题目描述 给定一个字符串,只包含大写字母,求在包含同一字母的子串中,长度第 k 长的子串的长度,相同字母只取最长的那个子串。 代码实现 # coding:utf-8 # 第K长的连续字母字符串长度 # https://www.nowcoder.com/discuss/353150…

差分走线的要求

1 等长:等长是指两条线的长度要尽量一样长,是为了保证两个差分信号时刻保持相反极性。减少共模分量。 2等宽等距:等宽是指两条信号的走线宽度需要保持一致,等距是指两条线之间的间距要保持不变,保持平行。 对走线要求最…

pytorch下的scatter、sparse安装

知道自己下载的torch配置 import torch print(torch.__version__) print(torch.version.cuda)进入网站,选择自己配置 https://pytorch-geometric.com/whl/下载相应的包 安装 pip install ******.whl

办公网络布线(三)

目录 3.布线施工设计 3.1 宿舍楼布线设计 3.布线施工设计 如图所示为宿舍楼平面图。 3.1 宿舍楼布线设计 前面讲解了布线系统的常识及具体实施的细节,但在实际工作中,作为工程的实施人员往往需要根据甲方提供的建筑平面图图纸给出网络建设方案&#xf…

Commonjs和Es6语法规范的理解

ES6 module和CommonJS到底有什么区别? “ES6 module是编译时加载,输出的是接口,CommonJS运行时加载,加载的是一个对象” 这里的“编译时”是什么意思?和运行时有什么区别?“接口”又是什么意思?…

Oracle-rolling upgrade升级19c

前言: 本文主要描述Oracle11g升19c rolling upgrade升级测试,通过逻辑DGautoupgrade方式实现rolling upgrade,从而达到在较少停机时间内完成Oracle11g升级到19c的目标 升级介绍: 升级技术: rolling upgrade轮询升级,通过采用跨版…

PS gif修改背景颜色(附加图片)

文章目录 问题描述.mp4转换为.gif 解决方案gif更换背景修改背景具体操作第一步第二步第三步第四步第五步第六步 总结 大家好!不知不觉又到周二了,农历:七月七,本来今天可以高高兴兴的度过一天,唉,接到领导布…

强训第38天

选择 D 0作为本地宿主机&#xff0c;127作为内部回送&#xff0c;不予分配 A B C C 存储在浏览器 D A B B D 网络延迟是指从报文开始进入网络到它离开网络之间的时间 编程 红与黑 红与黑__牛客网 #include <iostream> #include <stdexcept> #include <string…

【仿写框架之仿写Tomact】一、详解Tomcat的工作流程

文章目录 1、启动阶段2、监听阶段&#xff1a;3、请求处理阶段&#xff1a;4、发送请求处理后的响应 当涉及到Java Web应用程序的部署和运行&#xff0c;Apache Tomcat无疑是一个备受欢迎的选择。Tomcat作为一个开源的、轻量级的Java Servlet容器和JavaServer Pages (JSP) 容器…

排兵布阵很重要

以正合&#xff0c;以奇胜&#xff0c;排兵布阵很重要 【安志强趣讲《孙子兵法》第17讲】 第五章&#xff1a;势篇 【全文趣讲大白话】 善于打仗&#xff0c;能恰当的分兵&#xff0c;能借势。 【原文】 孙子曰&#xff1a;凡治众如治寡&#xff0c;分数是也&#xff1b;斗众如…

SFL214-100-21-10喷嘴挡板伺服阀

SFL214-100-21-10、SFL214-150-21-15、SFL214-100-32-40、SFL214-100-21-40、SFL216-230-21-40、SFL216-230-32-40采用千式力马达和两级液压放大器结构前置级为无摩撩副的双喷嘴挡板阀性能优良&#xff0c;动态响应高适用于对位置&#xff0c;力和速度进行闭环控制可用作三通阀…

函数的使用-1函数默认参数

在C中&#xff0c;函数的形参列表中的形参是可以有默认值的。 语法&#xff1a; 返回值类型 函数名 &#xff08;参数 默认值&#xff09;{} 1. 如果某个位置参数有默认值&#xff0c;那么从这个位置往后&#xff0c;从左向右&#xff0c;必须都要有默认值 2. 如果函数声明有默…

FPGA实现10G万兆网TCP/IP 协议栈,纯VHDL代码编写,提供服务器和客户端2套工程源码和技术支持

目录 1、前言免责声明 2、我这里已有的以太网方案3、该TCP/IP协议栈性能常规性能支持多节点FPGA资源占用少数据吞吐率高低延时性能 4、TCP/IP 协议栈代码详解代码架构用户接口代码模块级细讲顶层模块PACKET_PARSING_10G模块ARP_10G模块DHCP_SERVER_10G和 DHCP_CLIENT_10G模块IG…

c语言实现双向链表

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言一、链表的分类1、 单向或者双向链表2、带头结点或者不带头结点的链表3、循环或者非循环链表 二、带头双向循环链表1、链表结点的结构体定义2、链表的初始化3、…

交换机的基本原理与配置(三)

目录 3. 交换机基本配置 3.1 交换机配置前的连接 3.2 Cisco交换机的命令行模式 3.3 交换机的常见命令 3. 交换机基本配置 交换机的基本配置介绍如下。 3.1 交换机配置前的连接 配置一台Cisco交换机的方法有多种&#xff0c;本节介绍通过Console(控制台)接口讲行配置的方式这…

PCIE超高速实时运动控制卡在六面外观视觉检测上的应用

市场应用背景 XPCIE1028超高速实时运动控制卡在六面外观检测高速视觉筛选中的应用&#xff0c;结合正运动技术提供的专用筛选机调试软件&#xff0c;可实现15000pcs/分钟的IO触发检测速度&#xff0c;只需简单参数设置&#xff0c;搭配图像采集硬件和视觉处理软件&#xff0c;…