Yes we did use PRNG(DRBG), the entropy pool is polled from HW RngLib. Seed is 
generated by TSC.

Regards,
Yi

From: Ard Biesheuvel <[email protected]>
Sent: Friday, June 14, 2024 3:52 PM
To: Li, Yi1 <[email protected]>
Cc: Yao, Jiewen <[email protected]>; [email protected]; Hou, Wenxing 
<[email protected]>; Kinney, Michael D <[email protected]>; Pedro 
Falcato <[email protected]>
Subject: Re: CryptoPkg host test broken due to smoketest for RDRAND

For crypto unit tests, it is generally better to use a pseudo-random RNG, with 
a known (but not constant) seed, so that potential failures can be diagnosed 
more easily. E.g., the seed could be logged in the test output.


On Fri, 14 Jun 2024 at 09:24, Li, Yi1 
<[email protected]<mailto:[email protected]>> wrote:
Yes, we can create a host test specific lib if no better ways.

Regards,
Yi

From: Yao, Jiewen <[email protected]<mailto:[email protected]>>
Sent: Friday, June 14, 2024 3:20 PM
To: Li, Yi1 <[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]>
Cc: Hou, Wenxing <[email protected]<mailto:[email protected]>>; Kinney, 
Michael D <[email protected]<mailto:[email protected]>>; 
Pedro Falcato <[email protected]<mailto:[email protected]>>; Ard 
Biesheuvel <[email protected]<mailto:ardb%[email protected]>>
Subject: RE: CryptoPkg host test broken due to smoketest for RDRAND

Can we use a host test specific RngLib?



From: Li, Yi1 <[email protected]<mailto:[email protected]>>
Sent: Friday, June 14, 2024 3:08 PM
To: [email protected]<mailto:[email protected]>
Cc: Hou, Wenxing <[email protected]<mailto:[email protected]>>; Yao, 
Jiewen <[email protected]<mailto:[email protected]>>; Kinney, Michael D 
<[email protected]<mailto:[email protected]>>; Pedro Falcato 
<[email protected]<mailto:[email protected]>>; Ard Biesheuvel 
<[email protected]<mailto:[email protected]>>
Subject: CryptoPkg host test broken due to smoketest for RDRAND

All crypto host tests which consumed randlib broken due to:
https://github.com/tianocore/edk2/pull/5714
Not sure why this issue not reported  by CI when merge this PR.

The reason is that the ```BaseRngLibConstructor``` of rnglib is not called in 
host test, so ```mRdRandSupported``` is not enabled.
Then the Crypto API calls ```GetRandomNumber*``` will fail.
GetRandomNumber64 (
  OUT     UINT64  *Rand
  )
{
  ……
  if (!ArchIsRngSupported ()) {
    return FALSE;
  }

Is there a way to let unit test host to call the constructors correctly?

Regards,
Yi



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119573): https://edk2.groups.io/g/devel/message/119573
Mute This Topic: https://groups.io/mt/106666288/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to