Skip to content

Commit 9722e8c

Browse files
authored
Merge pull request #66 from kaleb-himes/sp-updates
Add S.P. highly coveted notes on the sp topic to the documentation!
2 parents 04b7f5d + f8fbae5 commit 9722e8c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

wolfSSL/src/chapter02.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,10 +2052,31 @@ Enabling fasthugemath includes support for the FastMath library and greatly incr
20522052
20532053
Enable Single-Precision (SP) math implementation with restricted algorithm suite. Unsupported algorithms are disabled. Overrides `--enable-sp`, `--enable-sp-math-all`, `--enable-fastmath` and `--enable-fasthugemath`.
20542054
2055+
- Replaces the math implementation with that in sp_int.c
2056+
- A minimal implementation, turns on portions of sp_int.c but not all.
2057+
- MUST combine with --enable-sp to turn on the solutions in sp_x86_64.c or sp_arm.c etc (list of files below depending on the target system) to be able to perform RSA/ECC/DH operations.
2058+
- Not to be combined with --enable-sp-math-all (below)
2059+
2060+
FILE LIST (platform dependent, chosen by configure based on system specs or can
2061+
be manually controlled when using a Makefile/IDE solution):
2062+
sp_arm32.c
2063+
sp_arm64.c
2064+
sp_armthumb.c
2065+
sp_cortexm.c
2066+
sp_dsp32.c
2067+
sp_x86_64.c
2068+
sp_x86_64_asm.S
2069+
sp_x86_64_asm.asm
2070+
20552071
### `--enable-sp-math-all`
20562072
20572073
Enabled by default. Enable Single-Precision (SP) math implementation with full algorithm suite. Unsupported algorithms are enabled, but unoptimized. Overrides `--enable-sp`, `--enable-fastmath` and `--enable-fasthugemath`.
20582074
2075+
- Replaces the math implementation with that in sp_int.c
2076+
- A FULL implementation, does not depend on --enable-sp to work
2077+
- Can be combined with --enable-sp to allow use of the implementations written in portable c assembly (non-hardware specific assembly) in sp_c32.c for 32-bit or sp_c64.c for 64-bit when possible. The rest of the time (when not possible) the implementations in sp_int.c are used. The portable C assembly gives significant performance gains on targets that do not have hardware optimizations available.
2078+
- Not to be combined with --enable-sp-math (above)
2079+
20592080
**NOTE**: If you are using asymmetric cryptography with key length in bits [256, 384, 521, 1024, 2048, 3072, 4096], you should consider using --enable-sp-math option to get maximum performance with a larger footprint size.
20602081
20612082
### `--enable-sp-asm`
@@ -2070,6 +2091,11 @@ Enable Single-Precision (SP) math for RSA, DH, and ECC to improve performance.
20702091
20712092
There are many possible values for OPT. Below is a list of ways to call enable-sp and the resulting macros that will be defined as a result. All of these can be combined in a coma separated list. For example, `--enable-sp=ec256,ec384`. The meaning of the macros that will be defined are defined above in the [wolfSSL’s Proprietary Single Precision (SP) Math Support] section.
20722093
2094+
**NOTE**:
2095+
1) "--enable-sp=small --enable-sp-math" can be smaller than...
2096+
2) "--enable-sp-math-all=small"...
2097+
as (1) only has implementations of specific key sizes while (2) has implementations to support all key sizes.
2098+
20732099
**NOTE**: This is for x86_64 and with no other configuration flags; your results may vary depending on your architectures and other configuration flags that you specify. For example, WOLFSSL_SP_384 and WOLFSSL_SP_4096 will only be enabled for Intel x86_64.
20742100
20752101
#### `--enable-sp=no` or `--disable-sp`

0 commit comments

Comments
 (0)