-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathKconfig
1017 lines (841 loc) · 33 KB
/
Kconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SPDX-License-Identifier: GPL-2.0
#
# Linux Random Number Generator configuration
#
config RANDOM_DEFAULT_IMPL
bool "Kernel RNG Default Implementation"
default y
help
The default random number generator as provided with
drivers/char/random.c is selected with this option.
config LRNG_AUTO_SELECTED
bool
default y if !RANDOM_DEFAULT_IMPL
default n if RANDOM_DEFAULT_IMPL
select LRNG
config LRNG
bool "Linux Random Number Generator"
default n
select CRYPTO_LIB_SHA256 if CRYPTO
help
The Linux Random Number Generator (LRNG) generates entropy
from different entropy sources. Each entropy source can
be enabled and configured independently. The interrupt
entropy source can be configured to be SP800-90B compliant.
The entire LRNG can be configured to be SP800-90C compliant.
Runtime-switchable cryptographic support is available.
The LRNG delivers significant entropy during boot.
The LRNG also provides compliance to SP800-90A/B/C.
menu "Linux Random Number Generator Configuration"
depends on LRNG
if LRNG
config LRNG_SHA256
bool
default y if CRYPTO_LIB_SHA256
config LRNG_SHA1
bool
default y if !CRYPTO_LIB_SHA256
config LRNG_COMMON_DEV_IF
bool
config LRNG_DRNG_ATOMIC
bool
select LRNG_DRNG_CHACHA20
config LRNG_SYSCTL
bool
depends on SYSCTL
config LRNG_RANDOM_IF
bool
default n if RANDOM_DEFAULT_IMPL
default y if !RANDOM_DEFAULT_IMPL
select LRNG_COMMON_DEV_IF
select LRNG_DRNG_ATOMIC
select LRNG_SYSCTL
menu "Specific DRNG seeding strategies"
config LRNG_AIS2031_NTG1_SEEDING_STRATEGY
bool "AIS 20/31 NTG.1 seeding strategy"
default n
help
When enabling this option, two entropy sources must
deliver 240 bits of entropy each to consider a DRNG
as fully seeded. Any two entropy sources can be used
to fulfill this requirement. If specific entropy sources
shall not be capable of contributing to this seeding
strategy, the respective entropy source must be configured
to provide less than 240 bits of entropy.
The strategy is consistent with the requirements for
NTG.1 compliance in German AIS 20/31 version 3.0 from 2024
and is only enforced with lrng_es_mgr.ntg1=1.
Compliance with German AIS 20/31 version 2.0 from 2011 is
always present when using /dev/random with the flag O_SYNC
or getrandom(2) with GRND_RANDOM.
If unsure, say N.
endmenu # "Specific DRNG seeding strategies"
menu "LRNG Interfaces"
config LRNG_KCAPI_IF
tristate "Interface with Kernel Crypto API"
depends on CRYPTO_RNG
help
The LRNG can be registered with the kernel crypto API's
random number generator framework. This offers a random
number generator with the name "lrng" and a priority that
is intended to be higher than the existing RNG
implementations.
config LRNG_HWRAND_IF
tristate "Interface with Hardware Random Number Generator Framework"
depends on HW_RANDOM
select LRNG_DRNG_ATOMIC
help
The LRNG can be registered with the hardware random number
generator framework. This offers a random number generator
with the name "lrng" that is accessible via the framework.
For example it allows pulling data from the LRNG via the
/dev/hwrng file.
config LRNG_DEV_IF
bool "Character device file interface"
select LRNG_COMMON_DEV_IF
help
The LRNG can create a character device file that operates
identically to /dev/random including IOCTL, read and write
operations.
endmenu # "LRNG Interfaces"
menu "Entropy Source Configuration"
config LRNG_RUNTIME_ES_CONFIG
bool "Enable runtime configuration of entropy sources"
help
When enabling this option, the LRNG provides the mechanism
allowing to alter the entropy rate of each entropy source
during boot time and runtime.
Each entropy source allows its entropy rate changed with
a kernel command line option. When not providing any
option, the default specified during kernel compilation
is applied.
comment "Common Timer-based Entropy Source Configuration"
config LRNG_IRQ_DFLT_TIMER_ES
bool
config LRNG_SCHED_DFLT_TIMER_ES
bool
config LRNG_TIMER_COMMON
bool
choice
prompt "Default Timer-based Entropy Source"
default LRNG_IRQ_DFLT_TIMER_ES
depends on LRNG_TIMER_COMMON
help
Select the timer-based entropy source that is credited
with entropy. The other timer-based entropy sources may
be operational and provide data, but are credited with no
entropy.
config LRNG_IRQ_DFLT_TIMER_ES
bool "Interrupt Entropy Source"
depends on LRNG_IRQ
help
The interrupt entropy source is selected as a timer-based
entropy source to provide entropy.
config LRNG_SCHED_DFLT_TIMER_ES
bool "Scheduler Entropy Source"
depends on LRNG_SCHED
help
The scheduler entropy source is selected as timer-based
entropy source to provide entropy.
endchoice
choice
prompt "LRNG Entropy Collection Pool Size"
default LRNG_COLLECTION_SIZE_1024
depends on LRNG_TIMER_COMMON
help
Select the size of the LRNG entropy collection pool
storing data for the interrupt as well as the scheduler
entropy sources without performing a compression
operation. The larger the collection size is, the faster
the average interrupt handling will be. The collection
size represents the number of bytes of the per-CPU memory
used to batch up entropy event data.
The default value is good for regular operations. Choose
larger sizes for servers that have no memory limitations.
If runtime memory is precious, choose a smaller size.
The collection size is unrelated to the entropy rate
or the amount of entropy the LRNG can process.
config LRNG_COLLECTION_SIZE_32
depends on LRNG_CONTINUOUS_COMPRESSION_ENABLED
depends on !LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION
depends on !CRYPTO_FIPS
bool "32 interrupt events"
config LRNG_COLLECTION_SIZE_256
depends on !CRYPTO_FIPS
bool "256 interrupt events"
config LRNG_COLLECTION_SIZE_512
bool "512 interrupt events"
config LRNG_COLLECTION_SIZE_1024
bool "1024 interrupt events (default)"
config LRNG_COLLECTION_SIZE_2048
bool "2048 interrupt events"
config LRNG_COLLECTION_SIZE_4096
bool "4096 interrupt events"
config LRNG_COLLECTION_SIZE_8192
bool "8192 interrupt events"
endchoice
config LRNG_COLLECTION_SIZE
int
default 32 if LRNG_COLLECTION_SIZE_32
default 256 if LRNG_COLLECTION_SIZE_256
default 512 if LRNG_COLLECTION_SIZE_512
default 1024 if LRNG_COLLECTION_SIZE_1024
default 2048 if LRNG_COLLECTION_SIZE_2048
default 4096 if LRNG_COLLECTION_SIZE_4096
default 8192 if LRNG_COLLECTION_SIZE_8192
config LRNG_HEALTH_TESTS
bool "Enable internal entropy source online health tests"
depends on LRNG_TIMER_COMMON
help
The online health tests applied to the interrupt entropy
source and to the scheduler entropy source to validate
the noise source at runtime for fatal errors. These tests
include SP800-90B compliant tests which are invoked if
the system is booted with fips=1. In case of fatal errors
during active SP800-90B tests, the issue is logged and
the noise data is discarded. These tests are required for
full compliance of the interrupt entropy source with
SP800-90B.
If both, the scheduler and the interrupt entropy sources,
are enabled, the health tests for both are applied
independent of each other.
If unsure, say Y.
config LRNG_RCT_BROKEN
bool "SP800-90B RCT with dangerous low cutoff value"
depends on LRNG_HEALTH_TESTS
depends on BROKEN
default n
help
This option enables a dangerously low SP800-90B repetitive
count test (RCT) cutoff value which makes it very likely
that the RCT is triggered to raise a self test failure.
This option is ONLY intended for developers wanting to
test the effectiveness of the SP800-90B RCT health test.
If unsure, say N.
config LRNG_APT_BROKEN
bool "SP800-90B APT with dangerous low cutoff value"
depends on LRNG_HEALTH_TESTS
depends on BROKEN
default n
help
This option enables a dangerously low SP800-90B adaptive
proportion test (APT) cutoff value which makes it very
likely that the APT is triggered to raise a self test
failure.
This option is ONLY intended for developers wanting to
test the effectiveness of the SP800-90B APT health test.
If unsure, say N.
# Default taken from SP800-90B sec 4.4.1 - significance level 2^-30
config LRNG_RCT_CUTOFF
int
default 31 if !LRNG_RCT_BROKEN
default 1 if LRNG_RCT_BROKEN
# Default taken from SP800-90B sec 4.4.1 - significance level 2^-80
config LRNG_RCT_CUTOFF_PERMANENT
int
default 81 if !LRNG_RCT_BROKEN
default 2 if LRNG_RCT_BROKEN
# Default taken from SP800-90B sec 4.4.2 - significance level 2^-30
config LRNG_APT_CUTOFF
int
default 325 if !LRNG_APT_BROKEN
default 32 if LRNG_APT_BROKEN
# Default taken from SP800-90B sec 4.4.2 - significance level 2^-80
config LRNG_APT_CUTOFF_PERMANENT
int
default 371 if !LRNG_APT_BROKEN
default 33 if LRNG_APT_BROKEN
comment "Interrupt Entropy Source"
config LRNG_IRQ
bool "Enable Interrupt Entropy Source as LRNG Seed Source"
default y
depends on !RANDOM_DEFAULT_IMPL
select LRNG_TIMER_COMMON
help
The LRNG models an entropy source based on the timing of the
occurrence of interrupts. Enable this option to enable this
IRQ entropy source.
The IRQ entropy source is triggered every time an interrupt
arrives and thus causes the interrupt handler to execute
slightly longer. Disabling the IRQ entropy source implies
that the performance penalty on the interrupt handler added
by the LRNG is eliminated. Yet, this entropy source is
considered to be an internal entropy source of the LRNG.
Thus, only disable it if you ensured that other entropy
sources are available that supply the LRNG with entropy.
If you disable the IRQ entropy source, you MUST ensure
one or more entropy sources collectively have the
capability to deliver sufficient entropy with one invocation
at a rate compliant to the security strength of the DRNG
(usually 256 bits of entropy). In addition, if those
entropy sources do not deliver sufficient entropy during
first request, the reseed must be triggered from user
space or kernel space when sufficient entropy is considered
to be present.
If unsure, say Y.
choice
prompt "Continuous entropy compression boot time setting"
default LRNG_CONTINUOUS_COMPRESSION_ENABLED
depends on LRNG_IRQ
help
Select the default behavior of the interrupt entropy source
continuous compression operation.
The LRNG IRQ ES collects entropy data during each interrupt.
For performance reasons, a amount of entropy data defined by
the LRNG entropy collection pool size is concatenated into
an array. When that array is filled up, a hash is calculated
to compress the entropy. That hash is calculated in
interrupt context.
In case such hash calculation in interrupt context is deemed
too time-consuming, the continuous compression operation
can be disabled. If disabled, the collection of entropy will
not trigger a hash compression operation in interrupt context.
The compression happens only when the DRNG is reseeded which is
in process context. This implies that old entropy data
collected after the last DRNG-reseed is overwritten with newer
entropy data once the collection pool is full instead of
retaining its entropy with the compression operation.
config LRNG_CONTINUOUS_COMPRESSION_ENABLED
bool "Enable continuous compression (default)"
config LRNG_CONTINUOUS_COMPRESSION_DISABLED
bool "Disable continuous compression"
endchoice
config LRNG_ENABLE_CONTINUOUS_COMPRESSION
bool
default y if LRNG_CONTINUOUS_COMPRESSION_ENABLED
default n if LRNG_CONTINUOUS_COMPRESSION_DISABLED
config LRNG_SWITCHABLE_CONTINUOUS_COMPRESSION
bool "Runtime-switchable continuous entropy compression"
depends on LRNG_IRQ
help
Per default, the interrupt entropy source continuous
compression operation behavior is hard-wired into the kernel.
Enable this option to allow it to be configurable at boot time.
To modify the default behavior of the continuous
compression operation, use the kernel command line option
of lrng_sw_noise.lrng_pcpu_continuous_compression.
If unsure, say N.
config LRNG_IRQ_ENTROPY_RATE
int "Interrupt Entropy Source Entropy Rate"
depends on LRNG_IRQ
range 256 4294967295 if LRNG_IRQ_DFLT_TIMER_ES
range 4294967295 4294967295 if !LRNG_IRQ_DFLT_TIMER_ES
default 256 if LRNG_IRQ_DFLT_TIMER_ES
default 4294967295 if !LRNG_IRQ_DFLT_TIMER_ES
help
The LRNG will collect the configured number of interrupts to
obtain 256 bits of entropy. This value can be set to any between
256 and 4294967295. The LRNG guarantees that this value is not
lower than 256. This lower limit implies that one interrupt event
is credited with one bit of entropy. This value is subject to the
increase by the oversampling factor, if no high-resolution timer
is found.
In order to effectively disable the interrupt entropy source,
the option has to be set to 4294967295. In this case, the
interrupt entropy source will still deliver data but without
being credited with entropy.
comment "Jitter RNG Entropy Source"
config LRNG_JENT
bool "Enable Jitter RNG as LRNG Seed Source"
depends on CRYPTO
select CRYPTO_JITTERENTROPY
help
The LRNG may use the Jitter RNG as entropy source. Enabling
this option enables the use of the Jitter RNG. Its default
entropy level is 16 bits of entropy per 256 data bits delivered
by the Jitter RNG. This entropy level can be changed at boot
time or at runtime with the lrng_base.jitterrng configuration
variable.
choice
prompt "Jitter RNG Async Block Number"
default LRNG_JENT_ENTROPY_BLOCKS_NO_128
depends on LRNG_JENT
help
Select the number of Jitter RNG entropy blocks the asynchronous
collection operation will fill. A caller for Jitter RNG entropy
will be given data from the pre-filled blocks if available to
prevent the Jitter RNG from utilizing the CPU too much in a
possible hot code path.
The number specifies the number of 256/384 bit blocks that will
be held in memory and asynchronously filled with Jitter RNG data.
The asynchronous entropy collection can also be disabled at
kernel startup time when setting the command line option of
lrng_es_jent.jent_async_enabled=0. Also, setting this option at
runtime is allowed via the corresponding SysFS interface. This
option is only available with the options SysFS and
CONFIG_LRNG_RUNTIME_ES_CONFIG enabled.
config LRNG_JENT_ENTROPY_BLOCKS_DISABLED
bool "Async collection disabled"
# Any block number is allowed, provided it is a power of 2 and
# equal or larger than 4 (4 is due to the division in
# lrng_jent_async_get when deciding to wake up the monitor).
config LRNG_JENT_ENTROPY_BLOCKS_NO_32
bool "32 blocks"
config LRNG_JENT_ENTROPY_BLOCKS_NO_64
bool "64 blocks"
config LRNG_JENT_ENTROPY_BLOCKS_NO_128
bool "128 blocks (default)"
config LRNG_JENT_ENTROPY_BLOCKS_NO_256
bool "256 blocks"
config LRNG_JENT_ENTROPY_BLOCKS_NO_512
bool "512 blocks"
config LRNG_JENT_ENTROPY_BLOCKS_NO_1024
bool "1024 blocks"
endchoice
config LRNG_JENT_ENTROPY_BLOCKS
int
default 0 if LRNG_JENT_ENTROPY_BLOCKS_DISABLED
default 32 if LRNG_JENT_ENTROPY_BLOCKS_NO_32
default 64 if LRNG_JENT_ENTROPY_BLOCKS_NO_64
default 128 if LRNG_JENT_ENTROPY_BLOCKS_NO_128
default 256 if LRNG_JENT_ENTROPY_BLOCKS_NO_256
default 512 if LRNG_JENT_ENTROPY_BLOCKS_NO_512
default 1024 if LRNG_JENT_ENTROPY_BLOCKS_NO_1024
config LRNG_JENT_ENTROPY_RATE
int "Jitter RNG Entropy Source Entropy Rate"
depends on LRNG_JENT
range 0 256
default 16
help
The option defines the amount of entropy the LRNG applies to 256
bits of data obtained from the Jitter RNG entropy source. The
LRNG enforces the limit that this value must be in the range
between 0 and 256.
When configuring this value to 0, the Jitter RNG entropy source
will provide 256 bits of data without being credited to contain
entropy.
comment "CPU Entropy Source"
config LRNG_CPU
bool "Enable CPU Entropy Source as LRNG Seed Source"
default y
help
Current CPUs commonly contain entropy sources which can be
used to seed the LRNG. For example, the Intel RDSEED
instruction, or the POWER DARN instruction will be sourced
to seed the LRNG if this option is enabled.
Note, if this option is enabled and the underlying CPU
does not offer such entropy source, the LRNG will automatically
detect this and ignore the hardware.
config LRNG_CPU_FULL_ENT_MULTIPLIER
int
default 1 if !LRNG_TEST_CPU_ES_COMPRESSION
default 123 if LRNG_TEST_CPU_ES_COMPRESSION
config LRNG_CPU_ENTROPY_RATE
int "CPU Entropy Source Entropy Rate"
depends on LRNG_CPU
range 0 256
default 8
help
The option defines the amount of entropy the LRNG applies to 256
bits of data obtained from the CPU entropy source. The LRNG
enforces the limit that this value must be in the range between
0 and 256.
When configuring this value to 0, the CPU entropy source will
provide 256 bits of data without being credited to contain
entropy.
Note, this option is overwritten when the option
CONFIG_RANDOM_TRUST_CPU is set.
comment "Scheduler Entropy Source"
config LRNG_SCHED
bool "Enable Scheduer Entropy Source as LRNG Seed Source"
select LRNG_TIMER_COMMON
help
The LRNG models an entropy source based on the timing of the
occurrence of scheduler-triggered context switches. Enable
this option to enable this scheduler entropy source.
The scheduler entropy source is triggered every time a
context switch is triggered thus causes the scheduler to
execute slightly longer. Disabling the scheduler entropy
source implies that the performance penalty on the scheduler
added by the LRNG is eliminated. Yet, this entropy source is
considered to be an internal entropy source of the LRNG.
Thus, only disable it if you ensured that other entropy
sources are available that supply the LRNG with entropy.
If you disable the scheduler entropy source, you MUST
ensure one or more entropy sources collectively have the
capability to deliver sufficient entropy with one invocation
at a rate compliant to the security strength of the DRNG
(usually 256 bits of entropy). In addition, if those
entropy sources do not deliver sufficient entropy during
first request, the reseed must be triggered from user
space or kernel space when sufficient entropy is considered
to be present.
If unsure, say Y.
config LRNG_SCHED_ENTROPY_RATE
int "Scheduler Entropy Source Entropy Rate"
depends on LRNG_SCHED
range 256 4294967295 if LRNG_SCHED_DFLT_TIMER_ES
range 4294967295 4294967295 if !LRNG_SCHED_DFLT_TIMER_ES
default 256 if LRNG_SCHED_DFLT_TIMER_ES
default 4294967295 if !LRNG_SCHED_DFLT_TIMER_ES
help
The LRNG will collect the configured number of context switches
triggered by the scheduler to obtain 256 bits of entropy. This
value can be set to any between 256 and 4294967295. The LRNG
guarantees that this value is not lower than 256. This lower
limit implies that one interrupt event is credited with one bit
of entropy. This value is subject to the increase by the
oversampling factor, if no high-resolution timer is found.
In order to effectively disable the scheduler entropy source,
the option has to be set to 4294967295. In this case, the
scheduler entropy source will still deliver data but without
being credited with entropy.
comment "Kernel RNG Entropy Source"
config LRNG_KERNEL_RNG
bool "Enable Kernel RNG as LRNG Seed Source"
depends on RANDOM_DEFAULT_IMPL
help
The LRNG may use the kernel RNG (random.c) as entropy
source.
config LRNG_KERNEL_RNG_ENTROPY_RATE
int "Kernel RNG Entropy Source Entropy Rate"
depends on LRNG_KERNEL_RNG
range 0 256
default 256
help
The option defines the amount of entropy the LRNG applies to 256
bits of data obtained from the kernel RNG entropy source. The
LRNG enforces the limit that this value must be in the range
between 0 and 256.
When configuring this value to 0, the kernel RNG entropy source
will provide 256 bits of data without being credited to contain
entropy.
Note: This value is set to 0 automatically when booting the
kernel in FIPS mode (with fips=1 kernel command line option).
This is due to the fact that random.c is not SP800-90B
compliant.
endmenu # "Entropy Source Configuration"
config LRNG_DRNG_CHACHA20
tristate
config LRNG_DRBG
tristate
depends on CRYPTO
select CRYPTO_DRBG_MENU
config LRNG_DRNG_KCAPI
tristate
depends on CRYPTO
select CRYPTO_RNG
config LRNG_SWITCH
bool
menuconfig LRNG_SWITCH_HASH
bool "Support conditioning hash runtime switching"
select LRNG_SWITCH
help
The LRNG uses a default message digest. With this
configuration option other message digests can be selected
and loaded at runtime.
if LRNG_SWITCH_HASH
config LRNG_HASH_KCAPI
tristate "Kernel crypto API hashing support for LRNG"
select CRYPTO_HASH
select CRYPTO_SHA512
help
Enable the kernel crypto API support for entropy compression
and conditioning functions.
endif # LRNG_SWITCH_HASH
menuconfig LRNG_SWITCH_DRNG
bool "Support DRNG runtime switching"
select LRNG_SWITCH
help
The LRNG uses a default DRNG With this configuration
option other DRNGs or message digests can be selected and
loaded at runtime.
if LRNG_SWITCH_DRNG
config LRNG_SWITCH_DRNG_CHACHA20
tristate "ChaCha20-based DRNG support for LRNG"
depends on !LRNG_DFLT_DRNG_CHACHA20
select LRNG_DRNG_CHACHA20
help
Enable the ChaCha20-based DRNG. This DRNG implementation
does not depend on the kernel crypto API presence.
config LRNG_SWITCH_DRBG
tristate "SP800-90A support for the LRNG"
depends on !LRNG_DFLT_DRNG_DRBG
select LRNG_DRBG
help
Enable the SP800-90A DRBG support for the LRNG. Once the
module is loaded, output from /dev/random, /dev/urandom,
getrandom(2), or get_random_bytes_full is provided by a DRBG.
config LRNG_SWITCH_DRNG_KCAPI
tristate "Kernel Crypto API support for the LRNG"
depends on !LRNG_DFLT_DRNG_KCAPI
depends on !LRNG_SWITCH_DRBG
select LRNG_DRNG_KCAPI
help
Enable the support for generic pseudo-random number
generators offered by the kernel crypto API with the
LRNG. Once the module is loaded, output from /dev/random,
/dev/urandom, getrandom(2), or get_random_bytes is
provided by the selected kernel crypto API RNG.
endif # LRNG_SWITCH_DRNG
choice
prompt "LRNG Default DRNG"
default LRNG_DFLT_DRNG_CHACHA20
help
Select the default deterministic random number generator
that is used by the LRNG. When enabling the switchable
cryptographic mechanism support, this DRNG can be
replaced at runtime.
config LRNG_DFLT_DRNG_CHACHA20
bool "ChaCha20-based DRNG"
select LRNG_DRNG_CHACHA20
config LRNG_DFLT_DRNG_DRBG
depends on RANDOM_DEFAULT_IMPL
bool "SP800-90A DRBG"
select LRNG_DRBG
config LRNG_DFLT_DRNG_KCAPI
depends on RANDOM_DEFAULT_IMPL
bool "Kernel Crypto API DRNG"
select LRNG_DRNG_KCAPI
endchoice
menuconfig LRNG_TESTING_MENU
bool "LRNG testing interfaces"
depends on DEBUG_FS
help
Enable one or more of the following test interfaces.
If unsure, say N.
if LRNG_TESTING_MENU
config LRNG_TESTING
bool
config LRNG_TESTING_RECORDING
bool
comment "Interrupt Entropy Source Test Interfaces"
config LRNG_RAW_HIRES_ENTROPY
bool "Interface to obtain raw unprocessed IRQ noise source data"
default y
depends on LRNG_IRQ
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned high resolution time stamp noise that
is collected by the LRNG for statistical analysis. Extracted
noise data is not used to seed the LRNG.
The raw noise data can be obtained using the lrng_raw_hires
debugfs file. Using the option lrng_testing.boot_raw_hires_test=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_RAW_JIFFIES_ENTROPY
bool "Entropy test interface to Jiffies of IRQ noise source"
depends on LRNG_IRQ
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned Jiffies that is collected by
the LRNG for statistical analysis. This data is used for
seeding the LRNG if a high-resolution time stamp is not
available. If a high-resolution time stamp is detected,
the Jiffies value is not collected by the LRNG and no
data is provided via the test interface. Extracted noise
data is not used to seed the random number generator.
The raw noise data can be obtained using the lrng_raw_jiffies
debugfs file. Using the option lrng_testing.boot_raw_jiffies_test=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_RAW_IRQ_ENTROPY
bool "Entropy test interface to IRQ number noise source"
depends on LRNG_IRQ
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned interrupt number that is collected by
the LRNG for statistical analysis. Extracted noise data is
not used to seed the random number generator.
The raw noise data can be obtained using the lrng_raw_irq
debugfs file. Using the option lrng_testing.boot_raw_irq_test=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_RAW_RETIP_ENTROPY
bool "Entropy test interface to RETIP value of IRQ noise source"
depends on LRNG_IRQ
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned return instruction pointer value
that is collected by the LRNG for statistical analysis.
Extracted noise data is not used to seed the random number
generator.
The raw noise data can be obtained using the lrng_raw_retip
debugfs file. Using the option lrng_testing.boot_raw_retip_test=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_RAW_REGS_ENTROPY
bool "Entropy test interface to IRQ register value noise source"
depends on LRNG_IRQ
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned interrupt register value that is
collected by the LRNG for statistical analysis. Extracted noise
data is not used to seed the random number generator.
The raw noise data can be obtained using the lrng_raw_regs
debugfs file. Using the option lrng_testing.boot_raw_regs_test=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_RAW_ARRAY
bool "Test interface to LRNG raw entropy IRQ storage array"
depends on LRNG_IRQ
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw noise data that is collected by the LRNG
in the per-CPU array for statistical analysis. The purpose
of this interface is to verify that the array handling code
truly only concatenates data and provides the same entropy
rate as the raw unconditioned noise source when assessing
the collected data byte-wise.
The data can be obtained using the lrng_raw_array debugfs
file. Using the option lrng_testing.boot_raw_array=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_IRQ_PERF
bool "LRNG interrupt entropy source performance monitor"
depends on LRNG_IRQ
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
With this option, the performance monitor of the LRNG
interrupt handling code is enabled. The file provides
the execution time of the interrupt handler in
cycles.
The interrupt performance data can be obtained using
the lrng_irq_perf debugfs file. Using the option
lrng_testing.boot_irq_perf=1 the performance data of
the first 1000 entropy events since boot can be sampled.
comment "Scheduler Entropy Source Test Interfaces"
config LRNG_RAW_SCHED_HIRES_ENTROPY
bool "Interface to obtain raw unprocessed scheduler noise source data"
depends on LRNG_SCHED
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned high resolution time stamp noise that
is collected by the LRNG for the Scheduler-based noise source
for statistical analysis. Extracted noise data is not used to
seed the LRNG.
The raw noise data can be obtained using the lrng_raw_sched_hires
debugfs file. Using the option
lrng_testing.boot_raw_sched_hires_test=1 the raw noise of the
first 1000 entropy events since boot can be sampled.
config LRNG_RAW_SCHED_PID_ENTROPY
bool "Entropy test interface to PID value"
depends on LRNG_SCHED
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned PID value that is collected by the
LRNG for statistical analysis. Extracted noise
data is not used to seed the random number generator.
The raw noise data can be obtained using the
lrng_raw_sched_pid debugfs file. Using the option
lrng_testing.boot_raw_sched_pid_test=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_RAW_SCHED_START_TIME_ENTROPY
bool "Entropy test interface to task start time value"
depends on LRNG_SCHED
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned task start time value that is collected
by the LRNG for statistical analysis. Extracted noise
data is not used to seed the random number generator.
The raw noise data can be obtained using the
lrng_raw_sched_starttime debugfs file. Using the option
lrng_testing.boot_raw_sched_starttime_test=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_RAW_SCHED_NVCSW_ENTROPY
bool "Entropy test interface to task context switch numbers"
depends on LRNG_SCHED
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
The test interface allows a privileged process to capture
the raw unconditioned task numbers of context switches that
are collected by the LRNG for statistical analysis. Extracted
noise data is not used to seed the random number generator.
The raw noise data can be obtained using the
lrng_raw_sched_nvcsw debugfs file. Using the option
lrng_testing.boot_raw_sched_nvcsw_test=1
the raw noise of the first 1000 entropy events since boot
can be sampled.
config LRNG_SCHED_PERF
bool "LRNG scheduler entropy source performance monitor"
depends on LRNG_SCHED
select LRNG_TESTING
select LRNG_TESTING_RECORDING
help
With this option, the performance monitor of the LRNG
scheduler event handling code is enabled. The file provides
the execution time of the interrupt handler in cycles.
The scheduler performance data can be obtained using
the lrng_sched_perf debugfs file. Using the option
lrng_testing.boot_sched_perf=1 the performance data of
the first 1000 entropy events since boot can be sampled.
comment "Auxiliary Test Interfaces"
config LRNG_ACVT_HASH
bool "Enable LRNG ACVT Hash interface"
select LRNG_TESTING
help
With this option, the LRNG built-in hash function used for
auxiliary pool management and prior to switching the
cryptographic backends is made available for ACVT. The
interface allows writing of the data to be hashed
into the interface. The read operation triggers the hash
operation to generate message digest.
The ACVT interface is available with the lrng_acvt_hash
debugfs file.
config LRNG_RUNTIME_MAX_WO_RESEED_CONFIG
bool "Enable runtime configuration of max reseed threshold"
help
When enabling this option, the LRNG provides an interface
allowing the setting of the maximum number of DRNG generate
operations without a reseed that has full entropy. The
interface is lrng_drng.max_wo_reseed.
config LRNG_RUNTIME_FORCE_SEEDING_DISABLE
bool "Enable runtime configuration of force seeding"
help
When enabling this option, the LRNG provides an interface
allowing the disabling of the force seeding when the DRNG
is not fully seeded but entropy is available.
config LRNG_TEST_CPU_ES_COMPRESSION
bool "Force CPU ES compression operation"
help
When enabling this option, the CPU ES compression operation
is forced by setting an arbitrary value > 1 for the data
multiplier even when the CPU ES would deliver full entropy.
This allows testing of the compression operation. It
therefore forces to pull more data from the CPU ES
than what may be required.
endif #LRNG_TESTING_MENU
config LRNG_SELFTEST
bool "Enable power-on and on-demand self-tests"
help
The power-on self-tests are executed during boot time
covering the ChaCha20 DRNG, the hash operation used for
processing the entropy pools and the auxiliary pool, and
the time stamp management of the LRNG.
The on-demand self-tests are triggered by writing any
value into the SysFS file selftest_status. At the same
time, when reading this file, the test status is
returned. A zero indicates that all tests were executed