mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
configure with ECC256 only
This commit is contained in:
@ -15,12 +15,6 @@ The `IDE/ECLIPSE/SIFIVE/main.c` example application provides a function to run t
|
|||||||
- #undef NO_CRYPT_TEST
|
- #undef NO_CRYPT_TEST
|
||||||
- #undef NO_CRYPT_BENCHMARK
|
- #undef NO_CRYPT_BENCHMARK
|
||||||
```
|
```
|
||||||
## Tested Configurations
|
|
||||||
- SHA-1
|
|
||||||
- SHA-256
|
|
||||||
- AES CBC
|
|
||||||
- ECC sign/verify/shared secret with fast math library
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
### Setting up the SDK with wolfSSL
|
### Setting up the SDK with wolfSSL
|
||||||
1. Download the wolfSSL source code or a zip file from GitHub and place it under your SDK `$HOME` directory. You can also copy or simlink to the source.
|
1. Download the wolfSSL source code or a zip file from GitHub and place it under your SDK `$HOME` directory. You can also copy or simlink to the source.
|
||||||
@ -178,6 +172,12 @@ ECDSA 256 sign 2 ops took 25.000 sec, avg 12500.000 ms, 0.080 ops/
|
|||||||
ECDSA 256 verify 2 ops took 48.000 sec, avg 24000.000 ms, 0.042 ops/sec
|
ECDSA 256 verify 2 ops took 48.000 sec, avg 24000.000 ms, 0.042 ops/sec
|
||||||
Benchmark complete
|
Benchmark complete
|
||||||
```
|
```
|
||||||
|
## Tested Configurations
|
||||||
|
- SHA-1
|
||||||
|
- SHA-256
|
||||||
|
- AES CBC
|
||||||
|
- ECC 256 sign/verify/shared secret with fast math library
|
||||||
|
|
||||||
## Known Caveats
|
## Known Caveats
|
||||||
- If you find the wolfcrypt test stuck on early_trap_vector error, it is like related to memory issues
|
- If you find the wolfcrypt test stuck on early_trap_vector error, it is like related to memory issues
|
||||||
- Using the `__stack_size` default value of 0x400 will not be enough for the ECC test to pass.
|
- Using the `__stack_size` default value of 0x400 will not be enough for the ECC test to pass.
|
||||||
|
@ -33,16 +33,27 @@
|
|||||||
/*-specs=nano.specs doesn’t include support for floating point in printf()*/
|
/*-specs=nano.specs doesn’t include support for floating point in printf()*/
|
||||||
asm (".global _printf_float");
|
asm (".global _printf_float");
|
||||||
|
|
||||||
#define RTC_FREQ 32768
|
#ifndef RTC_FREQ
|
||||||
|
#define RTC_FREQ 32768
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CLINT_MTIME_ADDR 0x200bff8
|
#define CLINT_MTIME_ADDR 0x200bff8
|
||||||
#define WOLFSSL_SIFIVE_RISC_V_DEBUG 0
|
#define WOLFSSL_SIFIVE_RISC_V_DEBUG 0
|
||||||
|
|
||||||
|
unsigned long get_cpu_freq(void)
|
||||||
|
{
|
||||||
|
/* If clocking up the CPU, you need to add a logic to measure cpu freq */
|
||||||
|
|
||||||
|
return RTC_FREQ;
|
||||||
|
}
|
||||||
|
|
||||||
double current_time(int reset)
|
double current_time(int reset)
|
||||||
{
|
{
|
||||||
volatile uint64_t * mtime = (uint64_t*) (CLINT_MTIME_ADDR);
|
volatile uint64_t * mtime = (uint64_t*) (CLINT_MTIME_ADDR);
|
||||||
uint64_t now = *mtime;
|
uint64_t now = *mtime;
|
||||||
(void)reset;
|
(void)reset;
|
||||||
return now/RTC_FREQ;
|
/**/
|
||||||
|
return now/get_cpu_freq();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -70,7 +81,7 @@ void mtime_sleep( uint64_t ticks) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void delay(int sec) {
|
void delay(int sec) {
|
||||||
uint64_t ticks = sec * RTC_FREQ;
|
uint64_t ticks = sec * get_cpu_freq();
|
||||||
mtime_sleep(ticks);
|
mtime_sleep(ticks);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -120,7 +131,7 @@ int main(void)
|
|||||||
#if WOLFSSL_SIFIVE_RISC_V_DEBUG
|
#if WOLFSSL_SIFIVE_RISC_V_DEBUG
|
||||||
printf("check stack and heap addresses\n");
|
printf("check stack and heap addresses\n");
|
||||||
check(8);
|
check(8);
|
||||||
printf("sleep for 10 seconds to verify timer\n");
|
printf("sleep for 10 seconds to verify timer, measure using a stopwatch\n");
|
||||||
delay(10);
|
delay(10);
|
||||||
printf("awake after sleeping for 10 seconds\n");
|
printf("awake after sleeping for 10 seconds\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -117,12 +117,12 @@ extern "C" {
|
|||||||
#define ECC_USER_CURVES
|
#define ECC_USER_CURVES
|
||||||
|
|
||||||
#ifdef ECC_USER_CURVES
|
#ifdef ECC_USER_CURVES
|
||||||
/* Manual Curve Selection */
|
/* Manual Curve Selection, FP_MAX_BITS must be adjusted accordingly */
|
||||||
#define HAVE_ECC192
|
// #define HAVE_ECC192
|
||||||
#define HAVE_ECC224
|
// #define HAVE_ECC224
|
||||||
#undef NO_ECC256
|
#undef NO_ECC256
|
||||||
#define HAVE_ECC384
|
// #define HAVE_ECC384
|
||||||
#define HAVE_ECC521
|
// #define HAVE_ECC521
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Fixed point cache (speeds repeated operations against same private key) */
|
/* Fixed point cache (speeds repeated operations against same private key) */
|
||||||
|
Reference in New Issue
Block a user