opengnsys_ipxe/src
Michael Brown 83ac98ce22 [crypto] Use Montgomery reduction for modular exponentiation
Speed up modular exponentiation by using Montgomery reduction rather
than direct modular reduction.

Montgomery reduction in base 2^n requires the modulus to be coprime to
2^n, which would limit us to requiring that the modulus is an odd
number.  Extend the implementation to include support for
exponentiation with even moduli via Garner's algorithm as described in
"Montgomery reduction with even modulus" (Koç, 1994).

Since almost all use cases for modular exponentation require a large
prime (and hence odd) modulus, the support for even moduli could
potentially be removed in future.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2024-11-28 15:06:01 +00:00
..
arch [crypto] Expose carry flag from big integer addition and subtraction 2024-11-26 12:55:13 +00:00
bin [build] Reduce scope of wildcard .gitignore rules 2024-01-09 12:39:48 +00:00
config [sbi] Add support for running as a RISC-V SBI payload 2024-10-28 19:20:50 +00:00
core [pci] Provide a null PCI API for platforms with no PCI bus 2024-10-28 16:43:43 +00:00
crypto [crypto] Use Montgomery reduction for modular exponentiation 2024-11-28 15:06:01 +00:00
doc [build] Rename gPXE to iPXE 2010-04-19 23:43:39 +01:00
drivers [pci] Drag in PCI settings mechanism only when PCI support is present 2024-10-25 14:40:28 +01:00
hci [usb] Add "usbscan" command for iterating over USB devices 2024-10-17 14:18:22 +01:00
image [crypto] Extend asn1_enter() to handle partial object cursors 2024-08-07 16:26:19 +01:00
include [crypto] Use Montgomery reduction for modular exponentiation 2024-11-28 15:06:01 +00:00
interface [efi] Ensure local drives are connected when attempting a SAN boot 2024-11-20 14:25:06 +00:00
libgcc [libgcc] Change __divmoddi4 from int64 [unknown] to int64_t 2020-07-21 14:33:32 +01:00
net [crypto] Remove the concept of a public-key algorithm reusable context 2024-08-21 21:00:57 +01:00
scripts [arm] Inhibit linker warnings about an implied executable stack 2023-01-23 12:55:44 +00:00
tests [crypto] Use Montgomery reduction for modular exponentiation 2024-11-28 15:06:01 +00:00
usr [image] Add the "imgdecrypt" command 2024-08-29 15:11:30 +01:00
util [riscv] Add support for the RISC-V CPU architecture 2024-09-15 22:34:10 +01:00
.gitignore [build] Reduce scope of wildcard .gitignore rules 2024-01-09 12:39:48 +00:00
Makefile [build] Allow for per-architecture cross-compilation prefixes 2024-10-29 14:11:08 +00:00
Makefile.efi [efi] Add support for driving EFI_MANAGED_NETWORK_PROTOCOL devices 2024-03-25 17:58:33 +00:00
Makefile.housekeeping [build] Allow for per-architecture cross-compilation prefixes 2024-10-29 14:11:08 +00:00
Makefile.linux [linux] Allow a sysroot to be specified via SYSROOT=... 2024-09-15 10:01:35 +01:00
doxygen.cfg [build] Remove PACKED macro 2010-05-29 23:49:47 +01:00