Commit Graph

383 Commits

Author SHA1 Message Date
terrafrost
011f6ad200 BigInteger/PHP: make sure that zero is represented uniformly 2018-04-03 20:23:47 -05:00
Wes
d4a98457bc Check phpinfo() is available before using
Fixes an issue I raised at https://github.com/phpseclib/phpseclib/issues/1255

Proof of logic at https://3v4l.org/RqrHt

I ended up moving more code than discussed in the issue - initially to avoid `$content` being undefined when it came to `preg_match_all()`, but also as it made sense grouping the code that way. Also, initialising `$versions` outside the check, right at the start ensures it's always defined for the `switch` code further down.
2018-03-24 11:05:16 +00:00
luz.paz
380517ef00 Misc. trivial typos
Found via `codespell -q 3`
2018-03-03 07:07:14 -05:00
terrafrost
44ac8f3996 Merge branch '2.0' 2018-01-22 07:26:57 -06:00
terrafrost
364e05babf Merge branch '1.0' into 2.0 2018-01-22 07:22:29 -06:00
terrafrost
92623daba8 BigInteger: fix issues with bitwise_xor 2018-01-22 00:38:42 -06:00
terrafrost
239a32ff06
Merge pull request #1222 from rrran/extract_func_phpdoc
Add PhpDoc @var for extract() functions
2017-12-23 14:18:28 -06:00
Sokolovskyy Roman
62ee1a5747 Multiline phpdoc for extract to one liner 2017-12-21 10:14:53 +01:00
terrafrost
0074539429 Merge branch 'array_to_short_syntax' 2017-12-04 23:03:35 -06:00
Sokolovskyy Roman
c705e7d9c6 Add PhpDoc @var for extract() functions 2017-12-04 11:11:43 +01:00
Sokolovskyy Roman
966ee7f170 Long array() to short [] syntax 2017-11-27 09:30:14 +01:00
terrafrost
88b34382f9 Merge branch '2.0-is-prime' 2017-11-22 19:52:49 -06:00
terrafrost
cd58e3be1d Merge branch '1.0-is-prime' into 2.0-is-prime 2017-11-22 19:50:49 -06:00
terrafrost
5ba61146e6 BigInteger: adjustment to isPrime 2017-11-22 19:49:55 -06:00
terrafrost
ec579bd9ed revisions to rrran's PHPDoc changes 2017-11-05 14:35:27 -06:00
terrafrost
10828543ce Merge remote-tracking branch 'rrran/Fixes3' 2017-11-05 13:16:03 -06:00
terrafrost
5f3c49cbcc Merge remote-tracking branch 'lzylinl/master' 2017-11-05 12:57:29 -06:00
terrafrost
6f6b93b012 BigInteger/GMP: use gmp_import / gmp_export 2017-11-05 12:33:22 -06:00
terrafrost
5801806d23 BigInteger/GMP: fix casting error 2017-11-05 12:28:16 -06:00
terrafrost
c7606818e0 BigInteger/Engines/PHP: small optimization to EvalBarrett engine 2017-11-05 01:56:04 -05:00
terrafrost
ff595f9951 BigInteger/Engines/PHP: fix issues with EvalBarrett reduction 2017-11-05 01:33:57 -05:00
terrafrost
5eec16041d BigInteger/Engines/PHP: HAC 14.42.2 does mod $b^{k+1}$ 2017-11-04 12:28:38 -05:00
terrafrost
f01cc6b099 BigInteger/Engines/PHP: fix issue with regular barrett engine 2017-11-04 02:16:01 -05:00
terrafrost
410e5aed96 BigInteger/Engines/PHP: use regular barrett for PHP32 engine 2017-11-04 02:15:32 -05:00
Sokolovskyy Roman
f40ea062c2 Lots of PHPDoc fixes 2017-10-25 11:44:14 +02:00
zylin
2fcc294cc6 Sometimes at php7 uniqid() return same result as their previous call. Here generates few equal labels wich makes error on eval. Does not know why uniqid() return same values but this is fact and my construction is more correct than previous. No need to call label id generation and use dirty goto :') 2017-10-23 22:31:18 +02:00
terrafrost
7a2f2e8e6b BigInteger\PHP: self::$primes -> static::$primes 2017-10-21 12:32:56 -05:00
terrafrost
ce92283c10 Merge branch '2.0' 2017-10-05 05:42:38 -05:00
terrafrost
6d51f2bf85 BigInteger: update bitwise_not fix for 2.0 2017-10-05 05:39:00 -05:00
terrafrost
245e7a15ca Merge branch '1.0' into 2.0 2017-10-05 05:37:56 -05:00
terrafrost
a7ebe7d39d BigInteger: fix bitwise_not for 0 2017-10-05 05:37:42 -05:00
terrafrost
03e15a5ab9 BigInteger: make constructor catch behave same as setEngine 2017-10-01 07:55:00 +01:00
terrafrost
256ffcca7b Merge remote-tracking branch 'pcf0/fix-biginteger-badconfigurationexception' 2017-10-01 07:53:54 +01:00
PCF
43803c6872
Catch BadConfigurationException in BigInteger 2017-09-30 02:47:00 +02:00
terrafrost
58768cb5aa Merge branch 'gmp-1.0' into gmp-2.0 2017-09-10 15:02:34 -05:00
terrafrost
b6d0e37432 BigInteger: use gmp_import / gmp_export when available 2017-09-10 14:56:57 -05:00
Sokolovskyy Roman
25c1ae6e00 Merge remote-tracking branch 'origin/master' into Bugfixes2 2017-08-09 12:28:02 +02:00
terrafrost
e7e30cd239 BigInteger: undo visibility changes 2017-08-07 22:38:56 -05:00
Sokolovskyy Roman
55cacdf7cd More PHPDOC fixes 2017-08-04 12:06:25 +02:00
Sokolovskyy Roman
de2e4662b0 Fixed wrong use of new self(1); 2017-08-03 09:26:46 +02:00
Sokolovskyy Roman
7bffa6bb8f Set of PHPDOC fixes 2017-08-03 09:26:09 +02:00
Sokolovskyy Roman
6f36c49baa Fixed methods visibility 2017-08-03 09:20:33 +02:00
Sokolovskyy Roman
d13f429b77 PHPDOC fixes 2017-08-03 09:20:17 +02:00
Sokolovskyy Roman
f314f9795f Fixed methods visibility 2017-08-03 09:20:05 +02:00
Sokolovskyy Roman
5583703040 Set of PHPDOC fixes 2017-08-03 09:15:16 +02:00
terrafrost
5fe629a171 BigInteger: modularize / modernize class and add new powmod engines 2017-06-26 20:07:10 -05:00
terrafrost
42def63b00 Merge remote-tracking branch 'upstream/master' into dsa-test-2 2017-02-02 21:07:47 -05:00
terrafrost
eb459daeaf add DSA implementation 2017-02-02 20:20:47 -05:00
terrafrost
fae358cc3c BigInteger: use public / private / protected 2017-01-05 00:20:18 -06:00
terrafrost
c852bae3c8 use short array syntax for arrays 2016-11-30 21:29:38 -06:00
terrafrost
874ada8d93 ASN1: make methods static 2016-11-27 22:38:11 -06:00
terrafrost
863ff6789b RSA: refactor PKCS1/PKCS8 to facilitate re-use 2016-11-17 08:09:10 -06:00
terrafrost
a862837a9a Merge remote-tracking branch 'origin/danog2' 2016-09-23 10:20:07 -05:00
terrafrost
8019baee62 BigInteger: add randomRange / randomPrimeRange
...and redo random / randomPrime such that they take the byte size
as the parameter instead of the range.
2016-09-17 19:48:51 -07:00
terrafrost
845135f887 add PHP5-style constructors along side PHP4-style ones 2016-09-10 10:41:05 -07:00
terrafrost
0ee24aa218 BigInteger: rm loopforeach method 2016-09-09 20:59:54 -08:00
terrafrost
72d1bdf60b a few changes to danog's changes 2016-09-08 00:22:30 -08:00
klemens
dd23d91d41 spelling fixes 2016-08-04 00:47:52 -05:00
terrafrost
c547ee16c7 Merge branch '1.0' into 2.0 2016-08-04 00:31:15 -05:00
klemens
dca95ac662 spelling fixes 2016-08-04 00:19:27 -05:00
danogentili
7cf300984c Added root, pow, max, min, loopforeach functions and tests. 2016-08-03 10:51:19 -04:00
terrafrost
7bdb09c4bd Merge branch '1.0' into 2.0 2016-06-18 23:29:33 -05:00
terrafrost
6ff421d354 BigInteger/RSA: don't compare openssl versions > 1.0 2016-06-18 23:28:33 -05:00
terrafrost
7a628c62b0 don't do phpinfo() check 2016-06-11 20:29:02 -05:00
terrafrost
e2a0b701c7 remove a few calls to paragonie/constant_time_encoding
- Hex::decode('aabb') can be replaced with "\xaa\xbb"
- Hex::decode(sha1('...')) can be replaced with sha1('...', true)
2016-06-04 22:31:23 -05:00
Paragon Initiative Enterprises
0e8fa93676 Use paragonie/constant_time_encoding 2016-05-12 16:28:40 -04:00
terrafrost
398a795e1f Revert "undo merging of master to 2.0 branch"
This reverts commit 8fb4c3363d.
2016-04-30 16:23:35 -05:00
terrafrost
8fb4c3363d undo merging of master to 2.0 branch 2016-04-28 15:34:10 -05:00
terrafrost
b4cf10fc94 Revert "Merge branch '2.0'"
This reverts commit be5f4ef6b19c82f6c898708cc8e1828b05e3d4e8, reversing
changes made to 638fe6971c.
2016-04-10 11:30:59 -05:00
terrafrost
4b69dcb1ca Revert "Merge remote-tracking branch 'bantu/bootstrap'"
This reverts commit ef04c870e9, reversing
changes made to cd57bf31ae.
2016-04-10 11:25:31 -05:00
terrafrost
2ae82a1bc7 Merge branch '2.0' 2016-03-19 12:23:11 -05:00
terrafrost
6bfbfdbf7e Merge branch '1.0' into 2.0 2016-03-19 12:23:04 -05:00
Abhishek Taneja
cb2ccea219 changing valid condition order, _slidingWindow biginteger 2016-03-19 12:11:59 -05:00
terrafrost
f8dc527af5 Merge branch 'master' into biginteger-revamp 2016-01-08 10:43:49 -06:00
terrafrost
1e15ef5a55 Merge branch 'bitwise-not-1.0' into 2.0 2016-01-08 10:42:20 -06:00
terrafrost
7ad9eade2d BigInteger: fix issue with doing bitwise not on 0 2016-01-08 10:31:48 -06:00
terrafrost
f7efbcbc8e BigInteger: updates per Joey3000 2016-01-08 10:19:48 -06:00
terrafrost
d86c61de78 BigInteger: add getprecision 2016-01-03 10:42:44 -06:00
terrafrost
a0d21b6321 BigInteger: make select methods static, add type hinting, etc 2015-12-27 10:24:17 -06:00
terrafrost
eac8613c75 BigInteger: 2.0 specific updates for __debuginfo 2015-12-14 13:56:07 -06:00
terrafrost
8448f63d76 Merge branch '1.0' into 2.0 2015-12-14 11:01:51 -06:00
terrafrost
c655b16f75 BigInteger: add engine to __debugInfo output and add unit test 2015-12-07 15:22:53 -06:00
terrafrost
37535744b2 small tweaks 2015-11-21 22:55:20 -05:00
terrafrost
33ea01f1ac Merge branch 'phpdoc-1.0' into phpdoc-2.0
Conflicts:
	phpseclib/Crypt/AES.php
	phpseclib/Crypt/Base.php
	phpseclib/Crypt/Blowfish.php
	phpseclib/Crypt/DES.php
	phpseclib/Crypt/Hash.php
	phpseclib/Crypt/RC2.php
	phpseclib/Crypt/RC4.php
	phpseclib/Crypt/RSA.php
	phpseclib/Crypt/Rijndael.php
	phpseclib/Crypt/TripleDES.php
	phpseclib/Crypt/Twofish.php
	phpseclib/File/ASN1.php
	phpseclib/File/X509.php
	phpseclib/Math/BigInteger.php
	phpseclib/Net/SCP.php
	phpseclib/Net/SFTP.php
	phpseclib/Net/SSH1.php
	phpseclib/Net/SSH2.php
	phpseclib/System/SSH/Agent.php
