Fix randomizer

Relying on the system randomizer for unit tests leads to cases where we
don't get deterministic results, which causes inconsistent results.
These random results don't need to be secure, so reimplement as a simple
linear feedback shift register[1].  This makes our unit tests now
produce the same output every time we call generate.

Note, this change showed a weakness in our testing, where timestamps
relied on different rules for ir->cper versus cper->ir.  hour 24 should
be allowed.

[1] https://en.wikipedia.org/wiki/Linear-feedback_shift_register

Change-Id: I0756b086c8ea5fb934e450f5d33e3ae0036868b3
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/generator/sections/gen-section-cxl-protocol.c b/generator/sections/gen-section-cxl-protocol.c
index 1918d68..e171c7f 100644
--- a/generator/sections/gen-section-cxl-protocol.c
+++ b/generator/sections/gen-section-cxl-protocol.c
@@ -16,15 +16,15 @@
 {
 	//Create a random length for the CXL DVSEC and CXL error log.
 	//The logs attached here do not necessarily conform to the specification, and are simply random.
-	int dvsec_len = rand() % 64;
-	int error_log_len = rand() % 64;
+	int dvsec_len = cper_rand() % 64;
+	int error_log_len = cper_rand() % 64;
 
 	//Create random bytes.
 	int size = 116 + dvsec_len + error_log_len;
 	UINT8 *bytes = generate_random_bytes(size);
 
 	//Set CXL agent type.
-	int cxl_agent_type = rand() % 2;
+	int cxl_agent_type = cper_rand() % 2;
 	*(bytes + 8) = cxl_agent_type;
 
 	//Set reserved areas to zero.