config root man

Current Path : /usr/local/lib/perl5/site_perl/5.8.9/Net/SSH/Perl/Util/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/local/lib/perl5/site_perl/5.8.9/Net/SSH/Perl/Util/SSH1MP.pm

# $Id: SSH1MP.pm,v 1.3 2001/04/17 00:55:19 btrott Exp $

package Net::SSH::Perl::Util::SSH1MP;
use strict;

use Digest::MD5 qw( md5 );
use Math::GMP;

sub _compute_session_id {
    my($check_bytes, $host, $public) = @_;
    my $id;
    $id .= _mp_linearize($host->{rsa}{n});
    $id .= _mp_linearize($public->{rsa}{n});
    $id .= $check_bytes;
    md5($id);
}

sub _mp_linearize {
    my($p, $l) = @_;
    $l ||= 0;
    my $base = Math::GMP->new(256);
    my $res = '';
    {
        my $r = $p % $base;
        my $d = Math::GMP->new($p-$r) / $base;
        $res = chr($r) . $res;
        if ($d >= $base) {
            $p = $d;
            redo;
        }
        elsif ($d != 0) {
            $res = chr($d) . $res;
        }
    }
    $res = "\0" x ($l-length($res)) . $res
        if length($res) < $l;
    $res;
}

1;

Man Man