2015-10-12 14:10:26 -05:00
terrafrost
2048a49aac use self:: in phpdoc comments to reduce merge conflicts 2015-10-11 12:22:07 -05:00
terrafrost
19229ed224 phpDoc changes 2015-10-05 13:22:51 -05:00
Graham Campbell
7f1bbfe216 Fixed phpdoc 2015-09-14 16:30:31 +01:00
terrafrost
3f7b3b393e Merge branch 'php7' into 2.0
Conflicts:
	phpseclib/Math/BigInteger.php
2015-09-13 19:15:13 -05:00
terrafrost
833da775b6 BigInteger: fix PHP7 error
$x = gmp_init(6); empty($x); demonstrates the problem
2015-09-13 19:13:31 -05:00
Andreas Fischer
2986ea9d6d Merge pull request #816 from terrafrost/small-tweaks
small CS changes

* terrafrost/small-tweaks:
  small CS changes
2015-09-14 01:30:54 +02:00
Andreas Fischer
4387b64426 Merge branch '1.0' into 2.0
* 1.0:
  Fixed another case
  Minor tweaks
  Fixed error
  More fixes
  PHPDoc fixes

Conflicts:
	phpseclib/Crypt/Random.php
	phpseclib/Math/BigInteger.php
	phpseclib/Net/SSH2.php
	tests/Functional/Net/SFTPUserStoryTest.php
