Skip to content

Commit 656ba24

Browse files
authored
Merge pull request #7852 from SparkiDev/sp_no_rng_fix
SP: no RNG fix
2 parents e142b16 + 17a09d9 commit 656ba24

7 files changed

Lines changed: 126 additions & 0 deletions

File tree

wolfcrypt/src/sp_arm32.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76369,6 +76369,7 @@ static void sp_256_from_bin(sp_digit* r, int size, const byte* a, int n)
7636976369
*/
7637076370
static int sp_256_ecc_gen_k_8(WC_RNG* rng, sp_digit* k)
7637176371
{
76372+
#ifndef WC_NO_RNG
7637276373
int err;
7637376374
byte buf[32];
7637476375

@@ -76385,6 +76386,11 @@ static int sp_256_ecc_gen_k_8(WC_RNG* rng, sp_digit* k)
7638576386
while (err == 0);
7638676387

7638776388
return err;
76389+
#else
76390+
(void)rng;
76391+
(void)k;
76392+
return NOT_COMPILED_IN;
76393+
#endif
7638876394
}
7638976395

7639076396
/* Makes a random EC key pair.
@@ -94126,6 +94132,7 @@ static void sp_384_from_bin(sp_digit* r, int size, const byte* a, int n)
9412694132
*/
9412794133
static int sp_384_ecc_gen_k_12(WC_RNG* rng, sp_digit* k)
9412894134
{
94135+
#ifndef WC_NO_RNG
9412994136
int err;
9413094137
byte buf[48];
9413194138

@@ -94142,6 +94149,11 @@ static int sp_384_ecc_gen_k_12(WC_RNG* rng, sp_digit* k)
9414294149
while (err == 0);
9414394150

9414494151
return err;
94152+
#else
94153+
(void)rng;
94154+
(void)k;
94155+
return NOT_COMPILED_IN;
94156+
#endif
9414594157
}
9414694158

9414794159
/* Makes a random EC key pair.
@@ -121869,6 +121881,7 @@ static void sp_521_from_bin(sp_digit* r, int size, const byte* a, int n)
121869121881
*/
121870121882
static int sp_521_ecc_gen_k_17(WC_RNG* rng, sp_digit* k)
121871121883
{
121884+
#ifndef WC_NO_RNG
121872121885
int err;
121873121886
byte buf[66];
121874121887

@@ -121886,6 +121899,11 @@ static int sp_521_ecc_gen_k_17(WC_RNG* rng, sp_digit* k)
121886121899
while (err == 0);
121887121900

121888121901
return err;
121902+
#else
121903+
(void)rng;
121904+
(void)k;
121905+
return NOT_COMPILED_IN;
121906+
#endif
121889121907
}
121890121908

121891121909
/* Makes a random EC key pair.

wolfcrypt/src/sp_arm64.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39763,6 +39763,7 @@ static void sp_256_from_bin(sp_digit* r, int size, const byte* a, int n)
3976339763
*/
3976439764
static int sp_256_ecc_gen_k_4(WC_RNG* rng, sp_digit* k)
3976539765
{
39766+
#ifndef WC_NO_RNG
3976639767
int err;
3976739768
byte buf[32];
3976839769

@@ -39779,6 +39780,11 @@ static int sp_256_ecc_gen_k_4(WC_RNG* rng, sp_digit* k)
3977939780
while (err == 0);
3978039781

3978139782
return err;
39783+
#else
39784+
(void)rng;
39785+
(void)k;
39786+
return NOT_COMPILED_IN;
39787+
#endif
3978239788
}
3978339789

3978439790
/* Makes a random EC key pair.
@@ -66501,6 +66507,7 @@ static void sp_384_from_bin(sp_digit* r, int size, const byte* a, int n)
6650166507
*/
6650266508
static int sp_384_ecc_gen_k_6(WC_RNG* rng, sp_digit* k)
6650366509
{
66510+
#ifndef WC_NO_RNG
6650466511
int err;
6650566512
byte buf[48];
6650666513

@@ -66517,6 +66524,11 @@ static int sp_384_ecc_gen_k_6(WC_RNG* rng, sp_digit* k)
6651766524
while (err == 0);
6651866525

6651966526
return err;
66527+
#else
66528+
(void)rng;
66529+
(void)k;
66530+
return NOT_COMPILED_IN;
66531+
#endif
6652066532
}
6652166533

6652266534
/* Makes a random EC key pair.
@@ -111637,6 +111649,7 @@ static void sp_521_from_bin(sp_digit* r, int size, const byte* a, int n)
111637111649
*/
111638111650
static int sp_521_ecc_gen_k_9(WC_RNG* rng, sp_digit* k)
111639111651
{
111652+
#ifndef WC_NO_RNG
111640111653
int err;
111641111654
byte buf[66];
111642111655

@@ -111654,6 +111667,11 @@ static int sp_521_ecc_gen_k_9(WC_RNG* rng, sp_digit* k)
111654111667
while (err == 0);
111655111668

111656111669
return err;
111670+
#else
111671+
(void)rng;
111672+
(void)k;
111673+
return NOT_COMPILED_IN;
111674+
#endif
111657111675
}
111658111676

