[Libre-soc-bugs] [Bug 1151] Ed25519 demo

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sat Jun 22 18:19:54 BST 2024


https://bugs.libre-soc.org/show_bug.cgi?id=1151

--- Comment #12 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Luke Kenneth Casson Leighton from comment #11)
> from michiel:
> 
> ----
> 
> Hi Luke,
> 
> I'm going through this as we speak, and don't understand how the repo works
> here.
> 
> In the OpenPower ISA repo, under /crypto I see a checkout of this code:
> 
> https://github.com/floodyberry/ed25519-donna

the main function  i converted from c to python, months go,
and cut/paste it to lines 10-32. it is the key functuon, being
a complete big-int multiply.

> and I see some preliminary code in
> src/openpower/decoder/isa/ed25519/curve25519_mul.py

yes. no. not preliminary: sufficient complete and self-contained
to prove the point. implementing Triangular REMAP is under a
completely different grant if i recall correctly.

> but that is just a first sketch and doesn't work, right?

that's incorrect - just run it. lines 78-80 set up 5 "random" tests.

> Or does it, and is there a way we should test this?

python3 curve25519_mul.py

it shows (lines 42 and 44, and 54 and 57) that a triangular REMAP
in hardware would do auto-looping around a single instruction
(multiply-and-add). that demonstrates that the entire loop(s) would
each reduce down to three instructions, just like Matrix REMAP
is only three instructions.

and that makes for a massive reduction in code density.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list