2015-09-14 01:27:04 +02:00
terrafrost
8b8d7a5dcd small CS changes 2015-09-13 18:13:35 -05:00
Graham Campbell
b1db7f05d9 Minor tweaks 2015-09-06 23:01:03 +01:00
Graham Campbell
eec8c9cb5d More fixes 2015-09-06 12:39:14 +01:00
Graham Campbell
dd031a1702 PHPDoc fixes 2015-09-06 12:28:08 +01:00
Andreas Fischer
864493bbf6 Merge pull request #790 from cweagans/switch-to-extension-loaded-2.0
Switch to extension loaded (2.0)

* cweagans/switch-to-extension-loaded-2.0:
  Remove conditions for PHP < 5.3.0 for this branch
  Switch to extension_loaded('gmp')
  Switch to extension_loaded instead of function_exists where it makes sense
2015-09-04 15:05:40 +02:00
Andreas Fischer
e08e2fd300 Merge pull request #791 from cweagans/switch-to-extension-loaded-1.0
Switch to extension loaded (1.0)

* cweagans/switch-to-extension-loaded-1.0:
  Remove unnecessary parens
  Convert most instances of function_exists() to extension_loaded() where applicable
2015-09-04 15:04:17 +02:00
Cameron Eagans
8206061a30 Remove unnecessary parens 2015-09-02 15:22:37 -04:00
Graham Campbell
634c1c2a18 Fixed lots of phpdoc typos 2015-09-02 00:42:15 +01:00
Graham Campbell
c08c099c56 Fixed invalid param phpdoc 2015-09-02 00:41:38 +01:00
Graham Campbell
cd0e10cf9d Fixed lots of phpdoc typos 2015-09-02 00:37:54 +01:00
Graham Campbell
5890f3da98 Fixed invalid param phpdoc 2015-09-02 00:22:30 +01:00
Cameron Eagans
2b75c37cc9 Convert most instances of function_exists() to extension_loaded() where applicable 2015-09-01 14:32:22 -04:00
Cameron Eagans
df6b201ab9 Switch to extension_loaded('gmp') 2015-09-01 14:22:17 -04:00
Cameron Eagans
a84699a346 Switch to extension_loaded instead of function_exists where it makes sense 2015-09-01 14:22:12 -04:00
Andreas Fischer
d9e9504fba Merge branch 'PSR2-1.0' into PSR2-2.0
* PSR2-1.0:
  Fix indentation phpcbf did not fix.
  Remove PSR2.Methods.FunctionCallSignature.SpaceAfterOpenBracket exception.
  Use phpcbf to fix PHP code to ruleset.
  Ignore coding guidelines in ANSI switch block.
  Base code sniffer ruleset on PSR2 rather than PEAR.
  Update PHP Code Sniffer to 2.3.3

