SHA256
1
0
forked from pool/libica
libica/rng-performance.patch

36 lines
1.3 KiB
Diff
Raw Normal View History

Index: libica-2.6.2/src/s390_prng.c
===================================================================
--- libica-2.6.2.orig/src/s390_prng.c
+++ libica-2.6.2/src/s390_prng.c
@@ -76,10 +76,9 @@ int s390_prng_init(void)
// available. However, the old prng is still initialized but
// only used as a fallback.
if(sha512_switch || sha512_drng_switch){
- const char *pers = "ica_drbg_global";
ica_drbg_instantiate(&ica_drbg_global, 256, true,
- ICA_DRBG_SHA512, (unsigned char *)pers,
- strlen(pers));
+ ICA_DRBG_SHA512,
+ (unsigned char *)"GLOBAL INSTANCE", 15);
}
// The old prng code starts here:
@@ -181,7 +180,7 @@ int s390_prng(unsigned char *output_data
unsigned char *ptr = output_data;
size_t i = 0;
for(; i < q; i++){
- status = ica_drbg_generate(ica_drbg_global, 256, true,
+ status = ica_drbg_generate(ica_drbg_global, 256, false,
NULL, 0, ptr,
ICA_DRBG_SHA512
->max_no_of_bytes_per_req);
@@ -191,7 +190,7 @@ int s390_prng(unsigned char *output_data
ptr += ICA_DRBG_SHA512->max_no_of_bytes_per_req;
}
if(!status){
- status = ica_drbg_generate(ica_drbg_global, 256, true,
+ status = ica_drbg_generate(ica_drbg_global, 256, false,
NULL, 0, ptr, r);
if(!status)
return 0;