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 * Specifies which single-bit-mode to use, if any at all. FIPS mode of
139 * operation is disabled in single-bit-mode of operation is selected.
140 */
142 /**
143 * Controls the scope (either by-line or by-sum) of the health tests.
144 *
145 * If true, the Adaptive Proportion (non-Symbol variant) and Markov Tests will
146 * accumulate all RNG input lines into a single score, and thresholds will be
147 * applied to the sum of all the entropy input lines.
148 *
149 * If false, the RNG input lines are all scored individually. A statistical
150 * deviation in any one input line, be it due to coincidence or failure, will
151 * force rejection of the sample, and count toward the total alert count.
152 */
154 /**
155 * The size of the window used for health tests.
156 *
157 * Units: bits
158 */
160 /**
161 * The number of health test failures that must occur before an alert is
162 * triggered. When set to 0, alerts are disabled.
163 */
166
167/**
168 * A statistical test on the bits emitted by an entropy source.
169 */
171 /**
172 * An SP 800-90B repetition count test.
173 *
174 * This test screens for stuck bits, or a total failure of the noise source.
175 * This test fails if any sequence of bits repeats too many times in a row
176 * for too many samples.
177 */
179 /**
180 * An SP 800-90B symbol repetition count test.
181 *
182 * This is similar to the above, test but is performed on a symbol, instead of
183 * bit, basis.
184 */
186 /**
187 * An SP 800-90B adaptive proportion test.
188 *
189 * This test screens for statistical bias in the number of ones or zeros
190 * output by the noise source.
191 */
193 /**
194 * An SP 800-90B adaptive proportion symbol test.
195 *
196 * This is similar to the above, test but is performed on a symbol, instead of
197 * bit, basis.
198 */
200 /**
201 * A bucket test.
202 *
203 * This test looks for correlations between individual noise channels.
204 */
206 /**
207 * A "Markov" test.
208 *
209 * This test looks for unexpected first-order temporal correlations
210 * between individual noise channels.
211 */
213 /**
214 * A firmware-driven "mailbox" test.
215 *
216 * This test allows firmware to inspect 2kbit blocks of entropy, and signal
217 * potential concerns to the hardware.
218 */
220 /** \internal */
221 kDifEntropySrcTestNumVariants = 7,
223
224/**
225 * Criteria used by various entropy source health tests to decide whether the
226 * test has failed.
227 */
229 /**
230 * The entropy source health test type to configure.
231 */
233 /**
234 * The high threshold for the health test.
235 */
237 /**
238 * The low threshold for the health test.
239 *
240 * If the corresponding health test has no low threshold, set to 0, otherwise
241 * `dif_entropy_src_health_test_configure()` will return `kDifBadArg`.
242 */
245
246/**
247 * Values of the health test watermark number register to record the high or low
248 * watermarks of the corresponding health tests.
249 */
251 kDifEntropySrcWatermarkNumRepcntHi = 0,
252 kDifEntropySrcWatermarkNumRepcntsHi = 1,
253 kDifEntropySrcWatermarkNumAdaptpHi = 2,
254 kDifEntropySrcWatermarkNumAdaptpLo = 3,
255 kDifEntropySrcWatermarkNumAdaptpsHi = 4,
256 kDifEntropySrcWatermarkNumBucketHi = 5,
257 kDifEntropySrcWatermarkNumMarkovHi = 6,
258 kDifEntropySrcWatermarkNumMarkovLo = 7,
259 kDifEntropySrcWatermarkNumExthtHi = 8,
260 kDifEntropySrcWatermarkNumExthtLo = 9,
262
263/**
264 * Revision information for an entropy source.
265 *
266 * The fields of this struct have an implementation-specific interpretation.
267 */
269 uint8_t abi_revision;
270 uint8_t hw_revision;
271 uint8_t chip_type;
273
274/**
275 * Statistics on entropy source health tests.
276 */
278 /**
279 * Identifier defining test and the watermark (high or low) the recorded
280 * number belongs to.
281 */
283 /**
284 * The recorded watermark. For low or high watermarks, this indicates the
285 * lowest or highest values emitted by the corresponding health test,
286 * respectively.
287 */
288 uint16_t watermark;
289 /**
290 * The number of times a particular test has failed above the high threshold
291 * (contains both failures when using the FIPS or the bypass thresholds).
292 */
293 uint32_t high_fails[kDifEntropySrcTestNumVariants];
294 /**
295 * The number of times a particular test has failed below the low threshold.
296 *
297 * Note, some health tests do not have a low threshold. For these tests, this
298 * value will always be 0.
299 */
300 uint32_t low_fails[kDifEntropySrcTestNumVariants];
302
303/**
304 * Statistics on entropy source health tests failures that triggered alerts.
305 */
307 /**
308 * The total number of test failures, across all test types, that contributed
309 * to the alerts fired.
310 */
311 uint16_t total_fails;
312 /**
313 * The number of test failures, due to the specific test execeeding the high
314 * threshold, that cause alerts to be fired.
315 */
316 uint8_t high_fails[kDifEntropySrcTestNumVariants];
317 /**
318 * The number of test failures, due to the specific test execeeding the low
319 * threshold, that cause alerts to be fired.
320 *
321 * Note, some health tests do not have a low threshold. For these tests, this
322 * value will always be 0.
323 */
324 uint8_t low_fails[kDifEntropySrcTestNumVariants];
326
327/**
328 * SHA3 state machine states.
329 *
330 * See `hw/ip/kmac/rtl/sha3_pkg.sv` for more details.
331 */
333 kDifEntropySrcSha3StateIdle = 0,
334 kDifEntropySrcSha3StateAbsorb = 1,
335 kDifEntropySrcSha3StateSqueeze = 2,
336 kDifEntropySrcSha3StateManualRun = 3,
337 kDifEntropySrcSha3StateFlush = 4,
338 kDifEntropySrcSha3StateError = 5,
340
341/**
342 * Debug status information.
343 */
345 /**
346 * Depth of the entropy source FIFO.
347 *
348 * Valid range: [0, 7]
349 */
351 /**
352 * The current state of the SHA3 preconditioner state machine.
353 *
354 * See `dif_entropy_src_sha3_state_t` for more details.
355 */
357 /**
358 * Whether the SHA3 preconditioner has completed processing the current block.
359 */
361 /**
362 * Whether the SHA3 preconditioner is in the squeezing state.
363 */
365 /**
366 * Whether the SHA3 preconditioner is in the absorbed state.
367 */
369 /**
370 * Whether the SHA3 preconditioner has is in an error state.
371 */
373 /**
374 * Whether the main FSM is in the idle state.
375 */
377 /**
378 * Whether the main FSM is in the boot done state.
379 */
382
383/**
384 * Recoverable alerts.
385 */
387 /**
388 * Triggered when the FIPS_ENABLE field in the CONF register is set to an
389 * unsupported value.
390 */
392 /**
393 * Triggered when the ENTROPY_DATA_REG_ENABLE field in the CONF register is
394 * set to an unsupported value.
395 */
397 /**
398 * Triggered when the MODULE_ENABLE field in the MODULE_ENABLE register is set
399 * to an unsupported value.
400 */
402 /**
403 * Triggered when the THRESHOLD_SCOPE field in the CONF register is set to an
404 * unsupported value.
405 */
407 /**
408 * Triggered when the RNG_BIT_ENABLE field in the CONF register is set to an
409 * unsupported value.
410 */
412 /**
413 * Triggered when the FW_OV_SHA3_START field in the FW_OV_SHA3_START register
414 * is set to an unsupported value.
415 */
417 /**
418 * Triggered when the FW_OV_MODE field in the FW_OV_CONTROL register is set to
419 * an unsupported value.
420 */
422 /**
423 * Triggered when the FW_OV_ENTROPY_INSERT field in the FW_OV_CONTROL register
424 * is set to an unsupported value.
425 */
427 /**
428 * Triggered when the ES_ROUTE field in the ENTROPY_CONTROL register is set to
429 * an unsupported value.
430 */
432 /**
433 * Triggered when the ES_TYPE field in the ENTROPY_CONTROL register is set to
434 * an unsupported value.
435 */
437 /**
438 * Triggered when the main state machine detects a threshold failure state.
439 */
441 /**
442 * Triggered when the internal entropy bus value is equal to the prior valid
443 * value on the bus, indicating a possible attack.
444 */
446 /**
447 * Triggered when the ALERT_THRESHOLD register is not configured properly,
448 * i.e., the upper field must be the exact inverse of the lower field.
449 */
451 /**
452 * Triggered when the packer FIFO has been written but was full at the time
453 * and we are in FW_OV_MODE and FW_OV_ENTROPY_INSERT modes.
454 */
456 /**
457 * Triggered when FW_OV_SHA3_START has been set to kMultiBitBool4False,
458 * without waiting for the bypass packer FIFO to clear.
459 */
461 /**
462 * Triggered when the FIPS_FLAG field in the CONF register is set to an
463 * unsupported value.
464 */
466 /**
467 * Triggered when the RNG_FIPS field in the CONF register is set to an
468 * unsupported value.
469 */
471 /**
472 * All alert reasons.
473 *
474 * This is useful when clearing all recoverable alerts at once.
475 */
478
479/**
480 * Error codes (non-recoverable).
481 */
483 /**
484 * Triggered when a write error has been detected for the esrng FIFO.
485 */
487 /**
488 * Triggered when a read error has been detected for the esrng FIFO.
489 */
491 /**
492 * Triggered when a state error has been detected for the esrng FIFO.
493 */
495 /**
496 * Triggered when a write error has been detected for the observe FIFO.
497 */
499 /**
500 * Triggered when a read error has been detected for the observe FIFO.
501 */
503 /**
504 * Triggered when a state error has been detected for the observe FIFO.
505 */
507 /**
508 * Triggered when a write error has been detected for the esfinal FIFO.
509 */
511 /**
512 * Triggered when a read error has been detected for the esfinal FIFO.
513 */
515 /**
516 * Triggered when a state error has been detected for the esfinal FIFO.
517 */
519 /**
520 * Triggered when an error has been detected for the acknowledgment stage
521 * state machine.
522 */
524 /**
525 * Triggered when an error has been detected for the main state machine.
526 */
528 /**
529 * Triggered when an error has been detected for a hardened counter.
530 */
533
534/**
535 * Stops the current mode of operation and disables the entropy_src module
536 *
537 * @param entropy_src An entropy source handle.
538 * @return The result of the operation.
539 */
542
543/**
544 * Configures entropy source with runtime information.
545 *
546 * This function should only need to be called once for the lifetime of the
547 * `entropy` handle.
548 *
549 * @param entropy_src An entropy source handle.
550 * @param config Runtime configuration parameters.
551 * @param enabled The enablement state of the entropy source.
552 * @return The result of the operation.
553 */
557 dif_toggle_t enabled);
558
559/**
560 * Configures entropy source firmware override feature with runtime information.
561 *
562 * This function should only need to be called once for the lifetime of the
563 * `entropy` handle.
564 *
565 * @param entropy_src An entropy source handle.
566 * @param config Runtime configuration parameters for firmware override.
567 * @param enabled The enablement state of the firmware override option.
568 * @return The result of the operation.
569 */
572 const dif_entropy_src_t *entropy_src,
574
575/**
576 * Configures whether to start the entropy source's SHA3 process and be ready to
577 * accept entropy data.
578 *
579 * This is used in firmware override mode and should be enabled before writing
580 * to the override FIFO. Disable this after writing has finished to ensure the
581 * SHA3 block finishes processing and pushes the results to the `esfinal` FIFO.
582 *
583 * @param entropy_src An entropy source handle.
584 * @param enabled Whether to start the SHA3 process.
585 */
588 const dif_entropy_src_t *entropy_src, dif_toggle_t enabled);
589
590/**
591 * Configures an entropy source health test feature with runtime information.
592 *
593 * This function should only need to be called once for each health test that
594 * requires configuration for the lifetime of the `entropy` handle.
595 *
596 * @param entropy_src An entropy source handle.
597 * @param config Runtime configuration parameters for the health test.
598 * @return The result of the operation.
599 */
602 const dif_entropy_src_t *entropy_src,
604
605/**
606 * Enables the one-way behavior of all entropy source health test threshold
607 * registers.
608 *
609 * This function is reentrant: calling it while the one-way behavior is enabled
610 * will have no effect and return `kDifOk`.
611 *
612 * @param entropy_src An entropy source handle.
613 * @return The result of the operation.
614 */
617 const dif_entropy_src_t *entropy_src);
618
619/**
620 * Configures the health test watermark number register to record the high or
621 * low watermark of a specific health test.
622 *
623 * This function is primarily required for the initial validation during chip
624 * bring-up.
625 *
626 * @param entropy_src An entropy source handle.
627 * @param config Specific health test and high or low watermark to be recorded.
628 * @return The result of the operation.
629 */
632 const dif_entropy_src_t *entropy_src,
634
635/**
636 * Enables/Disables the entropy source.
637 *
638 * @param entropy_src An entropy source handle.
639 * @param enabled The enablement state to configure the entropy source in.
640 * @return The result of the operation.
641 */
644 dif_toggle_t enabled);
645
646/**
647 * Locks out entropy source functionality.
648 *
649 * This function is reentrant: calling it while functionality is locked will
650 * have no effect and return `kDifOk`.
651 *
652 * @param entropy_src An entropy source handle.
653 * @return The result of the operation.
654 */
657
658/**
659 * Checks whether this entropy source is locked.
660 *
661 * @param entropy_src An entropy source handle.
662 * @param[out] is_locked Out-param for the locked state.
663 * @return The result of the operation.
664 */
667 bool *is_locked);
668
669/**
670 * Queries the entropy_src source IP for its revision information.
671 *
672 * @param entropy_src An entropy source handle.
673 * @param[out] revision Out-param for revision data.
674 * @return The result of the operation.
675 */
679
680/**
681 * Queries the entropy source for health test statistics.
682 *
683 * @param entropy_src An entropy source handle.
684 * @param[out] stats Out-param for stats data.
685 * @return The result of the operation.
686 */
689 const dif_entropy_src_t *entropy_src,
691
692/**
693 * Queries the entropy source for health test failure statistics.
694 *
695 * @param entropy_src An entropy source handle.
696 * @param[out] counts Out-param for test failure data that triggers alerts.
697 * @return The result of the operation.
698 */
701 const dif_entropy_src_t *entropy_src,
703
704/**
705 * Checks to see if entropy is available for software consumption.
706 *
707 * @param entropy_src An entropy source handle.
708 * @return The result of the operation.
709 */
712 const dif_entropy_src_t *entropy_src);
713
714/**
715 * Reads a word of entropy from the entropy source.
716 *
717 * @param entropy_src An entropy source handle.
718 * @param[out] word Out-param for the entropy word.
719 * @return The result of the operation.
720 */
723 const dif_entropy_src_t *entropy_src, uint32_t *word);
724
725/**
726 * Performs a blocking read from the entropy pipeline through the observe FIFO,
727 * which contains post health-test, unconditioned entropy.
728 *
729 * The entropy source must be configured with firmware override mode enabled,
730 * and the `len` parameter must be less than or equal to the FIFO threshold set
731 * in the firmware override parameters (that is, the threshold that triggers an
732 * interrupt). Additionally, `buf` may be `NULL`; in this case, reads will be
733 * discarded.
734 *
735 * @param entropy_src An entropy source handle.
736 * @param[out] buf A buffer to fill with words from the pipeline.
737 * @param len The number of words to read into `buf`.
738 * @return The result of the operation.
739 */
742 const dif_entropy_src_t *entropy_src, uint32_t *buf, size_t len);
743
744/**
745 * Performs a nonblocking read from the entropy pipeline through the observe
746 * FIFO, which contains post health-test, unconditioned entropy.
747 *
748 * The entropy source must be configured with firmware override mode enabled.
749 * This function will read at most `*len` words from the observe FIFO and store
750 * them in `buf` if it is not `NULL`. If `buf` is `NULL` then the reads will be
751 * discarded instead. This function never blocks and returns as soon as the FIFO
752 * is empty. It updates `*len` to store the number of actually read words.
753 *
754 * @param entropy_src An entropy source handle.
755 * @param[out] buf A buffer to fill with words from the pipeline.
756 * @param[inout] len A pointer to the maximum number of words to reads. This
757 * value is updated to contain the number of words acually read.
758 * @return The result of the operation.
759 */
762 const dif_entropy_src_t *entropy_src, uint32_t *buf, size_t *len);
763
764/**
765 * Performs a write to the entropy pipeline through the firmware override FIFO.
766 *
767 * Entropy source must be configured with firmware override and insert mode
768 * enabled, otherwise the function will return `kDifError`.
769 *
770 * @param entropy_src An entropy source handle.
771 * @param buf A buffer to push words from into the pipeline.
772 * @param len The number of words to write from `buf`.
773 * @param[out] written The number of words successfully written.
774 * @return The result of the operation.
775 */
778 const dif_entropy_src_t *entropy_src, const uint32_t *buf, size_t len,
779 size_t *written);
780
781/**
782 * Starts conditioner operation.
783 *
784 * Initializes the conditioner. Use the `dif_entropy_src_fw_ov_data_write()`
785 * function to send data to the conditioner, and
786 * `dif_entropy_src_conditioner_stop()` once ready to stop the conditioner
787 * operation.
788 *
789 * This function is only available when firmware override mode is enabled. See
790 * `dif_entropy_src_fw_override_configure()` for more details.
791 *
792 * @param entropy_src An entropy source handle.
793 * @return The result of the operation.
794 */
797 const dif_entropy_src_t *entropy_src);
798
799/**
800 * Stops conditioner operation.
801 *
802 * The conditioner stops processing input data and deposits the result digest
803 * in the entropy source output buffer. This operation is only available in
804 * firmware override mode.
805 *
806 * @param entropy_src An entropy source handle.
807 * @return The result of the operation.
808 */
811 const dif_entropy_src_t *entropy_src);
812
813/**
814 * Checks whether the firmware override write FIFO is full.
815 *
816 * @param entropy_src An entropy source handle.
817 * @param[out] is_full Whether the FIFO is full.
818 * @return The result of the operation.
819 */
822 bool *is_full);
823
824/**
825 * Checks whether the firmware override read FIFO has overflowed.
826 *
827 * @param entropy_src An entropy source handle.
828 * @param[out] has_overflowed Whether the FIFO has overflowed, and data has been
829 * lost.
830 * @return The result of the operation.
831 */
834 const dif_entropy_src_t *entropy_src, bool *has_overflowed);
835
836/**
837 * Read the firmware override FIFO depth.
838 *
839 * @param entropy_src An entropy source handle.
840 * @param[out] fifo_depth The FIFO depth.
841 * @return The result of the operation.
842 */
845 const dif_entropy_src_t *entropy_src, uint32_t *fifo_depth);
846
847/**
848 * Reads the debug status register.
849 *
850 * @param entropy_src An entropy source handle.
851 * @param[out] debug_state The current debug state of the IP.
852 * @return The result of the operation.
853 */
856 const dif_entropy_src_t *entropy_src,
857 dif_entropy_src_debug_state_t *debug_state);
858
859/**
860 * Reads the recoverable alert status register.
861 *
862 * @param entropy_src An entropy source handle.
863 * @param[out] alerts The alerts that were triggered (one or more
864 * `dif_entropy_src_alert_t`'s ORed together).
865 * @return The result of the operation.
866 */
869 const dif_entropy_src_t *entropy_src, uint32_t *alerts);
870
871/**
872 * Clears the alerts that are recoverable.
873 *
874 * @param entropy_src An entropy source handle.
875 * @param alerts The alerts to be cleared (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 * Reads the (nonrecoverable) error code status register.
885 *
886 * @param entropy_src An entropy source handle.
887 * @param[out] errors The errors that were triggered (one or more
888 * `dif_entropy_src_error_t`'s ORed together).
889 * @return The result of the operation.
890 */
893 uint32_t *errors);
894
895/**
896 * Forces the hardware to generate a error for testing purposes.
897 *
898 * @param entropy_src An entropy source handle.
899 * @param error The error to force (for testing purposes).
900 * @return The result of the operation.
901 */
905
906/**
907 * Reads the current main FSM state.
908 *
909 * @param entropy_src An entropy source handle.
910 * @param[out] state The current FSM state.
911 * @return The result of the operation.
912 */
915 const dif_entropy_src_t *entropy_src, dif_entropy_src_main_fsm_t *state);
916
917#ifdef __cplusplus
918} // extern "C"
919#endif // __cplusplus
920
921#endif // OPENTITAN_SW_DEVICE_LIB_DIF_DIF_ENTROPY_SRC_H_