Conflicts:
	build/code-sniffer-ruleset-tests.xml
	build/code-sniffer-ruleset.xml
	composer.lock
	phpseclib/Crypt/DES.php
	phpseclib/Crypt/Hash.php
	phpseclib/Crypt/RSA.php
	phpseclib/File/X509.php
	phpseclib/Math/BigInteger.php
	phpseclib/Net/SFTP.php
	phpseclib/Net/SSH1.php
	phpseclib/Net/SSH2.php
	tests/Functional/Net/SFTPUserStoryTest.php
	tests/Unit/Crypt/TwofishTest.php
2015-07-17 13:41:59 +02:00
Andreas Fischer
2013a31ecd Use phpcbf to fix PHP code to ruleset. 2015-07-17 12:57:41 +02:00
terrafrost
d75f703c0a rm PHP v4 compatability claim 2015-04-02 05:57:52 -05:00
Andreas Fischer
04dad3ff8c Merge branch 'master' into php5
* master:
  Compare numeric part of OpenSSL version
2015-01-09 13:09:21 +01:00
Ha Phan
b0129e9125 Compare numeric part of OpenSSL version 2015-01-08 20:55:14 +07:00
Clint Nelissen
f3565346fa Replaced get_class() calls with instanceof operators 2014-12-24 13:07:14 -08:00
Clint Nelissen
fe742e18d7 Namespaced Crypt Package 2014-12-16 16:16:54 -08:00
Andreas Fischer
c4b103468c Merge pull request #549 from bantu/fix-547
Change copyright years from roman numeral to decimal numbers.

