From 35abd5a660b3e1527e8e54a95222225b6f640ac3 Mon Sep 17 00:00:00 2001 From: Cesar_Strauss Date: Sun, 25 Aug 2024 18:46:44 +0100 Subject: [PATCH] --- crypto_router_asic.mdwn | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/crypto_router_asic.mdwn b/crypto_router_asic.mdwn index e190eb8a6..f32b843d3 100644 --- a/crypto_router_asic.mdwn +++ b/crypto_router_asic.mdwn @@ -85,8 +85,6 @@ implementation.) **5) Documentation and demonstration of the general-purpose instructions that happen to also help accelerate cryptographic algorithms** -See: - * [Big integer multiplication](https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/test/bigint/powmod.py;h=7fc794685bebb1f3c2451c64da041a0e81143e29;hb=HEAD#l29) * [Big integer division/modulus](https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/test/bigint/powmod.py;h=7fc794685bebb1f3c2451c64da041a0e81143e29;hb=HEAD#l131) * [Big integer modular power operation](https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/test/bigint/powmod.py;h=7fc794685bebb1f3c2451c64da041a0e81143e29;hb=HEAD#l991) @@ -94,7 +92,23 @@ See: To test the above assembly algorithms in the ISA simulator, [install the developer environment](/HDL_workflow/devscripts), go to the `~/src/openpower-isa/src/openpower/decoder/isa` directory, and run -`python3 test_aaa_caller_svp64_powmod.py` (warning: long running). +`SILENCELOG=1 python3 test_aaa_caller_svp64_powmod.py` (warning: long running). + +One catastrophic mistake made by many cryptographic instruction implementations +is to create over-specific instructions. "multiply by 2 then subtract 5" for example (the basis of a RISC-V chacha20 "accelerator"!) + +Using our instructions, [our implementation of chacha20](https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=crypto/chacha20/src/xchacha_encrypt_bytes_svp64.s;h=c1e0a8675cf679036b27de0bf83f8320ee36339a;hb=HEAD) +only has TEN INSTRUCTIONS in the inner loop entire algorithm. See: +[chacha20 design document](/openpower/sv/cookbook/chacha20). + +To run the chacha20 test in the ISA simulator, go to the +`~/src/openpower-isa/crypto/chacha20` directory, run `make` and +`SILENCELOG=1 ./test-chacha20` (warning: long running). + +Further reading: + +* [Bug 773 - High-Level Demos of Cryptographic and Other Relevant Algorithms](https://bugs.libre-soc.org/show_bug.cgi?id=773) +* [Bug 1044 - SVP64 implementation of pow(x,y,z)](https://bugs.libre-soc.org/show_bug.cgi?id=1044) **5) A flexible self-contained HDL platform (ls2) for implementing a System-on-Chip on an FPGA or ASIC** @@ -102,9 +116,7 @@ on an FPGA or ASIC** * [Documentation](/HDL_workflow/ls2/) * [Code](https://git.libre-soc.org/?p=ls2.git;a=blob;f=src/ls2.py;h=48f6cca7e06ac16ec42e76c361945e3943dca4b2;hb=HEAD) -One catastrophic mistake made by many cryptographic instruction implementations -is to create over-specific instructions. "multiply by 2 then subtract 5" for example -(the basis of a RISC-V chacha20 "accelerator"!) + ## TODO @@ -114,9 +126,6 @@ Links to: (probably not needed, cesar) * bug reports, git commits and other wiki pages -[[/openpower/sv/cookbook/chacha20]] - this was actually done under NLnet grant [2022-08-051](/nlnet_2022_opf_isa_wg) (see [[https://bugs.libre-soc.org/show_bug.cgi?id=952]]) and only has TEN INSTRUCTIONS in the inner -loop entire algorithm. - # Helpful information for Cryptorouter implementations: Given the work above, the information below is useful for allowing anyone -- 2.30.2