111659111677
/* Makes a random EC key pair.

wolfcrypt/src/sp_armthumb.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103929,6 +103929,7 @@ static void sp_256_from_bin(sp_digit* r, int size, const byte* a, int n)
103929103929
*/
103930103930
static int sp_256_ecc_gen_k_8(WC_RNG* rng, sp_digit* k)
103931103931
{
103932+
#ifndef WC_NO_RNG
103932103933
int err;
103933103934
byte buf[32];
103934103935

@@ -103945,6 +103946,11 @@ static int sp_256_ecc_gen_k_8(WC_RNG* rng, sp_digit* k)
103945103946
while (err == 0);
103946103947

103947103948
return err;
103949+
#else
103950+
(void)rng;
103951+
(void)k;
103952+
return NOT_COMPILED_IN;
103953+
#endif
103948103954
}
103949103955

103950103956
/* Makes a random EC key pair.
@@ -114823,6 +114829,7 @@ static void sp_384_from_bin(sp_digit* r, int size, const byte* a, int n)
114823114829
*/
114824114830
static int sp_384_ecc_gen_k_12(WC_RNG* rng, sp_digit* k)
114825114831
{
114832+
#ifndef WC_NO_RNG
114826114833
int err;
114827114834
byte buf[48];
114828114835

@@ -114839,6 +114846,11 @@ static int sp_384_ecc_gen_k_12(WC_RNG* rng, sp_digit* k)
114839114846
while (err == 0);
114840114847

114841114848
return err;
114849+
#else
114850+
(void)rng;
114851+
(void)k;
114852+
return NOT_COMPILED_IN;
114853+
#endif
114842114854
}
114843114855

114844114856
/* Makes a random EC key pair.
@@ -129050,6 +129062,7 @@ static void sp_521_from_bin(sp_digit* r, int size, const byte* a, int n)
129050129062
*/
129051129063
static int sp_521_ecc_gen_k_17(WC_RNG* rng, sp_digit* k)
129052129064
{
129065+
#ifndef WC_NO_RNG
129053129066
int err;
129054129067
byte buf[66];
129055129068

@@ -129067,6 +129080,11 @@ static int sp_521_ecc_gen_k_17(WC_RNG* rng, sp_digit* k)
129067129080
while (err == 0);
129068129081

129069129082
return err;
129083+
#else
129084+
(void)rng;
129085+
(void)k;
129086+
return NOT_COMPILED_IN;
129087+
#endif
129070129088
}
129071129089

129072129090
/* Makes a random EC key pair.

wolfcrypt/src/sp_c32.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24850,6 +24850,7 @@ static void sp_256_from_bin(sp_digit* r, int size, const byte* a, int n)
2485024850
*/
2485124851
static int sp_256_ecc_gen_k_9(WC_RNG* rng, sp_digit* k)
2485224852
{
24853+
#ifndef WC_NO_RNG
2485324854
int err;
2485424855
byte buf[32];
2485524856

@@ -24866,6 +24867,11 @@ static int sp_256_ecc_gen_k_9(WC_RNG* rng, sp_digit* k)
2486624867
while (err == 0);
2486724868

2486824869
return err;
24870+
#else
24871+
(void)rng;
24872+
(void)k;
24873+
return NOT_COMPILED_IN;
24874+
#endif
2486924875
}
2487024876

2487124877
/* Makes a random EC key pair.
@@ -32885,6 +32891,7 @@ static void sp_384_from_bin(sp_digit* r, int size, const byte* a, int n)
3288532891
*/
3288632892
static int sp_384_ecc_gen_k_15(WC_RNG* rng, sp_digit* k)
3288732893
{
32894+
#ifndef WC_NO_RNG
3288832895
int err;
3288932896
byte buf[48];
3289032897

@@ -32901,6 +32908,11 @@ static int sp_384_ecc_gen_k_15(WC_RNG* rng, sp_digit* k)
3290132908
while (err == 0);
3290232909

3290332910
return err;
32911+
#else
32912+
(void)rng;
32913+
(void)k;
32914+
return NOT_COMPILED_IN;
32915+
#endif
3290432916
}
3290532917

3290632918
/* Makes a random EC key pair.
@@ -40968,6 +40980,7 @@ static void sp_521_from_bin(sp_digit* r, int size, const byte* a, int n)
4096840980
*/
4096940981
static int sp_521_ecc_gen_k_21(WC_RNG* rng, sp_digit* k)
4097040982
{
40983+
#ifndef WC_NO_RNG
4097140984
int err;
4097240985
byte buf[66];
4097340986

@@ -40985,6 +40998,11 @@ static int sp_521_ecc_gen_k_21(WC_RNG* rng, sp_digit* k)
4098540998
while (err == 0);
4098640999

4098741000
return err;
41001+
#else
41002+
(void)rng;
41003+
(void)k;
41004+
return NOT_COMPILED_IN;
41005+
#endif
4098841006
}
4098941007

