| @@ -1,18 +1,18 @@ | | | @@ -1,18 +1,18 @@ |
1 | $NetBSD: patch-lib_hcrypto_libtommath_tommath.h,v 1.1 2011/09/14 17:33:00 hans Exp $ | | 1 | $NetBSD: patch-lib_hcrypto_libtommath_tommath.h,v 1.2 2011/09/15 09:32:32 wiz Exp $ |
2 | | | 2 | |
3 | --- /dev/null 1 Jan 1970 00:00:00 -0000 | | 3 | --- /dev/null 1 Jan 1970 00:00:00 -0000 |
4 | +++ lib/hcrypto/libtommath/tommath.h 29 Oct 2010 01:14:54 -0000 | | 4 | +++ lib/hcrypto/libtommath/tommath.h 29 Oct 2010 01:14:54 -0000 |
5 | @@ -0,0 +1,592 @@ | | 5 | @@ -0,0 +1,588 @@ |
6 | +/* LibTomMath, multiple-precision integer library -- Tom St Denis | | 6 | +/* LibTomMath, multiple-precision integer library -- Tom St Denis |
7 | + * | | 7 | + * |
8 | + * LibTomMath is a library that provides multiple-precision | | 8 | + * LibTomMath is a library that provides multiple-precision |
9 | + * integer arithmetic as well as number theoretic functionality. | | 9 | + * integer arithmetic as well as number theoretic functionality. |
10 | + * | | 10 | + * |
11 | + * The library was designed directly after the MPI library by | | 11 | + * The library was designed directly after the MPI library by |
12 | + * Michael Fromberger but has been written from scratch with | | 12 | + * Michael Fromberger but has been written from scratch with |
13 | + * additional optimizations in place. | | 13 | + * additional optimizations in place. |
14 | + * | | 14 | + * |
15 | + * The library is free for all purposes without any express | | 15 | + * The library is free for all purposes without any express |
16 | + * guarantee it works. | | 16 | + * guarantee it works. |
17 | + * | | 17 | + * |
18 | + * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com | | 18 | + * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com |
| @@ -583,28 +583,28 @@ $NetBSD: patch-lib_hcrypto_libtommath_to | | | @@ -583,28 +583,28 @@ $NetBSD: patch-lib_hcrypto_libtommath_to |
583 | +int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int mode); | | 583 | +int s_mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y, int mode); |
584 | +void bn_reverse(unsigned char *s, int len); | | 584 | +void bn_reverse(unsigned char *s, int len); |
585 | + | | 585 | + |
586 | +extern const char *mp_s_rmap; | | 586 | +extern const char *mp_s_rmap; |
587 | + | | 587 | + |
588 | +#ifdef __cplusplus | | 588 | +#ifdef __cplusplus |
589 | + } | | 589 | + } |
590 | +#endif | | 590 | +#endif |
591 | + | | 591 | + |
592 | +#endif | | 592 | +#endif |
593 | + | | 593 | + |
594 | + | | 594 | + |
595 | +/* $Source: /home/ryo/public_nerv/netbsd/pkgsrc/cvsroot/pkgsrc/security/heimdal/patches/Attic/patch-lib_hcrypto_libtommath_tommath.h,v $ */ | | 595 | +/* $Source: /home/ryo/public_nerv/netbsd/pkgsrc/cvsroot/pkgsrc/security/heimdal/patches/Attic/patch-lib_hcrypto_libtommath_tommath.h,v $ */ |
596 | +/* $Revision: 1.1 $ */ | | 596 | +/* $Revision: 1.2 $ */ |
597 | +/* $Date: 2011/09/14 17:33:00 $ */ | | 597 | +/* $Date: 2011/09/15 09:32:32 $ */ |
598 | --- /dev/null 1 Jan 1970 00:00:00 -0000 | | 598 | --- /dev/null 1 Jan 1970 00:00:00 -0000 |
599 | +++ lib/hcrypto/libtommath/tommath_class.h 29 Oct 2010 01:14:54 -0000 | | 599 | +++ lib/hcrypto/libtommath/tommath_class.h 29 Oct 2010 01:14:54 -0000 |
600 | @@ -0,0 +1,1000 @@ | | 600 | @@ -0,0 +1,1000 @@ |
601 | +#if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) | | 601 | +#if !(defined(LTM1) && defined(LTM2) && defined(LTM3)) |
602 | +#if defined(LTM2) | | 602 | +#if defined(LTM2) |
603 | +#define LTM3 | | 603 | +#define LTM3 |
604 | +#endif | | 604 | +#endif |
605 | +#if defined(LTM1) | | 605 | +#if defined(LTM1) |
606 | +#define LTM2 | | 606 | +#define LTM2 |
607 | +#endif | | 607 | +#endif |
608 | +#define LTM1 | | 608 | +#define LTM1 |
609 | + | | 609 | + |
610 | +#if defined(LTM_ALL) | | 610 | +#if defined(LTM_ALL) |
| @@ -1584,33 +1584,29 @@ $NetBSD: patch-lib_hcrypto_libtommath_to | | | @@ -1584,33 +1584,29 @@ $NetBSD: patch-lib_hcrypto_libtommath_to |
1584 | +#endif | | 1584 | +#endif |
1585 | + | | 1585 | + |
1586 | +#if defined(BNCORE_C) | | 1586 | +#if defined(BNCORE_C) |
1587 | +#endif | | 1587 | +#endif |
1588 | + | | 1588 | + |
1589 | +#ifdef LTM3 | | 1589 | +#ifdef LTM3 |
1590 | +#define LTM_LAST | | 1590 | +#define LTM_LAST |
1591 | +#endif | | 1591 | +#endif |
1592 | +#include <tommath_superclass.h> | | 1592 | +#include <tommath_superclass.h> |
1593 | +#include <tommath_class.h> | | 1593 | +#include <tommath_class.h> |
1594 | +#else | | 1594 | +#else |
1595 | +#define LTM_LAST | | 1595 | +#define LTM_LAST |
1596 | +#endif | | 1596 | +#endif |
1597 | + | | | |
1598 | +/* $Source: /home/ryo/public_nerv/netbsd/pkgsrc/cvsroot/pkgsrc/security/heimdal/patches/Attic/patch-lib_hcrypto_libtommath_tommath.h,v $ */ | | | |
1599 | +/* $Revision: 1.1 $ */ | | | |
1600 | +/* $Date: 2011/09/14 17:33:00 $ */ | | | |
1601 | --- /dev/null 1 Jan 1970 00:00:00 -0000 | | 1597 | --- /dev/null 1 Jan 1970 00:00:00 -0000 |
1602 | +++ lib/hcrypto/libtommath/tommath_superclass.h 29 Oct 2010 01:14:54 -0000 | | 1598 | +++ lib/hcrypto/libtommath/tommath_superclass.h 29 Oct 2010 01:14:54 -0000 |
1603 | @@ -0,0 +1,76 @@ | | 1599 | @@ -0,0 +1,72 @@ |
1604 | +/* super class file for PK algos */ | | 1600 | +/* super class file for PK algos */ |
1605 | + | | 1601 | + |
1606 | +/* default ... include all MPI */ | | 1602 | +/* default ... include all MPI */ |
1607 | +#define LTM_ALL | | 1603 | +#define LTM_ALL |
1608 | + | | 1604 | + |
1609 | +/* RSA only (does not support DH/DSA/ECC) */ | | 1605 | +/* RSA only (does not support DH/DSA/ECC) */ |
1610 | +/* #define SC_RSA_1 */ | | 1606 | +/* #define SC_RSA_1 */ |
1611 | + | | 1607 | + |
1612 | +/* For reference.... On an Athlon64 optimizing for speed... | | 1608 | +/* For reference.... On an Athlon64 optimizing for speed... |
1613 | + | | 1609 | + |
1614 | + LTM's mpi.o with all functions [striped] is 142KiB in size. | | 1610 | + LTM's mpi.o with all functions [striped] is 142KiB in size. |
1615 | + | | 1611 | + |
1616 | +*/ | | 1612 | +*/ |
| @@ -1663,17 +1659,13 @@ $NetBSD: patch-lib_hcrypto_libtommath_to | | | @@ -1663,17 +1659,13 @@ $NetBSD: patch-lib_hcrypto_libtommath_to |
1663 | + #undef BN_FAST_MP_INVMOD_C | | 1659 | + #undef BN_FAST_MP_INVMOD_C |
1664 | + | | 1660 | + |
1665 | + /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold | | 1661 | + /* To safely undefine these you have to make sure your RSA key won't exceed the Comba threshold |
1666 | + * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] | | 1662 | + * which is roughly 255 digits [7140 bits for 32-bit machines, 15300 bits for 64-bit machines] |
1667 | + * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without | | 1663 | + * which means roughly speaking you can handle upto 2536-bit RSA keys with these defined without |
1668 | + * trouble. | | 1664 | + * trouble. |
1669 | + */ | | 1665 | + */ |
1670 | + #undef BN_S_MP_MUL_DIGS_C | | 1666 | + #undef BN_S_MP_MUL_DIGS_C |
1671 | + #undef BN_S_MP_SQR_C | | 1667 | + #undef BN_S_MP_SQR_C |
1672 | + #undef BN_MP_MONTGOMERY_REDUCE_C | | 1668 | + #undef BN_MP_MONTGOMERY_REDUCE_C |
1673 | +#endif | | 1669 | +#endif |
1674 | + | | 1670 | + |
1675 | +#endif | | 1671 | +#endif |
1676 | + | | | |
1677 | +/* $Source: /home/ryo/public_nerv/netbsd/pkgsrc/cvsroot/pkgsrc/security/heimdal/patches/Attic/patch-lib_hcrypto_libtommath_tommath.h,v $ */ | | | |
1678 | +/* $Revision: 1.1 $ */ | | | |
1679 | +/* $Date: 2011/09/14 17:33:00 $ */ | | | |