From b95ba8a88fac8067ec80f9346437b49753209a94 Mon Sep 17 00:00:00 2001 From: Craig Everett Date: Fri, 21 Aug 2026 10:18:50 +0900 Subject: [PATCH] Adding TODO note to Ed25519 --- .../swiss/qpq/gajumaru/core/crypto/Ed25519.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/swiss/qpq/gajumaru/core/crypto/Ed25519.java b/src/main/java/swiss/qpq/gajumaru/core/crypto/Ed25519.java index 6a03444..a552530 100644 --- a/src/main/java/swiss/qpq/gajumaru/core/crypto/Ed25519.java +++ b/src/main/java/swiss/qpq/gajumaru/core/crypto/Ed25519.java @@ -31,6 +31,20 @@ import swiss.qpq.gajumaru.core.tools.CryptoUtils; // Uses exquisitely annoying Radix-2^25.5 field arithmetic. Never do this if you can avoid it. // Verified against the canonical Erlang ec_utils (see test/README.md for how). +// TODO: Craig 2026-08-21 +// I don't like the allocation of Scratch and Ge all over the place. +// If someone were to apply this library to a high-throughput system, with many threads +// signing stuff willy-nilly, then intense GC pressure could result simply because of +// all the dead (and zeroed) Scratch and Ge space left littered throughout the dead heap +// awaiting GC. What I want to do instead is provide a separate call path that allows the +// current mechanism to work as well as a slightly lower-level call path where the caller +// can provide a pre-allocated space by reference so if a high-throughput system is using +// lots of worker threads and really pressuring the system, the caller can pre-allocate the +// needed GC and Scratch space themselves once per thread. +// +// This should be pretty easy. +// I just don't want to look at this module for at least a few days. + public final class Ed25519 { // Precomputed limbs for Ed25519 constants (Radix 2^25.5)