mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 13:28:27 +00:00
Tests: add test for garbage collected primefield
This commit is contained in:
parent
f01892a9db
commit
69325956ce
@ -20,4 +20,21 @@ class PrimeFieldTest extends PhpseclibTestCase
|
|||||||
|
|
||||||
echo $num2->squareRoot();
|
echo $num2->squareRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group github1929
|
||||||
|
*/
|
||||||
|
public function testGarbageCollectedToBytes()
|
||||||
|
{
|
||||||
|
$blob = base64_decode('BFgsTFQeqKr0toyURbtT43INMDS7FTHjz3yn3MR1/Yv/pb2b9ZCYNQ/Tafe5hQpEJ4TpZOKfikP/hWZvFL8QCPgqbIGqw/KTfA==');
|
||||||
|
$public = "\0" . substr($blob, 0, 49);
|
||||||
|
$private = substr($blob, -24);
|
||||||
|
|
||||||
|
$point = \phpseclib3\Crypt\EC\Formats\Keys\PKCS1::extractPoint(
|
||||||
|
$public,
|
||||||
|
new \phpseclib3\Crypt\EC\Curves\secp192r1()
|
||||||
|
);
|
||||||
|
|
||||||
|
$point[0]->toBytes();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user