Files
perl-Crypt-Primes/perl-Crypt-Primes.spec
2025-08-12 18:12:51 +02:00

79 lines
2.7 KiB
RPMSpec

#
# spec file for package perl-Crypt-Primes
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define cpan_name Crypt-Primes
Name: perl-Crypt-Primes
Version: 0.520.0
Release: 0
# 0.52 -> normalize -> 0.520.0
%define cpan_version 0.52
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: Provable Prime Number Generator suitable for Cryptographic Applications
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/T/TI/TIMLEGGE/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
Patch0: math-pariinit.patch
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Crypt::Random)
BuildRequires: perl(Math::Pari)
Requires: perl(Crypt::Random)
Requires: perl(Math::Pari)
Provides: perl(Crypt::Primes) = %{version}
%undefine __perllib_provides
%{perl_requires}
%description
This module implements Ueli Maurer's algorithm for generating large
_provable_ primes and secure parameters for public-key cryptosystems. The
generated primes are almost uniformly distributed over the set of primes of
the specified bitsize and expected time for generation is less than the
time required for generating a pseudo-prime of the same size with
Miller-Rabin tests. Detailed description and running time analysis of the
algorithm can be found in Maurer's paper[1].
Crypt::Primes is a pure perl implementation. It uses Math::Pari for
multiple precision integer arithmetic and number theoretic functions.
Random numbers are gathered with Crypt::Random, a perl interface to
/dev/u?random devices found on most modern Unix operating systems.
%prep
%autosetup -n %{cpan_name}-%{cpan_version} -p1
find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path "*/script/*" ! -path "*/scripts/*" ! -name "configure" -print0 | xargs -0 chmod 644
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes docs README SECURITY.md
%license LICENSE
%changelog