#include <stdint.h>
/* Failure-only test provider. It never returns the accepted success code 1,
never provides entropy, and is never linked into the guest or TLS port.
Dirtying the span first verifies the managed adapter clears partial output. */
#ifndef FAILURE_RESULT
#define FAILURE_RESULT 0
#endif
#ifdef OMIT_ENTROPY_FILL
int xfe_test_entropy_absent(void) { return 0; }
#else
int xfe_runtime_random_fill(uint8_t* destination, uint32_t length)
{
if (length > 1048576 || (length && !destination)) return FAILURE_RESULT;
volatile uint8_t* output = destination;
for (uint32_t index = 0; index < length; index++) output[index] = 0xA5;
return FAILURE_RESULT;
}
#endif
#include <stdint.h>
/* Failure-only test provider. It never returns the accepted success code 1,
never provides entropy, and is never linked into the guest or TLS port.
Dirtying the span first verifies the managed adapter clears partial output. */
#ifndef FAILURE_RESULT
#define FAILURE_RESULT 0
#endif
#ifdef OMIT_ENTROPY_FILL
int xfe_test_entropy_absent(void) { return 0; }
#else
int xfe_runtime_random_fill(uint8_t* destination, uint32_t length)
{
if (length > 1048576 || (length && !destination)) return FAILURE_RESULT;
volatile uint8_t* output = destination;
for (uint32_t index = 0; index < length; index++) output[index] = 0xA5;
return FAILURE_RESULT;
}
#endif