* bantu/fix-547:
  Change copyright years from roman numeral to decimal numbers.

Conflicts:
	phpseclib/System/SSH_Agent.php
2014-12-10 00:06:08 +01:00
Andreas Fischer
0efae5a91e Change copyright years from roman numeral to decimal numbers. 2014-12-10 00:04:08 +01:00
Andreas Fischer
2f27620409 Add #@+ block for properties used by internal implementation. 2014-12-08 16:02:39 +01:00
Andreas Fischer
8ecf956499 Move in-code comments to property doc blocks. 2014-12-07 23:00:59 +01:00
Clint Nelissen
f5d6b7423d Refactor defined MATH_BIGINTEGER_ constants into class constants. 2014-12-07 22:33:39 +01:00
Andreas Fischer
638e62d60a Remove LICENSE text from source code files. 2014-12-03 18:49:33 +01:00
Clint Nelissen
f5ed86e385 Renamed Random::crypt_random_string to Random::string 2014-12-02 09:20:40 -08:00
Clint Nelissen
c70702afbb Namespaced Crypt\Random 2014-12-02 08:41:30 -08:00
Clint Nelissen
9c0c3faeb7 Initial commit 2014-12-01 18:54:44 -08:00
Andreas Fischer
0e38dc4951 Merge branch 'master' into php5
* master:
  Restore compatibility with PHP 5.6.1 by using explicit array indexes.
2014-10-19 20:46:15 +02:00
Andreas Fischer
ad03d84461 Restore compatibility with PHP 5.6.1 by using explicit array indexes.
This seems to be caused by the resolution of PHP Ticket 67985.
2014-10-19 20:24:13 +02:00
Andreas Fischer
da02246cc4 Merge branch 'master' into php5
* master:
  BigInteger: accomodate GMP change in PHP 5.6
2014-09-27 22:57:59 +02:00
terrafrost
a43dd38365 BigInteger: accomodate GMP change in PHP 5.6 2014-09-27 12:52:54 -05:00
Andreas Fischer
c59750562a Merge branch 'master' into php5
* master:
  BigInteger: fix previous fix
  BigInteger:  small optimization to bitwise_not
