Home | History | Annotate | Download | only in ecc
      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  * Tom St Denis, tomstdenis (at) gmail.com, http://libtomcrypt.com
     10  */
     11 
     12 /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b
     13  *
     14  * All curves taken from NIST recommendation paper of July 1999
     15  * Available at http://csrc.nist.gov/cryptval/dss.htm
     16  */
     17 #include "tomcrypt.h"
     18 
     19 /**
     20   @file ecc.c
     21   ECC Crypto, Tom St Denis
     22 */
     23 
     24 #ifdef MECC
     25 
     26 /* This holds the key settings.  ***MUST*** be organized by size from smallest to largest. */
     27 const ltc_ecc_set_type ltc_ecc_sets[] = {
     28 #ifdef ECC112
     29 {
     30         14,
     31         "SECP112R1",
     32         "DB7C2ABF62E35E668076BEAD208B",
     33         "659EF8BA043916EEDE8911702B22",
     34         "DB7C2ABF62E35E7628DFAC6561C5",
     35         "09487239995A5EE76B55F9C2F098",
     36         "A89CE5AF8724C0A23E0E0FF77500"
     37 },
     38 #endif
     39 #ifdef ECC128
     40 {
     41         16,
     42         "SECP128R1",
     43         "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",
     44         "E87579C11079F43DD824993C2CEE5ED3",
     45         "FFFFFFFE0000000075A30D1B9038A115",
     46         "161FF7528B899B2D0C28607CA52C5B86",
     47         "CF5AC8395BAFEB13C02DA292DDED7A83",
     48 },
     49 #endif
     50 #ifdef ECC160
     51 {
     52         20,
     53         "SECP160R1",
     54         "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF",
     55         "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45",
     56         "0100000000000000000001F4C8F927AED3CA752257",
     57         "4A96B5688EF573284664698968C38BB913CBFC82",
     58         "23A628553168947D59DCC912042351377AC5FB32",
     59 },
     60 #endif
     61 #ifdef ECC192
     62 {
     63         24,
     64         "ECC-192",
     65         "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
     66         "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1",
     67         "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831",
     68         "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012",
     69         "7192B95FFC8DA78631011ED6B24CDD573F977A11E794811",
     70 },
     71 #endif
     72 #ifdef ECC224
     73 {
     74         28,
     75         "ECC-224",
     76         "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001",
     77         "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4",
     78         "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D",
     79         "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21",
     80         "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",
     81 },
     82 #endif
     83 #ifdef ECC256
     84 {
     85         32,
     86         "ECC-256",
     87         "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",
     88         "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",
     89         "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551",
     90         "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",
     91         "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",
     92 },
     93 #endif
     94 #ifdef ECC384
     95 {
     96         48,
     97         "ECC-384",
     98         "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF",
     99         "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF",
    100         "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973",
    101         "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7",
    102         "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F",
    103 },
    104 #endif
    105 #ifdef ECC521
    106 {
    107         66,
    108         "ECC-521",
    109         "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
    110         "51953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00",
    111         "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409",
    112         "C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66",
    113         "11839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650",
    114 },
    115 #endif
    116 {
    117    0,
    118    NULL, NULL, NULL, NULL, NULL, NULL
    119 }
    120 };
    121 
    122 #endif
    123 
    124 /* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ecc.c,v $ */
    125 /* $Revision: 1.38 $ */
    126 /* $Date: 2006/11/07 23:14:28 $ */
    127 
    128