CryptPkg: Enable CryptoPkg BaseCryptLib ParallelHash for PEI and DXE

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4097

The BaseCryptLib in the CryptoPkg currently supports ParallelHash
algorithm for SMM. The MP Services PPI and MP Services Protocol
could be used to enable ParallelHash in PEI and DXE
versions of the BaseCryptLib.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Zhihao Li <zhihao.li@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Zhihao Li
2022-11-30 22:21:02 +08:00
committed by mergify[bot]
parent 47d988387e
commit 5d5be45bd1
8 changed files with 183 additions and 27 deletions

View File

@ -7,7 +7,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "CryptParallelHash.h"
#include <Library/MmServicesTableLib.h>
#include <Library/SynchronizationLib.h>
#define PARALLELHASH_CUSTOMIZATION "ParallelHash"
@ -69,27 +68,6 @@ ParallelHashApExecute (
}
}
/**
Dispatch the block task to each AP in SMM mode.
**/
VOID
EFIAPI
MmDispatchBlockToAP (
VOID
)
{
UINTN Index;
for (Index = 0; Index < gMmst->NumberOfCpus; Index++) {
if (Index != gMmst->CurrentlyExecutingCpu) {
gMmst->MmStartupThisAp (ParallelHashApExecute, Index, NULL);
}
}
return;
}
/**
Parallel hash function ParallelHash256, as defined in NIST's Special Publication 800-185,
published December 2016.
@ -197,9 +175,7 @@ ParallelHash256HashAll (
//
// Dispatch blocklist to each AP.
//
if (gMmst != NULL) {
MmDispatchBlockToAP ();
}
DispatchBlockToAp ();
//
// Wait until all block hash completed.