2014-08-12 11:30:30 +02:00
terrafrost
33182bb2de BigInteger: fix previous fix 2014-08-10 14:47:08 -05:00
terrafrost
4ce7a0f63a BigInteger: small optimization to bitwise_not 2014-08-10 02:03:58 -05:00
Andreas Fischer
e4516fb453 Merge branch 'master' into php5
* master:
  Add some test cases for SHA512.
  Use toBits() as there is no bits property.
  SSH2: Disallow the none MAC.
2014-07-26 17:20:09 +02:00
Andreas Fischer
737c8a9d0f Use toBits() as there is no bits property. 2014-07-26 13:43:57 +02:00
Andreas Fischer
fc417115be Merge branch 'master' into php5
* master:
  BigInteger: one more change to the comments
  BigInteger: update comments
  BigInteger: unit test update
  BigInteger: change argument names for random / randomPrime
  BigInteger: fix unit tests
  BigInteger: fix syntax error
  BigInteger: make it so you can do $min->random($max)

Conflicts:
	phpseclib/Math/BigInteger.php
2014-06-16 17:00:00 +02:00
terrafrost
4b9eb4af27 BigInteger: one more change to the comments 2014-06-16 09:23:34 -05:00
terrafrost
0eb0ae7ff7 BigInteger: update comments 2014-06-16 09:09:26 -05:00
terrafrost
34a971d317 BigInteger: change argument names for random / randomPrime 2014-06-14 23:49:57 -05:00
terrafrost
f8f0bd44b7 BigInteger: fix syntax error 2014-06-14 19:20:05 -05:00
terrafrost
46166c7351 BigInteger: make it so you can do $min->random($max)
...and $min->randomPrime($max) as well
2014-06-14 14:07:33 -05:00
Andreas Fischer
65ec4dc8bc Some more documentation polishing in Math/BigInteger.php. 2014-06-02 20:19:00 +02:00
Andreas Fischer
a011596578 Replace new Math_BigInteger with new static. 2014-06-02 20:19:00 +02:00
Andreas Fischer
740422c65f Reference to instances as BigInteger instead of Math_BigInteger. 2014-06-02 20:19:00 +02:00
Andreas Fischer
00f77ab341 Use namespace in example code. 2014-06-02 20:19:00 +02:00
Andreas Fischer
ae4099dc64 Remove any include statement. 2014-06-02 20:19:00 +02:00
Andreas Fischer
8dff257cae Add namespace statement. Rename class. 2014-06-02 20:17:18 +02:00
Andreas Fischer
7d9598a21e Use __construct. 2014-06-02 20:17:18 +02:00
Andreas Fischer
6f4a873cad Merge branch 'master' into php5
* master:
  Adjust documentation to coding guidelines: No () around include.
2014-06-02 12:51:24 +02:00
Andreas Fischer
e6f87318f5 Adjust documentation to coding guidelines: No () around include. 2014-06-01 23:28:49 +02:00
Andreas Fischer
4a89349615 Merge branch 'master' into php5
* master:
  BigInteger: "be less overly clever loading Crypt/Random"
2014-05-30 15:50:36 +02:00
terrafrost
7c08ab71d3 BigInteger: "be less overly clever loading Crypt/Random"
pretty much the same as this commit:

28f18f83ec
2014-05-29 16:31:26 -05:00
Andreas Fischer
b7ebb1e0e3 Merge branch 'master' into php5
* master:
  BigInteger: speedup internal mode slightly
2014-05-06 00:49:46 +02:00
terrafrost
309c8fd555 BigInteger: speedup internal mode slightly
Changes should yield a slight speedup per the analysis at https://github.com/phpseclib/phpseclib/pull/317#issuecomment-42122335
2014-05-05 11:34:45 -05:00
Andreas Fischer
1d01f56f28 Merge branch 'master' into php5
* master:
  BigInteger: update comments and add test case
  BigInteger: fix some int64 issues
2014-04-29 16:32:59 +02:00
terrafrost
9eb6e1ed67 BigInteger: update comments and add test case 2014-04-29 16:32:25 +02:00
terrafrost
e4ff01f054 BigInteger: fix some int64 issues 2014-04-29 16:32:25 +02:00
Andreas Fischer
5cfe1560a0 Merge branch 'master' into php5
* master:
  BigInteger: explain precense of uncallable code
