Software APIs
dif_entropy_src.h
Go to the documentation of this file.
1// Copyright lowRISC contributors (OpenTitan project).
2// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3// SPDX-License-Identifier: Apache-2.0
4
5#ifndef OPENTITAN_SW_DEVICE_LIB_DIF_DIF_ENTROPY_SRC_H_
6#define OPENTITAN_SW_DEVICE_LIB_DIF_DIF_ENTROPY_SRC_H_
7
8/**
9 * @file
10 * @brief <a href="/book/hw/ip/entropy_src/">Entropy Source</a> Device Interface
11 * Functions
12 */
13
14#include <stdint.h>
15
19
20#include "sw/device/lib/dif/autogen/dif_entropy_src_autogen.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif // __cplusplus
25
26/**
27 * A single-bit RNG mode, where only one bit is sampled.
28 */
30 /**
31 * Single-bit-mode, sampling the zeroth bit.
32 */
34 /**
35 * Single-bit-mode, sampling the first bit.
36 */
38 /**
39 * Single-bit-mode, sampling the second bit.
40 */
42 /**
43 * Single-bit-mode, sampling the third bit.
44 */
46 /**
47 * Indicates that single-bit-mode is disabled.
48 */
51
52/**
53 * Main FSM state.
54 */
56 kDifEntropySrcMainFsmStateIdle = 0x0f5,
57 kDifEntropySrcMainFsmStateBootHTRunning = 0x1d2,
58 kDifEntropySrcMainFsmStateBootPostHTChk = 0x16e,
59 kDifEntropySrcMainFsmStateBootPhaseDone = 0x08e,
60 kDifEntropySrcMainFsmStateStartupHTStart = 0x02c,
61 kDifEntropySrcMainFsmStateStartupPhase1 = 0x101,
62 kDifEntropySrcMainFsmStateStartupPass1 = 0x1a5,
63 kDifEntropySrcMainFsmStateStartupFail1 = 0x017,
64 kDifEntropySrcMainFsmStateContHTStart = 0x040,
65 kDifEntropySrcMainFsmStateContHTRunning = 0x1a2,
66 kDifEntropySrcMainFsmStateFWInsertStart = 0x0c3,
67 kDifEntropySrcMainFsmStateFWInsertMsg = 0x059,
68 kDifEntropySrcMainFsmStateSha3MsgDone = 0x10f,
69 kDifEntropySrcMainFsmStateSha3Process = 0x0f8,
70 kDifEntropySrcMainFsmStateSha3Valid = 0x0bf,
71 kDifEntropySrcMainFsmStateSha3Done = 0x198,
72 kDifEntropySrcMainFsmStateAlertState = 0x1cd,
73 kDifEntropySrcMainFsmStateAlertHang = 0x1fb,
74 kDifEntropySrcMainFsmStateError = 0x73
76
77/**
78 * Firmware override parameters for an entropy source.
79 */
81 /**
82 * Enables firmware to insert entropy bits back into the pre-conditioner FIFO
83 * via `dif_entropy_src_fw_ov_data_write()` calls. This feature is useful when
84 * the firmware is required to implement additional health checks, and to
85 * perform known answer tests of the conditioner.
86 *
87 * To take effect, this requires the firmware override feature to be enabled.
88 */
90 /**
91 * This field sets the depth of the observe FIFO hardware buffer used when
92 * the firmware override feature is enabled.
93 */
96
97/**
98 * Runtime configuration for an entropy source.
99 *
100 * This struct describes runtime information for one-time configuration of the
101 * hardware.
102 */
104 /**
105 * If set, FIPS compliant entropy will be generated by this module after being
106 * processed by an SP 800-90B compliant conditioning function.
107 *
108 * Software may opt for implementing FIPS mode of operation without hardware
109 * support by setting this field to false. In such case, software is
110 * responsible for implementing the conditioning function.
111 */
113 /**
114 * If set, the produced output entropy is marked as FIPS compliant
115 * through the FIPS bit being set to high.
116 */
118 /**
119 * If set, the noise source is instructed to produce high quality entropy.
120 */
122 /**
123 * If set, entropy will be routed to a firmware-visible register instead of
124 * being distributed to other hardware IPs.
125 */
127 /**
128 * If set, raw entropy will be sent to CSRNG, bypassing the conditioner block
129 * and disabling the FIPS flag. Note that the FIPS flag is different from
130 * running the block in FIPS mode. FIPS mode refers to running the entropy_src
131 * in continuous mode. Also note that if `fips_enable` is set to `True`, then
132 * at most one of either `route_to_firmware` or `bypass_conditioner` may be
133 * set, but will result in disabling the FIPS mode of operation from a
134 * hardware perspective.
135 */
137 /**
138 * If set, the esfinal FIFO holding previously produced entropy seeds is
139 * cleared upon disabling the module. Otherwise, previously produced entropy
140 * seeds get served to CSRNG upon request or can alternatively get read out
141 * via ENTROPY_DATA CSR even after disabling the module.
142 */
144 /**
145 * Specifies which single-bit-mode to use, if any at all. FIPS mode of
146 * operation is disabled in single-bit-mode of operation is selected.
147 */
149 /**
150 * Controls the scope (either by-line or by-sum) of the health tests.
151 *
152 * If true, the Adaptive Proportion (non-Symbol variant) and Markov Tests will
153 * accumulate all RNG input lines into a single score, and thresholds will be
154 * applied to the sum of all the entropy input lines.
155 *
156 * If false, the RNG input lines are all scored individually. A statistical
157 * deviation in any one input line, be it due to coincidence or failure, will
158 * force rejection of the sample, and count toward the total alert count.
159 */
161 /**
162 * The size of the window used for health tests.
163 *
164 * Units: bits
165 */
167 /**
168 * The number of health test failures that must occur before an alert is
169 * triggered. When set to 0, alerts are disabled.
170 */
173
174/**
175 * A statistical test on the bits emitted by an entropy source.
176 */
178 /**
179 * An SP 800-90B repetition count test.
180 *
181 * This test screens for stuck bits, or a total failure of the noise source.
182 * This test fails if any sequence of bits repeats too many times in a row
183 * for too many samples.
184 */
186 /**
187 * An SP 800-90B symbol repetition count test.
188 *
189 * This is similar to the above, test but is performed on a symbol, instead of
190 * bit, basis.
191 */
193 /**
194 * An SP 800-90B adaptive proportion test.
195 *
196 * This test screens for statistical bias in the number of ones or zeros
197 * output by the noise source.
198 */
200 /**
201 * An SP 800-90B adaptive proportion symbol test.
202 *
203 * This is similar to the above, test but is performed on a symbol, instead of
204 * bit, basis.
205 */
207 /**
208 * A bucket test.
209 *
210 * This test looks for correlations between individual noise channels.
211 */
213 /**
214 * A "Markov" test.
215 *
216 * This test looks for unexpected first-order temporal correlations
217 * between individual noise channels.
218 */
220 /**
221 * A firmware-driven "mailbox" test.
222 *
223 * This test allows firmware to inspect 2kbit blocks of entropy, and signal
224 * potential concerns to the hardware.
225 */
227 /** \internal */
228 kDifEntropySrcTestNumVariants = 7,
230
231/**
232 * Criteria used by various entropy source health tests to decide whether the
233 * test has failed.
234 */
236 /**
237 * The entropy source health test type to configure.
238 */
240 /**
241 * The high threshold for the health test.
242 */
244 /**
245 * The low threshold for the health test.
246 *
247 * If the corresponding health test has no low threshold, set to 0, otherwise
248 * `dif_entropy_src_health_test_configure()` will return `kDifBadArg`.
249 */
252
253/**
254 * Values of the health test watermark number register to record the high or low
255 * watermarks of the corresponding health tests.
256 */
258 kDifEntropySrcWatermarkNumRepcntHi = 0,
259 kDifEntropySrcWatermarkNumRepcntsHi = 1,
260 kDifEntropySrcWatermarkNumAdaptpHi = 2,
261 kDifEntropySrcWatermarkNumAdaptpLo = 3,
262 kDifEntropySrcWatermarkNumAdaptpsHi = 4,
263 kDifEntropySrcWatermarkNumBucketHi = 5,
264 kDifEntropySrcWatermarkNumMarkovHi = 6,
265 kDifEntropySrcWatermarkNumMarkovLo = 7,
266 kDifEntropySrcWatermarkNumExthtHi = 8,
267 kDifEntropySrcWatermarkNumExthtLo = 9,
269
270/**
271 * Revision information for an entropy source.
272 *
273 * The fields of this struct have an implementation-specific interpretation.
274 */
276 uint8_t abi_revision;
277 uint8_t hw_revision;
278 uint8_t chip_type;
280
281/**
282 * Statistics on entropy source health tests.
283 */
285 /**
286 * Identifier defining test and the watermark (high or low) the recorded
287 * number belongs to.
288 */
290 /**
291 * The recorded watermark. For low or high watermarks, this indicates the
292 * lowest or highest values emitted by the corresponding health test,
293 * respectively.
294 */
295 uint16_t watermark;
296 /**
297 * The number of times a particular test has failed above the high threshold
298 * (contains both failures when using the FIPS or the bypass thresholds).
299 */
300 uint32_t high_fails[kDifEntropySrcTestNumVariants];
301 /**
302 * The number of times a particular test has failed below the low threshold.
303 *
304 * Note, some health tests do not have a low threshold. For these tests, this
305 * value will always be 0.
306 */
307 uint32_t low_fails[kDifEntropySrcTestNumVariants];
309
310/**
311 * Statistics on entropy source health tests failures that triggered alerts.
312 */
314 /**
315 * The total number of test failures, across all test types, that contributed
316 * to the alerts fired.
317 */
318 uint16_t total_fails;
319 /**
320 * The number of test failures, due to the specific test execeeding the high
321 * threshold, that cause alerts to be fired.
322 */
323 uint8_t high_fails[kDifEntropySrcTestNumVariants];
324 /**
325 * The number of test failures, due to the specific test execeeding the low
326 * threshold, that cause alerts to be fired.
327 *
328 * Note, some health tests do not have a low threshold. For these tests, this
329 * value will always be 0.
330 */
331 uint8_t low_fails[kDifEntropySrcTestNumVariants];
333
334/**
335 * SHA3 state machine states.
336 *
337 * See `hw/ip/kmac/rtl/sha3_pkg.sv` for more details.
338 */
340 kDifEntropySrcSha3StateIdle = 0,
341 kDifEntropySrcSha3StateAbsorb = 1,
342 kDifEntropySrcSha3StateSqueeze = 2,
343 kDifEntropySrcSha3StateManualRun = 3,
344 kDifEntropySrcSha3StateFlush = 4,
345 kDifEntropySrcSha3StateError = 5,
347
348/**
349 * Debug status information.
350 */
352 /**
353 * Depth of the entropy source FIFO.
354 *
355 * Valid range: [0, 7]
356 */
358 /**
359 * The current state of the SHA3 preconditioner state machine.
360 *
361 * See `dif_entropy_src_sha3_state_t` for more details.
362 */
364 /**
365 * Whether the SHA3 preconditioner has completed processing the current block.
366 */
368 /**
369 * Whether the SHA3 preconditioner is in the squeezing state.
370 */
372 /**
373 * Whether the SHA3 preconditioner is in the absorbed state.
374 */
376 /**
377 * Whether the SHA3 preconditioner has is in an error state.
378 */
380 /**
381 * Whether the main FSM is in the idle state.
382 */
384 /**
385 * Whether the main FSM is in the boot done state.
386 */
389
390/**
391 * Recoverable alerts.
392 */
394 /**
395 * Triggered when the FIPS_ENABLE field in the CONF register is set to an
396 * unsupported value.
397 */
399 /**
400 * Triggered when the ENTROPY_DATA_REG_ENABLE field in the CONF register is
401 * set to an unsupported value.
402 */
404 /**
405 * Triggered when the MODULE_ENABLE field in the MODULE_ENABLE register is set
406 * to an unsupported value.
407 */
409 /**
410 * Triggered when the THRESHOLD_SCOPE field in the CONF register is set to an
411 * unsupported value.
412 */
414 /**
415 * Triggered when the THRESHOLD_ONEWAY field in the CONF register is set to an
416 * unsupported value.
417 */
419 /**
420 * Triggered when the RNG_BIT_ENABLE field in the CONF register is set to an
421 * unsupported value.
422 */
424 /**
425 * Triggered when the FW_OV_SHA3_START field in the FW_OV_SHA3_START register
426 * is set to an unsupported value.
427 */
429 /**
430 * Triggered when the FW_OV_MODE field in the FW_OV_CONTROL register is set to
431 * an unsupported value.
432 */
434 /**
435 * Triggered when the FW_OV_ENTROPY_INSERT field in the FW_OV_CONTROL register
436 * is set to an unsupported value.
437 */
439 /**
440 * Triggered when the ES_ROUTE field in the ENTROPY_CONTROL register is set to
441 * an unsupported value.
442 */
444 /**
445 * Triggered when the ES_TYPE field in the ENTROPY_CONTROL register is set to
446 * an unsupported value.
447 */
449 /**
450 * Triggered when the main state machine detects a threshold failure state.
451 */
453 /**
454 * Triggered when the internal entropy bus value is equal to the prior valid
455 * value on the bus, indicating a possible attack.
456 */
458 /**
459 * Triggered when the ALERT_THRESHOLD register is not configured properly,
460 * i.e., the upper field must be the exact inverse of the lower field.
461 */
463 /**
464 * Triggered when the packer FIFO has been written but was full at the time
465 * and we are in FW_OV_MODE and FW_OV_ENTROPY_INSERT modes.
466 */
468 /**
469 * Triggered when FW_OV_SHA3_START has been set to kMultiBitBool4False,
470 * without waiting for the bypass packer FIFO to clear.
471 */
473 /**
474 * Triggered when the FIPS_FLAG field in the CONF register is set to an
475 * unsupported value.
476 */
478 /**
479 * Triggered when the RNG_FIPS field in the CONF register is set to an
480 * unsupported value.
481 */
483 /**
484 * All alert reasons.
485 *
486 * This is useful when clearing all recoverable alerts at once.
487 */
490
491/**
492 * Error codes (non-recoverable).
493 */
495 /**
496 * Triggered when a write error has been detected for the esrng FIFO.
497 */
499 /**
500 * Triggered when a read error has been detected for the esrng FIFO.
501 */
503 /**
504 * Triggered when a state error has been detected for the esrng FIFO.
505 */
507 /**
508 * Triggered when a write error has been detected for the observe FIFO.
509 */
511 /**
512 * Triggered when a read error has been detected for the observe FIFO.
513 */
515 /**
516 * Triggered when a state error has been detected for the observe FIFO.
517 */
519 /**
520 * Triggered when a write error has been detected for the esfinal FIFO.
521 */
523 /**
524 * Triggered when a read error has been detected for the esfinal FIFO.
525 */
527 /**
528 * Triggered when a state error has been detected for the esfinal FIFO.
529 */
531 /**
532 * Triggered when an error has been detected for the acknowledgment stage
533 * state machine.
534 */
536 /**
537 * Triggered when an error has been detected for the main state machine.
538 */
540 /**
541 * Triggered when an error has been detected for a hardened counter.
542 */
545
546/**
547 * Stops the current mode of operation and disables the entropy_src module
548 *
549 * @param entropy_src An entropy source handle.
550 * @return The result of the operation.
551 */
554
555/**
556 * Configures entropy source with runtime information.
557 *
558 * This function should only need to be called once for the lifetime of the
559 * `entropy` handle.
560 *
561 * @param entropy_src An entropy source handle.
562 * @param config Runtime configuration parameters.
563 * @param enabled The enablement state of the entropy source.
564 * @return The result of the operation.
565 */
569 dif_toggle_t enabled);
570
571/**
572 * Configures entropy source firmware override feature with runtime information.
573 *
574 * This function should only need to be called once for the lifetime of the
575 * `entropy` handle.
576 *
577 * @param entropy_src An entropy source handle.
578 * @param config Runtime configuration parameters for firmware override.
579 * @param enabled The enablement state of the firmware override option.
580 * @return The result of the operation.
581 */
584 const dif_entropy_src_t *entropy_src,
586
587/**
588 * Configures whether to start the entropy source's SHA3 process and be ready to
589 * accept entropy data.
590 *
591 * This is used in firmware override mode and should be enabled before writing
592 * to the override FIFO. Disable this after writing has finished to ensure the
593 * SHA3 block finishes processing and pushes the results to the `esfinal` FIFO.
594 *
595 * @param entropy_src An entropy source handle.
596 * @param enabled Whether to start the SHA3 process.
597 */
600 const dif_entropy_src_t *entropy_src, dif_toggle_t enabled);
601
602/**
603 * Configures an entropy source health test feature with runtime information.
604 *
605 * This function should only need to be called once for each health test that
606 * requires configuration for the lifetime of the `entropy` handle.
607 *
608 * @param entropy_src An entropy source handle.
609 * @param config Runtime configuration parameters for the health test.
610 * @return The result of the operation.
611 */
614 const dif_entropy_src_t *entropy_src,
616
617/**
618 * Enables the one-way behavior of all entropy source health test threshold
619 * registers.
620 *
621 * This function is reentrant: calling it while the one-way behavior is enabled
622 * will have no effect and return `kDifOk`.
623 *
624 * @param entropy_src An entropy source handle.
625 * @return The result of the operation.
626 */
629 const dif_entropy_src_t *entropy_src);
630
631/**
632 * Configures the health test watermark number register to record the high or
633 * low watermark of a specific health test.
634 *
635 * This function is primarily required for the initial validation during chip
636 * bring-up.
637 *
638 * @param entropy_src An entropy source handle.
639 * @param config Specific health test and high or low watermark to be recorded.
640 * @return The result of the operation.
641 */
644 const dif_entropy_src_t *entropy_src,
646
647/**
648 * Enables/Disables the entropy source.
649 *
650 * @param entropy_src An entropy source handle.
651 * @param enabled The enablement state to configure the entropy source in.
652 * @return The result of the operation.
653 */
656 dif_toggle_t enabled);
657
658/**
659 * Locks out entropy source functionality.
660 *
661 * This function is reentrant: calling it while functionality is locked will
662 * have no effect and return `kDifOk`.
663 *
664 * @param entropy_src An entropy source handle.
665 * @return The result of the operation.
666 */
669
670/**
671 * Checks whether this entropy source is locked.
672 *
673 * @param entropy_src An entropy source handle.
674 * @param[out] is_locked Out-param for the locked state.
675 * @return The result of the operation.
676 */
679 bool *is_locked);
680
681/**
682 * Queries the entropy_src source IP for its revision information.
683 *
684 * @param entropy_src An entropy source handle.
685 * @param[out] revision Out-param for revision data.
686 * @return The result of the operation.
687 */
691
692/**
693 * Queries the entropy source for health test statistics.
694 *
695 * @param entropy_src An entropy source handle.
696 * @param[out] stats Out-param for stats data.
697 * @return The result of the operation.
698 */
701 const dif_entropy_src_t *entropy_src,
703
704/**
705 * Queries the entropy source for health test failure statistics.
706 *
707 * @param entropy_src An entropy source handle.
708 * @param[out] counts Out-param for test failure data that triggers alerts.
709 * @return The result of the operation.
710 */
713 const dif_entropy_src_t *entropy_src,
715
716/**
717 * Checks to see if entropy is available for software consumption.
718 *
719 * @param entropy_src An entropy source handle.
720 * @return The result of the operation.
721 */
724 const dif_entropy_src_t *entropy_src);
725
726/**
727 * Reads a word of entropy from the entropy source.
728 *
729 * @param entropy_src An entropy source handle.
730 * @param[out] word Out-param for the entropy word.
731 * @return The result of the operation.
732 */
735 const dif_entropy_src_t *entropy_src, uint32_t *word);
736
737/**
738 * Performs a blocking read from the entropy pipeline through the observe FIFO,
739 * which contains post health-test, unconditioned entropy.
740 *
741 * The entropy source must be configured with firmware override mode enabled,
742 * and the `len` parameter must be less than or equal to the FIFO threshold set
743 * in the firmware override parameters (that is, the threshold that triggers an
744 * interrupt). Additionally, `buf` may be `NULL`; in this case, reads will be
745 * discarded.
746 *
747 * @param entropy_src An entropy source handle.
748 * @param[out] buf A buffer to fill with words from the pipeline.
749 * @param len The number of words to read into `buf`.
750 * @return The result of the operation.
751 */
754 const dif_entropy_src_t *entropy_src, uint32_t *buf, size_t len);
755
756/**
757 * Performs a nonblocking read from the entropy pipeline through the observe
758 * FIFO, which contains post health-test, unconditioned entropy.
759 *
760 * The entropy source must be configured with firmware override mode enabled.
761 * This function will read at most `*len` words from the observe FIFO and store
762 * them in `buf` if it is not `NULL`. If `buf` is `NULL` then the reads will be
763 * discarded instead. This function never blocks and returns as soon as the FIFO
764 * is empty. It updates `*len` to store the number of actually read words.
765 *
766 * @param entropy_src An entropy source handle.
767 * @param[out] buf A buffer to fill with words from the pipeline.
768 * @param[inout] len A pointer to the maximum number of words to reads. This
769 * value is updated to contain the number of words acually read.
770 * @return The result of the operation.
771 */
774 const dif_entropy_src_t *entropy_src, uint32_t *buf, size_t *len);
775
776/**
777 * Performs a write to the entropy pipeline through the firmware override FIFO.
778 *
779 * Entropy source must be configured with firmware override and insert mode
780 * enabled, otherwise the function will return `kDifError`.
781 *
782 * @param entropy_src An entropy source handle.
783 * @param buf A buffer to push words from into the pipeline.
784 * @param len The number of words to write from `buf`.
785 * @param[out] written The number of words successfully written.
786 * @return The result of the operation.
787 */
790 const dif_entropy_src_t *entropy_src, const uint32_t *buf, size_t len,
791 size_t *written);
792
793/**
794 * Starts conditioner operation.
795 *
796 * Initializes the conditioner. Use the `dif_entropy_src_fw_ov_data_write()`
797 * function to send data to the conditioner, and
798 * `dif_entropy_src_conditioner_stop()` once ready to stop the conditioner
799 * operation.
800 *
801 * This function is only available when firmware override mode is enabled. See
802 * `dif_entropy_src_fw_override_configure()` for more details.
803 *
804 * @param entropy_src An entropy source handle.
805 * @return The result of the operation.
806 */
809 const dif_entropy_src_t *entropy_src);
810
811/**
812 * Stops conditioner operation.
813 *
814 * The conditioner stops processing input data and deposits the result digest
815 * in the entropy source output buffer. This operation is only available in
816 * firmware override mode.
817 *
818 * @param entropy_src An entropy source handle.
819 * @return The result of the operation.
820 */
823 const dif_entropy_src_t *entropy_src);
824
825/**
826 * Checks whether the firmware override write FIFO is full.
827 *
828 * @param entropy_src An entropy source handle.
829 * @param[out] is_full Whether the FIFO is full.
830 * @return The result of the operation.
831 */
834 bool *is_full);
835
836/**
837 * Checks whether the firmware override read FIFO has overflowed.
838 *
839 * @param entropy_src An entropy source handle.
840 * @param[out] has_overflowed Whether the FIFO has overflowed, and data has been
841 * lost.
842 * @return The result of the operation.
843 */
846 const dif_entropy_src_t *entropy_src, bool *has_overflowed);
847
848/**
849 * Read the firmware override FIFO depth.
850 *
851 * @param entropy_src An entropy source handle.
852 * @param[out] fifo_depth The FIFO depth.
853 * @return The result of the operation.
854 */
857 const dif_entropy_src_t *entropy_src, uint32_t *fifo_depth);
858
859/**
860 * Reads the debug status register.
861 *
862 * @param entropy_src An entropy source handle.
863 * @param[out] debug_state The current debug state of the IP.
864 * @return The result of the operation.
865 */
868 const dif_entropy_src_t *entropy_src,
869 dif_entropy_src_debug_state_t *debug_state);
870
871/**
872 * Reads the recoverable alert status register.
873 *
874 * @param entropy_src An entropy source handle.
875 * @param[out] alerts The alerts that were triggered (one or more
876 * `dif_entropy_src_alert_t`'s ORed together).
877 * @return The result of the operation.
878 */
881 const dif_entropy_src_t *entropy_src, uint32_t *alerts);
882
883/**
884 * Clears the alerts that are recoverable.
885 *
886 * @param entropy_src An entropy source handle.
887 * @param alerts The alerts to be cleared (one or more
888 * `dif_entropy_src_alert_t`'s ORed together).
889 * @return The result of the operation.
890 */
893 const dif_entropy_src_t *entropy_src, uint32_t alerts);
894
895/**
896 * Reads the (nonrecoverable) error code status register.
897 *
898 * @param entropy_src An entropy source handle.
899 * @param[out] errors The errors that were triggered (one or more
900 * `dif_entropy_src_error_t`'s ORed together).
901 * @return The result of the operation.
902 */
905 uint32_t *errors);
906
907/**
908 * Forces the hardware to generate a error for testing purposes.
909 *
910 * @param entropy_src An entropy source handle.
911 * @param error The error to force (for testing purposes).
912 * @return The result of the operation.
913 */
917
918/**
919 * Reads the current main FSM state.
920 *
921 * @param entropy_src An entropy source handle.
922 * @param[out] state The current FSM state.
923 * @return The result of the operation.
924 */
927 const dif_entropy_src_t *entropy_src, dif_entropy_src_main_fsm_t *state);
928
929#ifdef __cplusplus
930} // extern "C"
931#endif // __cplusplus
932
933#endif // OPENTITAN_SW_DEVICE_LIB_DIF_DIF_ENTROPY_SRC_H_