4099041008
/* Makes a random EC key pair.

wolfcrypt/src/sp_c64.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25746,6 +25746,7 @@ static void sp_256_from_bin(sp_digit* r, int size, const byte* a, int n)
2574625746
*/
2574725747
static int sp_256_ecc_gen_k_5(WC_RNG* rng, sp_digit* k)
2574825748
{
25749+
#ifndef WC_NO_RNG
2574925750
int err;
2575025751
byte buf[32];
2575125752

@@ -25762,6 +25763,11 @@ static int sp_256_ecc_gen_k_5(WC_RNG* rng, sp_digit* k)
2576225763
while (err == 0);
2576325764

2576425765
return err;
25766+
#else
25767+
(void)rng;
25768+
(void)k;
25769+
return NOT_COMPILED_IN;
25770+
#endif
2576525771
}
2576625772

2576725773
/* Makes a random EC key pair.
@@ -33206,6 +33212,7 @@ static void sp_384_from_bin(sp_digit* r, int size, const byte* a, int n)
3320633212
*/
3320733213
static int sp_384_ecc_gen_k_7(WC_RNG* rng, sp_digit* k)
3320833214
{
33215+
#ifndef WC_NO_RNG
3320933216
int err;
3321033217
byte buf[48];
3321133218

@@ -33222,6 +33229,11 @@ static int sp_384_ecc_gen_k_7(WC_RNG* rng, sp_digit* k)
3322233229
while (err == 0);
3322333230

3322433231
return err;
33232+
#else
33233+
(void)rng;
33234+
(void)k;
33235+
return NOT_COMPILED_IN;
33236+
#endif
3322533237
}
3322633238

3322733239
/* Makes a random EC key pair.
@@ -40617,6 +40629,7 @@ static void sp_521_from_bin(sp_digit* r, int size, const byte* a, int n)
4061740629
*/
4061840630
static int sp_521_ecc_gen_k_9(WC_RNG* rng, sp_digit* k)
4061940631
{
40632+
#ifndef WC_NO_RNG
4062040633
int err;
4062140634
byte buf[66];
4062240635

@@ -40634,6 +40647,11 @@ static int sp_521_ecc_gen_k_9(WC_RNG* rng, sp_digit* k)
4063440647
while (err == 0);
4063540648

4063640649
return err;
40650+
#else
40651+
(void)rng;
40652+
(void)k;
40653+
return NOT_COMPILED_IN;
40654+
#endif
4063740655
}
4063840656

4063940657
/* Makes a random EC key pair.

wolfcrypt/src/sp_cortexm.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39460,6 +39460,7 @@ static void sp_256_from_bin(sp_digit* r, int size, const byte* a, int n)
3946039460
*/
3946139461
static int sp_256_ecc_gen_k_8(WC_RNG* rng, sp_digit* k)
3946239462
{
39463+
#ifndef WC_NO_RNG
3946339464
int err;
3946439465
byte buf[32];
3946539466

@@ -39476,6 +39477,11 @@ static int sp_256_ecc_gen_k_8(WC_RNG* rng, sp_digit* k)
3947639477
while (err == 0);
3947739478

3947839479
return err;
39480+
#else
39481+
(void)rng;
39482+
(void)k;
39483+
return NOT_COMPILED_IN;
39484+
#endif
3947939485
}
3948039486

3948139487
/* Makes a random EC key pair.
@@ -49517,6 +49523,7 @@ static void sp_384_from_bin(sp_digit* r, int size, const byte* a, int n)
4951749523
*/
4951849524
static int sp_384_ecc_gen_k_12(WC_RNG* rng, sp_digit* k)
4951949525
{
49526+
#ifndef WC_NO_RNG
4952049527
int err;
4952149528
byte buf[48];
4952249529

@@ -49533,6 +49540,11 @@ static int sp_384_ecc_gen_k_12(WC_RNG* rng, sp_digit* k)
4953349540
while (err == 0);
4953449541

4953549542
return err;
49543+
#else
49544+
(void)rng;
49545+
(void)k;
49546+
return NOT_COMPILED_IN;
49547+
#endif
4953649548
}
4953749549

4953849550
/* Makes a random EC key pair.
@@ -62273,6 +62285,7 @@ static void sp_521_from_bin(sp_digit* r, int size, const byte* a, int n)
6227362285
*/
6227462286
static int sp_521_ecc_gen_k_17(WC_RNG* rng, sp_digit* k)
6227562287
{
62288+
#ifndef WC_NO_RNG
6227662289
int err;
6227762290
byte buf[66];
6227862291

@@ -62290,6 +62303,11 @@ static int sp_521_ecc_gen_k_17(WC_RNG* rng, sp_digit* k)
6229062303
while (err == 0);
6229162304

6229262305
return err;
62306+
#else
62307+
(void)rng;
62308+
(void)k;
62309+
return NOT_COMPILED_IN;
62310+
#endif
6229362311
}
6229462312

6229562313
/* Makes a random EC key pair.

0 commit comments

Comments
 (0)