all repos — TinyCrypT @ 4d5ebb7ceec126a009258e6b1b02e6330228598e

Short and sweet classical cryptographic primitives

More gloating
Juniper Beatitudes [email protected]
Mon, 05 Jan 2026 10:38:24 -0600
commit

4d5ebb7ceec126a009258e6b1b02e6330228598e

parent

60d5e34d19d776b1e9f86e3619584bb252134810

2 files changed, 4 insertions(+), 32 deletions(-)

jump to
M README.mdREADME.md

@@ -14,4 +14,7 @@ The CC20-P1305 implementation was not designed with side-channel attacks in mind. Rewriting it to perform actions in constant time is a goal currently being undertaken (after unit tests are in place).

## Testing Validations - The SHA-2 implementations pass all 586 NIST-provided test cases without memory violations (according to `valgrind`). -- The Ed25519 implementation passes all 1024 provided test cases (though signatures can take up to 8ms)+- The Ed25519 implementation passes all 1024 provided test cases without memory violations (according to `valgrind`). + +## Benchmarking +- The 64-bit implementation of Ed25519 (automatically compiled against when the target platform supports `__uint128_t`) is able to generate a signature in 0.086ms on an Intel Core i3-1315U processor.
D test.c

@@ -1,31 +0,0 @@

-#include "tinycrypt/ed25519.h" -#include <stdint.h> - -static uint8_t SK4[] = { - 0x6d, 0xf9, 0x34, 0x0c, 0x13, 0x8c, 0xc1, 0x88, 0xb5, 0xfe, 0x44, - 0x64, 0xeb, 0xaa, 0x3f, 0x7f, 0xc2, 0x06, 0xa2, 0xd5, 0x5c, 0x34, - 0x34, 0x70, 0x7e, 0x74, 0xc9, 0xfc, 0x04, 0xe2, 0x0e, 0xbb, -}; -static uint8_t PK4[] = { - 0xc0, 0xda, 0xc1, 0x02, 0xc4, 0x53, 0x31, 0x86, 0xe2, 0x5d, 0xc4, - 0x31, 0x28, 0x47, 0x23, 0x53, 0xea, 0xab, 0xdb, 0x87, 0x8b, 0x15, - 0x2a, 0xeb, 0x8e, 0x00, 0x1f, 0x92, 0xd9, 0x02, 0x33, 0xa7, -}; -static uint8_t MSG4[] = { - 0x5f, - 0x4c, - 0x89, - 0x89, -}; - -int -main (int argc, char **argv) -{ - uint8_t signature[64]; - uint8_t working_buf[sizeof (MSG4) + 64]; - for (unsigned int i = 0; i < 10000; ++i) - { - tct_ed25519_sign (MSG4, sizeof (MSG4), SK4, PK4, working_buf, signature); - } - return 0; -}