#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

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

#560 in Magic Beans

Download history 159/week @ 2024-10-21 3/week @ 2024-10-28 116/week @ 2024-11-04 108/week @ 2024-11-11

386 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