Related links:
The RSA Ontology 1.0
RSA-SHA1 Signature Suite - Version 1.0
Math Is Fun
Surjective (onto) ... (one-to-one) ...
<?php
string bcpowmod ( string $num,
string $exponent,
string $modulus,
?int $scale = null )
where,
$num = The base as STRING
$exponent = The exponent as STRING
$modulus = The modulus, as an integral STRING
$scale = The number of decimal places
considered by this operation
?>
<?php
$a = '3';
$mod01 = 17;
for ($b = 0; $b <=9; $b++)
{
$xbcpwmd = bcpowmod($a, $b, $mod01);
$xbcpw = bcpow($a,$b);
$xbcmd = bcmod($xbcpw, $mod01);
echo '<br>bcpow(' . $a . ', ' . $b . ') = ' . $xbcpw . ' => ';
echo 'bcmod(' . $xbcpw . ', ' . $mod01 . ') = ' . $xbcmd . '<br>';
echo 'bcpowmod(' . $a . ', ' . $b . ', ' . $mod01 . ') = ' .
$xbcpwmd . '<br>';
}
?>
<?php
$base= 3;
$exp = -3;
$mod = 0;
$xbcpwmd = bcpowmod($base, $exp, $mod);
$xbcpw = bcpow($base,$exp);
$xbcmd = bcmod($xbcpw, $mod);
echo '<br>bcpow(' . $base. ', ' . $exp . ') = ' . $xbcpw .
' => ';
echo 'bcmod(' . $xbcpw . ', ' . $mod . ') = ' . $xbcmd . '<br>';
echo 'bcpowmod(' . $base. ', ' . $exp . ', ' . $mod . ') = ' .
$xbcpwmd . '<br>';
?>