comparison libtomcrypt/src/math/tfm_desc.c @ 1435:f849a5ca2efc

update to libtomcrypt 1.17 (with Dropbear changes)
author Matt Johnston <matt@ucc.asn.au>
date Sat, 24 Jun 2017 17:50:50 +0800
parents 0cbe8f6dbf9e
children 6dba84798cd5
comparison
equal deleted inserted replaced
1434:27b9ddb06b09 1435:f849a5ca2efc
4 * algorithms in a highly modular and flexible manner. 4 * algorithms in a highly modular and flexible manner.
5 * 5 *
6 * The library is free for all purposes without any express 6 * The library is free for all purposes without any express
7 * guarantee it works. 7 * guarantee it works.
8 * 8 *
9 * Tom St Denis, [email protected], http://libtomcrypt.com 9 * Tom St Denis, [email protected], http://libtom.org
10 */ 10 */
11 11
12 #define DESC_DEF_ONLY 12 #define DESC_DEF_ONLY
13 #include "tomcrypt.h" 13 #include "tomcrypt.h"
14 14
401 LTC_ARGCHK(b != NULL); 401 LTC_ARGCHK(b != NULL);
402 *b = (fp_isprime(a) == FP_YES) ? LTC_MP_YES : LTC_MP_NO; 402 *b = (fp_isprime(a) == FP_YES) ? LTC_MP_YES : LTC_MP_NO;
403 return CRYPT_OK; 403 return CRYPT_OK;
404 } 404 }
405 405
406 #if defined(MECC) && defined(MECC_ACCEL) 406 #if defined(LTC_MECC) && defined(LTC_MECC_ACCEL)
407 407
408 static int tfm_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *Mp) 408 static int tfm_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void *Mp)
409 { 409 {
410 fp_int t1, t2; 410 fp_int t1, t2;
411 fp_digit mp; 411 fp_digit mp;
731 &montgomery_deinit, 731 &montgomery_deinit,
732 732
733 &exptmod, 733 &exptmod,
734 &isprime, 734 &isprime,
735 735
736 #ifdef MECC 736 #ifdef LTC_MECC
737 #ifdef MECC_FP 737 #ifdef LTC_MECC_FP
738 &ltc_ecc_fp_mulmod, 738 &ltc_ecc_fp_mulmod,
739 #else 739 #else
740 &ltc_ecc_mulmod, 740 &ltc_ecc_mulmod,
741 #endif /* MECC_FP */ 741 #endif /* LTC_MECC_FP */
742 #ifdef MECC_ACCEL 742 #ifdef LTC_MECC_ACCEL
743 &tfm_ecc_projective_add_point, 743 &tfm_ecc_projective_add_point,
744 &tfm_ecc_projective_dbl_point, 744 &tfm_ecc_projective_dbl_point,
745 #else 745 #else
746 &ltc_ecc_projective_add_point, 746 &ltc_ecc_projective_add_point,
747 &ltc_ecc_projective_dbl_point, 747 &ltc_ecc_projective_dbl_point,
748 #endif /* MECC_ACCEL */ 748 #endif /* LTC_MECC_ACCEL */
749 &ltc_ecc_map, 749 &ltc_ecc_map,
750 #ifdef LTC_ECC_SHAMIR 750 #ifdef LTC_ECC_SHAMIR
751 #ifdef MECC_FP 751 #ifdef LTC_MECC_FP
752 &ltc_ecc_fp_mul2add, 752 &ltc_ecc_fp_mul2add,
753 #else 753 #else
754 &ltc_ecc_mul2add, 754 &ltc_ecc_mul2add,
755 #endif /* MECC_FP */ 755 #endif /* LTC_MECC_FP */
756 #else 756 #else
757 NULL, 757 NULL,
758 #endif /* LTC_ECC_SHAMIR */ 758 #endif /* LTC_ECC_SHAMIR */
759 #else 759 #else
760 NULL, NULL, NULL, NULL, NULL, 760 NULL, NULL, NULL, NULL, NULL,
761 #endif /* MECC */ 761 #endif /* LTC_MECC */
762 762
763 #ifdef MRSA 763 #ifdef LTC_MRSA
764 &rsa_make_key, 764 &rsa_make_key,
765 &rsa_exptmod, 765 &rsa_exptmod,
766 #else 766 #else
767 NULL, NULL 767 NULL, NULL
768 #endif 768 #endif
770 }; 770 };
771 771
772 772
773 #endif 773 #endif
774 774
775 /* $Source: /cvs/libtom/libtomcrypt/src/math/tfm_desc.c,v $ */ 775 /* $Source$ */
776 /* $Revision: 1.26 $ */ 776 /* $Revision$ */
777 /* $Date: 2006/12/03 00:39:56 $ */ 777 /* $Date$ */