#big #svm #exp #fixed #solana #no-std #mod

solana-nostd-big-mod-exp

A more efficient implementation of Big Mod Exp for SVM

3 releases

0.1.3 Nov 15, 2024
0.1.1 Nov 6, 2024
0.1.0 Oct 21, 2024

#8 in #exp

Download history 143/week @ 2024-10-18 18/week @ 2024-10-25 102/week @ 2024-11-01 20/week @ 2024-11-08 121/week @ 2024-11-15 14/week @ 2024-11-22 13/week @ 2024-11-29 12/week @ 2024-12-06

161 downloads per month
Used in solana-secp256k1

MIT license

10KB
125 lines

Solana NoStd BigModExp

A more efficient implementation of Big Number Modular Exponentiation for SVM.

Installation

cargo add solana-nostd-big-mod-exp

Features

  • Makes use of MaybeUninit to skip zero allocations
  • Implements a fixed size big_mod_exp_fixed function to avoid heap allocations

Performance

library function CU cost
nostd-big-mod-exp big_mod_exp_fixed 2102
nostd-big-mod-exp big_mod_exp 2122
solana-program big_mod_exp 2151

Dependencies

~1.5MB
~28K SLoC