Server IP : 104.21.38.3 / Your IP : 172.71.82.137 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/x86_64-linux-gnu/perl5/5.34/Net/DNS/SEC/ |
Upload File : |
package Net::DNS::SEC::ECCGOST; use strict; use warnings; our $VERSION = (qw$Id: ECCGOST.pm 1853 2021-10-11 10:40:59Z willem $)[2]; =head1 NAME Net::DNS::SEC::ECCGOST - DNSSEC ECC-GOST digital signature algorithm =head1 SYNOPSIS require Net::DNS::SEC::ECCGOST; $validated = Net::DNS::SEC::ECCGOST->verify( $sigdata, $keyrr, $sigbin ); =head1 DESCRIPTION Implementation of GOST R 34.10-2001 elliptic curve digital signature verification procedure. =head2 sign Signature generation is not implemented. =head2 verify $validated = Net::DNS::SEC::ECCGOST->verify( $sigdata, $keyrr, $sigbin ); Verifies the signature over the binary sigdata using the specified public key resource record. =cut use constant Digest_GOST => defined( eval { require Digest::GOST } ); use constant ECCGOST_configured => Digest_GOST && Net::DNS::SEC::libcrypto->can('ECCGOST_verify'); BEGIN { die 'ECCGOST disabled or application has no "use Net::DNS::SEC"' unless ECCGOST_configured } my %parameters = ( 12 => [840, 'Digest::GOST::CryptoPro'] ); sub _index { return keys %parameters } sub sign { die 'Russian Federation standard GOST R 34.10-2001 is obsolete'; } sub verify { my ( $class, $sigdata, $keyrr, $sigbin ) = @_; my $algorithm = $keyrr->algorithm; my ( $nid, $object ) = @{$parameters{$algorithm} || []}; die 'public key not ECC-GOST' unless $nid; my $hash = $object->new(); $hash->add($sigdata); my $H = reverse $hash->digest; return unless $sigbin; my ( $y, $x ) = unpack 'a32 a32', reverse $keyrr->keybin; # public key my $eckey = Net::DNS::SEC::libcrypto::EC_KEY_new_ECCGOST( $x, $y ); my ( $s, $r ) = unpack 'a32 a32', $sigbin; # RFC5933, RFC4490 return Net::DNS::SEC::libcrypto::ECCGOST_verify( $H, $r, $s, $eckey ); } 1; __END__ ######################################## =head1 COPYRIGHT Copyright (c)2014,2018 Dick Franks. All rights reserved. =head1 LICENSE Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the original copyright notices appear in all copies and that both copyright notice and this permission notice appear in supporting documentation, and that the name of the author not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =head1 SEE ALSO L<Net::DNS>, L<Net::DNS::SEC>, L<Digest::GOST>, RFC4357, RFC4490, RFC5832, RFC5933, RFC7091 =cut