Skip to content

Speed up modular exponentiation of Go's big.Int's using precomputed tables

Notifications You must be signed in to change notification settings

bwesterb/go-exptable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-exptable

Compute tables to speed up Go's math/big.Int modular exponentiation for fixed base.

var table exptable.Table
table.Compute(&base, &m, 4)   // precomputes table for the given base
table.Exp(&result, &exponent) // sets result to base^exponent modulo m

Documentation at godoc.