trim trailing spaces

This commit is contained in:
Steffen Jaeckel 2014-03-04 21:28:16 +01:00
parent 621a75ab28
commit 84298440f4
3 changed files with 14 additions and 14 deletions

View File

@ -13,7 +13,7 @@
/**
@file crypt.c
Build strings, Tom St Denis
*/
*/
const char *crypt_build_settings =
"LibTomCrypt " SCRYPT " (Tom St Denis, tomstdenis@gmail.com)\n"
@ -199,7 +199,7 @@ const char *crypt_build_settings =
#endif
#if defined(LTC_F8_MODE)
" F8 MODE\n"
#endif
#endif
#if defined(LTC_XTS_MODE)
" LTC_XTS_MODE\n"
#endif
@ -274,7 +274,7 @@ const char *crypt_build_settings =
#endif
#if defined(MKAT)
" Katja\n"
#endif
#endif
"\nCompiler:\n"
#if defined(WIN32)
@ -302,7 +302,7 @@ const char *crypt_build_settings =
#endif
#if defined(LTC_PPC32)
" LTC_PPC32 defined \n"
#endif
#endif
"\nVarious others: "
#if defined(LTC_BASE64)
@ -367,7 +367,7 @@ const char *crypt_build_settings =
#endif
#if defined(LTC_EASY)
" (easy) "
#endif
#endif
#if defined(LTC_MECC_FP)
" LTC_MECC_FP "
#endif

View File

@ -19,7 +19,7 @@
/**
@file ltc_ecc_projective_add_point.c
ECC Crypto, Tom St Denis
*/
*/
#if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC))
@ -46,11 +46,11 @@ int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void
if ((err = mp_init_multi(&t1, &t2, &x, &y, &z, NULL)) != CRYPT_OK) {
return err;
}
/* should we dbl instead? */
if ((err = mp_sub(modulus, Q->y, t1)) != CRYPT_OK) { goto done; }
if ( (mp_cmp(P->x, Q->x) == LTC_MP_EQ) &&
if ( (mp_cmp(P->x, Q->x) == LTC_MP_EQ) &&
(Q->z != NULL && mp_cmp(P->z, Q->z) == LTC_MP_EQ) &&
(mp_cmp(P->y, Q->y) == LTC_MP_EQ || mp_cmp(P->y, t1) == LTC_MP_EQ)) {
mp_clear_multi(t1, t2, x, y, z, NULL);
@ -144,7 +144,7 @@ int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void
/* T1 = T1 * X */
if ((err = mp_mul(t1, x, t1)) != CRYPT_OK) { goto done; }
if ((err = mp_montgomery_reduce(t1, modulus, mp)) != CRYPT_OK) { goto done; }
/* X = Y*Y */
if ((err = mp_sqr(y, x)) != CRYPT_OK) { goto done; }
if ((err = mp_montgomery_reduce(x, modulus, mp)) != CRYPT_OK) { goto done; }
@ -158,7 +158,7 @@ int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, void
if ((err = mp_sub(t2, x, t2)) != CRYPT_OK) { goto done; }
if (mp_cmp_d(t2, 0) == LTC_MP_LT) {
if ((err = mp_add(t2, modulus, t2)) != CRYPT_OK) { goto done; }
}
}
/* T2 = T2 - X */
if ((err = mp_sub(t2, x, t2)) != CRYPT_OK) { goto done; }
if (mp_cmp_d(t2, 0) == LTC_MP_LT) {

View File

@ -19,7 +19,7 @@
/**
@file ltc_ecc_projective_dbl_point.c
ECC Crypto, Tom St Denis
*/
*/
#if defined(LTC_MECC) && (!defined(LTC_MECC_ACCEL) || defined(LTM_LTC_DESC))
@ -62,7 +62,7 @@ int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void
if (mp_cmp(R->z, modulus) != LTC_MP_LT) {
if ((err = mp_sub(R->z, modulus, R->z)) != CRYPT_OK) { goto done; }
}
/* T2 = X - T1 */
if ((err = mp_sub(R->x, t1, t2)) != CRYPT_OK) { goto done; }
if (mp_cmp_d(t2, 0) == LTC_MP_LT) {
@ -121,7 +121,7 @@ int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void
if ((err = mp_add(R->x, modulus, R->x)) != CRYPT_OK) { goto done; }
}
/* Y = Y - X */
/* Y = Y - X */
if ((err = mp_sub(R->y, R->x, R->y)) != CRYPT_OK) { goto done; }
if (mp_cmp_d(R->y, 0) == LTC_MP_LT) {
if ((err = mp_add(R->y, modulus, R->y)) != CRYPT_OK) { goto done; }
@ -134,7 +134,7 @@ int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, void *modulus, void
if (mp_cmp_d(R->y, 0) == LTC_MP_LT) {
if ((err = mp_add(R->y, modulus, R->y)) != CRYPT_OK) { goto done; }
}
err = CRYPT_OK;
done:
mp_clear_multi(t1, t2, NULL);