pssht
latest
SSH server library written in PHP
Main Page
Classes
Files
File List
Curve25519.php
1
<?php
2
3
/*
4
* This file is part of pssht.
5
*
6
* (c) François Poirotte <clicky@erebot.net>
7
*
8
* For the full copyright and license information, please view the LICENSE
9
* file that was distributed with this source code.
10
*/
11
12
namespace
fpoirotte\Pssht\KEX\LibsshOrg
;
13
18
class
Curve25519
implements
\fpoirotte\Pssht\KEX\KEXInterface
19
{
20
public
static
function
addHandlers(\
fpoirotte
\Pssht\
Transport
$transport)
21
{
22
$transport->setHandler(
23
\
fpoirotte
\Pssht\Messages\KEX\ECDH\INIT\Curve25519::getMessageId(),
24
new
\
fpoirotte
\Pssht\Handlers\KEX\ECDH\INIT\
Curve25519
()
25
);
26
}
27
28
public
static
function
getName
()
29
{
30
return
'curve25519-sha256@libssh.org'
;
31
}
32
33
public
function
hash
($data)
34
{
35
return
hash
(
'sha256'
, $data,
true
);
36
}
37
38
public
static
function
isAvailable()
39
{
40
if
(!function_exists(
'hash_algos'
) || !function_exists(
'hash'
)) {
41
return
false
;
42
}
43
return
in_array(
'sha256'
, hash_algos(),
true
);
44
}
45
}
fpoirotte\Pssht\KEX\KEXInterface
Definition:
KEXInterface.php:17
fpoirotte\Pssht\KEX\LibsshOrg\Curve25519\getName
static getName()
Return the name of the algorithm.
Definition:
Curve25519.php:28
fpoirotte\Pssht\KEX\LibsshOrg\Curve25519\hash
hash($data)
Definition:
Curve25519.php:33
fpoirotte\Pssht\Transport
Definition:
Transport.php:19
fpoirotte\Pssht\KEX\LibsshOrg
Definition:
Curve25519.php:12
fpoirotte
fpoirotte\Pssht\KEX\LibsshOrg\Curve25519
Definition:
Curve25519.php:18
src
KEX
LibsshOrg
Curve25519.php
Generated on Tue May 9 2017 12:09:55 for pssht by
1.8.11