Crypt::DSA::Util(3)

πŸ’– Crypt::DSA::Util πŸ’–

okay bestie, welcome to Crypt::DSA::Util β€” the little utility drawer for the whole Crypt::DSA family of libraries. it's giving backstage crew energy: you don't see it on stage, but the show does NOT happen without it. πŸŽ€


✨ NAME ✨

Crypt::DSA::Util β€” DSA utility functions, aka the lil helpers doing the math so you don't have to 🧚


🌸 SYNOPSIS 🌸

use Crypt::DSA::Util qw( func1 func2 ... );

pick whatever you need off the shelf, boo. exportable means exactly that. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Crypt::DSA::Util is a whole lil collection of exportable utility functions that get used all over the place throughout the Crypt::DSA set of libraries. no cap, it's the shared toolbox. πŸ”₯

πŸ“ bitsize($n)

hands you back the number of bits in the Math::Pari integer object $n. that's it. that's the whole function. iconic minimalism. ✨

πŸ“ bin2mp($string)

you hand it a string $string of absolutely any length, and it treats that string like it's a base-256 representation of an integer β€” then it returns that integer, as a Math::Pari object. so: bytes in, big mathy integer out. πŸ’–

πŸ“ mp2bin($int)

the glow-down of the one above, kind of. give it a biginteger $int (a Math::Pari object, bestie) and it linearizes the integer into an octet string, then returns that octet string. big mathy integer in, bytes out. 🫢

πŸ“ mod_exp($a, $exp, $n)

computes $a ^ $exp mod $n and returns the value. the math is all done with Math::Pari, and what comes back at you is a Math::Pari object. so it's $a to the $exp power, mod $n, and it slays. πŸ”₯

πŸ“ mod_inverse($a, $n)

computes the multiplicative inverse of $a mod $n and returns the value. again: math via Math::Pari, return value is a Math::Pari object. modular inverse, but make it cute. πŸ’œ


πŸ‘‘ AUTHOR & COPYRIGHTS πŸ‘‘

for the author, copyright, and license tea, please see the Crypt::DSA manpage. all the credits live over there. πŸ’–


ok that's the whole page, no notes, go forth and compute πŸ¦‹

perl v5.42.2 Β· 2026-07-03 β€” yeah that's the version and date stamp from the footer, mwah, bye bestie πŸ’…πŸŽ€

πŸ“¦ where this page comes from