diff options
Diffstat (limited to 'include/crypto/drbg.h')
-rw-r--r-- | include/crypto/drbg.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/crypto/drbg.h b/include/crypto/drbg.h index 831d786976c5..882675e7c055 100644 --- a/include/crypto/drbg.h +++ b/include/crypto/drbg.h | |||
@@ -162,12 +162,25 @@ static inline size_t drbg_max_request_bytes(struct drbg_state *drbg) | |||
162 | 162 | ||
163 | static inline size_t drbg_max_addtl(struct drbg_state *drbg) | 163 | static inline size_t drbg_max_addtl(struct drbg_state *drbg) |
164 | { | 164 | { |
165 | #if (__BITS_PER_LONG == 32) | ||
166 | /* | ||
167 | * SP800-90A allows smaller maximum numbers to be returned -- we | ||
168 | * return SIZE_MAX - 1 to allow the verification of the enforcement | ||
169 | * of this value in drbg_healthcheck_sanity. | ||
170 | */ | ||
171 | return (SIZE_MAX - 1); | ||
172 | #else | ||
165 | return (1UL<<(drbg->core->max_addtllen)); | 173 | return (1UL<<(drbg->core->max_addtllen)); |
174 | #endif | ||
166 | } | 175 | } |
167 | 176 | ||
168 | static inline size_t drbg_max_requests(struct drbg_state *drbg) | 177 | static inline size_t drbg_max_requests(struct drbg_state *drbg) |
169 | { | 178 | { |
179 | #if (__BITS_PER_LONG == 32) | ||
180 | return SIZE_MAX; | ||
181 | #else | ||
170 | return (1UL<<(drbg->core->max_req)); | 182 | return (1UL<<(drbg->core->max_req)); |
183 | #endif | ||
171 | } | 184 | } |
172 | 185 | ||
173 | /* | 186 | /* |