2014-04-19 14:05:12 +02:00
terrafrost
0cbb631852 BigInteger: explain precense of uncallable code 2014-04-18 23:43:03 -05:00
Andreas Fischer
7348ab6ef7 Remove deprecated method Math_BigInteger::setRandomGenerator(). 2014-04-13 01:04:37 +02:00
terrafrost
a8c2ff0fb0 add error suppression to phpinfo()
bad timezone settings can make phpinfo() throw errors so we'll just
suppress them. if there are legit non-timezone errors with php install
those will probably be hit in other parts of the code
2014-03-30 10:15:08 -05:00
Andreas Fischer
fb1296bbec Drop meaningless, outdated, inconsistent version tags in doc blocks.
find phpseclib -type f -name "*.php" -exec sed -i '/@version/d' {} \;
2014-03-11 15:58:33 +01:00
Veres Lajos
930a3fb4d2 typofixes - https://github.com/vlajos/misspell_fixer 2014-03-05 23:41:20 +00:00
Andreas Fischer
c1597f4533 Remove HTML from BigInteger code example. 2014-03-01 01:40:28 +01:00
Andreas Fischer
8bb80b3df0 CS: Add useful whitespace CodeSniffer rules. 2013-12-26 00:33:08 +01:00
Andreas Fischer
f0f029b2c1 CS: Fix "PEAR.Commenting.ClassComment.WrongTagOrder" sniff. 2013-12-11 18:33:18 +01:00
Andreas Fischer
3db1fbb072 CS: Fix "PEAR.Commenting.FileComment.TagIndent" sniff. 2013-12-10 20:10:37 +01:00
Andreas Fischer
ef2c50f9e0 Ignore coding style for "HAC 4.49" block in Math/BigInteger.php. 2013-12-03 21:04:13 +01:00
Andreas Fischer
e09f1b730e CodeSniffer: Fix PEAR.Classes.ClassDeclaration.OpenBraceNewLine sniff. 2013-12-03 19:34:41 +01:00
Marc Philip Scholten
3bfd884813 Removed vim comments
Reformated files
2013-11-23 19:42:26 +01:00
terrafrost
77447a3fc7 BigInteger, RSA: updates to OpenSSL version detection code 2013-09-20 12:14:01 -05:00
terrafrost
54f0f2131b RSA, BigInteger: add more openssl checks 2013-09-10 11:07:56 -05:00
terrafrost
442922ff0a BigInteger: refactor random number generation code somewhat 2013-08-06 23:17:49 -05:00
terrafrost
30408ff8fb BigInteger: define $p 2013-06-18 09:31:33 -04:00
terrafrost
043ad01eca BigInteger: refactor randomPrime somewhat 2013-06-08 11:10:52 -05:00
Andreas Fischer
dadaaf791e Remove unused variable $generator from Math_BigInteger::random(). 2013-06-06 17:17:15 +02:00
terrafrost
32a47d2fbc BigInteger: docblock update 2013-06-06 00:02:26 -05:00
Andreas Fischer
727dba5905 [remove-svn-version-lines] Remove useless @version: $Id$ lines.
These lines served some purpose on SVN, but are now useless on Git. They
actually do harm as they might make people think their files are older
than they actually are.
2013-06-02 18:50:46 +02:00
Veres Lajos
dd2a4ddff2 typofixes 2013-05-08 15:34:07 +01:00
terrafrost
cb36b811a0 Random: use constant for windows test
BigInteger: Docblock adjustments
2013-05-01 00:30:01 -05:00
terrafrost
08e987cede BigInteger: Docblock adjustments 2013-04-27 20:55:25 -05:00
terrafrost
42f22a4e44 BigInteger: fix special case for base-10 / bcmath
echo new Math_BigInteger('-') when in bcmath mode would output '-' - not '0'
2013-03-05 08:37:59 -06:00
terrafrost
4e06ab52dd BigInteger: revamp base-10 regex
new Math_BigInteger('-09') gave 0 back as a number in GMP mode
2013-03-05 08:29:06 -06:00
terrafrost
d7cdea6282 BigInteger: CS adjustment 2013-02-20 15:11:36 -06:00
Patrick Monnerat
90ff746ad1 Make all sources 7-bit ASCII. 2013-02-20 19:25:47 +01:00
Gemorroj
8d5e7a3945 Fixed broken characters. 2013-02-20 18:11:23 +03:00
Gemorroj
cc2c844d0e some minor fixes 2013-02-20 16:46:13 +03:00
terrafrost
4334d381b9 BigInteger: E_NOTICE: bitwise_xor and bitwise_or had parameters of array_pad mixed up 2013-02-17 18:53:36 -06:00
terrafrost
4a96cc8024 Use base-2**26 on systems with 32-bit ints and base-2**31 on systems with 64-bit ints 2013-02-17 17:52:59 -06:00
terrafrost
248e3bb085 Undo last commit 2013-01-30 08:37:50 -06:00
terrafrost
bfb04dcf4d Add __construct() constructor to make namespace'ing easier for those wishing to do it 2013-01-29 22:09:31 -06:00
terrafrost
9b4240c104 Use !empty('0') instead of strlen('0')
Thanks petrich!
2013-01-03 00:21:09 -06:00
terrafrost
35832fe2a1 Refactor crypt_random (renaming it to crypt_random_string)
...and update all the calls to it accordingly
2012-12-16 02:20:16 -06:00
terrafrost
7401d148f8 Remove unused lines
The MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_GMP case is already handled earlier
2012-12-11 18:38:45 -06:00
terrafrost
c2c3e9420d Negative numbers should be prepended with a 0 2012-09-02 11:06:53 -05:00
terrafrost
0f95ddc692 Updated fix for php.pear.net bug # 18015
toBits() on an object for which setPrecision(8) has been called should always return 8 bits.

