1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/freebl/mpi/utils/ptab.pl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +#!/usr/bin/perl 1.5 + 1.6 +# This Source Code Form is subject to the terms of the Mozilla Public 1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.9 + 1.10 +while(<>) { 1.11 + chomp; 1.12 + push(@primes, $_); 1.13 +} 1.14 + 1.15 +printf("mp_size prime_tab_size = %d;\n", ($#primes + 1)); 1.16 +print "mp_digit prime_tab[] = {\n"; 1.17 + 1.18 +print "\t"; 1.19 +$last = pop(@primes); 1.20 +foreach $prime (sort {$a<=>$b} @primes) { 1.21 + printf("0x%04X, ", $prime); 1.22 + $brk = ($brk + 1) % 8; 1.23 + print "\n\t" if(!$brk); 1.24 +} 1.25 +printf("0x%04X", $last); 1.26 +print "\n" if($brk); 1.27 +print "};\n\n"; 1.28 + 1.29 +exit 0;