Skip to content

Commit

Permalink
Fix some NTG.1 naming and other inconsistencies
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Mueller <smueller@chronox.de>
  • Loading branch information
bukka authored and smuellerDD committed Nov 15, 2024
1 parent 27098cd commit ec1d028
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions lrng_es_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ bool lrng_enforce_panic_on_permanent_health_failure(void)
return lrng_panic_on_permanent_health_failure;
}

bool lrng_ntg1_2022_compliant(void)
bool lrng_ntg1_2024_compliant(void)
{
/* Implies use of /dev/random w/ O_SYNC / getrandom w/ GRND_RANDOM */
return ntg1;
}

Expand Down Expand Up @@ -246,7 +245,7 @@ static u32 lrng_avail_entropy_thresh(void)
bool lrng_fully_seeded(bool fully_seeded, u32 collected_entropy,
struct entropy_buf *eb)
{
/* AIS20/31 NTG.1: two entropy sources with each delivering 220 bits */
/* AIS20/31 NTG.1: two entropy sources with each delivering 240 bits */
if (ntg1) {
u32 i, result = 0, ent_thresh = lrng_avail_entropy_thresh();

Expand Down Expand Up @@ -352,7 +351,7 @@ void lrng_init_ops(struct entropy_buf *eb)
return;

requested_bits = ntg1 ?
/* Approximation so that two ES should deliver 220 bits each */
/* Approximation so that two ES should deliver 240 bits each */
(lrng_avail_entropy() + LRNG_AIS2031_NPTRNG_MIN_ENTROPY) :
/* Apply SP800-90C oversampling if applicable */
lrng_get_seed_entropy_osr(state->all_online_numa_node_seeded);
Expand Down
2 changes: 1 addition & 1 deletion lrng_es_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extern struct lrng_es_cb *lrng_es[];
for ((ctr) = 0; (ctr) < lrng_ext_es_last; (ctr)++)

bool lrng_enforce_panic_on_permanent_health_failure(void);
bool lrng_ntg1_2022_compliant(void);
bool lrng_ntg1_2024_compliant(void);
bool lrng_pool_all_numa_nodes_seeded_get(void);
bool lrng_state_min_seeded(void);
void lrng_debug_report_seedlevel(const char *name);
Expand Down

0 comments on commit ec1d028

Please sign in to comment.