As such we'll just iterate backwards instead of forward.
2012-09-02 01:13:21 -05:00
terrafrost
11872fe747 CRYPT_RSA_ASN1_SEQUENCE shouldn't have been used 2012-08-26 02:01:26 -05:00
terrafrost
770075fe08 Don't redefine MATH_BIGINTEGER_OPENSSL_ENABLED 2012-08-26 01:52:58 -05:00
terrafrost
2f8d1055ea Use OpenSSL for Math_BigInteger::modPow speedups
Also, make Crypt_RSA's public keys compatible with OpenSSL and make it so __toString will return the key even when it's the public key that's loaded and it hasn't been set as the public key.
2012-08-26 01:36:34 -05:00
terrafrost
4eaf6db3ab - fix for PEAR bug # 19494 2012-07-07 17:24:45 -05:00
Andreas Fischer
eb64dfef7d [feature/consistent-file-endings] Make sure files have empty line at the end. 2012-06-11 10:34:07 +02:00
Jim Wigginton
a1f3ee7b69 - fix potential E_NOTICE in modInverse (thanks bantu!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@183 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-07 02:27:01 +00:00
Jim Wigginton
392d96445e - add support for PuTTY and XML formatted RSA keys
- remove ?>'s from PHP_Compat files
- update LICENSE block
- make it so NET_SSH2_MSG_USERAUTH_PK_OK records direction and time

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@152 21d32557-59b3-4da0-833f-c5933fad653e
2011-04-18 12:17:40 +00:00
Jim Wigginton
b94a467999 - change license to the less restrictive MIT license (if people want to modify phpseclib and distribute binaries of it [whatever that means for PHP] without including the source code I don't care); two of the three PHP_Compat stuff still uses the LGPL since I didn't author them but they're only needed, anyway, if you're using phpseclib on PHP4.
- add svn:eol-style: LF to all files
- fixed pear.php.net bug # 18037 (thanks, nounours!)

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@130 21d32557-59b3-4da0-833f-c5933fad653e
2010-11-13 19:28:20 +00:00
Jim Wigginton
19cc43cc16 - fixed pear.php.net bug # 18015 (thanks, nounours!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@129 21d32557-59b3-4da0-833f-c5933fad653e
2010-10-31 01:05:29 +00:00