diff --git a/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c b/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c index 39768fbac2..d6f4207a50 100644 --- a/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c +++ b/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c @@ -163,9 +163,9 @@ Rsa2048Sha256GuidedSectionHandler ( CertBlockRsa2048Sha256 = &((RSA_2048_SHA_256_SECTION2_HEADER *) InputSection)->CertBlockRsa2048Sha256; OutputBufferSize = SECTION2_SIZE (InputSection) - sizeof (RSA_2048_SHA_256_SECTION2_HEADER); if ((((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) { - PERF_START (NULL, "RsaCopy", "DXE", 0); + PERF_INMODULE_BEGIN ("DxeRsaCopy"); CopyMem (*OutputBuffer, (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION2_HEADER), OutputBufferSize); - PERF_END (NULL, "RsaCopy", "DXE", 0); + PERF_INMODULE_END ("DxeRsaCopy"); } else { *OutputBuffer = (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION2_HEADER); } @@ -191,9 +191,9 @@ Rsa2048Sha256GuidedSectionHandler ( CertBlockRsa2048Sha256 = &((RSA_2048_SHA_256_SECTION_HEADER *)InputSection)->CertBlockRsa2048Sha256; OutputBufferSize = SECTION_SIZE (InputSection) - sizeof (RSA_2048_SHA_256_SECTION_HEADER); if ((((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) { - PERF_START (NULL, "RsaCopy", "DXE", 0); + PERF_INMODULE_BEGIN ("DxeRsaCopy"); CopyMem (*OutputBuffer, (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION_HEADER), OutputBufferSize); - PERF_END (NULL, "RsaCopy", "DXE", 0); + PERF_INMODULE_END ("DxeRsaCopy"); } else { *OutputBuffer = (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION_HEADER); } @@ -327,9 +327,9 @@ Rsa2048Sha256GuidedSectionHandler ( *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED; goto Done; } - PERF_START (NULL, "RsaShaData", "DXE", 0); + PERF_INMODULE_BEGIN ("DxeRsaShaData"); CryptoStatus = Sha256Update (HashContext, *OutputBuffer, OutputBufferSize); - PERF_END (NULL, "RsaShaData", "DXE", 0); + PERF_INMODULE_END ("DxeRsaShaData"); if (!CryptoStatus) { DEBUG ((DEBUG_ERROR, "DxeRsa2048Sha256: Sha256Update() failed\n")); *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED; @@ -345,7 +345,7 @@ Rsa2048Sha256GuidedSectionHandler ( // // Verify the RSA 2048 SHA 256 signature. // - PERF_START (NULL, "RsaVerify", "DXE", 0); + PERF_INMODULE_BEGIN ("DxeRsaVerify"); CryptoStatus = RsaPkcs1Verify ( Rsa, Digest, @@ -353,7 +353,7 @@ Rsa2048Sha256GuidedSectionHandler ( CertBlockRsa2048Sha256->Signature, sizeof (CertBlockRsa2048Sha256->Signature) ); - PERF_END (NULL, "RsaVerify", "DXE", 0); + PERF_INMODULE_END ("DxeRsaVerify"); if (!CryptoStatus) { // // If RSA 2048 SHA 256 signature verification fails, AUTH tested failed bit is set. diff --git a/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c b/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c index ba1c700ad0..2272308ddc 100644 --- a/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c +++ b/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c @@ -160,9 +160,9 @@ Rsa2048Sha256GuidedSectionHandler ( CertBlockRsa2048Sha256 = &((RSA_2048_SHA_256_SECTION2_HEADER *) InputSection)->CertBlockRsa2048Sha256; OutputBufferSize = SECTION2_SIZE (InputSection) - sizeof (RSA_2048_SHA_256_SECTION2_HEADER); if ((((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) { - PERF_START (NULL, "RsaCopy", "PEI", 0); + PERF_INMODULE_BEGIN ("PeiRsaCopy"); CopyMem (*OutputBuffer, (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION2_HEADER), OutputBufferSize); - PERF_END (NULL, "RsaCopy", "PEI", 0); + PERF_INMODULE_END ("PeiRsaCopy"); } else { *OutputBuffer = (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION2_HEADER); } @@ -188,9 +188,9 @@ Rsa2048Sha256GuidedSectionHandler ( CertBlockRsa2048Sha256 = &((RSA_2048_SHA_256_SECTION_HEADER *)InputSection)->CertBlockRsa2048Sha256; OutputBufferSize = SECTION_SIZE (InputSection) - sizeof (RSA_2048_SHA_256_SECTION_HEADER); if ((((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) { - PERF_START (NULL, "RsaCopy", "PEI", 0); + PERF_INMODULE_BEGIN ("PeiRsaCopy"); CopyMem (*OutputBuffer, (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION_HEADER), OutputBufferSize); - PERF_END (NULL, "RsaCopy", "PEI", 0); + PERF_INMODULE_END ("PeiRsaCopy"); } else { *OutputBuffer = (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION_HEADER); } @@ -311,9 +311,9 @@ Rsa2048Sha256GuidedSectionHandler ( *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED; goto Done; } - PERF_START (NULL, "RsaShaData", "PEI", 0); + PERF_INMODULE_BEGIN ("PeiRsaShaData"); CryptoStatus = Sha256Update (HashContext, *OutputBuffer, OutputBufferSize); - PERF_END (NULL, "RsaShaData", "PEI", 0); + PERF_INMODULE_END ("PeiRsaShaData"); if (!CryptoStatus) { DEBUG ((DEBUG_ERROR, "PeiRsa2048Sha256: Sha256Update() failed\n")); *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED; @@ -329,7 +329,7 @@ Rsa2048Sha256GuidedSectionHandler ( // // Verify the RSA 2048 SHA 256 signature. // - PERF_START (NULL, "RsaVerify", "PEI", 0); + PERF_INMODULE_BEGIN ("PeiRsaVerify"); CryptoStatus = RsaPkcs1Verify ( Rsa, Digest, @@ -337,7 +337,7 @@ Rsa2048Sha256GuidedSectionHandler ( CertBlockRsa2048Sha256->Signature, sizeof (CertBlockRsa2048Sha256->Signature) ); - PERF_END (NULL, "RsaVerify", "PEI", 0); + PERF_INMODULE_END ("PeiRsaVerify"); if (!CryptoStatus) { // // If RSA 2048 SHA 256 signature verification fails, AUTH tested failed bit is set.