1+ from communication .fi_rng_commands import OTFIRng
2+ from communication .chip import *
3+ from communication .dut import DUT
4+ import time
5+
6+ def char_csrng_bias (opentitantool , iterations , trigger ):
7+ target = DUT ()
8+ reset_target (opentitantool )
9+ # Clear the output from the reset
10+ target .dump_all ()
11+
12+ rngfi = OTFIRng (target )
13+ # Initialize our chip and catch its output
14+ device_id , sensors , alerts , owner_page , boot_log , boot_measurements , version = rngfi .init ("char_csrng_bias" )
15+ for _ in range (iterations ):
16+ rngfi .rng_csrng_bias (trigger )
17+ response = target .read_response ()
18+ return response
19+
20+ def char_edn_resp_ack (opentitantool , iterations ):
21+ target = DUT ()
22+ reset_target (opentitantool )
23+ # Clear the output from the reset
24+ target .dump_all ()
25+
26+ rngfi = OTFIRng (target )
27+ # Initialize our chip and catch its output
28+ device_id , sensors , alerts , owner_page , boot_log , boot_measurements , version = rngfi .init ("char_edn_resp_ack" )
29+ for _ in range (iterations ):
30+ rngfi .rng_edn_resp_ack ()
31+ response = target .read_response ()
32+ return response
33+
34+ def char_edn_bias (opentitantool , iterations ):
35+ target = DUT ()
36+ reset_target (opentitantool )
37+ # Clear the output from the reset
38+ target .dump_all ()
39+
40+ rngfi = OTFIRng (target )
41+ # Initialize our chip and catch its output
42+ device_id , sensors , alerts , owner_page , boot_log , boot_measurements , version = rngfi .init ("char_edn_bias" )
43+ for _ in range (iterations ):
44+ rngfi .rng_edn_bias ()
45+ response = target .read_response ()
46+ return response
47+
48+ def char_entropy_bias (opentitantool , iterations ):
49+ target = DUT ()
50+ reset_target (opentitantool )
51+ # Clear the output from the reset
52+ target .dump_all ()
53+
54+ rngfi = OTFIRng (target )
55+ # Initialize our chip and catch its output
56+ device_id , sensors , alerts , owner_page , boot_log , boot_measurements , version = rngfi .init ("char_entropy_bias" )
57+ for _ in range (iterations ):
58+ rngfi .rng_entropy_bias ()
59+ response = target .read_response ()
60+ return response
61+
62+ def char_fw_overwrite (opentitantool , iterations , disable_health_check ):
63+ target = DUT ()
64+ rngfi = OTFIRng (target )
65+
66+ for _ in range (iterations ):
67+ reset_target (opentitantool )
68+ # Clear the output from the reset
69+ target .dump_all ()
70+
71+ # Initialize our chip and catch its output
72+ device_id , sensors , alerts , owner_page , boot_log , boot_measurements , version = rngfi .init ("char_fw_overwrite" )
73+ rngfi .rng_fw_overwrite (disable_health_check )
74+ response = target .read_response ()
75+ return response
0 commit comments