|
SharkSSL™ Embedded SSL/TLS Stack
|
This guide explains how to add the RX assembly implementations to an existing SharkSSL build. Cipher acceleration and big-integer acceleration are configured separately.
Compile SharkSslCrypto_RX.s together with SharkSslCrypto.c:
Set the following in TargConfig.h:
Enable the algorithms required by your application:
See SharkSslCrypto.h for the APIs. The Poly1305 implementation is based on Daniel J. Bernstein's "The Poly1305-AES message-authentication code", but this API does not use AES. The ChaCha20 implementation is based on his "The ChaCha family of stream ciphers".
When ChaCha20 assembly is excluded, SHARKSSL_CHACHA_SMALL_FOOTPRINT=1 selects a smaller, slightly slower C implementation.
Compile SharkSslBigInt_RX.s together with SharkSslBigInt.c:
Set the following in TargConfig.h:
The historical speed and size examples are shown side by side below. Enable CCM only if your application needs it.
These values are reference examples, not a production TLS preset. In particular, SHARKSSL_USE_RNG_TINYMT=1 selects a generator unsuitable for cryptographic use. For a current build, follow build configuration and the configuration API.
| Setting | Speed example | Size example |
|---|---|---|
B_LITTLE_ENDIAN | 1 | 1 |
SHARKSSL_AES_CIPHER_LOOP_UNROLL | 1 | 0 |
SHARKSSL_BIGINT_EXP_SLIDING_WINDOW_K | 5 | 1 |
SHARKSSL_BIGINT_WORDSIZE | 32 | 32 |
SHARKSSL_DES_CIPHER_LOOP_UNROLL | 1 | 0 |
SHARKSSL_ENABLE_AES_CCM | 1 /* IF NEEDED */ | 1 /* IF NEEDED */ |
SHARKSSL_ENABLE_AES_CTR_MODE | 0 | 0 |
SHARKSSL_ENABLE_AES_GCM | 1 | 1 |
SHARKSSL_ENABLE_RSA_BLINDING | 1 | 1 |
SHARKSSL_MD5_SMALL_FOOTPRINT | 0 | 1 |
SHARKSSL_OPTIMIZED_BIGINT_ASM | 1 | 1 |
SHARKSSL_SHA1_SMALL_FOOTPRINT | 0 | 1 |
SHARKSSL_SHA256_SMALL_FOOTPRINT | 0 | 1 |
SHARKSSL_UNALIGNED_ACCESS | 1 | 1 |
SHARKSSL_USE_3DES | 1 | 1 |
SHARKSSL_USE_AES_128 | 1 | 1 |
SHARKSSL_USE_AES_256 | 1 | 1 |
SHARKSSL_USE_ARC4 | 0 | 0 |
SHARKSSL_USE_DES | 0 | 0 |
SHARKSSL_USE_ECC | 1 | 1 |
SHARKSSL_USE_RNG_TINYMT | 1 | 1 |
SHARKSSL_USE_SHA_256 | 1 | 1 |
The RX routines provide processor-specific implementations of ChaCha20, Poly1305, and big-integer arithmetic. Their intended benefit is lower cryptographic processing cost without changing application APIs. Performance depends on the selected routines, compiler settings, and RX processor. Measure the selected configuration on the intended RX processor before estimating application throughput.