all repos — TinyCrypT @ c8b139650863d70d18fb01979f0868465f0057b1

Short and sweet classical cryptographic primitives

Fixed failing tests on portable Ed25519
Juniper Beatitudes [email protected]
Sun, 03 May 2026 20:01:58 -0500
commit

c8b139650863d70d18fb01979f0868465f0057b1

parent

68ba22e4e7eef306f98b06edf8cbdc1d4be6d9ba

1 files changed, 6 insertions(+), 9 deletions(-)

jump to
M tinycrypt/portable/ed25519.ctinycrypt/portable/ed25519.c

@@ -746,8 +746,8 @@ tct_sha512 (privkey, 32, digest);

digest[0] &= 0b11111000; digest[31] &= 0b01111111; digest[31] |= 0b01000000; - uint32_t k[16]; - for (unsigned int i = 0; i < 16; ++i) + uint32_t k[8]; + for (unsigned int i = 0; i < 8; ++i) { k[i] = from_le32 (digest + 4 * i); }

@@ -806,13 +806,10 @@ xB (r, rBx, rBy, rBz, rBt);

inv256_modp (rBz, rBz); mult256_modp (rBz, rBx, rBx); mult256_modp (rBz, rBy, chunked); - for (unsigned int i = 0; i < 32; ++i) { - signature[i] = digest[i]; - } - // for (unsigned int i = 0; i < 8; ++i) - // { - // to_le32 (chunked[i], signature + 4 * i); - // } + for (unsigned int i = 0; i < 8; ++i) + { + to_le32 (chunked[i], signature + 4 * i); + } signature[31] &= 0b01111111; signature[31] |= (rBx[0] & 1) << 7; for (unsigned int i = 0; i < 32; ++i)