| 1 | #cxx . . $ `<file>/bn_mp_prime_rabin_miller_trials.c`/include "tommath_private.h"cxx . . $ `<file>/tommath_private.h`/ |
| 2 | #ifdef BN_MP_PRIME_RABIN_MILLER_TRIALS_Ccxx . . $ `tommath_class.h:98:12`! |
| 3 | /* LibTomMath, multiple-precision integer library -- Tom St Denis */ |
| 4 | /* SPDX-License-Identifier: Unlicense */ |
| 5 | |
| 6 | static const structcxx . . $ $anonymous_type_4f1341df32432692_0# { |
| 7 | int kcxx . . $ $anonymous_type_4f1341df32432692_0#k., tcxx . . $ $anonymous_type_4f1341df32432692_0#t.; |
| 8 | } sizescxx . . $ sizes.[] = { |
| 9 | { 80, -1 }, /* Use deterministic algorithm for size <= 80 bits */ |
| 10 | { 81, 37 }, /* max. error = 2^(-96)*/ |
| 11 | { 96, 32 }, /* max. error = 2^(-96)*/ |
| 12 | { 128, 40 }, /* max. error = 2^(-112)*/ |
| 13 | { 160, 35 }, /* max. error = 2^(-112)*/ |
| 14 | { 256, 27 }, /* max. error = 2^(-128)*/ |
| 15 | { 384, 16 }, /* max. error = 2^(-128)*/ |
| 16 | { 512, 18 }, /* max. error = 2^(-160)*/ |
| 17 | { 768, 11 }, /* max. error = 2^(-160)*/ |
| 18 | { 896, 10 }, /* max. error = 2^(-160)*/ |
| 19 | { 1024, 12 }, /* max. error = 2^(-192)*/ |
| 20 | { 1536, 8 }, /* max. error = 2^(-192)*/ |
| 21 | { 2048, 6 }, /* max. error = 2^(-192)*/ |
| 22 | { 3072, 4 }, /* max. error = 2^(-192)*/ |
| 23 | { 4096, 5 }, /* max. error = 2^(-256)*/ |
| 24 | { 5120, 4 }, /* max. error = 2^(-256)*/ |
| 25 | { 6144, 4 }, /* max. error = 2^(-256)*/ |
| 26 | { 8192, 3 }, /* max. error = 2^(-256)*/ |
| 27 | { 9216, 3 }, /* max. error = 2^(-256)*/ |
| 28 | { 10240, 2 } /* For bigger keysizes use always at least 2 Rounds */ |
| 29 | }; |
| 30 | |
| 31 | /* returns # of RM trials required for a given bit size */ |
| 32 | int mp_prime_rabin_miller_trialscxx . . $ mp_prime_rabin_miller_trials(7864480464b09eea).(int size) |
| 33 | { |
| 34 | int x; |
| 35 | |
| 36 | for (x = 0; x < (int)(sizeof(sizescxx . . $ sizes.)/(sizeof(sizescxx . . $ sizes.[0]))); x++) { |
| 37 | if (sizescxx . . $ sizes.[x].kcxx . . $ $anonymous_type_4f1341df32432692_0#k. == size) { |
| 38 | return sizescxx . . $ sizes.[x].tcxx . . $ $anonymous_type_4f1341df32432692_0#t.; |
| 39 | } else if (sizescxx . . $ sizes.[x].kcxx . . $ $anonymous_type_4f1341df32432692_0#k. > size) { |
| 40 | return (x == 0) ? sizescxx . . $ sizes.[0].tcxx . . $ $anonymous_type_4f1341df32432692_0#t. : sizescxx . . $ sizes.[x - 1].tcxx . . $ $anonymous_type_4f1341df32432692_0#t.; |
| 41 | } |
| 42 | } |
| 43 | return sizescxx . . $ sizes.[x-1].tcxx . . $ $anonymous_type_4f1341df32432692_0#t.; |
| 44 | } |
| 45 | |
| 46 | |
| 47 | #endif |