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-dmar.c b/generator/sections/gen-section-dmar.c
index 7c2a85f..4062338 100644
--- a/generator/sections/gen-section-dmar.c
+++ b/generator/sections/gen-section-dmar.c
@@ -25,10 +25,10 @@
 	*(reserved + 1) = 0;
 
 	//Set expected values.
-	*(bytes + 4) = rand() % 0xC;   //Fault reason.
-	*(bytes + 5) = rand() % 2;     //Access type.
-	*(bytes + 6) = rand() % 2;     //Address type.
-	*(bytes + 7) = rand() % 2 + 1; //Architecture type.
+	*(bytes + 4) = cper_rand() % 0xC;   //Fault reason.
+	*(bytes + 5) = cper_rand() % 2;	    //Access type.
+	*(bytes + 6) = cper_rand() % 2;	    //Address type.
+	*(bytes + 7) = cper_rand() % 2 + 1; //Architecture type.
 
 	//Set return values, exit.
 	*location = bytes;