コード例 #1
0
ファイル: RSA.php プロジェクト: chenwaichung/bi2php
 function biRSAKeyPair($encryptionExponent, $decryptionExponent, $modulus)
 {
     global $biRadixBits;
     $this->e = biFromString($encryptionExponent, 16);
     $this->d = biFromString($decryptionExponent, 16);
     $this->m = biFromString($modulus, 16);
     // We can do two bytes per digit, so
     // chunkSize = 2 * (number of digits in modulus - 1).
     // Since biHighIndex returns the high index, not the number of digits, 1 has
     // already been subtracted.
     $this->chunkSize = biHighIndex($this->m);
     $this->radix = $biRadixBits;
     //12;
     $this->barrett = new biBarrettMu($this->m);
 }
コード例 #2
0
ファイル: BigInt.php プロジェクト: chenwaichung/bi2php
function biFromHex($s)
{
    return biFromString($s, 16);
}