security/nss/lib/freebl/mpi/utils/ptab.pl

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:6df7ab171fbb
1 #!/usr/bin/perl
2
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7 while(<>) {
8 chomp;
9 push(@primes, $_);
10 }
11
12 printf("mp_size prime_tab_size = %d;\n", ($#primes + 1));
13 print "mp_digit prime_tab[] = {\n";
14
15 print "\t";
16 $last = pop(@primes);
17 foreach $prime (sort {$a<=>$b} @primes) {
18 printf("0x%04X, ", $prime);
19 $brk = ($brk + 1) % 8;
20 print "\n\t" if(!$brk);
21 }
22 printf("0x%04X", $last);
23 print "\n" if($brk);
24 print "};\n\n";
25
26 exit 0;

mercurial