pssht  latest
SSH server library written in PHP
DHGroupSHA1Base.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;
13 
19 abstract class DHGroupSHA1Base implements
22 {
23  public function hash($data)
24  {
25  return sha1($data, true);
26  }
27 
28  public static function addHandlers(\fpoirotte\Pssht\Transport $transport)
29  {
30  $transport->setHandler(
31  \fpoirotte\Pssht\Messages\KEXDH\INIT::getMessageId(),
32  new \fpoirotte\Pssht\Handlers\KEXDH\INIT()
33  );
34  }
35 }