本文整理汇总了PHP中Point::rmul方法的典型用法代码示例。如果您正苦于以下问题:PHP Point::rmul方法的具体用法?PHP Point::rmul怎么用?PHP Point::rmul使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point::rmul方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bcmath_signatureValidity
public static function bcmath_signatureValidity($verbose = false)
{
$start_time = microtime(true);
$p192 = NISTcurve::generator_192();
$d = '651056770906015076056810763456358567190100156695615665659';
$k = '6140507067065001063065065565667405560006161556565665656654';
$e = '968236873715988614170569073515315707566766479517';
$pubk = new PublicKey($p192, Point::rmul($p192, $d));
$privk = new PrivateKey($pubk, $d);
$sig = $privk->sign($e, $k);
$r = $sig->getR();
$s = $sig->getS();
if ($r != '3342403536405981729393488334694600415596881826869351677613' || $s != '5735822328888155254683894997897571951568553642892029982342') {
print "*** r or s came out wrong.<br />";
flush();
} else {
if ($verbose) {
print "r and s came out right.<br />";
}
flush();
}
$valid = $pubk->verifies($e, $sig);
if ($valid) {
if ($verbose) {
print "Signature verified OK.<br />";
}
flush();
} else {
print "*** Signature failed verification.<br />";
flush();
}
$valid = $pubk->verifies(bcsub($e, 1), $sig);
if (!$valid) {
if ($verbose) {
print "Forgery was correctly rejected.<br />";
}
flush();
} else {
print "*** Forgery was erroneously accepted.<br />";
}
flush();
if ($verbose) {
print "Trying signature-verification tests from ECDSAVS.pdf B.2.4:<br />";
}
flush();
if ($verbose) {
print "P-192:";
}
flush();
$Msg = bcmath_Utils::bchexdec('0x84ce72aa8699df436059f052ac51b6398d2511e49631bcb7e71f89c499b9ee425dfbc13a5f6d408471b054f2655617cbbaf7937b7c80cd8865cf02c8487d30d2b0fbd8b2c4e102e16d828374bbc47b93852f212d5043c3ea720f086178ff798cc4f63f787b9c2e419efa033e7644ea7936f54462dc21a6c4580725f7f0e7d158');
$Qx = bcmath_Utils::bchexdec('0xd9dbfb332aa8e5ff091e8ce535857c37c73f6250ffb2e7ac');
$Qy = bcmath_Utils::bchexdec('0x282102e364feded3ad15ddf968f88d8321aa268dd483ebc4');
$R = bcmath_Utils::bchexdec('0x64dca58a20787c488d11d6dd96313f1b766f2d8efe122916');
$S = bcmath_Utils::bchexdec('0x1ecba28141e84ab4ecad92f56720e2cc83eb3d22dec72479');
self::test_signature_validity($Msg, $Qx, $Qy, $R, $S, true, $verbose);
$Msg = bcmath_Utils::bchexdec('0x94bb5bacd5f8ea765810024db87f4224ad71362a3c28284b2b9f39fab86db12e8beb94aae899768229be8fdb6c4f12f28912bb604703a79ccff769c1607f5a91450f30ba0460d359d9126cbd6296be6d9c4bb96c0ee74cbb44197c207f6db326ab6f5a659113a9034e54be7b041ced9dcf6458d7fb9cbfb2744d999f7dfd63f4');
$Qx = bcmath_Utils::bchexdec('0x3e53ef8d3112af3285c0e74842090712cd324832d4277ae7');
$Qy = bcmath_Utils::bchexdec('0xcc75f8952d30aec2cbb719fc6aa9934590b5d0ff5a83adb7');
$R = bcmath_Utils::bchexdec('0x8285261607283ba18f335026130bab31840dcfd9c3e555af');
$S = bcmath_Utils::bchexdec('0x356d89e1b04541afc9704a45e9c535ce4a50929e33d7e06c');
self::test_signature_validity($Msg, $Qx, $Qy, $R, $S, true, $verbose);
$Msg = bcmath_Utils::bchexdec('0xf6227a8eeb34afed1621dcc89a91d72ea212cb2f476839d9b4243c66877911b37b4ad6f4448792a7bbba76c63bdd63414b6facab7dc71c3396a73bd7ee14cdd41a659c61c99b779cecf07bc51ab391aa3252386242b9853ea7da67fd768d303f1b9b513d401565b6f1eb722dfdb96b519fe4f9bd5de67ae131e64b40e78c42dd');
$Qx = bcmath_Utils::bchexdec('0x16335dbe95f8e8254a4e04575d736befb258b8657f773cb7');
$Qy = bcmath_Utils::bchexdec('0x421b13379c59bc9dce38a1099ca79bbd06d647c7f6242336');
$R = bcmath_Utils::bchexdec('0x4141bd5d64ea36c5b0bd21ef28c02da216ed9d04522b1e91');
$S = bcmath_Utils::bchexdec('0x159a6aa852bcc579e821b7bb0994c0861fb08280c38daa09');
self::test_signature_validity($Msg, $Qx, $Qy, $R, $S, false, $verbose);
$Msg = bcmath_Utils::bchexdec('0x16b5f93afd0d02246f662761ed8e0dd9504681ed02a253006eb36736b563097ba39f81c8e1bce7a16c1339e345efabbc6baa3efb0612948ae51103382a8ee8bc448e3ef71e9f6f7a9676694831d7f5dd0db5446f179bcb737d4a526367a447bfe2c857521c7f40b6d7d7e01a180d92431fb0bbd29c04a0c420a57b3ed26ccd8a');
$Qx = bcmath_Utils::bchexdec('0xfd14cdf1607f5efb7b1793037b15bdf4baa6f7c16341ab0b');
$Qy = bcmath_Utils::bchexdec('0x83fa0795cc6c4795b9016dac928fd6bac32f3229a96312c4');
$R = bcmath_Utils::bchexdec('0x8dfdb832951e0167c5d762a473c0416c5c15bc1195667dc1');
$S = bcmath_Utils::bchexdec('0x1720288a2dc13fa1ec78f763f8fe2ff7354a7e6fdde44520');
self::test_signature_validity($Msg, $Qx, $Qy, $R, $S, false, $verbose);
$Msg = bcmath_Utils::bchexdec('0x08a2024b61b79d260e3bb43ef15659aec89e5b560199bc82cf7c65c77d39192e03b9a895d766655105edd9188242b91fbde4167f7862d4ddd61e5d4ab55196683d4f13ceb90d87aea6e07eb50a874e33086c4a7cb0273a8e1c4408f4b846bceae1ebaac1b2b2ea851a9b09de322efe34cebe601653efd6ddc876ce8c2f2072fb');
$Qx = bcmath_Utils::bchexdec('0x674f941dc1a1f8b763c9334d726172d527b90ca324db8828');
$Qy = bcmath_Utils::bchexdec('0x65adfa32e8b236cb33a3e84cf59bfb9417ae7e8ede57a7ff');
$R = bcmath_Utils::bchexdec('0x9508b9fdd7daf0d8126f9e2bc5a35e4c6d800b5b804d7796');
$S = bcmath_Utils::bchexdec('0x36f2bf6b21b987c77b53bb801b3435a577e3d493744bfab0');
self::test_signature_validity($Msg, $Qx, $Qy, $R, $S, false, $verbose);
$Msg = bcmath_Utils::bchexdec('0x1843aba74b0789d4ac6b0b8923848023a644a7b70afa23b1191829bbe4397ce15b629bf21a8838298653ed0c19222b95fa4f7390d1b4c844d96e645537e0aae98afb5c0ac3bd0e4c37f8daaff25556c64e98c319c52687c904c4de7240a1cc55cd9756b7edaef184e6e23b385726e9ffcba8001b8f574987c1a3fedaaa83ca6d');
$Qx = bcmath_Utils::bchexdec('0x10ecca1aad7220b56a62008b35170bfd5e35885c4014a19f');
$Qy = bcmath_Utils::bchexdec('0x04eb61984c6c12ade3bc47f3c629ece7aa0a033b9948d686');
$R = bcmath_Utils::bchexdec('0x82bfa4e82c0dfe9274169b86694e76ce993fd83b5c60f325');
$S = bcmath_Utils::bchexdec('0xa97685676c59a65dbde002fe9d613431fb183e8006d05633');
self::test_signature_validity($Msg, $Qx, $Qy, $R, $S, false, $verbose);
$Msg = bcmath_Utils::bchexdec('0x5a478f4084ddd1a7fea038aa9732a822106385797d02311aeef4d0264f824f698df7a48cfb6b578cf3da416bc0799425bb491be5b5ecc37995b85b03420a98f2c4dc5c31a69a379e9e322fbe706bbcaf0f77175e05cbb4fa162e0da82010a278461e3e974d137bc746d1880d6eb02aa95216014b37480d84b87f717bb13f76e1');
$Qx = bcmath_Utils::bchexdec('0x6636653cb5b894ca65c448277b29da3ad101c4c2300f7c04');
$Qy = bcmath_Utils::bchexdec('0xfdf1cbb3fc3fd6a4f890b59e554544175fa77dbdbeb656c1');
$R = bcmath_Utils::bchexdec('0xeac2ddecddfb79931a9c3d49c08de0645c783a24cb365e1c');
$S = bcmath_Utils::bchexdec('0x3549fee3cfa7e5f93bc47d92d8ba100e881a2a93c22f8d50');
self::test_signature_validity($Msg, $Qx, $Qy, $R, $S, false, $verbose);
$Msg = bcmath_Utils::bchexdec('0xc598774259a058fa65212ac57eaa4f52240e629ef4c310722088292d1d4af6c39b49ce06ba77e4247b20637174d0bd67c9723feb57b5ead232b47ea452d5d7a089f17c00b8b6767e434a5e16c231ba0efa718a340bf41d67ea2d295812ff1b9277daacb8bc27b50ea5e6443bcf95ef4e9f5468fe78485236313d53d1c68f6ba2');
$Qx = bcmath_Utils::bchexdec('0xa82bd718d01d354001148cd5f69b9ebf38ff6f21898f8aaa');
$Qy = bcmath_Utils::bchexdec('0xe67ceede07fc2ebfafd62462a51e4b6c6b3d5b537b7caf3e');
$R = bcmath_Utils::bchexdec('0x4d292486c620c3de20856e57d3bb72fcde4a73ad26376955');
$S = bcmath_Utils::bchexdec('0xa85289591a6081d5728825520e62ff1c64f94235c04c7f95');
self::test_signature_validity($Msg, $Qx, $Qy, $R, $S, false, $verbose);
$Msg = bcmath_Utils::bchexdec('0xca98ed9db081a07b7557f24ced6c7b9891269a95d2026747add9e9eb80638a961cf9c71a1b9f2c29744180bd4c3d3db60f2243c5c0b7cc8a8d40a3f9a7fc910250f2187136ee6413ffc67f1a25e1c4c204fa9635312252ac0e0481d89b6d53808f0c496ba87631803f6c572c1f61fa049737fdacce4adff757afed4f05beb658');
$Qx = bcmath_Utils::bchexdec('0x7d3b016b57758b160c4fca73d48df07ae3b6b30225126c2f');
$Qy = bcmath_Utils::bchexdec('0x4af3790d9775742bde46f8da876711be1b65244b2b39e7ec');
//.........这里部分代码省略.........