]> pd.if.org Git - zpackage/blob - libtomcrypt/src/pk/ecc/ecc_sizes.c
commit files needed for zpm-fetchurl
[zpackage] / libtomcrypt / src / pk / ecc / ecc_sizes.c
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2  *
3  * LibTomCrypt is a library that provides various cryptographic
4  * algorithms in a highly modular and flexible manner.
5  *
6  * The library is free for all purposes without any express
7  * guarantee it works.
8  */
9
10 /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b
11  *
12  * All curves taken from NIST recommendation paper of July 1999
13  * Available at http://csrc.nist.gov/cryptval/dss.htm
14  */
15 #include "tomcrypt.h"
16
17 /**
18   @file ecc_sizes.c
19   ECC Crypto, Tom St Denis
20 */
21
22 #ifdef LTC_MECC
23
24 void ecc_sizes(int *low, int *high)
25 {
26  int i;
27  LTC_ARGCHKVD(low  != NULL);
28  LTC_ARGCHKVD(high != NULL);
29
30  *low = INT_MAX;
31  *high = 0;
32  for (i = 0; ltc_ecc_sets[i].size != 0; i++) {
33      if (ltc_ecc_sets[i].size < *low)  {
34         *low  = ltc_ecc_sets[i].size;
35      }
36      if (ltc_ecc_sets[i].size > *high) {
37         *high = ltc_ecc_sets[i].size;
38      }
39  }
40 }
41
42 #endif
43 /* ref:         $Format:%D$ */
44 /* git commit:  $Format:%H$ */
45 /* commit time: $Format:%ai$ */
46