lt / php-curve25519 Goto Github PK
View Code? Open in Web Editor NEWPure PHP implementation of Curve25519
License: MIT License
Pure PHP implementation of Curve25519
License: MIT License
Can I sign and verify messages with this library?
PHPUnit 4.4.4 by Sebastian Bergmann.
Configuration read from /tmp/PHP-Curve25519/phpunit.xml.dist
.FFFFE...
Time: 150 ms, Memory: 3.50Mb
There was 1 error:
1) Curve25519Test::testClamp
unpack() expects parameter 2 to be string, array given
/tmp/PHP-Curve25519/lib/Curve25519.php:220
/tmp/PHP-Curve25519/test/Curve25519Test.php:124
--
There were 4 failures:
1) Curve25519Test::testAddModP
Failed asserting that Array &0 (
0 => 2
1 => 0
2 => 0
3 => 0
4 => 0
5 => 0
6 => 0
7 => 0
8 => 0
9 => 0
) is identical to Array &0 (
0 => 2
1 => 0
2 => 0
3 => 0
4 => 0
5 => 0
6 => 0
7 => 0
8 => 0
9 => 0
10 => 0
11 => 0
12 => 0
13 => 0
14 => 0
15 => 0
).
/tmp/PHP-Curve25519/test/Curve25519Test.php:31
2) Curve25519Test::testSubModP
Failed asserting that Array &0 (
0 => 67108864
1 => 33554431
2 => 67108863
3 => 33554431
4 => 67108863
5 => 33554431
6 => 67108863
7 => 33554431
8 => 67108863
9 => 33554431
) is identical to Array &0 (
0 => 0
1 => 0
2 => 0
3 => 0
4 => 0
5 => 0
6 => 0
7 => 0
8 => 0
9 => 0
10 => 0
11 => 0
12 => 0
13 => 0
14 => 0
15 => 32768
).
/tmp/PHP-Curve25519/test/Curve25519Test.php:60
3) Curve25519Test::testMulModP
Failed asserting that Array &0 (
0 => 267
1 => 154
2 => 213
3 => 118
4 => 159
5 => 82
6 => 105
7 => 46
8 => 51
9 => 10
) is identical to Array &0 (
0 => 571
1 => 534
2 => 497
3 => 460
4 => 423
5 => 386
6 => 349
7 => 312
8 => 275
9 => 238
10 => 201
11 => 164
12 => 127
13 => 90
14 => 53
15 => 16
).
/tmp/PHP-Curve25519/test/Curve25519Test.php:89
4) Curve25519Test::testSqrModP
Failed asserting that Array &0 (
0 => 267
1 => 154
2 => 213
3 => 118
4 => 159
5 => 82
6 => 105
7 => 46
8 => 51
9 => 10
) is identical to Array &0 (
0 => 571
1 => 534
2 => 497
3 => 460
4 => 423
5 => 386
6 => 349
7 => 312
8 => 275
9 => 238
10 => 201
11 => 164
12 => 127
13 => 90
14 => 53
15 => 16
).
/tmp/PHP-Curve25519/test/Curve25519Test.php:109
FAILURES!
Tests: 9, Assertions: 8, Failures: 4, Errors: 1.
Hi,
I'm trying to use your library to exchange encryption keys, those keys are generated by php-encryption library but I'm facing issues that shared keys were generated by PHP-Curve25519 are Pure Bytes and it should be implement some rules provided by php-encryption to ensure key security & integrity.
Are you interesting to integrate and enhance your library feature?
Thanks
Hello,
I try to run this lib in Windows, but the generation of public key does seem to be correct in Windows SO.
Here is the PHPUnit results:
$ ./vendor/bin/phpunit.bat -c phpunit.xml.dist
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.
FF....
Time: 749 ms, Memory: 4.00MB
There were 2 failures:
1) Curve25519\Curve25519Test::testOverall
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-3h═╗@Smp@L-_;(
+a
╚╗
+╚ ,╚ ╔@ǎ2X q
C:\Users\mmunoz\proyectos\whatsapp-web-api\vendor\leigh\curve25519\test\Curve25519Test.php:20
2) Curve25519\Curve25519Test::testNaCL
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
- 0Tt}ܴ>Z
-:
-&8뤩Nj
+
Here is my PHP version:
$ php -v
PHP 7.2.6 (cli) (built: May 23 2018 20:51:04) ( ZTS MSVC15 (Visual C++ 2017) x86 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
Hi,
I'm wondering if Curve25519 keys are compatible with Ed25519(Signing & Authenticating)?
Thanks
Parse error for me:
PHP Parse error: syntax error, unexpected '[' in Curve25519.php on line 5
PHP Parse error: syntax error, unexpected '[', expecting ')' in Curve25519Test.php on line 26
PHP 5.3.3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.